From 662078d15cd8052cab2a7effd2a1306283cfb2a6 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 22 Dec 2017 21:42:59 +0100 Subject: [PATCH] add an indicator when login fails --- index.html | 1 + js/ui.js | 9 ++++++++- style/lantea.css | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 8bb8240..d1ea156 100644 --- a/index.html +++ b/index.html @@ -80,6 +80,7 @@ operator to any other services, e.g. OpenStreetMap.

+ diff --git a/js/ui.js b/js/ui.js index e20a4ae..92dd488 100644 --- a/js/ui.js +++ b/js/ui.js @@ -14,7 +14,7 @@ var gWaitCounter = 0; var gTrackUpdateInterval; var gAction, gActionLabel; var authData = null, userData = null; -var gBackendURL = "https://backend.lantea.kairo.at"; +var gBackendURL = "https://backend.lantea.kairo.at/"; var gAuthClientID = "lantea"; window.onload = function() { @@ -112,6 +112,9 @@ window.onresize = function() { } function startLogin() { + var logerr = document.getElementById("loginerror"); + logerr.classList.add("hidden"); + logerr.title = ""; if (!authData || !authData["state"]) { // We have no oAuth state, try to fetch it and call ourselves again if it worked. prepareLoginButton(function() { @@ -121,6 +124,8 @@ function startLogin() { else if (!userData) { // Only warn if we didn't actually end up being logged in. console.log("No OAuth state and fetching fails, client or server may be offline."); + logerr.classList.remove("hidden"); + logerr.title = "Client or server may be offline."; } }); return; @@ -132,6 +137,8 @@ function startLogin() { } else { console.log("Opening Sign In window failed."); + logerr.classList.remove("hidden"); + logerr.title = "Opening Sign-In window failed."; } } diff --git a/style/lantea.css b/style/lantea.css index 64ee62f..dbc28b0 100644 --- a/style/lantea.css +++ b/style/lantea.css @@ -410,6 +410,12 @@ h1 { color: #FFFFFF; } +#loginerror { + color: red; + font-weight: bold; + padding: .5em; +} + /* dialog area - for loading error and welcome messages */ #dialogArea { position: absolute; -- 2.35.3