From: Robert Kaiser
Date: Sun, 22 Oct 2017 22:58:45 +0000 (+0200)
Subject: add first run and update info dialogs
X-Git-Tag: production~27
X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=e1c3d337e88cb06b988d97e060938466a9815634;p=lantea.git
add first run and update info dialogs
---
diff --git a/index.html b/index.html
index c3c491d..3ca9752 100644
--- a/index.html
+++ b/index.html
@@ -66,7 +66,7 @@ operator to any other services, e.g. OpenStreetMap.
-
Track Upload to Lantea Maps Server
+
Track Upload to Lantea Maps Server
Upload in progress…
Track upload successful!
@@ -146,6 +146,40 @@ upload from multiple devices.
Unable to initialize WebGL. You need a browser that supports it.
+
+
Welcome to Lantea Maps!
+
This web app lets you record GPS tracks of your journeys, which you can
+ upload to our backend servers and download as GPX files.
+
You can find track details, upload, etc. in the "track" drawer that you can
+ access via the icon at the left top of the
+ window.
+
Right underneath that icon, you find
+ settings.
+
Both track and settings "drawers" can be closed by clicking/tapping on their
+ title line.
+
From the track "drawer", you can also access a library of uploaded tracks,
+ their name/comment links to the GPX download of the specific track.
+
+
+
+
+
+
Lantea Maps has changed!
+
Lantea Maps has been updated with a few significant changes.
+
Most importantly, the previously broken upload functionality for tracks has
+ been fixed and improved to use our own Lantea Maps server instead of
+ OpenStreetMaps. For using it, you need to log in with KaiRo.at via their
+ "sign in" button now in the track "drawer".
+
From there, you can also access a library of uploaded tracks, their
+ name/comment links to the GPX download of the specific track.
+
If you set a device name in the settings, you can even distinguish tracks
+ uploaded to the same account by different devices you're using.
+
+
+
+
diff --git a/js/ui.js b/js/ui.js
index f737507..f451fbe 100644
--- a/js/ui.js
+++ b/js/ui.js
@@ -8,6 +8,7 @@ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequest
var mainDB;
var gAppInitDone = false;
+var firstRun = false;
var gUIHideCountdown = 0;
var gWaitCounter = 0;
var gTrackUpdateInterval;
@@ -101,6 +102,17 @@ function postInit(aEvent) {
document.getElementById("uploadDevName").value = aValue;
}
});
+ if (firstRun) {
+ showFirstRunDialog();
+ }
+ else {
+ gPrefs.get("lastInfoShown", function(aValue) {
+ if (!aValue || !parseInt(aValue) || parseInt(aValue) < 1) {
+ showInfoDialog();
+ }
+ });
+ }
+ gPrefs.set("lastInfoShown", 1);
}
window.onresize = function() {
@@ -241,6 +253,7 @@ function initDB(aEvent) {
if (!mainDB.objectStoreNames.contains("prefs")) {
// Create a "prefs" objectStore.
var prefsStore = mainDB.createObjectStore("prefs");
+ firstRun = true;
}
if (!mainDB.objectStoreNames.contains("track")) {
// Create a "track" objectStore.
@@ -352,6 +365,11 @@ function showUploadDialog() {
dia.classList.remove("hidden");
}
+function cancelTrackDialog() {
+ document.getElementById("trackDialogArea").classList.add("hidden");
+ document.getElementById("uploadTrackButton").disabled = false;
+}
+
function showGLWarningDialog() {
var dia = document.getElementById("dialogArea");
var areas = dia.children;
@@ -362,9 +380,28 @@ function showGLWarningDialog() {
dia.classList.remove("hidden");
}
-function cancelTrackDialog() {
- document.getElementById("trackDialogArea").classList.add("hidden");
- document.getElementById("uploadTrackButton").disabled = false;
+function showFirstRunDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("firstRunIntro").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
+function closeDialog() {
+ document.getElementById("dialogArea").classList.add("hidden");
+}
+
+function showInfoDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("infoDialog").style.display = "block";
+ dia.classList.remove("hidden");
}
var uiEvHandler = {
diff --git a/manifest.appcache b/manifest.appcache
index 3c8c0b4..244ce5c 100644
--- a/manifest.appcache
+++ b/manifest.appcache
@@ -1,6 +1,6 @@
CACHE MANIFEST
-# 2017-10-08
+# 2017-10-22
index.html
login.html
manifest.webapp
diff --git a/style/lantea.css b/style/lantea.css
index 589beff..64ee62f 100644
--- a/style/lantea.css
+++ b/style/lantea.css
@@ -219,11 +219,6 @@ h1 {
font-size: .75em;
}
-.dialogTitle {
- margin: 0 0 .5em;
- font-weight: bold;
-}
-
.dialogHelp {
margin: .5em 0;
font-size: .8em;
@@ -415,12 +410,13 @@ h1 {
color: #FFFFFF;
}
-/* dialog area - only used for loading error */
+/* dialog area - for loading error and welcome messages */
#dialogArea {
+ position: absolute;
top: 20%;
right: 0;
left: 0;
- width: 30ch;
+ width: 50ch;
max-width: 92%;
z-index: 10;
background-color: rgba(255, 255, 255, .8);
@@ -431,10 +427,19 @@ h1 {
}
#dialogArea.hidden {
- top: -100%;
+ top: -1000%;
display: block;
}
+.dialogTitle {
+ margin: 0 0 .5em;
+ font-weight: bold;
+}
+
+.dialogButtonLine {
+ text-align: center;
+}
+
/* full screen overlay - library, etc. */
.fullScreenOverlay {
position: absolute;