From: joshuaruesweg Date: Wed, 16 Jun 2021 09:26:59 +0000 (+0200) Subject: Add `SendNewPasswordAction` X-Git-Tag: 5.5.0_Alpha_1~479^2~18 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43659c9a0613f1ee91770fcad060e3f3e06f3293;p=GitHub%2FWoltLab%2FWCF.git Add `SendNewPasswordAction` --- diff --git a/ts/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.ts b/ts/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.ts new file mode 100644 index 0000000000..53d2555e25 --- /dev/null +++ b/ts/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.ts @@ -0,0 +1,35 @@ +import * as EventHandler from "../../../../Event/Handler"; +import * as Language from "../../../../Language"; +import AbstractUserAction from "./AbstractUserAction"; + +/** + * @author Joshua Ruesweg + * @copyright 2001-2021 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Acp/Ui/User/Action + * @since 5.5 + */ +export class SendNewPasswordAction extends AbstractUserAction { + protected init() { + this.button.addEventListener("click", (event) => { + event.preventDefault(); + + // emulate clipboard selection + EventHandler.fire("com.woltlab.wcf.clipboard", "com.woltlab.wcf.user", { + data: { + actionName: "com.woltlab.wcf.user.sendNewPassword", + parameters: { + confirmMessage: Language.get("wcf.acp.user.action.sendNewPassword.confirmMessage"), + objectIDs: [this.userId], + }, + }, + responseData: { + actionName: "com.woltlab.wcf.user.sendNewPassword", + objectIDs: [this.userId], + }, + }); + }); + } +} + +export default SendNewPasswordAction; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.js new file mode 100644 index 0000000000..2714c94180 --- /dev/null +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction.js @@ -0,0 +1,38 @@ +define(["require", "exports", "tslib", "../../../../Event/Handler", "../../../../Language", "./AbstractUserAction"], function (require, exports, tslib_1, EventHandler, Language, AbstractUserAction_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SendNewPasswordAction = void 0; + EventHandler = tslib_1.__importStar(EventHandler); + Language = tslib_1.__importStar(Language); + AbstractUserAction_1 = tslib_1.__importDefault(AbstractUserAction_1); + /** + * @author Joshua Ruesweg + * @copyright 2001-2021 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Acp/Ui/User/Action + * @since 5.5 + */ + class SendNewPasswordAction extends AbstractUserAction_1.default { + init() { + this.button.addEventListener("click", (event) => { + event.preventDefault(); + // emulate clipboard selection + EventHandler.fire("com.woltlab.wcf.clipboard", "com.woltlab.wcf.user", { + data: { + actionName: "com.woltlab.wcf.user.sendNewPassword", + parameters: { + confirmMessage: Language.get("wcf.acp.user.action.sendNewPassword.confirmMessage"), + objectIDs: [this.userId], + }, + }, + responseData: { + actionName: "com.woltlab.wcf.user.sendNewPassword", + objectIDs: [this.userId], + }, + }); + }); + } + } + exports.SendNewPasswordAction = SendNewPasswordAction; + exports.default = SendNewPasswordAction; +});