From 0700102c574016924aa8796dfd54f419a11fd80c Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Sat, 18 Mar 2017 01:04:19 -0300 Subject: [PATCH] notifications on tile layer add/remove --- CHANGELOG.md | 1 + js/gpxedit.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6bb94e..be317e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - save/restore current tile layer - integration in "Files" and "File sharing" context menu for .gpx files [#11](https://gitlab.com/eneiluj/gpxedit-oc/issues/11) @rugk +- notifications on tile layer add/remove ### Changed diff --git a/js/gpxedit.js b/js/gpxedit.js index cc3745b..a49b2c1 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -967,8 +967,14 @@ function deleteTileServer(li){ } gpxedit.activeLayers.removeLayer(gpxedit.baseLayers[sname]); delete gpxedit.baseLayers[sname]; + OC.Notification.showTemporary(t('gpxedit', 'Tile server "{ts}" has been deleted', {ts: sname})); + } + else{ + OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" deletion', {ts: sname})); } }).always(function(){ + }).fail(function(){ + OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" deletion', {ts: sname})); }); } @@ -1011,8 +1017,14 @@ function addTileServer(){ {maxZoom: 18, attribution: 'custom tile server'}); gpxedit.activeLayers.addBaseLayer(newlayer, sname); gpxedit.baseLayers[sname] = newlayer; + OC.Notification.showTemporary(t('gpxedit', 'Tile server "{ts}" has been added', {ts: sname})); + } + else{ + OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" addition', {ts: sname})); } }).always(function(){ + }).fail(function(){ + OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" addition', {ts: sname})); }); }