Merge pull request #4204 from WoltLab/code_cleanup
authorMatthias Schmidt <gravatronics@live.com>
Mon, 10 May 2021 14:34:46 +0000 (16:34 +0200)
committerGitHub <noreply@github.com>
Mon, 10 May 2021 14:34:46 +0000 (16:34 +0200)
Code cleanup

com.woltlab.wcf/templates/footer.tpl
com.woltlab.wcf/templates/header.tpl
ts/WoltLabSuite/Core/Ui/Mobile.ts
wcfsetup/install/files/acp/templates/footer.tpl
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/3rdParty/jquery.js
wcfsetup/install/files/js/3rdParty/jquery.min.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js

index 308157a9143f596224a16ebddb483044c6612b14..0e9a4e229e08dba6ad0a7b9a778a2b6ed730e4b0 100644 (file)
 
 {@FOOTER_CODE}
 
-<a id="bottom"></a>
+<span id="bottom"></span>
 
 </body>
 </html>
index bc792e9b4e65c11b6f67f2863c5afb5c8cff9a13..dc9e0c51166a13d6bc1c81b1953bc7ef9756501c 100644 (file)
@@ -27,7 +27,7 @@
        {if !$__pageDataAttributes|empty}{@$__pageDataAttributes}{/if}
        class="{if $__wcf->getActivePage() != null && $__wcf->getActivePage()->cssClassName}{$__wcf->getActivePage()->cssClassName}{/if}{if !$__pageCssClassName|empty} {$__pageCssClassName}{/if}">
 
-<a id="top"></a>
+<span id="top"></span>
 
 <div id="pageContainer" class="pageContainer">
        {event name='beforePageHeader'}
index eff98789ea4d7be20a7656691fd1113dad2c0d0a..4f5f3ef7693f4fc89bd96e7b4506a5978945d792 100644 (file)
@@ -238,45 +238,49 @@ function toggleMobileNavigation(message: HTMLElement, quickOptions: HTMLElement,
 function setupLGTouchNavigation(): void {
   _enabledLGTouchNavigation = true;
   document.querySelectorAll(".boxMenuHasChildren > a").forEach((element: HTMLElement) => {
-    element.addEventListener("touchstart", function (event) {
-      if (_enabledLGTouchNavigation && element.getAttribute("aria-expanded") === "false") {
-        event.preventDefault();
-
-        element.setAttribute("aria-expanded", "true");
-
-        // Register an new event listener after the touch ended, which is triggered once when an
-        // element on the page is pressed. This allows us to reset the touch status of the navigation
-        // entry when the entry is no longer open, so that it does not redirect to the page when you
-        // click it again.
-        element.addEventListener(
-          "touchend",
-          () => {
-            document.body.addEventListener(
-              "touchstart",
-              () => {
-                document.body.addEventListener(
-                  "touchend",
-                  (event) => {
-                    const parent = element.parentElement!;
-                    const target = event.target as HTMLElement;
-                    if (!parent.contains(target) && target !== parent) {
-                      element.setAttribute("aria-expanded", "false");
-                    }
-                  },
-                  {
-                    once: true,
-                  },
-                );
-              },
-              {
-                once: true,
-              },
-            );
-          },
-          { once: true },
-        );
-      }
-    });
+    element.addEventListener(
+      "touchstart",
+      (event) => {
+        if (_enabledLGTouchNavigation && element.getAttribute("aria-expanded") === "false") {
+          event.preventDefault();
+
+          element.setAttribute("aria-expanded", "true");
+
+          // Register an new event listener after the touch ended, which is triggered once when an
+          // element on the page is pressed. This allows us to reset the touch status of the navigation
+          // entry when the entry is no longer open, so that it does not redirect to the page when you
+          // click it again.
+          element.addEventListener(
+            "touchend",
+            () => {
+              document.body.addEventListener(
+                "touchstart",
+                () => {
+                  document.body.addEventListener(
+                    "touchend",
+                    (event) => {
+                      const parent = element.parentElement!;
+                      const target = event.target as HTMLElement;
+                      if (!parent.contains(target) && target !== parent) {
+                        element.setAttribute("aria-expanded", "false");
+                      }
+                    },
+                    {
+                      once: true,
+                    },
+                  );
+                },
+                {
+                  once: true,
+                },
+              );
+            },
+            { once: true },
+          );
+        }
+      },
+      { passive: false },
+    );
   });
 }
 
index da3b6ece2ca362a0259d032bdf4c45fab42df5cd..ca15232394a24624985e77c570a21aa31bd68e8a 100644 (file)
@@ -12,7 +12,7 @@
 
 <!-- JAVASCRIPT_RELOCATE_POSITION -->
 
-<a id="bottom"></a>
+<span id="bottom"></span>
 
 </body>
 </html>
index c6eeddd28be9fdbd82e2f4c49b5e046797e86af2..e42883decb96d2dde019322effabec3b16ccab39 100644 (file)
 </head>
 
 <body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}" class="wcfAcp">
-       <a id="top"></a>
+       <span id="top"></span>
        
        {assign var=_acpPageSubMenuActive value=false}
        {if PACKAGE_ID}
index 34a5703d80fb917d5e3af1a5e97b898e04f9788d..aabf4d01702af9f622b3ce608ba4a08f51852435 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery JavaScript Library v3.3.1
+ * jQuery JavaScript Library v3.99.99
  * https://jquery.com/
  *
  * Includes Sizzle.js
  * https://jquery.org/license
  *
  * Date: 2018-01-20T17:24Z
+ * 
+ * This is a modified version of jQuery based upon the 3.3.1 release, but with backports of
+ * the fixes for the security issues addressed in jQuery 3.5.0/3.5.1. No other changes are
+ * made to avoid introducing backwards incompatible changes. The version number has been set
+ * to 3.99.99 to indicate the change and to make external tools stop whining about "3.3.1".
  */
 ( function( global, factory ) {
 
@@ -129,7 +134,7 @@ function toType( obj ) {
 
 
 var
-       version = "3.3.1",
+       version = "3.99.99",
 
        // Define a local copy of jQuery
        jQuery = function( selector, context ) {
index c7cf67afc394eed4c4d6f8b03f6aaa0b03b204ed..456c87d3a73f91d2ab7bfc38823c55599b17f955 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery JavaScript Library v3.3.1
+ * jQuery JavaScript Library v3.99.99
  * https://jquery.com/
  *
  * Includes Sizzle.js
  * https://jquery.org/license
  *
  * Date: 2018-01-20T17:24Z
+ * 
+ * This is a modified version of jQuery based upon the 3.3.1 release, but with backports of
+ * the fixes for the security issues addressed in jQuery 3.5.0/3.5.1. No other changes are
+ * made to avoid introducing backwards incompatible changes. The version number has been set
+ * to 3.99.99 to indicate the change and to make external tools stop whining about "3.3.1".
  */
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},v=function(e){return null!=e&&e===e.window},y={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in y)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b=function(e,t){return new b.fn.init(e,t)},w=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}b.fn=b.prototype={jquery:"3.3.1",constructor:b,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},b.extend=b.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(b.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&b.isPlainObject(n)?n:{},a[t]=b.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},b.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(w,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?b.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(T(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(b.fn[Symbol.iterator]=n[Symbol.iterator]),b.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var C=
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},v=function(e){return null!=e&&e===e.window},y={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in y)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b=function(e,t){return new b.fn.init(e,t)},w=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}b.fn=b.prototype={jquery:"3.99.99",constructor:b,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},b.extend=b.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(b.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&b.isPlainObject(n)?n:{},a[t]=b.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},b.extend({expando:"jQuery"+("3.99.99"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(w,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?b.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(T(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(b.fn[Symbol.iterator]=n[Symbol.iterator]),b.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var C=
 /*!
  * Sizzle CSS Selector Engine v2.3.3
  * https://sizzlejs.com/
index 00c8f11849ef7e8bf4fd1255fe5a56be8a8e36ae..45de7cd1d4a92934c7f681d7f275b25b81fec1cd 100644 (file)
@@ -205,7 +205,7 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Change/Listener", "../
     function setupLGTouchNavigation() {
         _enabledLGTouchNavigation = true;
         document.querySelectorAll(".boxMenuHasChildren > a").forEach((element) => {
-            element.addEventListener("touchstart", function (event) {
+            element.addEventListener("touchstart", (event) => {
                 if (_enabledLGTouchNavigation && element.getAttribute("aria-expanded") === "false") {
                     event.preventDefault();
                     element.setAttribute("aria-expanded", "true");
@@ -229,7 +229,7 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Change/Listener", "../
                         });
                     }, { once: true });
                 }
-            });
+            }, { passive: false });
         });
     }
     function enableLGTouchNavigation() {