Moved the call to `favico.js` into `WCF.User.js`
authorAlexander Ebert <ebert@woltlab.com>
Fri, 1 Jan 2021 12:15:33 +0000 (13:15 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 1 Jan 2021 12:15:33 +0000 (13:15 +0100)
package-lock.json
package.json
wcfsetup/install/files/js/WCF.User.js
wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Bootstrap.ts

index 159f6b19cf0f00edfe081b5273dfe3374b77fba4..be241647fe225974402be2d4a42963b5b8e94295 100644 (file)
       "resolved": "https://registry.npmjs.org/@types/facebook-js-sdk/-/facebook-js-sdk-3.3.1.tgz",
       "integrity": "sha512-jRVPdOu237QxDDoBjc9/xzGsDz75FmdvcwVZdCEg1AjHAQxGmXoHfACUyUVtz7DSWA4E+jgj5MQME4snjGwOng=="
     },
-    "@types/favico.js": {
-      "version": "0.0.28",
-      "resolved": "https://registry.npmjs.org/@types/favico.js/-/favico.js-0.0.28.tgz",
-      "integrity": "sha1-u3t8qhGCFzGNA0Zmkg1oeljWXus=",
-      "dev": true
-    },
     "@types/jquery": {
       "version": "3.5.4",
       "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.4.tgz",
index 2c82ef942138f02bffe9334ce060219449c85c08..24987ad4c3389858cbc835a2213cdb15c251a3f4 100644 (file)
@@ -2,7 +2,6 @@
   "name": "@woltlab/wcf",
   "version": "5.4.0",
   "devDependencies": {
-    "@types/favico.js": "0.0.28",
     "@types/perfect-scrollbar": "^0.6.1",
     "@typescript-eslint/eslint-plugin": "^4.6.0",
     "@typescript-eslint/parser": "^4.6.0",
index 7262838575eaadb3f05e6455d1a96ee993f900af..9f5c37dadb18e2cf04702e2d3af48ea5d04ef28a 100644 (file)
@@ -419,15 +419,17 @@ if (COMPILER_TARGET_DEFAULT) {
                        this._super($('#userNotifications'), 'userNotifications', options);
                        
                        try {
-                               this._favico = new Favico({
-                                       animation: 'none',
-                                       type: 'circle'
+                               require(["favico"], (Favico) => {
+                                       this._favico = new Favico({
+                                               animation: 'none',
+                                               type: 'circle'
+                                       });
+                                       
+                                       if (this._badge !== null) {
+                                               var $count = parseInt(this._badge.text()) || 0;
+                                               this._favico.badge($count);
+                                       }
                                });
-                               
-                               if (this._badge !== null) {
-                                       var $count = parseInt(this._badge.text()) || 0;
-                                       this._favico.badge($count);
-                               }
                        }
                        catch (e) {
                                console.debug("[WCF.User.Panel.Notification] Failed to initialized Favico: " + e.message);
index 65bec3ba5ee5b09788f34e310fb0d97f175c9954..4649f0750bd5336849d11636c659ff9d7016ec63 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", "favico.js"], 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"], 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) {
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.setup = void 0;
index 0bde2bb663eb03ebf15f3e6ff62d4f906e8055dd..9e3a44be55ebe7abee2015201fe3646a63e3521a 100644 (file)
@@ -25,9 +25,6 @@ import * as UiPageAction from "./Ui/Page/Action";
 import * as UiTabMenu from "./Ui/TabMenu";
 import * as UiTooltip from "./Ui/Tooltip";
 
-// Import favico.js into the global namespace.
-import "favico.js";
-
 // 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
 import perfectScrollbar from "perfect-scrollbar";