--- /dev/null
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+console.log("JS-load");
+
+window.onload = function() {
+ // Complete the login process by calling the main window.
+ console.log("onload");
+ if (window.opener) {
+ console.log("opener");
+ window.opener.finishLogin(getParameterByName("code"), getParameterByName("state"));
+ console.log("finished");
+ window.close();
+ }
+ else {
+ console.log("no-opener");
+ document.getElementById("logininfo").textContent = "You have called this document outside of the login flow, which is not supported.";
+ }
+}
var gAuthClientID = "lantea";
window.onload = function() {
- if (/\/login\.html/.test(window.location)) {
- // If we are in the login window, call a function to complete the process and don't do anything else here.
- completeLoginWindow();
- return;
- }
gAction = document.getElementById("action");
gActionLabel = document.getElementById("actionlabel");
);
}
-function completeLoginWindow() {
- if (window.opener) {
- window.opener.finishLogin(getParameterByName("code"), getParameterByName("state"));
- window.close();
- }
- else {
- document.getElementById("logininfo").textContent = "You have called this document outside of the login flow, which is not supported.";
- }
-}
-
function finishLogin(aCode, aState) {
if (aState == authData["state"]) {
fetchBackend("login?code=" + aCode + "&state=" + aState + "&redirect_uri=" + encodeURIComponent(getRedirectURI()), "GET", null,
https://developer.mozilla.org/en/Mobile/Viewport_meta_tag -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Lantea Login</title>
- <script src="js/ui.js"></script>
- <!-- script src="js/piwik.js" async="" defer=""></script -->
+ <script src="js/loginwindow.js"></script>
+ <script src="js/piwik.js" async="" defer=""></script>
<link rel="stylesheet" href="style/lantea.css">
<link rel="shortcut icon" href="style/lanteaIcon16.png" type="image/png">
</head>
CACHE MANIFEST
-# 2017-10-23
+# 2017-11-10
index.html
login.html
manifest.webapp
js/map.js
js/ui.js
js/library.js
+js/loginwindow.js
style/lantea.css
style/loading.png
style/loading_action.png