X-Git-Url: https://git-public.kairo.at/?p=lantea.git;a=blobdiff_plain;f=js%2Fui.js;h=f0d2b189b0d97773caed08ecc7d61b741420600b;hp=560f48c9d8f0f461ac620f0b53cc79a23263ae8e;hb=6ddefbf98ebff13592de1d87a3bfc2796ac06d84;hpb=0a4b9f5f2283b15acacf54d9048d9da0a7f9ab20 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;