-define(['Language', 'Ui/Dialog'], function (Language, UiDialog) {
- return {
- init: function () {
- elBySelAll('.jsButtonCopyPage', 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, Dialog_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.init = void 0;
+ Language = tslib_1.__importStar(Language);
+ Dialog_1 = tslib_1.__importDefault(Dialog_1);
+ class AcpUiPageCopy {
+ constructor() {
+ document.querySelectorAll(".jsButtonCopyPage").forEach((button) => {
+ button.addEventListener("click", (ev) => this.click(ev));
+ });
+ }
+ click(event) {
event.preventDefault();
- UiDialog.open(this);
- },
- _dialogSetup: function () {
+ Dialog_1.default.open(this);
+ }
+ _dialogSetup() {
return {
- id: 'acpPageCopyDialog',
+ id: "acpPageCopyDialog",
options: {
- title: Language.get('wcf.acp.page.copy')
- }
+ title: Language.get("wcf.acp.page.copy"),
+ },
};
}
- };
+ }
+ let acpUiPageCopy;
+ function init() {
+ if (!acpUiPageCopy) {
+ acpUiPageCopy = new AcpUiPageCopy();
+ }
+ }
+ exports.init = init;
});
+++ /dev/null
-define(['Language', 'Ui/Dialog'], function(Language, UiDialog) {
- return {
- init: function () {
- elBySelAll('.jsButtonCopyPage', 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: 'acpPageCopyDialog',
- options: {
- title: Language.get('wcf.acp.page.copy')
- }
- };
- }
- };
-});
--- /dev/null
+import { DialogCallbackObject, DialogCallbackSetup } from "../../../Ui/Dialog/Data";
+import * as Language from "../../../Language";
+import UiDialog from "../../../Ui/Dialog";
+
+class AcpUiPageCopy implements DialogCallbackObject {
+ constructor() {
+ document.querySelectorAll(".jsButtonCopyPage").forEach((button: HTMLAnchorElement) => {
+ button.addEventListener("click", (ev) => this.click(ev));
+ });
+ }
+
+ private click(event: MouseEvent): void {
+ event.preventDefault();
+
+ UiDialog.open(this);
+ }
+
+ _dialogSetup(): ReturnType<DialogCallbackSetup> {
+ return {
+ id: "acpPageCopyDialog",
+ options: {
+ title: Language.get("wcf.acp.page.copy"),
+ },
+ };
+ }
+}
+
+let acpUiPageCopy: AcpUiPageCopy;
+
+export function init(): void {
+ if (!acpUiPageCopy) {
+ acpUiPageCopy = new AcpUiPageCopy();
+ }
+}