From: joshuaruesweg Date: Mon, 9 Aug 2021 09:59:19 +0000 (+0200) Subject: Add `callbackSuccess` support for `AcpUserContentRemoveHandler` X-Git-Tag: 5.5.0_Alpha_1~479^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e76907e0c1d46f664822b84494026c0065c6e39a;p=GitHub%2FWoltLab%2FWCF.git Add `callbackSuccess` support for `AcpUserContentRemoveHandler` --- diff --git a/ts/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.ts b/ts/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.ts index fa87386b89..3e84f9e938 100644 --- a/ts/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.ts +++ b/ts/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.ts @@ -15,6 +15,16 @@ import UiDialog from "../../../../../Ui/Dialog"; import { AjaxCallbackSetup } from "../../../../../Ajax/Data"; import { DialogCallbackSetup } from "../../../../../Ui/Dialog/Data"; +type CallbackSuccess = (data: AjaxResponseSuccess) => void; + +interface AjaxResponseSuccess { + loopCount: number; + parameters: ArbitraryObject; + proceedURL: string; + progress: number; + template?: string; +} + interface AjaxResponse { returnValues: { template: string; @@ -24,13 +34,15 @@ interface AjaxResponse { class AcpUserContentRemoveHandler { private readonly dialogId: string; private readonly userId: number; + private readonly callbackSuccess: CallbackSuccess | null | undefined; /** * Initializes the content remove handler. */ - constructor(element: HTMLElement, userId: number) { + constructor(element: HTMLElement, userId: number, callbackSuccess?: CallbackSuccess | null) { this.userId = userId; this.dialogId = `userRemoveContentHandler-${this.userId}`; + this.callbackSuccess = callbackSuccess; element.addEventListener("click", (ev) => this.click(ev)); } @@ -59,6 +71,7 @@ class AcpUserContentRemoveHandler { userID: this.userId, contentProvider: objectTypes, }, + callbackSuccess: this.callbackSuccess, }); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.js index 20b97f5e16..ae4dd3e0fb 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler.js @@ -17,9 +17,10 @@ define(["require", "exports", "tslib", "../../../Worker", "../../../../../Ajax", /** * Initializes the content remove handler. */ - constructor(element, userId) { + constructor(element, userId, callbackSuccess) { this.userId = userId; this.dialogId = `userRemoveContentHandler-${this.userId}`; + this.callbackSuccess = callbackSuccess; element.addEventListener("click", (ev) => this.click(ev)); } /** @@ -43,6 +44,7 @@ define(["require", "exports", "tslib", "../../../Worker", "../../../../../Ajax", userID: this.userId, contentProvider: objectTypes, }, + callbackSuccess: this.callbackSuccess, }); } /**