/**
* Data handler for the poll options.
*
- * @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/Wysiwyg/Poll
- * @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/Wysiwyg/Poll
+ * @since 5.2
*/
-define(['Core', '../Field'], function(Core, FormBuilderField) {
- "use strict";
-
- /**
- * @constructor
- */
- function FormBuilderFieldPoll(fieldId) {
- this.init(fieldId);
- };
- Core.inherit(FormBuilderFieldPoll, FormBuilderField, {
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
- */
- _getData: function() {
- return this._pollEditor.getData();
- },
-
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_readField
- */
- _readField: function() {
- // does nothing
- },
-
- /**
- *
- * @param {WoltLabSuite/Core/Ui/Poll/Editor} pollEditor
- */
- setPollEditor: function(pollEditor) {
- this._pollEditor = pollEditor;
- }
- });
-
- return FormBuilderFieldPoll;
+define(["require", "exports", "tslib", "../Field", "../../../../Core"], function (require, exports, tslib_1, Field_1, Core) {
+ "use strict";
+ Field_1 = tslib_1.__importDefault(Field_1);
+ Core = tslib_1.__importStar(Core);
+ class Poll extends Field_1.default {
+ _getData() {
+ return this._pollEditor.getData();
+ }
+ _readField() {
+ // does nothing
+ }
+ setPollEditor(pollEditor) {
+ this._pollEditor = pollEditor;
+ }
+ }
+ Core.enableLegacyInheritance(Poll);
+ return Poll;
});
--- /dev/null
+/**
+ * Data handler for the poll options.
+ *
+ * @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/Wysiwyg/Poll
+ * @since 5.2
+ */
+
+import Field from "../Field";
+import * as Core from "../../../../Core";
+import { FormBuilderData } from "../../Data";
+import UiPollEditor from "../../../../Ui/Poll/Editor";
+
+class Poll extends Field {
+ protected _pollEditor: UiPollEditor;
+
+ protected _getData(): FormBuilderData {
+ return this._pollEditor.getData();
+ }
+
+ protected _readField(): void {
+ // does nothing
+ }
+
+ public setPollEditor(pollEditor: UiPollEditor): void {
+ this._pollEditor = pollEditor;
+ }
+}
+
+Core.enableLegacyInheritance(Poll);
+
+export = Poll;