From 8877755ee3cf228003877c7ba23a9a80e846df70 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 12 Dec 2020 15:36:32 +0100 Subject: [PATCH] Convert `Form/Builder/Field/Wysiwyg/Attachment` to TypeScript --- .../Form/Builder/Field/Wysiwyg/Attachment.js | 28 +++++++++---------- .../Form/Builder/Field/Wysiwyg/Attachment.js | 22 --------------- .../Form/Builder/Field/Wysiwyg/Attachment.ts | 22 +++++++++++++++ 3 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js create mode 100644 wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.ts diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js index cdb17a6ed8..2a7d04c86e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js @@ -1,21 +1,21 @@ /** * Data handler for a wysiwyg attachment form builder field that stores the temporary hash. * - * @author Matthias Schmidt - * @copyright 2001-2019 WoltLab GmbH - * @license GNU Lesser General Public License - * @module WoltLabSuite/Core/Form/Builder/Field/Checked - * @since 5.2 + * @author Matthias Schmidt + * @copyright 2001-2020 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Form/Builder/Field/Field/Wysiwyg/Attachment + * @since 5.2 */ -define(['Core', '../Value'], function (Core, FormBuilderFieldValue) { +define(["require", "exports", "tslib", "../Value", "../../../../Core"], function (require, exports, tslib_1, Value_1, Core) { "use strict"; - /** - * @constructor - */ - function FormBuilderFieldAttachment(fieldId) { - this.init(fieldId + '_tmpHash'); + Value_1 = tslib_1.__importDefault(Value_1); + Core = tslib_1.__importStar(Core); + class Attachment extends Value_1.default { + constructor(fieldId) { + super(fieldId + "_tmpHash"); + } } - ; - Core.inherit(FormBuilderFieldAttachment, FormBuilderFieldValue, {}); - return FormBuilderFieldAttachment; + Core.enableLegacyInheritance(Attachment); + return Attachment; }); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js b/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js deleted file mode 100644 index e287068b49..0000000000 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Data handler for a wysiwyg attachment form builder field that stores the temporary hash. - * - * @author Matthias Schmidt - * @copyright 2001-2019 WoltLab GmbH - * @license GNU Lesser General Public License - * @module WoltLabSuite/Core/Form/Builder/Field/Checked - * @since 5.2 - */ -define(['Core', '../Value'], function(Core, FormBuilderFieldValue) { - "use strict"; - - /** - * @constructor - */ - function FormBuilderFieldAttachment(fieldId) { - this.init(fieldId + '_tmpHash'); - }; - Core.inherit(FormBuilderFieldAttachment, FormBuilderFieldValue, {}); - - return FormBuilderFieldAttachment; -}); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.ts new file mode 100644 index 0000000000..76f8cba609 --- /dev/null +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.ts @@ -0,0 +1,22 @@ +/** + * Data handler for a wysiwyg attachment form builder field that stores the temporary hash. + * + * @author Matthias Schmidt + * @copyright 2001-2020 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Form/Builder/Field/Field/Wysiwyg/Attachment + * @since 5.2 + */ + +import Value from "../Value"; +import * as Core from "../../../../Core"; + +class Attachment extends Value { + constructor(fieldId: string) { + super(fieldId + "_tmpHash"); + } +} + +Core.enableLegacyInheritance(Attachment); + +export = Attachment; -- 2.20.1