Convert `Form/Builder/Field/Wysiwyg/Attachment` to TypeScript
authorMatthias Schmidt <gravatronics@live.com>
Sat, 12 Dec 2020 14:36:32 +0000 (15:36 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 15 Dec 2020 17:23:05 +0000 (18:23 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js [deleted file]
wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.ts [new file with mode: 0644]

index cdb17a6ed853431a33786518a764b4e6983d88b8..2a7d04c86ebe7d7f206b74c4ad34bcffb2cf4a57 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
- * @module     WoltLabSuite/Core/Form/Builder/Field/Checked
- * @since      5.2
+ * @author  Matthias Schmidt
+ * @copyright 2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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 (file)
index e287068..0000000
+++ /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 <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index 0000000..76f8cba
--- /dev/null
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
+ * @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;