a few animations and french translations

merge-requests/1/head
Julien Veyssier 2017-03-10 15:24:58 -03:00
parent f05d86a7ee
commit 92a1edeb6b
3 changed files with 21 additions and 8 deletions

View File

@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- show animation during exporting and saving - show animation during exporting and saving
- show saving/loading ajax percentage - show saving/loading ajax percentage
- save/restore tilelayer - save/restore tilelayer
- animations when add/remove tile servers
- few french translations
### Changed ### Changed

View File

@ -932,7 +932,7 @@ function loadFile(file){
clear(); clear();
} }
if (response.gpx === ''){ 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{ else{
parseGpx(response.gpx); parseGpx(response.gpx);
@ -959,7 +959,7 @@ function deleteTileServer(li){
}).done(function (response) { }).done(function (response) {
//alert(response.done); //alert(response.done);
if (response.done){ if (response.done){
li.remove(); li.fadeOut('slow', function() { li.remove(); });
var activeLayerName = gpxedit.activeLayers.getActiveBaseLayer().name; var activeLayerName = gpxedit.activeLayers.getActiveBaseLayer().name;
// if we delete the active layer, first select another // if we delete the active layer, first select another
if (activeLayerName === sname){ if (activeLayerName === sname){
@ -976,7 +976,11 @@ function addTileServer(){
var sname = $('#tileservername').val(); var sname = $('#tileservername').val();
var surl = $('#tileserverurl').val(); var surl = $('#tileserverurl').val();
if (sname === '' || surl === ''){ 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; return;
} }
$('#tileservername').val(''); $('#tileservername').val('');
@ -996,10 +1000,12 @@ function addTileServer(){
//alert(response.done); //alert(response.done);
if (response.done){ if (response.done){
$('#tileserverlist ul').prepend( $('#tileserverlist ul').prepend(
'<li name="'+sname+'" title="'+surl+'">'+sname+' <button>'+ '<li style="display:none;" name="'+sname+'" title="'+surl+'">'+sname+' <button>'+
'<i class="fa fa-trash" aria-hidden="true" style="color:red;"></i> '+ '<i class="fa fa-trash" aria-hidden="true" style="color:red;"></i> '+
t('gpxedit','Delete')+'</button></li>' t('gpxedit','Delete')+'</button></li>'
); );
$('#tileserverlist ul li[name="'+sname+'"]').fadeIn('slow');
// add tile server in leaflet control // add tile server in leaflet control
var newlayer = new L.TileLayer(surl, var newlayer = new L.TileLayer(surl,
{maxZoom: 18, attribution: 'custom tile server'}); {maxZoom: 18, attribution: 'custom tile server'});
@ -1075,7 +1081,7 @@ function restoreOptions(){
optionsValues = response.values; optionsValues = response.values;
//alert('option values : '+optionsValues); //alert('option values : '+optionsValues);
}).fail(function(){ }).fail(function(){
alert('failed to restore options values'); OC.dialogs.alert(t('gpxedit','failed to restore options values'), t('gpxedit','Error'));
}); });
optionsValues = $.parseJSON(optionsValues); optionsValues = $.parseJSON(optionsValues);
if (optionsValues.markerstyle !== undefined && if (optionsValues.markerstyle !== undefined &&
@ -1117,7 +1123,7 @@ function saveOptions(){
}).done(function (response) { }).done(function (response) {
//alert(response); //alert(response);
}).fail(function(){ }).fail(function(){
alert('failed to save options values'); OC.dialogs.alert(t('gpxedit','failed to save options values'), t('gpxedit','Error'));
}); });
} }

View File

@ -40,8 +40,13 @@ OC.L10N.register(
"Finish" : "Terminer", "Finish" : "Terminer",
"Finish drawing" : "Terminer le dessin", "Finish drawing" : "Terminer le dessin",
"Delete last point" : "Supprimer le dernier point", "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);"); "nplurals=2; plural=(n > 1);");