force: {if $forceBackgroundQueuePerform|isset}true{else}false{/if}
},
enableUserPopover: {if $__wcf->getSession()->getPermission('user.profile.canViewUserProfile')}true{else}false{/if},
+ executeCronjobs: {if $executeCronjobs}true{else}false{/if},
styleChanger: {if $__wcf->getStyleHandler()->showStyleChanger()}true{else}false{/if}
});
{event name='javascriptInit'}
- {if $executeCronjobs}
- new WCF.Action.Proxy({
- autoSend: true,
- data: {
- className: 'wcf\\data\\cronjob\\CronjobAction',
- actionName: 'executeCronjobs'
- },
- showLoadingOverlay: false,
- failure: function() {
- return false;
- }
- });
- {/if}
-
{if ENABLE_POLLING && $__wcf->user->userID}
require(['WoltLabSuite/Core/Notification/Handler'], function(NotificationHandler) {
NotificationHandler.setup({
import * as UiUserIgnore from "./Ui/User/Ignore";
import * as UiPageHeaderMenu from "./Ui/Page/Header/Menu";
import * as UiMessageUserConsent from "./Ui/Message/UserConsent";
+import * as Ajax from "./Ajax";
interface BoostrapOptions {
backgroundQueue: {
force: boolean;
};
enableUserPopover: boolean;
+ executeCronjobs: boolean;
styleChanger: boolean;
}
_initUserPopover();
}
+ if (options.executeCronjobs) {
+ Ajax.apiOnce({
+ data: {
+ className: "wcf\\data\\cronjob\\CronjobAction",
+ actionName: "executeCronjobs",
+ },
+ failure: () => false,
+ silent: true,
+ });
+ }
+
BackgroundQueue.setUrl(options.backgroundQueue.url);
if (Math.random() < 0.1 || options.backgroundQueue.force) {
// invoke the queue roughly every 10th request or on demand
* @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"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, ControllerStyleChanger, ControllerPopover, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent) {
+define(["require", "exports", "tslib", "./BackgroundQueue", "./Bootstrap", "./Controller/Style/Changer", "./Controller/Popover", "./Ui/User/Ignore", "./Ui/Page/Header/Menu", "./Ui/Message/UserConsent", "./Ajax"], function (require, exports, tslib_1, BackgroundQueue, Bootstrap, ControllerStyleChanger, ControllerPopover, UiUserIgnore, UiPageHeaderMenu, UiMessageUserConsent, Ajax) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setup = void 0;
UiUserIgnore = tslib_1.__importStar(UiUserIgnore);
UiPageHeaderMenu = tslib_1.__importStar(UiPageHeaderMenu);
UiMessageUserConsent = tslib_1.__importStar(UiMessageUserConsent);
+ Ajax = tslib_1.__importStar(Ajax);
/**
* Initializes user profile popover.
*/
if (options.enableUserPopover) {
_initUserPopover();
}
+ if (options.executeCronjobs) {
+ Ajax.apiOnce({
+ data: {
+ className: "wcf\\data\\cronjob\\CronjobAction",
+ actionName: "executeCronjobs",
+ },
+ failure: () => false,
+ silent: true,
+ });
+ }
BackgroundQueue.setUrl(options.backgroundQueue.url);
if (Math.random() < 0.1 || options.backgroundQueue.force) {
// invoke the queue roughly every 10th request or on demand