$this->view->jslocales = array(
'saveSuccess' => __("save took place successfully"),
'requestError' => __("server did not understood request. That's probably caused by a bug in SYJ"),
- 'gonePathError' => __("route has been deleted from the server."),
+ 'gonePathError' => __("route not referenced on the server. It has probably been deleted."),
'uniquePathError' => __("similar path seems to already exist. Please do not create two exactly identical paths"),
'notReachedError' => __("server could not be reached"),
'serverError' => __("there was a server error"),
'confirmDelete' => __("There is no undo. Delete this route definitively ?"),
'notReachedError' => __("server could not be reached"),
'requestError' => __("server did not understood request. That's probably caused by a bug in SYJ"),
- 'gonePathError' => __("route has been deleted from the server."),
+ 'gonePathError' => __("route not referenced on the server. It has probably been deleted."),
'serverError' => __("there was a server error"),
'unknownError' => __("there was an unknown error"),
'deleteSuccess' => __("route was successfully deleted"),
msgstr ""
"Project-Id-Version: syj\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-08-07 20:59+0200\n"
+"POT-Creation-Date: 2010-08-11 21:44+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: arno <arno@renevier.net>\n"
"Language-Team: arno <arno@renevier.net>\n"
msgstr "Email was send successfully"
#: application/views/scripts/idx/index.phtml:8
+#: application/views/scripts/list/index.phtml:8
msgid "SYJ needs javascript. Please activate scripts in your browser."
msgstr "SYJ needs javascript. Please activate scripts in your browser."
msgid "When you have finished a path, press \"save\", button."
msgstr "When you have finished a path, press \"save\", button."
-#: application/views/scripts/idx/index.phtml:24
+#: application/views/scripts/idx/index.phtml:25
msgid "edit"
msgstr "edit"
-#: application/views/scripts/idx/index.phtml:35
+#: application/views/scripts/idx/index.phtml:25
+msgid "start a route"
+msgstr "start a route"
+
+#: application/views/scripts/idx/index.phtml:37
#: application/controllers/LoginController.php:8
-#: application/layouts/scripts/footer.phtml:54
+#: application/layouts/scripts/footer.phtml:72
#: application/forms/Login.php:26
msgid "login"
msgstr "login"
-#: application/views/scripts/idx/index.phtml:37
-#: application/views/scripts/idx/index.phtml:68
+#: application/views/scripts/idx/index.phtml:39
+#: application/views/scripts/idx/index.phtml:70
msgid "create an account"
msgstr "create an account"
-#: application/views/scripts/idx/index.phtml:38
+#: application/views/scripts/idx/index.phtml:40
msgid "Whith an account, you can manage and modify your routes"
msgstr "Whith an account, you can manage and modify your routes"
msgstr "Sources of the software running the website are <a href=\"http://dev.renevier.net/?p=syj.git\">publicly available</a> under a agpl license. The map used to display the routes comes from <a href=\"http://www.openstreetmap.org/\">openstreetmap</a>."
#: application/views/scripts/newpwd/success.phtml:4
-#: application/controllers/IdxController.php:102
+#: application/controllers/IdxController.php:103
msgid "A link to reset your password has been emailed to you"
msgstr "A link to reset your password has been emailed to you"
msgid "Your account was modified successfully"
msgstr "Your account was modified successfully"
-#: application/views/helpers/LogoutLink.php:12
-#: application/layouts/scripts/footer.phtml:45
+#: application/views/scripts/list/index.phtml:17
+#: application/layouts/scripts/footer.phtml:17
+msgid "create a route"
+msgstr "create a route"
+
+#: application/views/scripts/list/index.phtml:18
+#, php-format
+msgid "you have created no route yet, you may want to %s"
+msgstr "you have created no route yet, you may want to %s"
+
+#: application/views/scripts/list/index.phtml:29
+msgid "first page"
+msgstr "first page"
+
+#: application/views/scripts/list/index.phtml:33
+msgid "previous page"
+msgstr "previous page"
+
+#: application/views/scripts/list/index.phtml:42
+msgid "next page"
+msgstr "next page"
+
+#: application/views/scripts/list/index.phtml:46
+msgid "last page"
+msgstr "last page"
+
+#: application/views/scripts/list/index.phtml:67
+msgid "modify"
+msgstr "modify"
+
+#: application/views/scripts/list/index.phtml:68
+msgid "duplicate"
+msgstr "duplicate"
+
+#: application/views/scripts/list/index.phtml:69
+#: application/forms/Pending/ValidateCreation.php:23
+msgid "delete"
+msgstr "delete"
+
+#: application/views/helpers/LogoutLink.php:10
+#: application/layouts/scripts/footer.phtml:65
msgid "logout"
msgstr "logout"
"Syj team"
#: application/controllers/LoginController.php:101
-#: application/controllers/IdxController.php:90
+#: application/controllers/IdxController.php:91
msgid "you must enter a login name"
msgstr "you must enter a login name"
msgstr "Oups, something went wrong"
#: application/controllers/TermsofuseController.php:12
-#: application/layouts/scripts/footer.phtml:67
-#: application/forms/Geom.php:25
+#: application/layouts/scripts/footer.phtml:85
+#: application/forms/Geom.php:24
#: application/forms/User.php:41
msgid "terms of use"
msgstr "terms of use"
+#: application/controllers/ListController.php:18
+#: application/layouts/scripts/footer.phtml:51
+msgid "my routes"
+msgstr "my routes"
+
+#: application/controllers/ListController.php:35
+msgid "There is no undo. Delete this route definitively ?"
+msgstr "There is no undo. Delete this route definitively ?"
+
+#: application/controllers/ListController.php:36
+#: application/controllers/IdxController.php:88
+msgid "server could not be reached"
+msgstr "server could not be reached"
+
+#: application/controllers/ListController.php:37
+#: application/controllers/IdxController.php:85
+msgid "server did not understood request. That's probably caused by a bug in SYJ"
+msgstr "server did not understood request. That's probably caused by a bug in SYJ"
+
+#: application/controllers/ListController.php:38
+#: application/controllers/IdxController.php:86
+msgid "route not referenced on the server. It has probably been deleted."
+msgstr "route not referenced on the server. It has probably been deleted."
+
+#: application/controllers/ListController.php:39
+#: application/controllers/IdxController.php:89
+msgid "there was a server error"
+msgstr "there was a server error"
+
+#: application/controllers/ListController.php:40
+#: application/controllers/IdxController.php:90
+msgid "there was an unknown error"
+msgstr "there was an unknown error"
+
+#: application/controllers/ListController.php:41
+msgid "route was successfully deleted"
+msgstr "route was successfully deleted"
+
#: application/controllers/AccountController.php:16
#: application/layouts/scripts/footer.phtml:39
msgid "my account"
msgstr "Wrong password"
#: application/controllers/AccountController.php:44
-#: application/controllers/IdxController.php:100
+#: application/controllers/IdxController.php:101
msgid "an user is already registered with this email"
msgstr "an user is already registered with this email"
#: application/controllers/AccountController.php:72
-#: application/controllers/IdxController.php:94
+#: application/controllers/IdxController.php:95
#: application/forms/Account.php:40
msgid "Password do not match"
msgstr "Password do not match"
msgid "You have made no change"
msgstr "You have made no change"
-#: application/controllers/IdxController.php:83
+#: application/controllers/IdxController.php:84
msgid "save took place successfully"
msgstr "save took place successfully"
-#: application/controllers/IdxController.php:84
-msgid "server did not understood request. That's probably caused by a bug in SYJ"
-msgstr "server did not understood request. That's probably caused by a bug in SYJ"
-
-#: application/controllers/IdxController.php:85
-msgid "path did not exist in the server. May be it has been already deleted"
-msgstr "path did not exist in the server. May be it has been already deleted"
-
-#: application/controllers/IdxController.php:86
+#: application/controllers/IdxController.php:87
msgid "similar path seems to already exist. Please do not create two exactly identical paths"
msgstr "similar path seems to already exist. Please do not create two exactly identical paths"
-#: application/controllers/IdxController.php:87
-msgid "server could not be reached"
-msgstr "server could not be reached"
-
-#: application/controllers/IdxController.php:88
-msgid "there was a server error"
-msgstr "there was a server error"
-
-#: application/controllers/IdxController.php:89
-msgid "there was an unknown error"
-msgstr "there was an unknown error"
-
-#: application/controllers/IdxController.php:91
+#: application/controllers/IdxController.php:92
msgid "Login correct"
msgstr "Login correct"
-#: application/controllers/IdxController.php:92
+#: application/controllers/IdxController.php:93
msgid "Wrong login/password"
msgstr "Wrong login/password"
-#: application/controllers/IdxController.php:93
+#: application/controllers/IdxController.php:94
msgid "you must enter a password"
msgstr "you must enter a password"
-#: application/controllers/IdxController.php:95
+#: application/controllers/IdxController.php:96
msgid "You must accept terms of use"
msgstr "You must accept terms of use"
-#: application/controllers/IdxController.php:96
+#: application/controllers/IdxController.php:97
msgid "you must enter an email"
msgstr "you must enter an email"
-#: application/controllers/IdxController.php:97
+#: application/controllers/IdxController.php:98
msgid "invalid email"
msgstr "invalid email"
-#: application/controllers/IdxController.php:98
+#: application/controllers/IdxController.php:99
msgid "pseudo must only contain letters, digits, dots or underscores"
msgstr "pseudo must only contain letters, digits, dots or underscores"
-#: application/controllers/IdxController.php:99
+#: application/controllers/IdxController.php:100
msgid "unavailable pseudo"
msgstr "unavailable pseudo"
-#: application/controllers/IdxController.php:101
+#: application/controllers/IdxController.php:102
msgid "Account created"
msgstr "Account created"
-#: application/controllers/IdxController.php:103
+#: application/controllers/IdxController.php:104
msgid "Now, you can retry to save"
msgstr "Now, you can retry to save"
-#: application/controllers/IdxController.php:104
+#: application/controllers/IdxController.php:105
msgid "route by"
msgstr "route by"
-#: application/controllers/IdxController.php:105
+#: application/controllers/IdxController.php:106
msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
msgstr "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-#: application/layouts/scripts/footer.phtml:17
-msgid "create a route"
-msgstr "create a route"
-
#: application/layouts/scripts/footer.phtml:28
msgid "contact"
msgstr "contact"
msgid "Send a message"
msgstr "Send a message"
-#: application/forms/Geom.php:19
+#: application/forms/Geom.php:18
msgid "optional title for this journey"
msgstr "optional title for this journey"
-#: application/forms/Geom.php:26
+#: application/forms/Geom.php:25
#: application/forms/User.php:42
#, php-format
msgid "I've read and accepted %s"
msgstr "I've read and accepted %s"
-#: application/forms/Geom.php:34
+#: application/forms/Geom.php:33
#: application/forms/Pending/ValidateCreation.php:17
msgid "save"
msgstr "save"
msgid "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button."
msgstr "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button."
-#: application/forms/Pending/ValidateCreation.php:23
-msgid "delete"
-msgstr "delete"
-
#: 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 "route has been deleted from the server."
+#~ msgstr "route has been deleted from the server."
#~ msgid "You need to login before retrying to save"
#~ msgstr "You need to login before retrying to save"
#~ msgid "You need to have cookies enabled to login to SYJ"
#~ msgstr "You need to have cookies enabled to login to SYJ"
-#~ msgid "main page"
-#~ msgstr "main page"
#~ msgid "reset password"
#~ msgstr "reset password"
msgstr ""
"Project-Id-Version: syj\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-08-07 20:59+0200\n"
+"POT-Creation-Date: 2010-08-11 21:44+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: arno <arno@renevier.net>\n"
"Language-Team: arno <arno@renevier.net>\n"
msgstr "L'email a été envoyé avec succès"
#: application/views/scripts/idx/index.phtml:8
+#: application/views/scripts/list/index.phtml:8
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."
msgid "When you have finished a path, press \"save\", button."
msgstr "Lorsque vous avez fini votre tracé, pressez le bouton \"enregistrer\"."
-#: application/views/scripts/idx/index.phtml:24
+#: application/views/scripts/idx/index.phtml:25
msgid "edit"
msgstr "modifier"
-#: application/views/scripts/idx/index.phtml:35
+#: application/views/scripts/idx/index.phtml:25
+msgid "start a route"
+msgstr "commencer un itinéraire"
+
+#: application/views/scripts/idx/index.phtml:37
#: application/controllers/LoginController.php:8
-#: application/layouts/scripts/footer.phtml:54
+#: application/layouts/scripts/footer.phtml:72
#: application/forms/Login.php:26
msgid "login"
msgstr "connexion"
-#: application/views/scripts/idx/index.phtml:37
-#: application/views/scripts/idx/index.phtml:68
+#: application/views/scripts/idx/index.phtml:39
+#: application/views/scripts/idx/index.phtml:70
msgid "create an account"
msgstr "créer un compte"
-#: application/views/scripts/idx/index.phtml:38
+#: application/views/scripts/idx/index.phtml:40
msgid "Whith an account, you can manage and modify your routes"
msgstr "Avec un compte, vous pourrez gérer et modifier vos itinéraires"
msgstr "Les sources du logiciel qui fait tourner le site web sont <a href=\"http://dev.renevier.net/?p=syj.git\">disponibles publiquement</a> sous une licence agpl. La carte utilisée pour l'affichage des itinéraires vient d'<a href=\"http://www.openstreetmap.org/\">openstreetmap</a>."
#: application/views/scripts/newpwd/success.phtml:4
-#: application/controllers/IdxController.php:102
+#: application/controllers/IdxController.php:103
msgid "A link to reset your password has been emailed to you"
msgstr "Un email contenant un lien pour réinitialiser votre mot de passe vous a été envoyé"
msgid "Your account was modified successfully"
msgstr "Votre compte a bien été modifié."
-#: application/views/helpers/LogoutLink.php:12
-#: application/layouts/scripts/footer.phtml:45
+#: application/views/scripts/list/index.phtml:17
+#: application/layouts/scripts/footer.phtml:17
+msgid "create a route"
+msgstr "créer un itinéraire"
+
+#: application/views/scripts/list/index.phtml:18
+#, php-format
+msgid "you have created no route yet, you may want to %s"
+msgstr "Vous n'avez pas encore créé d'itinéraire. Voulez vous %s"
+
+#: application/views/scripts/list/index.phtml:29
+msgid "first page"
+msgstr "première page"
+
+#: application/views/scripts/list/index.phtml:33
+msgid "previous page"
+msgstr "page précédente"
+
+#: application/views/scripts/list/index.phtml:42
+msgid "next page"
+msgstr "page suivante"
+
+#: application/views/scripts/list/index.phtml:46
+msgid "last page"
+msgstr "dernière page"
+
+#: application/views/scripts/list/index.phtml:67
+msgid "modify"
+msgstr "modifier"
+
+#: application/views/scripts/list/index.phtml:68
+msgid "duplicate"
+msgstr "dupliquer"
+
+#: application/views/scripts/list/index.phtml:69
+#: application/forms/Pending/ValidateCreation.php:23
+msgid "delete"
+msgstr "supprimer"
+
+#: application/views/helpers/LogoutLink.php:10
+#: application/layouts/scripts/footer.phtml:65
msgid "logout"
msgstr "déconnexion"
"L'équipe de Syj"
#: application/controllers/LoginController.php:101
-#: application/controllers/IdxController.php:90
+#: application/controllers/IdxController.php:91
msgid "you must enter a login name"
msgstr "vous devez entrer un nom d'utilisateur"
msgstr "Oups, il y a eu un souci"
#: application/controllers/TermsofuseController.php:12
-#: application/layouts/scripts/footer.phtml:67
-#: application/forms/Geom.php:25
+#: application/layouts/scripts/footer.phtml:85
+#: application/forms/Geom.php:24
#: application/forms/User.php:41
msgid "terms of use"
msgstr "conditions d'utilisation"
+#: application/controllers/ListController.php:18
+#: application/layouts/scripts/footer.phtml:51
+msgid "my routes"
+msgstr "mes itinéraires"
+
+#: application/controllers/ListController.php:35
+msgid "There is no undo. Delete this route definitively ?"
+msgstr "Vous ne pourrez pas annuler. Supprimer l'itinéraire définitivement ?"
+
+#: application/controllers/ListController.php:36
+#: application/controllers/IdxController.php:88
+msgid "server could not be reached"
+msgstr "serveur inaccessible"
+
+#: application/controllers/ListController.php:37
+#: application/controllers/IdxController.php:85
+msgid "server did not understood request. That's probably caused by a bug in SYJ"
+msgstr "Le serveur n'a pas compris la requête. Il s'agit probablement d'un bug dans SYJ"
+
+#: application/controllers/ListController.php:38
+#: application/controllers/IdxController.php:86
+msgid "route not referenced on the server. It has probably been deleted."
+msgstr "chemin non référencé sur le serveur. Il a probablement été supprimé."
+
+#: application/controllers/ListController.php:39
+#: application/controllers/IdxController.php:89
+msgid "there was a server error"
+msgstr "Il s'est produit une erreur serveur"
+
+#: application/controllers/ListController.php:40
+#: application/controllers/IdxController.php:90
+msgid "there was an unknown error"
+msgstr "Il s'est produit une erreur inconnue"
+
+#: application/controllers/ListController.php:41
+msgid "route was successfully deleted"
+msgstr "l'itinéraire a été correctement supprimé"
+
#: application/controllers/AccountController.php:16
#: application/layouts/scripts/footer.phtml:39
msgid "my account"
msgstr "Mauvais mot de passe"
#: application/controllers/AccountController.php:44
-#: application/controllers/IdxController.php:100
+#: application/controllers/IdxController.php:101
msgid "an user is already registered with this email"
msgstr "il y'a déjà un utilisateur enregistré avec cet email"
#: application/controllers/AccountController.php:72
-#: application/controllers/IdxController.php:94
+#: application/controllers/IdxController.php:95
#: application/forms/Account.php:40
msgid "Password do not match"
msgstr "Les mots de passe ne correspondent pas"
msgid "You have made no change"
msgstr "Vous n'avez fait aucun changement"
-#: application/controllers/IdxController.php:83
+#: application/controllers/IdxController.php:84
msgid "save took place successfully"
msgstr "La sauvegarde s'est déroulée correctement"
-#: application/controllers/IdxController.php:84
-msgid "server did not understood request. That's probably caused by a bug in SYJ"
-msgstr "Le serveur n'a pas compris la requête. Il s'agit probablement d'un bug dans SYJ"
-
-#: application/controllers/IdxController.php:85
-msgid "path did not exist in the server. May be it has been already deleted"
-msgstr "Le chemin n'existait pas sur le serveur. Il a peut-être supprimé"
-
-#: application/controllers/IdxController.php:86
+#: application/controllers/IdxController.php:87
msgid "similar path seems to already exist. Please do not create two exactly identical paths"
msgstr "Il semble qu'il y ait déjà un chemin similaire. Veuillez ne pas créer deux chemins exactement identiques"
-#: application/controllers/IdxController.php:87
-msgid "server could not be reached"
-msgstr "serveur inaccessible"
-
-#: application/controllers/IdxController.php:88
-msgid "there was a server error"
-msgstr "Il s'est produit une erreur serveur"
-
-#: application/controllers/IdxController.php:89
-msgid "there was an unknown error"
-msgstr "Il s'est produit une erreur inconnue"
-
-#: application/controllers/IdxController.php:91
+#: application/controllers/IdxController.php:92
msgid "Login correct"
msgstr "Vous êtes connectés"
-#: application/controllers/IdxController.php:92
+#: application/controllers/IdxController.php:93
msgid "Wrong login/password"
msgstr "Mauvais nom d'utilisateur ou mot de passe"
-#: application/controllers/IdxController.php:93
+#: application/controllers/IdxController.php:94
msgid "you must enter a password"
msgstr "vous devez entrer un mot de passe"
-#: application/controllers/IdxController.php:95
+#: application/controllers/IdxController.php:96
msgid "You must accept terms of use"
msgstr "Vous devez accepter les conditions d'utilisation"
-#: application/controllers/IdxController.php:96
+#: application/controllers/IdxController.php:97
msgid "you must enter an email"
msgstr "vous devez entrer un email"
-#: application/controllers/IdxController.php:97
+#: application/controllers/IdxController.php:98
msgid "invalid email"
msgstr "email invalide"
-#: application/controllers/IdxController.php:98
+#: application/controllers/IdxController.php:99
msgid "pseudo must only contain letters, digits, dots or underscores"
msgstr "le pseudo ne peut contenir que des lettres, des chiffres, des points ou des soulignés"
-#: application/controllers/IdxController.php:99
+#: application/controllers/IdxController.php:100
msgid "unavailable pseudo"
msgstr "pseudo non disponible"
-#: application/controllers/IdxController.php:101
+#: application/controllers/IdxController.php:102
msgid "Account created"
msgstr "Compte créé"
-#: application/controllers/IdxController.php:103
+#: application/controllers/IdxController.php:104
msgid "Now, you can retry to save"
msgstr "Maintenant, vous pouvez réessayer de sauvegarder"
-#: application/controllers/IdxController.php:104
+#: application/controllers/IdxController.php:105
msgid "route by"
msgstr "tracé par"
-#: application/controllers/IdxController.php:105
+#: application/controllers/IdxController.php:106
msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
msgstr "Carte par <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-#: application/layouts/scripts/footer.phtml:17
-msgid "create a route"
-msgstr "créer un itinéraire"
-
#: application/layouts/scripts/footer.phtml:28
msgid "contact"
msgstr "contact"
msgid "Send a message"
msgstr "Envoyer un message"
-#: application/forms/Geom.php:19
+#: application/forms/Geom.php:18
msgid "optional title for this journey"
msgstr "titre facultatif pour ce trajet"
-#: application/forms/Geom.php:26
+#: application/forms/Geom.php:25
#: application/forms/User.php:42
#, php-format
msgid "I've read and accepted %s"
msgstr "J'ai lu et accepté les %s"
-#: application/forms/Geom.php:34
+#: application/forms/Geom.php:33
#: application/forms/Pending/ValidateCreation.php:17
msgid "save"
msgstr "enregistrer"
msgid "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button."
msgstr "Quelqu'un, probablement vous, a enregistré un compte %s avec l'adresse email %s sur syj. Pour confirmer la création du compte, validez avec le bouton suivant."
-#: application/forms/Pending/ValidateCreation.php:23
-msgid "delete"
-msgstr "supprimer"
-
#: 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."
#~ msgstr "Vous devez vous connecter avant de réesayer de sauvegarder"
#~ msgid "You need to have cookies enabled to login to SYJ"
#~ msgstr "Vous devez activer les cookies pour pouvoir vous connecter à SYJ"
-#~ msgid "main page"
-#~ msgstr "page d'accueil"
#, fuzzy
#~ msgid "reset password"
<div id="data_controls">
<input id="edit-btn" name="edit-btn" type="button" value="<?php
- echo isset($this->path) ? $this->translate('edit'): $this->translate('start');
+ echo isset($this->path) ? $this->translate('edit'): $this->translate('start a route');
?>">
<?php
width: 100px;
height: 100px;
margin: 0 10px 6px 0;
+ position: relative;
}
.map {
- width: 100%;
- height: 100%;
+ position: absolute;
+ top: 0; bottom: 0; right: 0; left: 0;
}
.title {
var WGS84 = new OpenLayers.Projection("EPSG:4326");
var Mercator = new OpenLayers.Projection("EPSG:900913");
-function deletePath(evt) {
- evt.stop();
- if (!confirm(SyjStrings.confirmDelete)) {
- return;
- }
- var link = evt.target,
- item = $(link).up('.item'),
- id = item.getAttribute('data-id');
-
- $("message").hide();
- new Ajax.Request('path/' + id.toString() + '/delete', {
- method: 'post',
- onSuccess: function(transport) {
- item.down('.title').update();
- item.down('.geom').update().setStyle({backgroundColor: 'gray'});
- $("message").setMessage(SyjStrings.deleteSuccess, "success");
- },
- onFailure: function(transport) {
- var httpCode = 0, message = "";
- if (transport) {
- httpCode = transport.getStatus();
- }
- switch (httpCode) {
- case 0:
- message = SyjStrings.notReachedError;
- break;
- case 400:
- case 403:
- location = loginlink();
- return;
- break;
- case 404:
- message = SyjStrings.requestError;
- break;
- case 410:
- message = SyjStrings.gonePathError;
- break;
- case 500:
- message = SyjStrings.serverError;
- break;
- default:
- message = SyjStrings.unknownError;
- break;
- }
- $("message").setMessage(message, "error");
- }
- });
-}
document.observe("dom:loaded", function() {
$("message").hide();
viewLayer.addFeatures([wkt.read(geom)]);
map.zoomToExtent(viewLayer.getDataExtent());
});
- $$(".delete-link").invoke('observe', 'click', deletePath);
+
+ $$(".item").each(function(elt) {
+ new item(elt);
+ });
});
+function item(elt) {
+ this.deleteHandler = elt.on('click', '.delete-link', this.remove.bindAsEventListener(this));
+ this.elt = elt;
+}
+item.prototype = {
+ deleteSuccess: function() {
+ this.elt.down('.title').update();
+ this.elt.down('.geom').update().setStyle({backgroundColor: 'gray'});
+ this.deleteHandler.stop();
+ this.elt.on('click', 'a', function(evt) { evt.stop(); });
+ this.elt.select('a').invoke('setStyle', {textDecoration: 'line-through'});
+ $("message").setMessage(SyjStrings.deleteSuccess, "success");
+ },
+
+ deleteFailure: function(transport) {
+ var httpCode = 0, message = "";
+ if (transport) {
+ httpCode = transport.getStatus();
+ }
+ switch (httpCode) {
+ case 0:
+ message = SyjStrings.notReachedError;
+ break;
+ case 400:
+ case 403:
+ location = loginlink();
+ return;
+ break;
+ case 404:
+ message = SyjStrings.requestError;
+ break;
+ case 410:
+ message = SyjStrings.gonePathError;
+ break;
+ case 500:
+ message = SyjStrings.serverError;
+ break;
+ default:
+ message = SyjStrings.unknownError;
+ break;
+ }
+ $("message").setMessage(message, "error");
+ },
+
+ remove: function(evt) {
+ evt.stop();
+ if (!confirm(SyjStrings.confirmDelete)) {
+ return;
+ }
+ var id = this.elt.getAttribute('data-id');
+
+ $("message").hide();
+ new Ajax.Request('path/' + id.toString() + '/delete', {
+ method: 'post',
+ onSuccess: this.deleteSuccess.bind(this),
+ onFailure: this.deleteFailure.bind(this)
+ });
+ }
+};
+
function loginlink() {
var lang;
if (location.search && location.search.length && location.search[0] === '?') {