diff --git a/CHANGELOG.md b/CHANGELOG.md index d362217..76bc566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -### +### Added - file description field +- 'destination' readonly field indicating full save path ### Changed - keep time information in loaded tracks/routes/waypoints, written in saved files +- design : borders around file trees, button icons ## 0.0.2 – 2016-12-08 ### Added diff --git a/css/gpxedit.css b/css/gpxedit.css index 815b271..8617ab7 100644 --- a/css/gpxedit.css +++ b/css/gpxedit.css @@ -782,11 +782,27 @@ h2.popupTitle{ margin-right: auto; display:block; } +#saveButton i{ + color: blue; +} +#clearButton i{ + color: red; +} #saveButton{ width:18%; + display:block; + margin-left: auto; + margin-right: auto; } -#saveName{ - width:78%; +#saveNameLabel, #savePathLabel{ + float:left; +} +#saveName, #savePath{ + width: 78%; + float: right; +} +#savePath{ + background-color: #C9C9C9; } .selectimg{ background: url('images/symbols/geocache-open.png') no-repeat right 8px center rgba(240, 240, 240, 0.90); @@ -796,3 +812,8 @@ h2.popupTitle{ width: 100%; height: 70px; } +#loadtree, #savetree{ + padding: 7px; + border: 1px solid black; + border-radius: 6px; +} diff --git a/js/gpxedit.js b/js/gpxedit.js index 3fd91b1..e33f9e2 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -6,6 +6,7 @@ var gpxedit = { baseLayers: null, drawControl: null, id: 0, + saveDirPath: '/', // indexed by gpxedit_id layersData: {} }; @@ -806,8 +807,9 @@ function loadAction(file){ var spl = file.split('/'); var basename = spl[spl.length-1]; $('input#saveName').val( - basename.replace(/\.jpg$/, '.gpx').replace(/\.kml$/, '.gpx').replace(/\.csv$/, '.gpx') - ); + basename.replace(/\.jpg$/, '.gpx').replace(/\.kml$/, '.gpx').replace(/\.csv$/, '.gpx') + ); + updateSavePath(); } function loadFile(file){ @@ -999,6 +1001,15 @@ function fillWaypointStyles(){ $('select#markerstyleselect').val('marker'); } +function updateSavePath(){ + var dir = gpxedit.saveDirPath; + if (dir === '/'){ + dir = ''; + } + var filename = $('#saveName').val(); + $('#savePath').val(dir+'/'+filename); +} + $(document).ready(function(){ gpxedit.username = $('p#username').html(); load_map(); @@ -1071,7 +1082,7 @@ $(document).ready(function(){ var saveFilePath = '/'+$('input#saveName').val(); } else{ - var saveFilePath = gpxedit.savePath+'/'+$('input#saveName').val(); + var saveFilePath = gpxedit.saveDirPath+'/'+$('input#saveName').val(); } var req = { path: saveFilePath, @@ -1114,15 +1125,20 @@ $(document).ready(function(){ }); $('#savetree').on('filetreeexpand', function(e, data){ - gpxedit.savePath = data.rel; + gpxedit.saveDirPath = data.rel; $('#savetree a').removeClass('selectedFolder'); data.li.find('>a').addClass('selectedFolder'); + updateSavePath(); }); $('#savetree').on('filetreecollapse', function(e, data){ - gpxedit.savePath = data.li.parent().parent().find('>a').attr('rel'); + gpxedit.saveDirPath = data.li.parent().parent().find('>a').attr('rel') || '/'; data.li.find('li.expanded').removeClass('expanded'); data.li.find('>a').removeClass('selectedFolder'); data.li.parent().parent().find('>a').addClass('selectedFolder'); + updateSavePath(); + }); + $('#saveName').on('input',function(e){ + updateSavePath(); }); $('body').on('click','h2#loadtitle', function(e) { @@ -1166,6 +1182,7 @@ $(document).ready(function(){ if (urlfileparam && urlfileparam !== undefined){ loadAction(fileparam); } + updateSavePath(); }); diff --git a/templates/gpxcontent.php b/templates/gpxcontent.php index 41bb8b1..92fc656 100644 --- a/templates/gpxcontent.php +++ b/templates/gpxcontent.php @@ -40,15 +40,25 @@ p($_['gpxedit_version']);

Select a folder, set a name and click "Save" button



- - -
+
+ + +
+
+
+ + +
+


+ +

- +
+