From 92a1edeb6ba9951045a15a48103646e7574bcbee Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 10 Mar 2017 15:24:58 -0300 Subject: [PATCH] a few animations and french translations --- CHANGELOG.md | 2 ++ js/gpxedit.js | 18 ++++++++++++------ l10n/fr.js | 9 +++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9c5b15..61ccd6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - show animation during exporting and saving - show saving/loading ajax percentage - save/restore tilelayer +- animations when add/remove tile servers +- few french translations ### Changed diff --git a/js/gpxedit.js b/js/gpxedit.js index b0c817e..bdbd690 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -932,7 +932,7 @@ function loadFile(file){ clear(); } if (response.gpx === ''){ - alert('The file does not exist or it is not a gpx'); + OC.dialogs.alert('The file does not exist or it is not supported', 'Load error'); } else{ parseGpx(response.gpx); @@ -959,7 +959,7 @@ function deleteTileServer(li){ }).done(function (response) { //alert(response.done); if (response.done){ - li.remove(); + li.fadeOut('slow', function() { li.remove(); }); var activeLayerName = gpxedit.activeLayers.getActiveBaseLayer().name; // if we delete the active layer, first select another if (activeLayerName === sname){ @@ -976,7 +976,11 @@ function addTileServer(){ var sname = $('#tileservername').val(); var surl = $('#tileserverurl').val(); if (sname === '' || surl === ''){ - alert('Server name or server url should not be empty'); + OC.dialogs.alert(t('gpxedit','Server name or server url should not be empty'), t('gpxedit','Impossible to add tile server')); + return; + } + if ($('#tileserverlist ul li[name="'+sname+'"]').length > 0){ + OC.dialogs.alert(t('gpxedit','A server with this name already exists'), t('gpxedit','Impossible to add tile server')); return; } $('#tileservername').val(''); @@ -996,10 +1000,12 @@ function addTileServer(){ //alert(response.done); if (response.done){ $('#tileserverlist ul').prepend( - '
  • '+sname+'
  • ' ); + $('#tileserverlist ul li[name="'+sname+'"]').fadeIn('slow'); + // add tile server in leaflet control var newlayer = new L.TileLayer(surl, {maxZoom: 18, attribution: 'custom tile server'}); @@ -1075,7 +1081,7 @@ function restoreOptions(){ optionsValues = response.values; //alert('option values : '+optionsValues); }).fail(function(){ - alert('failed to restore options values'); + OC.dialogs.alert(t('gpxedit','failed to restore options values'), t('gpxedit','Error')); }); optionsValues = $.parseJSON(optionsValues); if (optionsValues.markerstyle !== undefined && @@ -1117,7 +1123,7 @@ function saveOptions(){ }).done(function (response) { //alert(response); }).fail(function(){ - alert('failed to save options values'); + OC.dialogs.alert(t('gpxedit','failed to save options values'), t('gpxedit','Error')); }); } diff --git a/l10n/fr.js b/l10n/fr.js index 17d2f7d..f4d105b 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -40,8 +40,13 @@ OC.L10N.register( "Finish" : "Terminer", "Finish drawing" : "Terminer le dessin", "Delete last point" : "Supprimer le dernier point", - "Delete last point drawn" : "Supprimer le dernier point dessiné" - + "Delete last point drawn" : "Supprimer le dernier point dessiné", + "Server name or server url should not be empty" : "L'URL ou le nom du serveur doivent être non vides", + "A server with this name already exists" : "Un serveur avec ce nom existe déjà", + "Impossible to add tile server" : "Impossible d'ajouter le serveur de tuiles", + "Failed to restore options values" : "Echec du chargement des valeurs des options", + "Failed to save options values" : "Echec à la sauvegarde des valeurs des options", + "Error" : "Erreur" }, "nplurals=2; plural=(n > 1);");