1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 // Call initElements at the earliest possible stage after parsing the document.
6 if (window.addEventListener) { window.addEventListener("DOMContentLoaded", initElements, false); }
7 else { window.onload = initElements(); }
9 function initElements() {
10 var jsWarning = document.getElementById("jswarning");
12 if (jsWarning.classList) {
13 jsWarning.classList.add("hidden");
16 // IE9 or older (sigh)
17 jsWarning.setAttribute("class", "warn hidden");
20 var loginForm = document.getElementById("loginform");
22 if (loginForm.classList) {
23 loginForm.classList.remove("hidden");
26 // IE9 or older (sigh)
27 loginForm.setAttribute("class", "loginarea");
30 var cancelAuth = document.getElementById("cancelauth");
32 cancelAuth.onclick = function() {
33 document.getElementById("isauthorized").value = "no";
34 document.getElementById("authform").submit();
37 var addAnotherEmail = document.getElementById("addanotheremail");
38 if (addAnotherEmail) {
39 addAnotherEmail.onclick = function() {
40 location.href = "./?addemail";
43 var isNotMe = document.getElementById("isnotme");
45 isNotMe.onclick = function() {
46 location.href = location.href + "&logout=1";