Visman 1 rok pred
rodič
commit
2a014a7f91
4 zmenil súbory, kde vykonal 19 pridanie a 15 odobranie
  1. 8 6
      public/js/common.js
  2. 3 1
      public/js/media.js
  3. 5 4
      public/js/poll.js
  4. 3 4
      public/js/scloader.js

+ 8 - 6
public/js/common.js

@@ -24,6 +24,7 @@ ForkBB.common = (function (doc, win) {
             backs[i].addEventListener("click", function (event) {
             backs[i].addEventListener("click", function (event) {
                 win.history.back();
                 win.history.back();
                 event.preventDefault();
                 event.preventDefault();
+
                 return false;
                 return false;
             });
             });
         }
         }
@@ -43,7 +44,7 @@ ForkBB.common = (function (doc, win) {
         }
         }
     }
     }
 
 
-    function initShowPAss()
+    function initShowPass()
     {
     {
         var inps = doc.querySelectorAll("input[type='password']");
         var inps = doc.querySelectorAll("input[type='password']");
 
 
@@ -83,13 +84,14 @@ ForkBB.common = (function (doc, win) {
     return {
     return {
         init : function () {
         init : function () {
             initGoBack();
             initGoBack();
-            initAnchorHL();
-            initShowPAss();
             initForm();
             initForm();
+
+            if (typeof DOMTokenList !== 'undefined') {
+                initAnchorHL();
+                initShowPass();
+            }
         },
         },
     };
     };
 }(document, window));
 }(document, window));
 
 
-if (document.addEventListener) {
-	document.addEventListener("DOMContentLoaded", ForkBB.common.init, false);
-}
+document.addEventListener("DOMContentLoaded", ForkBB.common.init, false);

+ 3 - 1
public/js/media.js

@@ -459,7 +459,9 @@ ForkBB.media = (function (doc, win, nav) {
 
 
     return {
     return {
         init : function () {
         init : function () {
-            crawl();
+            if (!!Element.prototype.closest) {
+                crawl();
+            }
         },
         },
     };
     };
 }(document, window, navigator));
 }(document, window, navigator));

+ 5 - 4
public/js/poll.js

@@ -57,7 +57,10 @@ ForkBB.poll = (function (doc, win) {
 
 
     return {
     return {
         init : function () {
         init : function () {
-            if (0 !== inputPE) {
+            if (
+                0 !== inputPE
+                || typeof DOMTokenList === 'undefined'
+            ) {
                 return;
                 return;
             }
             }
 
 
@@ -188,6 +191,4 @@ ForkBB.poll = (function (doc, win) {
     };
     };
 }(document, window));
 }(document, window));
 
 
-if (document.addEventListener) {
-	document.addEventListener("DOMContentLoaded", ForkBB.poll.init, false);
-}
+document.addEventListener("DOMContentLoaded", ForkBB.poll.init, false);

+ 3 - 4
public/js/scloader.js

@@ -40,7 +40,8 @@ ForkBB.editor = (function (doc, win) {
         var conf, smiliesEnabled, linkEnabled;
         var conf, smiliesEnabled, linkEnabled;
 
 
         if (
         if (
-            !sceditor
+            !Object.assign
+            || !sceditor
             || !(textarea = doc.querySelector(selector))
             || !(textarea = doc.querySelector(selector))
             || !(conf = JSON.parse(textarea.getAttribute(dataName)))
             || !(conf = JSON.parse(textarea.getAttribute(dataName)))
         ) {
         ) {
@@ -109,6 +110,4 @@ ForkBB.editor = (function (doc, win) {
     };
     };
 }(document, window));
 }(document, window));
 
 
-if (document.addEventListener && Object.assign) {
-    document.addEventListener("DOMContentLoaded", ForkBB.editor.init, false);
-}
+document.addEventListener("DOMContentLoaded", ForkBB.editor.init, false);