Lazy load the style changer and poll editor
authorAlexander Ebert <ebert@woltlab.com>
Thu, 27 Jan 2022 17:46:26 +0000 (18:46 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 27 Jan 2022 17:46:26 +0000 (18:46 +0100)
ts/WoltLabSuite/Core/BootstrapFrontend.ts
ts/WoltLabSuite/Core/Controller/Style/Changer.ts
ts/WoltLabSuite/Core/Date/Picker.ts
ts/WoltLabSuite/Core/Ui/Poll/Editor.ts
wcfsetup/install/files/js/WoltLabSuite/Core/BootstrapFrontend.js
wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Style/Changer.js
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js

index b50a8cb778ca9e3561cd438ecadbdd30edd359fd..c806b8850cbf5fc011a1b458cdb2ee2fe90a59d9 100644 (file)
@@ -9,7 +9,6 @@
 
 import * as BackgroundQueue from "./BackgroundQueue";
 import * as Bootstrap from "./Bootstrap";
-import * as ControllerStyleChanger from "./Controller/Style/Changer";
 import * as ControllerPopover from "./Controller/Popover";
 import * as UiUserIgnore from "./Ui/User/Ignore";
 import * as UiPageHeaderMenu from "./Ui/Page/Header/Menu";
@@ -67,7 +66,9 @@ export function setup(options: BoostrapOptions): void {
   UiPageHeaderMenu.init();
 
   if (options.styleChanger) {
-    ControllerStyleChanger.setup();
+    void import("./Controller/Style/Changer").then((ControllerStyleChanger) => {
+      ControllerStyleChanger.setup();
+    });
   }
 
   if (options.enableUserPopover) {
index 8fd8264ab8c760234b00cf802976f76b2e989f3f..3b2dca44895eaa1797e886d29b4e0d2f34a6797d 100644 (file)
@@ -5,6 +5,7 @@
  * @copyright  2001-2019 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Controller/Style/Changer
+ * @woltlabExcludeBundle all
  */
 
 import * as Ajax from "../../Ajax";
index 3089a26ebb320e66844e106aa5279ac124f3275c..302842feb35952204b05104aabe5fd765054117d 100644 (file)
@@ -5,7 +5,6 @@
  * @copyright  2001-2019 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Date/Picker
- * @woltlabExcludeBundle all
  */
 
 import * as Core from "../Core";
index 4b064e8eee556679295af04e5264f99e603276d2..e43e58ea3bc4cb6de48ad876ed5772a7e63f5a62 100644 (file)
@@ -5,7 +5,7 @@
  * @copyright  2001-2020 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Ui/Poll/Editor
- * @woltlabExcludeBundle tiny
+ * @woltlabExcludeBundle all
  */
 
 import * as Core from "../../Core";
index ca7a9d3706cf31a23250daf4e963a426618b5086..558de389460e4f638a7c5b974b314696cccc67ff 100644 (file)
@@ -6,13 +6,12 @@
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/BootstrapFrontend
  */
-define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Controller/Style/Changer", "./Controller/Popover", "./Ui/User/Ignore", "./Ui/Page/Header/Menu", "./Ui/Message/UserConsent", "./Ajax", "./Ui/Message/Share/Dialog", "./Ui/Message/Share/Providers", "./Ui/Feed/Dialog", "./User", "./Ui/Page/Menu/Main/Frontend"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, ControllerStyleChanger, ControllerPopover, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent, Ajax, UiMessageShareDialog, UiMessageShareProviders, UiFeedDialog, User_1, Frontend_1) {
+define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Controller/Popover", "./Ui/User/Ignore", "./Ui/Page/Header/Menu", "./Ui/Message/UserConsent", "./Ajax", "./Ui/Message/Share/Dialog", "./Ui/Message/Share/Providers", "./Ui/Feed/Dialog", "./User", "./Ui/Page/Menu/Main/Frontend"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, ControllerPopover, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent, Ajax, UiMessageShareDialog, UiMessageShareProviders, UiFeedDialog, User_1, Frontend_1) {
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.setup = void 0;
     BackgroundQueue = (0, tslib_1.__importStar)(BackgroundQueue);
     Bootstrap = (0, tslib_1.__importStar)(Bootstrap);
-    ControllerStyleChanger = (0, tslib_1.__importStar)(ControllerStyleChanger);
     ControllerPopover = (0, tslib_1.__importStar)(ControllerPopover);
     UiUserIgnore = (0, tslib_1.__importStar)(UiUserIgnore);
     UiPageHeaderMenu = (0, tslib_1.__importStar)(UiPageHeaderMenu);
@@ -52,7 +51,9 @@ define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Co
         });
         UiPageHeaderMenu.init();
         if (options.styleChanger) {
-            ControllerStyleChanger.setup();
+            void new Promise((resolve_1, reject_1) => { require(["./Controller/Style/Changer"], resolve_1, reject_1); }).then(tslib_1.__importStar).then((ControllerStyleChanger) => {
+                ControllerStyleChanger.setup();
+            });
         }
         if (options.enableUserPopover) {
             _initUserPopover();
index be3a77b48bb6dfb7030b2611fc18d16255478e02..22df6bddcda59cd8acb78960d0040db4c42ef40c 100644 (file)
@@ -5,6 +5,7 @@
  * @copyright  2001-2019 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Controller/Style/Changer
+ * @woltlabExcludeBundle all
  */
 define(["require", "exports", "tslib", "../../Ajax", "../../Language", "../../Ui/Dialog"], function (require, exports, tslib_1, Ajax, Language, Dialog_1) {
     "use strict";
index 98923e9fc4c11f41d04289cc1091bdbb67b29a99..801b0300f340bfa9a1f6e81a736f0f446974b666 100644 (file)
@@ -5,7 +5,6 @@
  * @copyright  2001-2019 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Date/Picker
- * @woltlabExcludeBundle all
  */
 define(["require", "exports", "tslib", "../Core", "./Util", "../Dom/Change/Listener", "../Event/Handler", "../Language", "../Ui/Alignment", "../Ui/CloseOverlay", "../Dom/Util", "focus-trap"], function (require, exports, tslib_1, Core, DateUtil, Listener_1, EventHandler, Language, UiAlignment, CloseOverlay_1, Util_1, focus_trap_1) {
     "use strict";
index 1a34f53eb88d1e285ed3c3561904494303edebc0..f94967848d6ce37a9df10256ee8522bde3f7e728 100644 (file)
@@ -5,7 +5,7 @@
  * @copyright  2001-2020 WoltLab GmbH
  * @license  GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module  WoltLabSuite/Core/Ui/Poll/Editor
- * @woltlabExcludeBundle tiny
+ * @woltlabExcludeBundle all
  */
 define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sortable/List", "../../Event/Handler", "../../Date/Picker"], function (require, exports, tslib_1, Core, Language, List_1, EventHandler, DatePicker) {
     "use strict";