data-disable-attachments="true"
data-support-mention="true"
>{$comment->message}</textarea>
-{include file='messageFormTabsInline'}
+{include file='messageFormTabsInline' wysiwygContainerID=$wysiwygSelector wysiwygSelector=$wysiwygSelector}
<div class="formSubmit">
<button type="button" class="button buttonPrimary" data-type="save" accesskey="s">{lang}wcf.global.button.submit{/lang}</button>
<button type="button" class="button" data-type="cancel">{lang}wcf.global.button.cancel{/lang}</button>
</div>
-{include file='wysiwyg'}
+<script data-relocate="true">
+ require(['WoltLabSuite/Core/Component/Comment/Add'], ({ setCommentEditorFeatures }) => {
+ setCommentEditorFeatures(document.getElementById('{$wysiwygSelector}'));
+ });
+</script>
+
+{include file='wysiwyg' wysiwygSelector=$wysiwygSelector}
data-disable-attachments="true"
data-support-mention="true"
>{$response->message}</textarea>
-{include file='messageFormTabsInline'}
+{include file='messageFormTabsInline' wysiwygContainerID=$wysiwygSelector wysiwygSelector=$wysiwygSelector}
<div class="formSubmit">
<button type="button" class="button buttonPrimary" data-type="save" accesskey="s">{lang}wcf.global.button.submit{/lang}</button>
<button type="button" class="button" data-type="cancel">{lang}wcf.global.button.cancel{/lang}</button>
</div>
-{include file='wysiwyg'}
+<script data-relocate="true">
+ require(['WoltLabSuite/Core/Component/Comment/Add'], ({ setCommentEditorFeatures }) => {
+ setCommentEditorFeatures(document.getElementById('{$wysiwygSelector}'));
+ });
+</script>
+
+{include file='wysiwyg' wysiwygSelector=$wysiwygSelector}
void this.#submit();
});
- listenToCkeditor(this.#textarea).setupFeatures(({ features }) => {
- features.heading = false;
- features.quoteBlock = false;
- features.spoiler = false;
- features.table = false;
- });
+ setCommentEditorFeatures(this.#textarea);
}
/**
}
}
}
+
+export function setCommentEditorFeatures(textarea: HTMLTextAreaElement): void {
+ listenToCkeditor(textarea).setupFeatures(({ features }) => {
+ features.heading = false;
+ features.quoteBlock = false;
+ features.spoiler = false;
+ features.table = false;
+ });
+}
define(["require", "exports", "tslib", "../../Ajax", "../../Ui/Scroll", "../../Ui/Notification", "../../Language", "../../Event/Handler", "../../Dom/Util", "./GuestDialog", "../../Core", "../Ckeditor", "../Ckeditor/Event"], function (require, exports, tslib_1, Ajax_1, UiScroll, UiNotification, Language_1, EventHandler, Util_1, GuestDialog_1, Core, Ckeditor_1, Event_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
- exports.CommentAdd = void 0;
+ exports.setCommentEditorFeatures = exports.CommentAdd = void 0;
UiScroll = tslib_1.__importStar(UiScroll);
UiNotification = tslib_1.__importStar(UiNotification);
EventHandler = tslib_1.__importStar(EventHandler);
event.preventDefault();
void this.#submit();
});
- (0, Event_1.listenToCkeditor)(this.#textarea).setupFeatures(({ features }) => {
- features.heading = false;
- features.quoteBlock = false;
- features.spoiler = false;
- features.table = false;
- });
+ setCommentEditorFeatures(this.#textarea);
}
/**
* Scrolls the editor into view and sets the caret to the end of the editor.
}
}
exports.CommentAdd = CommentAdd;
+ function setCommentEditorFeatures(textarea) {
+ (0, Event_1.listenToCkeditor)(textarea).setupFeatures(({ features }) => {
+ features.heading = false;
+ features.quoteBlock = false;
+ features.spoiler = false;
+ features.table = false;
+ });
+ }
+ exports.setCommentEditorFeatures = setCommentEditorFeatures;
});