</select>
<p class="dialogHelp">Public Domain tracks can be forwarded by the server
operator to any other services, e.g. OpenStreetMap.</p>
-<label for="uploadDesc">Description:</label>
+<label for="uploadDesc">Comment:</label>
<input type="text" id="uploadDesc" maxlength="255" size="25"
value="Lantea Maps">
<input type="button" id="uploadDialogUploadButton" value="Upload Track"
<input type="button" id="clearCacheButton" value="Clear Cached Maps"
onclick="gTileService.clearDB();">
</p>
-<div id="uploadSettingsArea" class="debugHide">
-<p class="settingsSubTitle">OpenStreetMap Track Upload:</p>
-<label for="uploadUser">User name:</label>
-<input type="text" id="uploadUser" maxlength="255"
- onchange="setUploadField(this);"><br/>
-<label for="uploadPwd">Password:</label>
-<input type="password" id="uploadPwd" maxlength="255"
+<div id="uploadSettingsArea">
+<p class="settingsSubTitle">Track Upload:</p>
+<label for="uploadDevName">Device name:</label>
+<input type="text" id="uploadDevName" maxlength="255" placeholder="My Device"
onchange="setUploadField(this);">
+<p class="dialogHelp">The device name enables you to tell apart tracks you may
+upload from multiple devices.</p>
</div>
</div>
var gAction, gActionLabel;
var gBackendURL = "https://backend.lantea.kairo.at";
var gAuthClientID = "lantea";
-var gOSMAPIURL = "https://api.openstreetmap.org/";
-var gOSMOAuthData = {
- oauth_consumer_key: "6jjWwlbhGqyYeCdlFE1lTGG6IRGOv1yKpFxkcq2z",
- oauth_secret: "A21gUeDM6mdoQgbA9uF7zJ13sbUQrNG7QQ4oSrKA",
- url: "https://www.openstreetmap.org",
- landing: "auth-done.html",
-}
window.onload = function() {
if (/\/login\.html/.test(window.location)) {
// Call any UI preparation that needs the backend.
});
- if (gDebug) {
- // Note that GPX upload returns an error 500 on the dev API right now.
- gOSMAPIURL = "http://api06.dev.openstreetmap.org/";
- }
-
gAction.addEventListener("dbinit-done", initMap, false);
gAction.addEventListener("mapinit-done", postInit, false);
console.log("starting DB init...");
gActionLabel.textContent = "";
gAction.style.display = "none";
setTracking(document.getElementById("trackCheckbox"));
- gPrefs.get(gDebug ? "osm_dev_user" : "osm_user", function(aValue) {
+ gPrefs.get("devicename", function(aValue) {
if (aValue) {
- document.getElementById("uploadUser").value = aValue;
- document.getElementById("uploadTrackButton").disabled = false;
+ document.getElementById("uploadDevName").value = aValue;
}
});
- gPrefs.get(gDebug ? "osm_dev_pwd" : "osm_pwd", function(aValue) {
- var upwd = document.getElementById("uploadPwd");
- if (aValue)
- document.getElementById("uploadPwd").value = aValue;
- });
}
window.onresize = function() {
function setUploadField(aField) {
switch (aField.id) {
- case "uploadUser":
- gPrefs.set(gDebug ? "osm_dev_user" : "osm_user", aField.value);
- document.getElementById("uploadTrackButton").disabled = !aField.value.length;
- break;
- case "uploadPwd":
- gPrefs.set(gDebug ? "osm_dev_pwd" : "osm_pwd", aField.value);
+ case "uploadDevName":
+ gPrefs.set("devicename", aField.value);
break;
}
}
var desc = document.getElementById("uploadDesc").value;
formData.append("comment",
desc.length ? desc : "Track recorded via Lantea Maps");
- //formData.append("devicename", "");
+ formData.append("devicename",
+ document.getElementById("uploadDevName").value);
formData.append("public",
document.getElementById("uploadPublic").value);
var result = {};
if (XHR.getResponseHeader("Content-Type") == "application/json") {
// Got a JSON object, see if we have success.
- result = JSON.parse(XHR.responseText);
+ try {
+ result = JSON.parse(XHR.responseText);
+ }
+ catch (e) {
+ console.log(e);
+ result = {"error": e,
+ "message": XHR.responseText};
+ }
}
else {
result = XHR.responseText;
color: #404040;
}
+.menuDrawer input[type="text"],
+.menuDrawer input[type="number"] {
+ vertical-align: middle;
+ background-image: none;
+ background-color: rgba(204, 204, 204, .7);
+ color: #404040;
+ padding: 1px .5em;
+ margin: 1px 0;
+ border: 1px solid #CCCCCC;
+ border-radius: 3px;
+}
+
+.menuDrawer input[type="text"] {
+ text-align: left;
+}
+
+.menuDrawer input[type="number"] {
+ text-align: right;
+}
+
+.menuDrawer input[type="text"]:disabled,
+.menuDrawer input[type="number"]:disabled {
+ background-color: rgba(204, 204, 204, .1);
+ color: rgba(204, 204, 204, .5);
+ border: 1px solid rgba(255, 255, 255, .5);
+}
+
+.menuDrawer input[type="text"]:not(:disabled):hover,
+.menuDrawer input[type="number"]:not(:disabled):hover {
+ border: 1px solid #FFFFFF;
+}
+
+.menuDrawer input[type="text"]:not(:disabled):focus,
+.menuDrawer input[type="number"]:not(:disabled):focus {
+ background-color: rgba(204, 204, 255, .8);
+ border: 1px solid #FFFFFF;
+ color: #202020;
+}
+
#trackData {
margin: 0;
}
bottom: 5px;
right: .5em;
margin: 0;
- font-size: small;
+ font-size: .8em;
opacity: .66;
z-index: 2;
background-color: rgba(255, 255, 255, 1);
.dialogHelp {
margin: .5em 0;
- font-size: small;
+ font-size: .8em;
opacity: .66;
}
#copyright {
bottom: 1px;
right: 1px;
- font-size: 8px;
}
}