Replace usage of `WCF.System.PageNavigation` with `Ui/Page/JumpTo` (#3877)
authorMatthias Schmidt <gravatronics@live.com>
Mon, 18 Jan 2021 16:03:13 +0000 (17:03 +0100)
committerGitHub <noreply@github.com>
Mon, 18 Jan 2021 16:03:13 +0000 (17:03 +0100)
See #3876

com.woltlab.wcf/templates/headIncludeJavaScript.tpl
ts/WoltLabSuite/Core/Bootstrap.ts
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js

index f0225e29128e1fc37f95f00fe18a80a2609e1c05..bbefb0446c585f945619055f4b77561b6e6851a8 100644 (file)
@@ -206,7 +206,6 @@ window.addEventListener('pageshow', function(event) {
 
 <script data-relocate="true">
        $(function() {
-               WCF.System.PageNavigation.init('.pagination');
                WCF.User.Profile.ActivityPointList.init();
                
                {if MODULE_TROPHY && $__wcf->session->getPermission('user.profile.trophy.canSeeTrophies')}
index 28fedec9b66ee8972ed5a0a810422b80843b9f6c..65521193f58a978b72a5d37e16373011489e945b 100644 (file)
@@ -24,6 +24,7 @@ import * as UiMobile from "./Ui/Mobile";
 import * as UiPageAction from "./Ui/Page/Action";
 import * as UiTabMenu from "./Ui/TabMenu";
 import * as UiTooltip from "./Ui/Tooltip";
+import * as UiPageJumpTo from "./Ui/Page/JumpTo";
 
 // perfectScrollbar does not need to be bound anywhere, it just has to be loaded for WCF.js
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -122,6 +123,8 @@ export function setup(options: BoostrapOptions): void {
     }
   }, 20);
 
+  document.querySelectorAll(".pagination").forEach((el: HTMLElement) => UiPageJumpTo.init(el));
+
   initA11y();
 
   DomChangeListener.add("WoltLabSuite/Core/Bootstrap", () => initA11y);
index 11077b0fe1a83a536ab36152d8fa260613660af0..04f641776a494f44442bd7109e023c2b4ab91552 100644 (file)
                $(function() {
                        if (jQuery.browser.touch) $('html').addClass('touch');
                        
-                       WCF.System.PageNavigation.init('.pagination');
-                       
                        {if $__wcf->user->userID}
                                new WCF.ACP.Search();
                        {/if}
index 12fd083ec396e21c37930315e9e611450e98b6d2..f1625ad2aa1880e8fb1d79c0dc53ba725f35451d 100644 (file)
@@ -8,7 +8,7 @@
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Bootstrap
  */
-define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/Relative", "./Devtools", "./Dom/Change/Listener", "./Environment", "./Event/Handler", "./Language", "./StringUtil", "./Ui/Dialog", "./Ui/Dropdown/Simple", "./Ui/Mobile", "./Ui/Page/Action", "./Ui/TabMenu", "./Ui/Tooltip"], function (require, exports, tslib_1, Core, Picker_1, DateTimeRelative, Devtools_1, Listener_1, Environment, EventHandler, Language, StringUtil, Dialog_1, Simple_1, UiMobile, UiPageAction, UiTabMenu, UiTooltip) {
+define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/Relative", "./Devtools", "./Dom/Change/Listener", "./Environment", "./Event/Handler", "./Language", "./StringUtil", "./Ui/Dialog", "./Ui/Dropdown/Simple", "./Ui/Mobile", "./Ui/Page/Action", "./Ui/TabMenu", "./Ui/Tooltip", "./Ui/Page/JumpTo"], function (require, exports, tslib_1, Core, Picker_1, DateTimeRelative, Devtools_1, Listener_1, Environment, EventHandler, Language, StringUtil, Dialog_1, Simple_1, UiMobile, UiPageAction, UiTabMenu, UiTooltip, UiPageJumpTo) {
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.setup = void 0;
@@ -27,6 +27,7 @@ define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/R
     UiPageAction = tslib_1.__importStar(UiPageAction);
     UiTabMenu = tslib_1.__importStar(UiTabMenu);
     UiTooltip = tslib_1.__importStar(UiTooltip);
+    UiPageJumpTo = tslib_1.__importStar(UiPageJumpTo);
     // non strict equals by intent
     if (window.WCF == null) {
         window.WCF = {};
@@ -100,6 +101,7 @@ define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/R
                 window.jQuery.holdReady(false);
             }
         }, 20);
+        document.querySelectorAll(".pagination").forEach((el) => UiPageJumpTo.init(el));
         initA11y();
         Listener_1.default.add("WoltLabSuite/Core/Bootstrap", () => initA11y);
     }