From 6d5823cb678935cfb8fa170fb31977986dfed34b Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 4 Apr 2011 13:02:40 +0200 Subject: [PATCH 01/16] change "faq" link to "help" --- application/languages/lang_en.po | 9 ++++++--- application/languages/lang_fr.po | 9 ++++++--- application/languages/lang_ja.po | 9 ++++++--- application/layouts/scripts/footer.phtml | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/application/languages/lang_en.po b/application/languages/lang_en.po index cdae8be..37b1628 100644 --- a/application/languages/lang_en.po +++ b/application/languages/lang_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-27 10:56+0200\n" +"POT-Creation-Date: 2011-04-04 13:02+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -672,8 +672,8 @@ msgid "contact" msgstr "contact" #: application/layouts/scripts/footer.phtml:97 -msgid "faq" -msgstr "faq" +msgid "help" +msgstr "help" #: application/forms/Login.php:9 msgid "user" @@ -801,3 +801,6 @@ msgstr "Someone, probably you, has registered an account %s with email address % #: application/forms/Pending/ValidateCreation.php:24 msgid "To cancel account creation, press following button. The account and all its data will be deleted." msgstr "To cancel account creation, press following button. The account and all its data will be deleted." + +#~ msgid "faq" +#~ msgstr "faq" diff --git a/application/languages/lang_fr.po b/application/languages/lang_fr.po index 824b872..8050a90 100644 --- a/application/languages/lang_fr.po +++ b/application/languages/lang_fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-27 10:56+0200\n" +"POT-Creation-Date: 2011-04-04 13:02+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -674,8 +674,8 @@ msgid "contact" msgstr "contact" #: application/layouts/scripts/footer.phtml:97 -msgid "faq" -msgstr "faq" +msgid "help" +msgstr "aide" #: application/forms/Login.php:9 msgid "user" @@ -803,3 +803,6 @@ msgstr "Quelqu'un, probablement vous, a enregistré un compte %s avec l'adresse #: application/forms/Pending/ValidateCreation.php:24 msgid "To cancel account creation, press following button. The account and all its data will be deleted." msgstr "Pour annuler la création du compte, pressez le bouton suivant. Le compte ainsi que toutes ses données seront supprimés." + +#~ msgid "faq" +#~ msgstr "faq" diff --git a/application/languages/lang_ja.po b/application/languages/lang_ja.po index 66c8cad..fe3696f 100644 --- a/application/languages/lang_ja.po +++ b/application/languages/lang_ja.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-27 10:56+0200\n" +"POT-Creation-Date: 2011-04-04 13:02+0200\n" "PO-Revision-Date: \n" "Last-Translator: S.Higashi \n" "Language: \n" @@ -767,8 +767,8 @@ msgid "contact" msgstr "連絡先" #: application/layouts/scripts/footer.phtml:97 -msgid "faq" -msgstr "FAQ" +msgid "help" +msgstr "" #: application/forms/Login.php:9 msgid "user" @@ -914,3 +914,6 @@ msgid "" msgstr "" "アカウント作成をキャンセルするには、次のボタンを押してください。アカウントと" "そのデータは全て削除されます。" + +#~ msgid "faq" +#~ msgstr "FAQ" diff --git a/application/layouts/scripts/footer.phtml b/application/layouts/scripts/footer.phtml index 776d906..514ea24 100644 --- a/application/layouts/scripts/footer.phtml +++ b/application/layouts/scripts/footer.phtml @@ -94,7 +94,7 @@ echo $this->footerLink(array( 'route' => 'faq', 'action' => 'index', 'controller' => 'faq'), - $this->translate("faq"), + $this->translate("help"), false); echo '' . PHP_EOL; -- 2.39.2 From 591799b685ba18b84ad5230a5d84a11daa380136 Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 4 Apr 2011 13:11:51 +0200 Subject: [PATCH 02/16] explain how to delete a point in welcome message --- application/languages/lang_en.po | 13 ++++++++----- application/languages/lang_fr.po | 13 ++++++++----- application/languages/lang_ja.po | 20 ++++++++++++-------- application/views/scripts/idx/index.phtml | 4 ++-- public/css/syj.css | 2 +- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/application/languages/lang_en.po b/application/languages/lang_en.po index 37b1628..335ce2b 100644 --- a/application/languages/lang_en.po +++ b/application/languages/lang_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:02+0200\n" +"POT-Creation-Date: 2011-04-04 13:05+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -51,12 +51,12 @@ msgid "SYJ needs javascript. Please activate scripts in your browser." msgstr "SYJ needs javascript. Please activate scripts in your browser." #: application/views/scripts/idx/index.phtml:21 -msgid "Welcome on Syj." -msgstr "Welcome on Syj." +msgid "To create a journey, press \"start a route\" button, then click on the map to add points. To delete a point, hold shift pressed while clicking on it." +msgstr "To create a journey, press \"start a route\" button, then click on the map to add points. To delete a point, hold shift pressed while clicking on it." #: application/views/scripts/idx/index.phtml:23 -msgid "To create a journey, just press \"start a route\" button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner" -msgstr "To create a journey, just press \"start a route\" button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner" +msgid "You can zoom and move the map with the controls in the top left corner." +msgstr "You can zoom and move the map with the controls in the top left corner." #: application/views/scripts/idx/index.phtml:25 msgid "When you have finished a path, press \"create\", button." @@ -802,5 +802,8 @@ msgstr "Someone, probably you, has registered an account %s with email address % msgid "To cancel account creation, press following button. The account and all its data will be deleted." msgstr "To cancel account creation, press following button. The account and all its data will be deleted." +#~ msgid "Welcome on Syj." +#~ msgstr "Welcome on Syj." + #~ msgid "faq" #~ msgstr "faq" diff --git a/application/languages/lang_fr.po b/application/languages/lang_fr.po index 8050a90..6efd1a2 100644 --- a/application/languages/lang_fr.po +++ b/application/languages/lang_fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:02+0200\n" +"POT-Creation-Date: 2011-04-04 13:05+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -51,12 +51,12 @@ msgid "SYJ needs javascript. Please activate scripts in your browser." msgstr "SYJ a besoin de javascript pour fonctionner. Veuillez activer les scripts dans votre navigateur." #: application/views/scripts/idx/index.phtml:21 -msgid "Welcome on Syj." -msgstr "Bienvenue sur Syj." +msgid "To create a journey, press \"start a route\" button, then click on the map to add points. To delete a point, hold shift pressed while clicking on it." +msgstr "Pour créer un trajet, pressez le bouton \"commencer un itinéraire\" puis cliquez sur la carte pour ajouter des points à votre tracé. Pour supprimer un point, maintenant shift enfoncé en cliquant sur ce point." #: application/views/scripts/idx/index.phtml:23 -msgid "To create a journey, just press \"start a route\" button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner" -msgstr "Pour créer un trajet, pressez simplement le bouton \"commencer un itinéraire\" puis cliquez sur la carte pour ajouter des points à votre tracé. Vous pouvez zoomer et bouger la carte avec les boutons en haut à gauche." +msgid "You can zoom and move the map with the controls in the top left corner." +msgstr "Vous pouvez zoomer et bouger la carte avec les boutons en haut à gauche." #: application/views/scripts/idx/index.phtml:25 msgid "When you have finished a path, press \"create\", button." @@ -804,5 +804,8 @@ msgstr "Quelqu'un, probablement vous, a enregistré un compte %s avec l'adresse msgid "To cancel account creation, press following button. The account and all its data will be deleted." msgstr "Pour annuler la création du compte, pressez le bouton suivant. Le compte ainsi que toutes ses données seront supprimés." +#~ msgid "Welcome on Syj." +#~ msgstr "Bienvenue sur Syj." + #~ msgid "faq" #~ msgstr "faq" diff --git a/application/languages/lang_ja.po b/application/languages/lang_ja.po index fe3696f..37704d4 100644 --- a/application/languages/lang_ja.po +++ b/application/languages/lang_ja.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:02+0200\n" +"POT-Creation-Date: 2011-04-04 13:05+0200\n" "PO-Revision-Date: \n" "Last-Translator: S.Higashi \n" "Language: \n" @@ -49,19 +49,20 @@ msgstr "" "てください" #: application/views/scripts/idx/index.phtml:21 -msgid "Welcome on Syj." -msgstr "Syjへようこそ。" - -#: application/views/scripts/idx/index.phtml:23 +#, fuzzy msgid "" -"To create a journey, just press \"start a route\" button, " -"then click on the map to add points to your route. You can zoom and move the " -"map with the controls in the top left corner" +"To create a journey, press \"start a route\" button, then " +"click on the map to add points. To delete a point, hold shift pressed while " +"clicking on it." msgstr "" "旅の記録を作成するには、まず\"ルート開始\" ボタンを押してく" "ださい。そしてマップをクリックしながらルートに沿ってポイントを追加してくださ" "い。画面左上のコントロールでマップのズームや移動ができます" +#: application/views/scripts/idx/index.phtml:23 +msgid "You can zoom and move the map with the controls in the top left corner." +msgstr "" + #: application/views/scripts/idx/index.phtml:25 msgid "When you have finished a path, press \"create\", button." msgstr "パスを描き終わったら、\"作成\"ボタンを押してください" @@ -915,5 +916,8 @@ msgstr "" "アカウント作成をキャンセルするには、次のボタンを押してください。アカウントと" "そのデータは全て削除されます。" +#~ msgid "Welcome on Syj." +#~ msgstr "Syjへようこそ。" + #~ msgid "faq" #~ msgstr "FAQ" diff --git a/application/views/scripts/idx/index.phtml b/application/views/scripts/idx/index.phtml index 455f90b..b69bf38 100644 --- a/application/views/scripts/idx/index.phtml +++ b/application/views/scripts/idx/index.phtml @@ -18,9 +18,9 @@ if ($this->errorMsg) { $message .= $this->errorMsg; $msgclass = "error"; } else if (!$this->path and !$this->loggedUser) { - $message .= $this->translate('Welcome on Syj.'); + $message .= $this->translate('To create a journey, press "start a route" button, then click on the map to add points. To delete a point, hold shift pressed while clicking on it.'); $message .= "
"; - $message .= $this->translate('To create a journey, just press "start a route" button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner'); + $message .= $this->translate('You can zoom and move the map with the controls in the top left corner.'); $message .= "
"; $message .= $this->translate('When you have finished a path, press "create", button.'); $msgclass = "info optional"; diff --git a/public/css/syj.css b/public/css/syj.css index c41d6cf..b5151ae 100644 --- a/public/css/syj.css +++ b/public/css/syj.css @@ -38,7 +38,7 @@ body, html { bottom: 3.5em; width: 40%; margin: 0px 45% 0px 15%; - padding: 1.5em 1.5em 1.5em 1.5em; + padding: 1.5em 1.5em 0.5em 1.5em; text-align: center; border-width: 2px; border-style: solid; -- 2.39.2 From 8f53507b26e10f259abcd19a8ca3486b9a0bd6a8 Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 4 Apr 2011 18:57:21 +0200 Subject: [PATCH 03/16] use __DIR__ instead of dirname(__FILE__) --- public/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/init.php b/public/init.php index 4780fe3..7a1af75 100644 --- a/public/init.php +++ b/public/init.php @@ -2,7 +2,7 @@ // Define path to application directory defined('APPLICATION_PATH') - || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); + || define('APPLICATION_PATH', realpath(__DIR__ . '/../application')); // Define application environment defined('APPLICATION_ENV') -- 2.39.2 From d52fa81549b32a16a59b17732adb19a0c6559cc1 Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 11 Apr 2011 22:39:07 +0200 Subject: [PATCH 04/16] use all 3 available osm tile servers --- public/js/syj.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/syj.js b/public/js/syj.js index 78d7606..85db31a 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -288,7 +288,11 @@ var SYJView = { theme: null }); - baseLayer = new OpenLayers.Layer.OSM("OSM", null, { wrapDateLine: true , attribution: SyjStrings.osmAttribution }); + baseLayer = new OpenLayers.Layer.OSM("OSM", [ + 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], + { wrapDateLine: true , attribution: SyjStrings.osmAttribution }); layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, -- 2.39.2 From ac9d01aaea19ae2de146b98a1a2fea91d8e98754 Mon Sep 17 00:00:00 2001 From: arno Date: Tue, 12 Apr 2011 23:56:44 +0200 Subject: [PATCH 05/16] locale switcher takes full url (does not drop search part) --- application/views/helpers/LocaleSwitcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/helpers/LocaleSwitcher.php b/application/views/helpers/LocaleSwitcher.php index 68ea4ff..2f4237b 100644 --- a/application/views/helpers/LocaleSwitcher.php +++ b/application/views/helpers/LocaleSwitcher.php @@ -9,7 +9,7 @@ class Syj_View_Helper_LocaleSwitcher extends Zend_View_Helper_Abstract $availables = $translator->getList(); $current = $translator->getLocale(); - $requestUri = $this->view->UriPath(); + $requestUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); $links = array(); foreach ($availables as $lang) { -- 2.39.2 From 1c81f27d068e82e2ad4b6f6617f85d3e8413267e Mon Sep 17 00:00:00 2001 From: arno Date: Wed, 13 Apr 2011 22:18:07 +0200 Subject: [PATCH 06/16] fix git submodule paths --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index d392f02..26fad1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = git://github.com/arenevier/gisconverter.php [submodule "public/prototype"] path = public/prototype - url = /var/www/syj/public/prototype + url = git://github.com/sstephenson/prototype.git [submodule "public/simplebox"] path = public/simplebox - url = /var/www/syj/public/simplebox + url = git://github.com/arenevier/simplebox.git -- 2.39.2 From 4022a532856c006efc57fbd8830bde4607c0114d Mon Sep 17 00:00:00 2001 From: arno Date: Thu, 14 Apr 2011 09:42:52 +0200 Subject: [PATCH 07/16] add mapquest layer --- .gitmodules | 3 + COPYING.TXT | 3 + application/configs/medias.ini | 2 +- application/controllers/IdxController.php | 2 + application/languages/lang_en.po | 24 +++--- application/languages/lang_fr.po | 24 +++--- application/languages/lang_ja.po | 27 ++++--- public/css/syj.css | 31 ++++++++ public/css/syjprint.css | 2 +- .../icons/layer-switcher-maximize-flipped.png | Bin 0 -> 479 bytes public/js/store.js | 1 + public/js/syj.js | 70 +++++++++++++++++- public/js/syjraw.js | 35 ++++++++- public/store.js | 1 + scripts/fulljslint.js | 2 +- scripts/syj.cfg | 1 + 16 files changed, 190 insertions(+), 38 deletions(-) create mode 100644 public/icons/layer-switcher-maximize-flipped.png create mode 120000 public/js/store.js create mode 160000 public/store.js diff --git a/.gitmodules b/.gitmodules index 26fad1a..0bbb505 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "public/simplebox"] path = public/simplebox url = git://github.com/arenevier/simplebox.git +[submodule "public/store.js"] + path = public/store.js + url = git://github.com/cloudhead/store.js.git diff --git a/COPYING.TXT b/COPYING.TXT index 6128571..e83ada2 100644 --- a/COPYING.TXT +++ b/COPYING.TXT @@ -10,6 +10,9 @@ - pseudo.gif files has been generated with http://ajaxload.info/ generator and is free for use. +- layer-switcher-maximize-flipped.png is a flipped version of + layer-switcher-maximize.png from OpenLayers. As such it is licensed under a + modified BSD license. =============================================================================== diff --git a/application/configs/medias.ini b/application/configs/medias.ini index 7826dc7..53c5489 100644 --- a/application/configs/medias.ini +++ b/application/configs/medias.ini @@ -1,7 +1,7 @@ ; This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier, ; and is published under the AGPL license. */ [production] -scripts.idx = OpenLayers, ModifiablePath, prototype, simplebox, utils, syj +scripts.idx = OpenLayers, ModifiablePath, prototype, simplebox, utils, syj, store scripts.rawidx = OpenLayers, syjraw scripts.login = prototype, utils, login scripts.contact = prototype, utils, contact diff --git a/application/controllers/IdxController.php b/application/controllers/IdxController.php index 16ff68f..d0fa248 100644 --- a/application/controllers/IdxController.php +++ b/application/controllers/IdxController.php @@ -149,6 +149,7 @@ class IdxController extends Zend_Controller_Action protected function _jsRawLocaleStrings() { $this->view->jslocales = array( 'osmAttribution' => __("Map by OpenStreetMap"), + 'mapquestAttribution' => __("Map by MapQuest, OpenStreetMap and contributors, CC-BY-SA"), ); } @@ -174,6 +175,7 @@ class IdxController extends Zend_Controller_Action 'canResubmit' => __("Now, you can retry to save"), 'routeBy' => __("route by"), 'osmAttribution' => __("Map by OpenStreetMap"), + 'mapquestAttribution' => __("Map by MapQuest, OpenStreetMap and contributors, CC-BY-SA"), 'pseudoChecking' => __("checking availibilty"), 'availablePseudo' => __("available pseudo"), 'unavailablePseudo' => __("unavailable pseudo"), diff --git a/application/languages/lang_en.po b/application/languages/lang_en.po index 335ce2b..defca44 100644 --- a/application/languages/lang_en.po +++ b/application/languages/lang_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:05+0200\n" +"POT-Creation-Date: 2011-04-12 23:13+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -106,12 +106,12 @@ msgid "gpx export" msgstr "gpx export" #: application/views/scripts/idx/index.phtml:112 -#: application/controllers/IdxController.php:182 +#: application/controllers/IdxController.php:183 msgid "duplicate" msgstr "duplicate" #: application/views/scripts/idx/index.phtml:114 -#: application/controllers/IdxController.php:180 +#: application/controllers/IdxController.php:181 msgid "edit" msgstr "edit" @@ -476,7 +476,7 @@ msgstr "Hi," #: application/controllers/ContactController.php:121 #: application/controllers/NewpwdController.php:68 #: application/controllers/AccountController.php:70 -#: application/controllers/IdxController.php:184 +#: application/controllers/IdxController.php:185 msgid "Value is required" msgstr "Value is required" @@ -640,30 +640,34 @@ msgid "route by" msgstr "route by" #: application/controllers/IdxController.php:177 +msgid "Map by MapQuest, OpenStreetMap and contributors, CC-BY-SA" +msgstr "Map by MapQuest, OpenStreetMap and contributors, CC-BY-SA" + +#: application/controllers/IdxController.php:178 msgid "checking availibilty" msgstr "checking availibilty" -#: application/controllers/IdxController.php:178 +#: application/controllers/IdxController.php:179 msgid "available pseudo" msgstr "available pseudo" -#: application/controllers/IdxController.php:179 +#: application/controllers/IdxController.php:180 msgid "unavailable pseudo" msgstr "unavailable pseudo" -#: application/controllers/IdxController.php:181 +#: application/controllers/IdxController.php:182 msgid "create" msgstr "create" -#: application/controllers/IdxController.php:183 +#: application/controllers/IdxController.php:184 msgid "You have an unsaved route" msgstr "You have an unsaved route" -#: application/controllers/IdxController.php:185 +#: application/controllers/IdxController.php:186 msgid "no result" msgstr "no result" -#: application/controllers/IdxController.php:186 +#: application/controllers/IdxController.php:187 msgid "could not analyze file content" msgstr "could not analyze file content" diff --git a/application/languages/lang_fr.po b/application/languages/lang_fr.po index 6efd1a2..cc18240 100644 --- a/application/languages/lang_fr.po +++ b/application/languages/lang_fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:05+0200\n" +"POT-Creation-Date: 2011-04-12 23:13+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -106,12 +106,12 @@ msgid "gpx export" msgstr "export gpx" #: application/views/scripts/idx/index.phtml:112 -#: application/controllers/IdxController.php:182 +#: application/controllers/IdxController.php:183 msgid "duplicate" msgstr "dupliquer" #: application/views/scripts/idx/index.phtml:114 -#: application/controllers/IdxController.php:180 +#: application/controllers/IdxController.php:181 msgid "edit" msgstr "modifier" @@ -478,7 +478,7 @@ msgstr "Bonjour," #: application/controllers/ContactController.php:121 #: application/controllers/NewpwdController.php:68 #: application/controllers/AccountController.php:70 -#: application/controllers/IdxController.php:184 +#: application/controllers/IdxController.php:185 msgid "Value is required" msgstr "Le champ est requis" @@ -642,30 +642,34 @@ msgid "route by" msgstr "tracé par" #: application/controllers/IdxController.php:177 +msgid "Map by MapQuest, OpenStreetMap and contributors, CC-BY-SA" +msgstr "Carte par MapQuest, OpenStreetMap et contributeurs, CC-BY-SA" + +#: application/controllers/IdxController.php:178 msgid "checking availibilty" msgstr "vérification de la disponibilité" -#: application/controllers/IdxController.php:178 +#: application/controllers/IdxController.php:179 msgid "available pseudo" msgstr "pseudo disponible" -#: application/controllers/IdxController.php:179 +#: application/controllers/IdxController.php:180 msgid "unavailable pseudo" msgstr "pseudo non disponible" -#: application/controllers/IdxController.php:181 +#: application/controllers/IdxController.php:182 msgid "create" msgstr "créér" -#: application/controllers/IdxController.php:183 +#: application/controllers/IdxController.php:184 msgid "You have an unsaved route" msgstr "Vous avez un itinéraire non sauvegardé" -#: application/controllers/IdxController.php:185 +#: application/controllers/IdxController.php:186 msgid "no result" msgstr "pas de résultat" -#: application/controllers/IdxController.php:186 +#: application/controllers/IdxController.php:187 msgid "could not analyze file content" msgstr "impossible d'analyser le contenu du fichier" diff --git a/application/languages/lang_ja.po b/application/languages/lang_ja.po index 37704d4..00c952e 100644 --- a/application/languages/lang_ja.po +++ b/application/languages/lang_ja.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-04 13:05+0200\n" +"POT-Creation-Date: 2011-04-12 23:13+0200\n" "PO-Revision-Date: \n" "Last-Translator: S.Higashi \n" "Language: \n" @@ -110,12 +110,12 @@ msgid "gpx export" msgstr "gpxにエクスポート" #: application/views/scripts/idx/index.phtml:112 -#: application/controllers/IdxController.php:182 +#: application/controllers/IdxController.php:183 msgid "duplicate" msgstr "複製" #: application/views/scripts/idx/index.phtml:114 -#: application/controllers/IdxController.php:180 +#: application/controllers/IdxController.php:181 msgid "edit" msgstr "編集" @@ -572,7 +572,7 @@ msgstr "Hi," #: application/controllers/ContactController.php:121 #: application/controllers/NewpwdController.php:68 #: application/controllers/AccountController.php:70 -#: application/controllers/IdxController.php:184 +#: application/controllers/IdxController.php:185 msgid "Value is required" msgstr "値が必要です" @@ -736,30 +736,37 @@ msgid "route by" msgstr "ルート作成者" #: application/controllers/IdxController.php:177 +msgid "" +"Map by MapQuest, OpenStreetMap " +"and contributors, CC-BY-SA" +msgstr "" + +#: application/controllers/IdxController.php:178 msgid "checking availibilty" msgstr "利用可能かチェック中" -#: application/controllers/IdxController.php:178 +#: application/controllers/IdxController.php:179 msgid "available pseudo" msgstr "利用出来るID" -#: application/controllers/IdxController.php:179 +#: application/controllers/IdxController.php:180 msgid "unavailable pseudo" msgstr "利用できないID" -#: application/controllers/IdxController.php:181 +#: application/controllers/IdxController.php:182 msgid "create" msgstr "作成" -#: application/controllers/IdxController.php:183 +#: application/controllers/IdxController.php:184 msgid "You have an unsaved route" msgstr "保存されていないルートがあります" -#: application/controllers/IdxController.php:185 +#: application/controllers/IdxController.php:186 msgid "no result" msgstr "結果がありません" -#: application/controllers/IdxController.php:186 +#: application/controllers/IdxController.php:187 msgid "could not analyze file content" msgstr "ファイル内容を分析できませんでした" diff --git a/public/css/syj.css b/public/css/syj.css index b5151ae..ae8e1b6 100644 --- a/public/css/syj.css +++ b/public/css/syj.css @@ -29,6 +29,37 @@ body, html { left: 0.5em; } +.olControlLayerSwitcher { + bottom: 4em; + top: auto; + left: 13px; + opacity: 0.75; + height: 6em; + max-width: intrinsic; + max-width: -moz-max-content; +} + +/* setting opacity to .olControlLayerSwitcher does not work */ +.olControlLayerSwitcher .layersDiv, +.olControlLayerSwitcher .maximizeDiv, +.olControlLayerSwitcher .minimizeDiv +{ + filter:alpha(opacity=75); +} + +.olControlLayerSwitcher .dataLayersDiv, .olControlLayerSwitcher .dataLbl { + display: none; +} +.olControlLayerSwitcher .layersDiv { + padding: 5px 12px 5px 36px; +} +.olControlLayerSwitcher .maximizeDiv { + top: -6em; +} +.olControlLayerSwitcher .minimizeDiv { + left: 4px; +} + /* * main message rules */ diff --git a/public/css/syjprint.css b/public/css/syjprint.css index 305b06d..89b90fa 100644 --- a/public/css/syjprint.css +++ b/public/css/syjprint.css @@ -1,7 +1,7 @@ /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier, and is published under the AGPL license. */ -.olControlPanZoom, .olControlAttribution { +.olControlPanZoom, .olControlAttribution, .olControlLayerSwitcher { display: none; } #message, #other-language, #menu, #user_area, #login_area, #newpwd_area, #termsofusearea, #footer, #map-overlay { diff --git a/public/icons/layer-switcher-maximize-flipped.png b/public/icons/layer-switcher-maximize-flipped.png new file mode 100644 index 0000000000000000000000000000000000000000..f87fa323d2f1f29426fc64f836d04b15935ed83f GIT binary patch literal 479 zcmV<50U-W~P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipV- z6f`Mx8wa`o00Cb~L_t(I%dM2XOG053#(%F~KM})*E8-Y}(9jeTE<(G5i>__1f&WE9 zOS`jstAk)D=-TM!Rm4T@qISLdHkcRudJF5B4(A-6^L+$7Nq$Bj=m2e?CS|F)?;w6j zw2un#C}nA~Rk%1055T(+<@B$JbUjEo>^)_U163i)7fPaBE`ebb>Gz8S0-B2KSxKbp zL6*xEn&!gib1TafqI`F5kM?oDlXEH+!|&fjPb4CaKAnzZnic@P-Ur?8WS{8P8GkAj zqh8N5pWBW#6!NlI*x2@ZvnxU%r6dx0IoLC&G$9W272;4YjyVEOX|2|POs0z8zfong zR}_mkXqt;c;T6+dI;9;!XQxN4*1(aI$xBCWGz`Y$PgS$q|24JRNutqchR5T^w%1tJ zN_lrumYT|=jYfma=Qh)+b;`v6uB9wZG*zhKaHcXFKz{oH&h1gR7fb*E002ovPDHLkV1nbS%R&GE literal 0 HcmV?d00001 diff --git a/public/js/store.js b/public/js/store.js new file mode 120000 index 0000000..bc23b5e --- /dev/null +++ b/public/js/store.js @@ -0,0 +1 @@ +../store.js/store.js \ No newline at end of file diff --git a/public/js/syj.js b/public/js/syj.js index 85db31a..0233634 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -272,7 +272,7 @@ var SYJView = { mode: 'view', init: function() { - var externalGraphic, baseURL, baseLayer, layerOptions, hidemessenger; + var externalGraphic, baseURL, osmLayer, layerOptions, hidemessenger, layerCode, parameters; // is svg context, opera does not resolve links with base element is svg context externalGraphic = styleMap.edit.styles.select.defaultStyle.externalGraphic; @@ -283,16 +283,24 @@ var SYJView = { controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoom(), + this.createLayerSwitcher(), new OpenLayers.Control.Attribution() ], theme: null }); - baseLayer = new OpenLayers.Layer.OSM("OSM", [ + osmLayer = new OpenLayers.Layer.OSM("OSM", [ 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], - { wrapDateLine: true , attribution: SyjStrings.osmAttribution }); + { wrapDateLine: true , attribution: SyjStrings.osmAttribution, layerCode: 'O'}); + + mapquestLayer = new OpenLayers.Layer.OSM("Mapquest", [ + 'http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png'], + { wrapDateLine: true , attribution: SyjStrings.mapquestAttribution, layerCode: 'M'}); layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, @@ -300,7 +308,34 @@ var SYJView = { attribution: SyjStrings.geomAttribution }; this.viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions); - this.map.addLayers([baseLayer, this.viewLayer]); + this.map.addLayers([osmLayer, mapquestLayer, this.viewLayer]); + + this.map.setBaseLayer(mapquestLayer); + layerCode = null; + parameters = OpenLayers.Util.getParameters(window.location.href); + if (parameters.layer) { + layerCode = parameters.layer; + try { + store.remove('baselayer'); + } catch(e) {} + } else { + try { + layerCode = store.get('baselayer'); + } catch(e) {} + } + + if (layerCode) { + layerCode = layerCode.toUpperCase(); + var self = this; + $([osmLayer, mapquestLayer]).each(function(layer) { + if (layer.layerCode === layerCode) { + self.map.setBaseLayer(layer); + } + }); + } + + + this.map.events.register("changebaselayer", this, this.saveBaseLayer); if ($("edit-btn")) { $("edit-btn").observe('click', function() { @@ -431,6 +466,33 @@ var SYJView = { SYJPathLength.update(); }, + saveBaseLayer: function(data) { + try { + store.set('baselayer', data.layer.layerCode); + } catch(e) {} + }, + + createLayerSwitcher: function() { + var control = new OpenLayers.Control.LayerSwitcher({roundedCorner: false}); + // XXX: we need to "live-patch" LayerSwitcher to use our icons. We use + // a regexp instead of a string in case OpenLayers is modified and in + // case browsers modify the function representation + control.loadContents = eval('(function() { return (' + control.loadContents.toString().replace( + /\s*=\s*imgLocation\s*\+\s*['"]layer-switcher-maximize\.png['"]\s*;/, + " = 'icons/layer-switcher-maximize-flipped.png';" + ) + ')}())'); + var oldMaximizeControl = control.maximizeControl; + var self = this; + control.maximizeControl = (function(oldfunc) { + return function() { + oldfunc.apply(control, arguments); + self.messenger.hide(); + }; + }(control.maximizeControl)); + + return control; + }, + initMaPos: function (aPos) { var extent = null, center = null, zoom = 0; diff --git a/public/js/syjraw.js b/public/js/syjraw.js index cf6be9c..8a77bb0 100644 --- a/public/js/syjraw.js +++ b/public/js/syjraw.js @@ -17,12 +17,30 @@ function resizeMap() { map.style.height = map.offsetHeight.toString() + 'px'; } +function mapquestLayer() { + return new OpenLayers.Layer.OSM("Mapquest", [ + 'http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png', + 'http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png'], + { attribution: SyjStrings.mapquestAttribution}); +} + +function osmLayer() { + return new OpenLayers.Layer.OSM("OSM", [ + 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], + { attribution: SyjStrings.osmAttribution}); +} + function init() { var map = new OpenLayers.Map('map', { controls: [ new OpenLayers.Control.Attribution() ], theme: null}), - baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }), + parameters = OpenLayers.Util.getParameters(window.location.href), + baseLayer = null, layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, @@ -32,6 +50,21 @@ function init() { viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions), wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 }); + if (parameters.layer) { + switch (parameters.layer.toUpperCase()) { + case 'M': + baseLayer = mapquestLayer(); + break; + case 'O': + baseLayer = osmLayer(); + break; + } + } + + if (!baseLayer) { + baseLayer = osmLayer(); + } + map.addLayers([baseLayer, viewLayer]); viewLayer.addFeatures([wkt.read(gInitialGeom.data)]); extent = viewLayer.getDataExtent(); diff --git a/public/store.js b/public/store.js new file mode 160000 index 0000000..25c640b --- /dev/null +++ b/public/store.js @@ -0,0 +1 @@ +Subproject commit 25c640b09962bcbf46a17e88817ce195118cfeac diff --git a/scripts/fulljslint.js b/scripts/fulljslint.js index 9bffa4f..4cd74d3 100755 --- a/scripts/fulljslint.js +++ b/scripts/fulljslint.js @@ -6595,4 +6595,4 @@ loop: for (;;) { return itself; -}()); \ No newline at end of file +}()); diff --git a/scripts/syj.cfg b/scripts/syj.cfg index f473f40..5c729f7 100644 --- a/scripts/syj.cfg +++ b/scripts/syj.cfg @@ -15,6 +15,7 @@ OpenLayers/BaseTypes/Element.js OpenLayers/Console.js OpenLayers/Control/Attribution.js OpenLayers/Control/DrawFeature.js +OpenLayers/Control/LayerSwitcher.js OpenLayers/Control/Navigation.js OpenLayers/Control/DragFeature.js OpenLayers/Control/PanZoom.js -- 2.39.2 From a73fb9125bf059e16ae583f82d67bcc59efb69b4 Mon Sep 17 00:00:00 2001 From: arno Date: Thu, 14 Apr 2011 10:20:21 +0200 Subject: [PATCH 08/16] fixe map resizing --- public/js/syj.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/public/js/syj.js b/public/js/syj.js index 0233634..ed68bcf 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -512,13 +512,6 @@ var SYJView = { } else { this.map.setCenter(center, zoom); } - this.resizeMap(); - }, - - resizeMap: function() { - var map = $('map'); - map.style.width = map.offsetWidth.toString() + 'px'; - map.style.height = map.offsetHeight.toString() + 'px'; }, observer: function(evt) { @@ -1355,7 +1348,3 @@ window.onbeforeunload = function() { return undefined; } }; - -window.onresize = function() { - SYJView.resizeMap(); -}; -- 2.39.2 From 41a62d74f105acd6e59c86d42a831559a86177cd Mon Sep 17 00:00:00 2001 From: arno Date: Thu, 14 Apr 2011 10:38:01 +0200 Subject: [PATCH 09/16] use html5