diff --git a/application/assets/js/osm.js b/application/assets/js/osm.js index 895f5183..784168cd 100644 --- a/application/assets/js/osm.js +++ b/application/assets/js/osm.js @@ -1,7 +1,11 @@ const osm = (() => { let osm_server_upload_gpx = function (filename, gpx_data, notify = true) { - if (general.osm_token) { - helper.side_toaster("you are connected to openstreetmap", 5000); + if (!general.osm_token) { + helper.side_toaster( + "looks like you are not connected to openstreetmap", + 5000 + ); + return false; } let n = "Bearer " + general.osm_token; @@ -13,7 +17,7 @@ const osm = (() => { type: "application/gpx", }); - if (notify) helper.side_toaster("try uploading file", 2000); + if (notify) helper.side_toaster("try uploading file", 5000); let formData = new FormData(); formData.append("description", "uploaded from o.map"); @@ -28,10 +32,7 @@ const osm = (() => { .then((response) => response.text()) .then((data) => { status.live_track_id.push(data); - setTimeout(() => { - if (notify) - helper.side_toaster("file uploaded" + status.live_track_id, 4000); - }, 2000); + if (notify == true) helper.side_toaster("file uploaded", 4000); }) .catch((error) => { diff --git a/application/index.html b/application/index.html index e4250252..60022da5 100644 --- a/application/index.html +++ b/application/index.html @@ -522,6 +522,10 @@

Export

+
+ Alitude +
+
Duration @@ -533,10 +537,7 @@

Export

-
- Alitude -
-
+ + +
+
+
during tracking,
larger view of the parameters
+
5
+
+
search
diff --git a/application/index.js b/application/index.js index 49c261d8..6dfd6e95 100644 --- a/application/index.js +++ b/application/index.js @@ -365,14 +365,6 @@ document.addEventListener("DOMContentLoaded", function () { }; //build menu let build_menu = function () { - /* - document.querySelector("div#tracksmarkers").innerHTML = ""; - document.querySelector("div#maps").innerHTML = ""; - document.querySelector("div#layers").innerHTML = ""; - document.querySelector("div#overpass").innerHTML = ""; - document.querySelector("div#gpx").innerHTML = ""; - */ - let el = document.querySelector("div#maps"); el.innerHTML = ""; el.insertAdjacentHTML( @@ -743,7 +735,6 @@ document.addEventListener("DOMContentLoaded", function () { files.sort((a, b) => { return b.name.localeCompare(a.name); }); - console.log(files); } else { for (let n = 0; n < s[i].childNodes.length; n++) { if (s[i].childNodes[n].tagName == "tag") { @@ -1549,9 +1540,12 @@ document.addEventListener("DOMContentLoaded", function () { document.querySelector("div#files-option").style.display = "none"; open_finder(); general.active_item.focus(); + let loadGPX_data_callback = (filename, data) => { + osm.osm_server_upload_gpx(filename, data, true); + }; module.loadGPX_data( general.active_item.getAttribute("data-filepath"), - osm.osm_server_upload_gpx + loadGPX_data_callback ); } } @@ -2602,6 +2596,9 @@ document.addEventListener("DOMContentLoaded", function () { case "Enter": if (status.intro) return false; + if (status.windowOpen == "user-input" && save_mode == "routing") + return false; + if ( status.windowOpen == "user-input" && save_mode == "geojson-tracking" @@ -2614,10 +2611,6 @@ document.addEventListener("DOMContentLoaded", function () { break; } - if (status.windowOpen == "user-input" && save_mode == "routing") { - break; - } - if (status.windowOpen == "user-input" && save_mode == "rename-file") { helper.renameFile( general.active_item.getAttribute("data-filepath"), @@ -2630,7 +2623,6 @@ document.addEventListener("DOMContentLoaded", function () { if (status.windowOpen == "map") { open_finder(); - status.windowOpen = "finder"; break; } if ( @@ -2654,10 +2646,7 @@ document.addEventListener("DOMContentLoaded", function () { if (status.windowOpen == "search") { search.search_return_data(); - // map.setView([olc_lat_lng[0], olc_lat_lng[1]]); search.hideSearch(); - //mainmarker.current_lat = Number(olc_lat_lng[0]); - //mainmarker.current_lng = Number(olc_lat_lng[1]); helper.side_toaster("press 5 to save the marker", 2000); break; } @@ -2814,8 +2803,10 @@ document.addEventListener("DOMContentLoaded", function () { // maps.export_db(); //maps.import_db(); if (status.tracking_running) { - document.getElementById("tracking-view").style.display = "flex"; - status.windowOpen = "trackingView"; + document.getElementById("tracking-view").style.display = + status.windowOpen === "trackingView" ? "none" : "flex"; + status.windowOpen = + status.windowOpen === "trackingView" ? "map" : "trackingView"; } break; @@ -2857,7 +2848,11 @@ document.addEventListener("DOMContentLoaded", function () { case "*": if (status.intro) return false; - mainmarker.selected_marker = module.select_marker(); + if (status.keylock) return false; + if (status.windowOpen == "map") { + mainmarker.selected_marker = module.select_marker(); + } + break; case "#": diff --git a/application/manifest.webapp b/application/manifest.webapp index a6cef9e9..186de9a0 100644 --- a/application/manifest.webapp +++ b/application/manifest.webapp @@ -1,5 +1,5 @@ { - "version": "1.9.749", + "version": "1.9.752", "version_name": "hotline", "name": "o.map", "description": "O.map, your ultimate navigation companion for KaiOS-powered devices. O.map is a lightweight and feature-rich map application designed specifically for KaiOS, enabling you to explore and navigate the world with ease. Whether you're a local resident, a tourist, or an adventurer, O.map is here to enhance your journey and keep you on the right track.", @@ -7,7 +7,7 @@ "type": "privileged", "fullscreen": "true", "priority": "high", - "userAgentInfo": "o.map / 1.9.7 written by strukturart@gmail.com", + "userAgentInfo": "o.map / 1.9.751 written by strukturart@gmail.com", "icons": { "56": "/assets/icons/icon-56-56.png", "112": "/assets/icons/icon-112-112.png" diff --git a/docs/assets/js/osm.js b/docs/assets/js/osm.js index 895f5183..784168cd 100644 --- a/docs/assets/js/osm.js +++ b/docs/assets/js/osm.js @@ -1,7 +1,11 @@ const osm = (() => { let osm_server_upload_gpx = function (filename, gpx_data, notify = true) { - if (general.osm_token) { - helper.side_toaster("you are connected to openstreetmap", 5000); + if (!general.osm_token) { + helper.side_toaster( + "looks like you are not connected to openstreetmap", + 5000 + ); + return false; } let n = "Bearer " + general.osm_token; @@ -13,7 +17,7 @@ const osm = (() => { type: "application/gpx", }); - if (notify) helper.side_toaster("try uploading file", 2000); + if (notify) helper.side_toaster("try uploading file", 5000); let formData = new FormData(); formData.append("description", "uploaded from o.map"); @@ -28,10 +32,7 @@ const osm = (() => { .then((response) => response.text()) .then((data) => { status.live_track_id.push(data); - setTimeout(() => { - if (notify) - helper.side_toaster("file uploaded" + status.live_track_id, 4000); - }, 2000); + if (notify == true) helper.side_toaster("file uploaded", 4000); }) .catch((error) => { diff --git a/docs/index.html b/docs/index.html index e4250252..60022da5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -522,6 +522,10 @@

Export

+
+ Alitude +
+
Duration @@ -533,10 +537,7 @@

Export

-
- Alitude -
-
+
+ +
+
+
during tracking,
larger view of the parameters
+
5
+
+
search
diff --git a/docs/index.js b/docs/index.js index 49c261d8..6dfd6e95 100644 --- a/docs/index.js +++ b/docs/index.js @@ -365,14 +365,6 @@ document.addEventListener("DOMContentLoaded", function () { }; //build menu let build_menu = function () { - /* - document.querySelector("div#tracksmarkers").innerHTML = ""; - document.querySelector("div#maps").innerHTML = ""; - document.querySelector("div#layers").innerHTML = ""; - document.querySelector("div#overpass").innerHTML = ""; - document.querySelector("div#gpx").innerHTML = ""; - */ - let el = document.querySelector("div#maps"); el.innerHTML = ""; el.insertAdjacentHTML( @@ -743,7 +735,6 @@ document.addEventListener("DOMContentLoaded", function () { files.sort((a, b) => { return b.name.localeCompare(a.name); }); - console.log(files); } else { for (let n = 0; n < s[i].childNodes.length; n++) { if (s[i].childNodes[n].tagName == "tag") { @@ -1549,9 +1540,12 @@ document.addEventListener("DOMContentLoaded", function () { document.querySelector("div#files-option").style.display = "none"; open_finder(); general.active_item.focus(); + let loadGPX_data_callback = (filename, data) => { + osm.osm_server_upload_gpx(filename, data, true); + }; module.loadGPX_data( general.active_item.getAttribute("data-filepath"), - osm.osm_server_upload_gpx + loadGPX_data_callback ); } } @@ -2602,6 +2596,9 @@ document.addEventListener("DOMContentLoaded", function () { case "Enter": if (status.intro) return false; + if (status.windowOpen == "user-input" && save_mode == "routing") + return false; + if ( status.windowOpen == "user-input" && save_mode == "geojson-tracking" @@ -2614,10 +2611,6 @@ document.addEventListener("DOMContentLoaded", function () { break; } - if (status.windowOpen == "user-input" && save_mode == "routing") { - break; - } - if (status.windowOpen == "user-input" && save_mode == "rename-file") { helper.renameFile( general.active_item.getAttribute("data-filepath"), @@ -2630,7 +2623,6 @@ document.addEventListener("DOMContentLoaded", function () { if (status.windowOpen == "map") { open_finder(); - status.windowOpen = "finder"; break; } if ( @@ -2654,10 +2646,7 @@ document.addEventListener("DOMContentLoaded", function () { if (status.windowOpen == "search") { search.search_return_data(); - // map.setView([olc_lat_lng[0], olc_lat_lng[1]]); search.hideSearch(); - //mainmarker.current_lat = Number(olc_lat_lng[0]); - //mainmarker.current_lng = Number(olc_lat_lng[1]); helper.side_toaster("press 5 to save the marker", 2000); break; } @@ -2814,8 +2803,10 @@ document.addEventListener("DOMContentLoaded", function () { // maps.export_db(); //maps.import_db(); if (status.tracking_running) { - document.getElementById("tracking-view").style.display = "flex"; - status.windowOpen = "trackingView"; + document.getElementById("tracking-view").style.display = + status.windowOpen === "trackingView" ? "none" : "flex"; + status.windowOpen = + status.windowOpen === "trackingView" ? "map" : "trackingView"; } break; @@ -2857,7 +2848,11 @@ document.addEventListener("DOMContentLoaded", function () { case "*": if (status.intro) return false; - mainmarker.selected_marker = module.select_marker(); + if (status.keylock) return false; + if (status.windowOpen == "map") { + mainmarker.selected_marker = module.select_marker(); + } + break; case "#": diff --git a/docs/manifest.webapp b/docs/manifest.webapp index a6cef9e9..186de9a0 100644 --- a/docs/manifest.webapp +++ b/docs/manifest.webapp @@ -1,5 +1,5 @@ { - "version": "1.9.749", + "version": "1.9.752", "version_name": "hotline", "name": "o.map", "description": "O.map, your ultimate navigation companion for KaiOS-powered devices. O.map is a lightweight and feature-rich map application designed specifically for KaiOS, enabling you to explore and navigate the world with ease. Whether you're a local resident, a tourist, or an adventurer, O.map is here to enhance your journey and keep you on the right track.", @@ -7,7 +7,7 @@ "type": "privileged", "fullscreen": "true", "priority": "high", - "userAgentInfo": "o.map / 1.9.7 written by strukturart@gmail.com", + "userAgentInfo": "o.map / 1.9.751 written by strukturart@gmail.com", "icons": { "56": "/assets/icons/icon-56-56.png", "112": "/assets/icons/icon-112-112.png"