From df81068a623617335f324f8db12808f0c065e35e Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 7 Jul 2013 23:52:10 +0200 Subject: [PATCH 01/16] we need to return even if position isn't set --- js/map.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/map.js b/js/map.js index 62a14d4..41a413d 100644 --- a/js/map.js +++ b/js/map.js @@ -135,10 +135,10 @@ function loadPrefs(aEvent) { gPrefs.get("position", function(aValue) { if (aValue) { gPos = aValue; - gWaitCounter--; - var throwEv = new CustomEvent("prefs-step"); - gAction.dispatchEvent(throwEv); } + gWaitCounter--; + var throwEv = new CustomEvent("prefs-step"); + gAction.dispatchEvent(throwEv); }); gWaitCounter++; gPrefs.get("center_map", function(aValue) { -- 2.35.3 From 6ddefbf98ebff13592de1d87a3bfc2796ac06d84 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Thu, 25 Jul 2013 02:51:54 +0200 Subject: [PATCH 02/16] reset upload status when starting upload; load track in reverse order and once we have the most recent point in async mode so that loading app with long track is sped up --- js/map.js | 33 ++++++++++++++++++++++++--------- js/ui.js | 26 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/js/map.js b/js/map.js index 41a413d..3cc00c5 100644 --- a/js/map.js +++ b/js/map.js @@ -162,15 +162,26 @@ function loadPrefs(aEvent) { gAction.dispatchEvent(throwEv); }); gWaitCounter++; - gTrackStore.getList(function(aTPoints) { - if (gDebug) - console.log(aTPoints.length + " points loaded."); - if (aTPoints.length) { - gTrack = aTPoints; + var trackLoadStarted = false; + gTrackStore.getListStepped(function(aTPoint) { + if (aTPoint) { + // Add in front and return new length. + var tracklen = gTrack.unshift(aTPoint); + // Redraw track every 100 values (initial paint will do first anyhow). + if (tracklen % 100 == 0) + drawTrack(); + } + else { + // Last point received. + drawTrack(); + } + if (!trackLoadStarted) { + // We have the most recent point, if present, rest will load async. + trackLoadStarted = true; + gWaitCounter--; + var throwEv = new CustomEvent("prefs-step"); + gAction.dispatchEvent(throwEv); } - gWaitCounter--; - var throwEv = new CustomEvent("prefs-step"); - gAction.dispatchEvent(throwEv); }); } } @@ -355,6 +366,10 @@ function drawMap(aPixels, aOverdraw) { } } } + drawTrack(); +} + +function drawTrack() { gLastDrawnPoint = null; gCurPosMapCache = undefined; gTrackContext.clearRect(0, 0, gTrackCanvas.width, gTrackCanvas.height); @@ -756,7 +771,7 @@ function endTracking() { function clearTrack() { gTrack = []; gTrackStore.clear(); - drawMap({left: 0, right: 0, top: 0, bottom: 0}); + drawTrack(); } var gTileService = { diff --git a/js/ui.js b/js/ui.js index 560f48c..f0d2b18 100644 --- a/js/ui.js +++ b/js/ui.js @@ -307,11 +307,19 @@ function saveTrackDump() { } function uploadTrack() { + // Hide all areas in the dialog. var dia = document.getElementById("dialogArea"); var areas = dia.children; for (var i = 0; i <= areas.length - 1; i++) { areas[i].style.display = "none"; } + // Reset all the fields in the status area. + document.getElementById("uploadStatusCloseButton").disabled = true; + document.getElementById("uploadInProgress").style.display = "block"; + document.getElementById("uploadSuccess").style.display = "none"; + document.getElementById("uploadErrorMsg").textContent = ""; + document.getElementById("uploadError").style.display = "none"; + // Now show the status area. document.getElementById("uploadStatus").style.display = "block"; // See http://wiki.openstreetmap.org/wiki/Api06#Uploading_traces @@ -445,6 +453,24 @@ var gTrackStore = { } }, + getListStepped: function(aCallback) { + if (!mainDB) + return; + var transaction = mainDB.transaction([this.objStore]); + var objStore = transaction.objectStore(this.objStore); + // Use cursor in reverse direction (so we get the most recent position first) + objStore.openCursor(null, "prev").onsuccess = function(event) { + var cursor = event.target.result; + if (cursor) { + aCallback(cursor.value); + cursor.continue(); + } + else { + aCallback(null); + } + }; + }, + push: function(aValue, aCallback) { if (!mainDB) return; -- 2.35.3 From fb6aea4138461023849a385cf1ca83e5ede35ce9 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Thu, 25 Jul 2013 02:55:44 +0200 Subject: [PATCH 03/16] update TODO list --- README | 2 +- TODO | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README b/README index cc31284..73bc06b 100644 --- a/README +++ b/README @@ -15,7 +15,7 @@ Note that Lantea Maps does not send any location data to anyone else, it's recorded locally on your device only. The app name "Lantea" is based on a fictional mostly-ocean planet in the -"Stargate: Atlantis" TV series, on which the Ancients erected the artificial +"Stargate: Atlantis" TV series, on which the Ancients placed the artificial "island" city of Atlantis. diff --git a/TODO b/TODO index e6ed5e7..cc252cb 100644 --- a/TODO +++ b/TODO @@ -2,6 +2,7 @@ Tasks to complete for Lantea Maps: Required: +* Switch map to (2D) WebGL to improve panning performance * Improve tile cache: ** If cached tiles have changed, possibly also try (async) updates of other cached zoom levels covering this area ** Pre-cache tiles in adjacent areas and possibly zoom levels @@ -13,7 +14,6 @@ Required: * Support pinch zoom gestures * Smooth animations for zooming, probably using some canvas magic * Use available larger/smaller tiles with resizing as loading placeholders while zooming in/out -* Save GPX tiles to the web (OSM? Public cloud service? Private service?) * Better GPX saving implementation [blocked by missing web APIs] ** Set file name to save into to a good default (date + maybe some location name) @@ -21,11 +21,11 @@ Nice To Have: * Possibility to auto-rotate map to match movement direction * GPS details display (satellite visibility/strength) [blocked by missing web APIs] -* Magnetic compass display [blocked by missing web APIs] +* Magnetic compass display (using orientiation API) Future Possibilities: * Routing / Turn-by-turn navigation * POI display * Search address -* Mark a target location and show distance to it \ No newline at end of file +* Mark a target location and show distance to it -- 2.35.3 From 0494a6db5d31a23189214f7e8ab10cb4ee220b24 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 26 Jul 2013 00:22:54 +0200 Subject: [PATCH 04/16] for upload, issue an empty POST (Bad Request) first to get the credentials and not send the actual data twice when not signed into OSM yet --- js/ui.js | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/js/ui.js b/js/ui.js index f0d2b18..352f7e7 100644 --- a/js/ui.js +++ b/js/ui.js @@ -333,22 +333,44 @@ function uploadTrack() { //formData.append("tags", ""); formData.append("visibility", document.getElementById("uploadVisibility").value); - var XHR = new XMLHttpRequest(); - XHR.onreadystatechange = function() { - if (XHR.readyState == 4 && XHR.status == 200) { - // so far so good - reportUploadStatus(true); - } else if (XHR.readyState == 4 && XHR.status != 200) { - // fetched the wrong page or network error... + // Do an empty POST request first, so that we don't send everything, + // then ask for credentials, and then send again. + var hXHR = new XMLHttpRequest(); + hXHR.onreadystatechange = function() { + if (hXHR.readyState == 4 && (XHR.status == 200 || hXHR.status == 400)) { + // 400 is Bad Request, but that's expected as this was empty. + // So far so good, init actual upload. + var XHR = new XMLHttpRequest(); + XHR.onreadystatechange = function() { + if (XHR.readyState == 4 && XHR.status == 200) { + // Everthing looks fine. + reportUploadStatus(true); + } else if (XHR.readyState == 4 && XHR.status != 200) { + // Fetched the wrong page or network error... + reportUploadStatus(false); + } + }; + XHR.open("POST", gOSMAPIURL + "api/0.6/gpx/create", true); + // Cross-Origin XHR doesn't allow username/password (HTTP Auth). + // So, we'll ask the user for entering credentials with rather ugly UI. + XHR.withCredentials = true; + try { + XHR.send(formData); // Send actual form data. + } + catch (e) { + reportUploadStatus(false, e); + } + } else if (hXHR.readyState == 4 && hXHR.status != 200) { + // Fetched the wrong page or network error... reportUploadStatus(false); } }; - XHR.open("POST", gOSMAPIURL + "api/0.6/gpx/create", true); + hXHR.open("POST", gOSMAPIURL + "api/0.6/gpx/create", true); // Cross-Origin XHR doesn't allow username/password (HTTP Auth). // So, we'll ask the user for entering credentials with rather ugly UI. - XHR.withCredentials = true; + hXHR.withCredentials = true; try { - XHR.send(formData); + hXHR.send(); // Empty request, see above. } catch (e) { reportUploadStatus(false, e); -- 2.35.3 From 517c0099ce72299ffb350423332a9fccf60a8ab3 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:38:30 +0200 Subject: [PATCH 05/16] try supporting pinch zoom in a simple way --- js/map.js | 44 +++++++++++++++++++++++++++++++++++++++++++- manifest.appcache | 2 +- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/js/map.js b/js/map.js index 3cc00c5..2ecd3a4 100644 --- a/js/map.js +++ b/js/map.js @@ -61,7 +61,7 @@ var gLoadingTile; var gMapPrefsLoaded = false; var gDragging = false; -var gDragTouchID; +var gDragTouchID, gPinchStartWidth; var gGeoWatchID; var gTrack = []; @@ -482,6 +482,14 @@ var mapEvHandler = { case "mousedown": case "touchstart": if (touchEvent) { + if (aEvent.targetTouches.length == 2) { + gPinchStartWidth = Math.sqrt( + Math.pow(aEvent.targetTouches.item(1).clientX - + aEvent.targetTouches.item(0).clientX, 2) + + Math.pow(aEvent.targetTouches.item(1).clientY - + aEvent.targetTouches.item(0).clientY, 2) + ); + } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); } @@ -497,6 +505,40 @@ var mapEvHandler = { break; case "mousemove": case "touchmove": + if (touchEvent && aEvent.targetTouches.length == 2) { + curPinchStartWidth = Math.sqrt( + Math.pow(aEvent.targetTouches.item(1).clientX - + aEvent.targetTouches.item(0).clientX, 2) + + Math.pow(aEvent.targetTouches.item(1).clientY - + aEvent.targetTouches.item(0).clientY, 2) + ); + if (gPinchStartWidth / curPinchStartWidth > 1.7 || + gPinchStartWidth / curPinchStartWidth < 0.6) { + var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1); + if ((newZoomLevel >= 0) && (newZoomLevel <= gMaxZoom)) { + // Calculate new center of the map - preserve middle of pinch. + // This means that pixel distance between old center and middle + // must equal pixel distance of new center and middle. + var x = (aEvent.targetTouches.item(1).clientX + + aEvent.targetTouches.item(0).clientX) / 2 - + gMapCanvas.offsetLeft; + var y = (aEvent.targetTouches.item(1).clientY + + aEvent.targetTouches.item(0).clientY) / 2 - + gMapCanvas.offsetTop; + + // Zoom factor after this action. + var newZoomFactor = Math.pow(2, gMaxZoom - newZoomLevel); + gPos.x -= (x - gMapCanvas.width / 2) * (newZoomFactor - gZoomFactor); + gPos.y -= (y - gMapCanvas.height / 2) * (newZoomFactor - gZoomFactor); + + if (gPinchStartWidth < curPinchStartWidth) + zoomIn(); + else + zoomOut(); + } + } + break; + } var x = coordObj.clientX - gMapCanvas.offsetLeft; var y = coordObj.clientY - gMapCanvas.offsetTop; if (gDragging === true) { diff --git a/manifest.appcache b/manifest.appcache index cdbbc5a..ef33d92 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2013-07-07 +# 2013-08-15 manifest.webapp js/map.js js/ui.js -- 2.35.3 From 7710f0a3d22b1856b08f57b90101c09876f1c89c Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:42:18 +0200 Subject: [PATCH 06/16] log pinch widths --- js/map.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/map.js b/js/map.js index 2ecd3a4..ce66429 100644 --- a/js/map.js +++ b/js/map.js @@ -512,6 +512,7 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); + console.log(gPinchStartWidth + ' ' + curPinchStartWidth); if (gPinchStartWidth / curPinchStartWidth > 1.7 || gPinchStartWidth / curPinchStartWidth < 0.6) { var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1); -- 2.35.3 From 6a42dec82d1f84a676585379401cdad4e44b7b56 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:45:51 +0200 Subject: [PATCH 07/16] log pinch widths --- js/map.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/map.js b/js/map.js index ce66429..77585e2 100644 --- a/js/map.js +++ b/js/map.js @@ -489,6 +489,7 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); + console.log('!!!' + gPinchStartWidth); } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); -- 2.35.3 From 003d56f8a1eee6825cc6c800f135e13df753770d Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:50:35 +0200 Subject: [PATCH 08/16] care that starting pinch width is set as it should be --- js/map.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/map.js b/js/map.js index 77585e2..6aeacf6 100644 --- a/js/map.js +++ b/js/map.js @@ -489,7 +489,7 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); - console.log('!!!' + gPinchStartWidth); + console.log('!!! ' + gPinchStartWidth); } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); @@ -513,6 +513,8 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); + if (!gPinchStartWidth) + gPinchStartWidth = curPinchStartWidth; console.log(gPinchStartWidth + ' ' + curPinchStartWidth); if (gPinchStartWidth / curPinchStartWidth > 1.7 || gPinchStartWidth / curPinchStartWidth < 0.6) { @@ -537,6 +539,9 @@ var mapEvHandler = { zoomIn(); else zoomOut(); + + // Reset pinch start width and start another pinch gesture. + gPinchStartWidth = null; } } break; -- 2.35.3 From d07d7abcbf226716c7f1d6cb70942252d5af27ad Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:54:49 +0200 Subject: [PATCH 09/16] remove debugging, reset pinch when ending touch --- js/map.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/map.js b/js/map.js index 6aeacf6..dc3ad9c 100644 --- a/js/map.js +++ b/js/map.js @@ -489,7 +489,6 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); - console.log('!!! ' + gPinchStartWidth); } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); @@ -515,7 +514,7 @@ var mapEvHandler = { ); if (!gPinchStartWidth) gPinchStartWidth = curPinchStartWidth; - console.log(gPinchStartWidth + ' ' + curPinchStartWidth); + if (gPinchStartWidth / curPinchStartWidth > 1.7 || gPinchStartWidth / curPinchStartWidth < 0.6) { var newZoomLevel = gPos.z + (gPinchStartWidth < curPinchStartWidth ? 1 : -1); @@ -544,6 +543,7 @@ var mapEvHandler = { gPinchStartWidth = null; } } + // If we are in a pinch, do not drag. break; } var x = coordObj.clientX - gMapCanvas.offsetLeft; @@ -574,6 +574,7 @@ var mapEvHandler = { break; case "mouseup": case "touchend": + gPinchStartWidth = null; gDragging = false; showUI(); break; -- 2.35.3 From fcdc81dd4c0947c8bcc8721bc201718cb6ca778f Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 19:09:45 +0200 Subject: [PATCH 10/16] acknowledge that we now do pinch zoom --- TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO b/TODO index cc252cb..26828fa 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,6 @@ Required: * Display movement speed * Display location accuracy * Show a better visible marker for the current location, possibly also indicating movement direction/speed -* Support pinch zoom gestures * Smooth animations for zooming, probably using some canvas magic * Use available larger/smaller tiles with resizing as loading placeholders while zooming in/out * Better GPX saving implementation [blocked by missing web APIs] -- 2.35.3 From fdaf08dbc34cd93d2800100959ca1f2b0d75ea5d Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 18 Aug 2013 19:17:41 +0200 Subject: [PATCH 11/16] try to fix upload error, make initial draw faster --- js/map.js | 9 ++++++--- js/ui.js | 2 +- manifest.appcache | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/map.js b/js/map.js index dc3ad9c..5e65ed6 100644 --- a/js/map.js +++ b/js/map.js @@ -162,14 +162,17 @@ function loadPrefs(aEvent) { gAction.dispatchEvent(throwEv); }); gWaitCounter++; - var trackLoadStarted = false; + var trackLoadStarted = false; redrawBase = 100; gTrackStore.getListStepped(function(aTPoint) { if (aTPoint) { // Add in front and return new length. var tracklen = gTrack.unshift(aTPoint); - // Redraw track every 100 values (initial paint will do first anyhow). - if (tracklen % 100 == 0) + // Redraw track periodically, larger distance the longer it gets. + // Initial paint will do initial track drawing. + if (tracklen % redrawBase == 0) { drawTrack(); + redrawBase = tracklen; + } } else { // Last point received. diff --git a/js/ui.js b/js/ui.js index 352f7e7..5d2c7b0 100644 --- a/js/ui.js +++ b/js/ui.js @@ -337,7 +337,7 @@ function uploadTrack() { // then ask for credentials, and then send again. var hXHR = new XMLHttpRequest(); hXHR.onreadystatechange = function() { - if (hXHR.readyState == 4 && (XHR.status == 200 || hXHR.status == 400)) { + if (hXHR.readyState == 4 && (hXHR.status == 200 || hXHR.status == 400)) { // 400 is Bad Request, but that's expected as this was empty. // So far so good, init actual upload. var XHR = new XMLHttpRequest(); diff --git a/manifest.appcache b/manifest.appcache index ef33d92..13f95d3 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2013-08-15 +# 2013-08-17 manifest.webapp js/map.js js/ui.js -- 2.35.3 From 3beb94191771ee9c4e9b8a9de90955d84f8b9d50 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 18 Aug 2013 19:24:26 +0200 Subject: [PATCH 12/16] fix setting of var --- js/map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/map.js b/js/map.js index 5e65ed6..e0f0a39 100644 --- a/js/map.js +++ b/js/map.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ var gMapCanvas, gMapContext, gTrackCanvas, gTrackContext, gGeolocation; -var gDebug = false; +var gDebug = true; var gTileSize = 256; var gMaxZoom = 18; // The minimum is 0. @@ -162,7 +162,7 @@ function loadPrefs(aEvent) { gAction.dispatchEvent(throwEv); }); gWaitCounter++; - var trackLoadStarted = false; redrawBase = 100; + var trackLoadStarted = false, redrawBase = 100; gTrackStore.getListStepped(function(aTPoint) { if (aTPoint) { // Add in front and return new length. -- 2.35.3 From 7e9524be0118bd5890d84b83ced68e8ab3decf5f Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 18 Aug 2013 19:24:55 +0200 Subject: [PATCH 13/16] fix setting of var --- manifest.appcache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.appcache b/manifest.appcache index 13f95d3..63a82fc 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2013-08-17 +# 2013-08-17.1 manifest.webapp js/map.js js/ui.js -- 2.35.3 From 0dc9cd0d14fb105bc65c606378e543984261305b Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 18 Aug 2013 19:27:27 +0200 Subject: [PATCH 14/16] no debug on prod, please --- js/map.js | 2 +- manifest.appcache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/map.js b/js/map.js index e0f0a39..1afc24f 100644 --- a/js/map.js +++ b/js/map.js @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ var gMapCanvas, gMapContext, gTrackCanvas, gTrackContext, gGeolocation; -var gDebug = true; +var gDebug = false; var gTileSize = 256; var gMaxZoom = 18; // The minimum is 0. diff --git a/manifest.appcache b/manifest.appcache index 63a82fc..7870ed2 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2013-08-17.1 +# 2013-08-17.2 manifest.webapp js/map.js js/ui.js -- 2.35.3 From cef88e12438c01ca96198c62b32e7d3e99617625 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 18 Aug 2013 19:42:18 +0200 Subject: [PATCH 15/16] independet var assignments --- js/map.js | 3 ++- manifest.appcache | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/map.js b/js/map.js index 1afc24f..5c93ae5 100644 --- a/js/map.js +++ b/js/map.js @@ -162,7 +162,8 @@ function loadPrefs(aEvent) { gAction.dispatchEvent(throwEv); }); gWaitCounter++; - var trackLoadStarted = false, redrawBase = 100; + var trackLoadStarted = false; + var redrawBase = 100; gTrackStore.getListStepped(function(aTPoint) { if (aTPoint) { // Add in front and return new length. diff --git a/manifest.appcache b/manifest.appcache index 7870ed2..ac9621e 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2013-08-17.2 +# 2013-08-17.3 manifest.webapp js/map.js js/ui.js -- 2.35.3 From 362a6833c5e41dc0d006667b4ef8bb15d898dc4b Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Thu, 2 Jan 2014 14:42:44 +0100 Subject: [PATCH 16/16] fix http://bugzilla.kairo.at/show_bug.cgi?id=360 by adding 1 to month value, thanks to javiribera for reporting and debugging --- js/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index 5d2c7b0..921b952 100644 --- a/js/ui.js +++ b/js/ui.js @@ -246,8 +246,9 @@ function setUploadField(aField) { function makeISOString(aTimestamp) { // ISO time format is YYYY-MM-DDTHH:mm:ssZ var tsDate = new Date(aTimestamp); + // Note that .getUTCMonth() returns a number between 0 and 11 (0 for January)! return tsDate.getUTCFullYear() + "-" + - (tsDate.getUTCMonth() < 10 ? "0" : "") + tsDate.getUTCMonth() + "-" + + (tsDate.getUTCMonth() < 9 ? "0" : "") + (tsDate.getUTCMonth() + 1 ) + "-" + (tsDate.getUTCDate() < 10 ? "0" : "") + tsDate.getUTCDate() + "T" + (tsDate.getUTCHours() < 10 ? "0" : "") + tsDate.getUTCHours() + ":" + (tsDate.getUTCMinutes() < 10 ? "0" : "") + tsDate.getUTCMinutes() + ":" + -- 2.35.3