-define(['Language', 'Ui/Dialog'], function (Language, UiDialog) {
- return {
- init: function () {
- elBySelAll('.jsButtonCopyBox', undefined, (function (button) {
- button.addEventListener('click', this._click.bind(this));
- }).bind(this));
- },
- /**
- * @param {Event} event
- * @protected
- */
- _click: function (event) {
+define(["require", "exports", "tslib", "../../../Language", "../../../Ui/Dialog"], function (require, exports, tslib_1, Language, UiDialog) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.init = void 0;
+ Language = tslib_1.__importStar(Language);
+ UiDialog = tslib_1.__importStar(UiDialog);
+ class AcpUiBoxCopy {
+ constructor() {
+ document.querySelectorAll(".jsButtonCopyBox").forEach((button) => {
+ button.addEventListener("click", (ev) => this.click(ev));
+ });
+ }
+ click(event) {
event.preventDefault();
UiDialog.open(this);
- },
- _dialogSetup: function () {
+ }
+ _dialogSetup() {
return {
- id: 'acpBoxCopyDialog',
+ id: "acpBoxCopyDialog",
options: {
- title: Language.get('wcf.acp.box.copy')
- }
+ title: Language.get("wcf.acp.box.copy"),
+ },
};
}
- };
+ }
+ let acpUiBoxCopy;
+ function init() {
+ if (!acpUiBoxCopy) {
+ acpUiBoxCopy = new AcpUiBoxCopy();
+ }
+ }
+ exports.init = init;
});
+++ /dev/null
-define(['Language', 'Ui/Dialog'], function(Language, UiDialog) {
- return {
- init: function () {
- elBySelAll('.jsButtonCopyBox', undefined, (function(button) {
- button.addEventListener('click', this._click.bind(this));
- }).bind(this));
- },
-
- /**
- * @param {Event} event
- * @protected
- */
- _click: function (event) {
- event.preventDefault();
-
- UiDialog.open(this);
- },
-
- _dialogSetup: function () {
- return {
- id: 'acpBoxCopyDialog',
- options: {
- title: Language.get('wcf.acp.box.copy')
- }
- };
- }
- };
-});
--- /dev/null
+import { DialogCallbackObject, DialogCallbackSetup } from "../../../Ui/Dialog/Data";
+import * as Language from "../../../Language";
+import * as UiDialog from "../../../Ui/Dialog";
+
+class AcpUiBoxCopy implements DialogCallbackObject {
+ constructor() {
+ document.querySelectorAll(".jsButtonCopyBox").forEach((button: HTMLElement) => {
+ button.addEventListener("click", (ev) => this.click(ev));
+ });
+ }
+
+ private click(event: MouseEvent): void {
+ event.preventDefault();
+
+ UiDialog.open(this);
+ }
+
+ _dialogSetup(): ReturnType<DialogCallbackSetup> {
+ return {
+ id: "acpBoxCopyDialog",
+ options: {
+ title: Language.get("wcf.acp.box.copy"),
+ },
+ };
+ }
+}
+
+let acpUiBoxCopy: AcpUiBoxCopy;
+
+export function init(): void {
+ if (!acpUiBoxCopy) {
+ acpUiBoxCopy = new AcpUiBoxCopy();
+ }
+}