make the JS compatible with older IE versions, though this is a hack that hardcodes...
[authserver.git] / authsystem.js
index 8fd97566360ccce5fe1a5f0bdc179020ce9506ad..faaf975c36c48f34adcc97495bdd3f535f20bdc8 100644 (file)
@@ -3,9 +3,24 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 window.onload = function() {
-  document.getElementById("jswarning").classList.add("hidden");
+  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) {
-    loginForm.classList.remove("hidden");
+    if (loginForm.classList) {
+      loginForm.classList.remove("hidden");
+    }
+    else {
+      // IE9 or older (sigh)
+      loginForm.setAttribute("class", "loginarea");
+    }
   }
 }