X-Git-Url: https://git-public.kairo.at/?p=authserver.git;a=blobdiff_plain;f=app%2Fauthsystem.js;fp=app%2Fauthsystem.js;h=7a24d84af4b5efde87be187e217d3256c78ffedf;hp=0000000000000000000000000000000000000000;hb=04116cc5dabb951023fb511fda0dc36956d6a84a;hpb=c4e0aceb5d9e9076effd75de03f4588b65329740 diff --git a/app/authsystem.js b/app/authsystem.js new file mode 100644 index 0000000..7a24d84 --- /dev/null +++ b/app/authsystem.js @@ -0,0 +1,45 @@ +/* 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/. */ + +window.onload = function() { + var jsWarning = document.getElementById("jswarning"); + if (jsWarning) { + if (jsWarning.classList) { + jsWarning.classList.add("hidden"); + } + else { + // IE9 or older (sigh) + jsWarning.setAttribute("class", "warn hidden"); + } + } + var loginForm = document.getElementById("loginform"); + if (loginForm) { + if (loginForm.classList) { + loginForm.classList.remove("hidden"); + } + else { + // IE9 or older (sigh) + loginForm.setAttribute("class", "loginarea"); + } + } + var cancelAuth = document.getElementById("cancelauth"); + if (cancelAuth) { + cancelAuth.onclick = function() { + document.getElementById("isauthorized").value = "no"; + document.getElementById("loginauthform").submit(); + } + } + var addAnotherEmail = document.getElementById("addanotheremail"); + if (addAnotherEmail) { + addAnotherEmail.onclick = function() { + location.href = "./?addemail"; + } + } + var isNotMe = document.getElementById("isnotme"); + if (isNotMe) { + isNotMe.onclick = function() { + location.href = location.href + "&logout=1"; + } + } +}