throw new Error("Unable to find the source element '{$wysiwygSelector|encodeJS}' for the editor.")
}
+ let enableAttachments = element.dataset.disableAttachments !== "true";
+ {if !$attachmentHandler|empty && !$attachmentHandler->canUpload()}
+ enableAttachments = false;
+ {/if}
+
const features = {
alignment: true,
- attachment: element.dataset.disableAttachments !== "true",
+ attachment: enableAttachments,
autosave: element.dataset.autosave || "",
code: true,
codeBlock: true,
#setupImage(): void {
if (this.#features.image) {
this.#toolbar.push("insertImage");
+
+ if (!this.#features.attachment) {
+ this.#removePlugins.push("ImageUpload", "ImageUploadUI", "WoltlabAttachment");
+ }
} else {
this.#removePlugins.push("ImageInsertUI", "ImageToolbar", "ImageStyle", "ImageUpload", "ImageUploadUI");
throw new Error("Unable to find the source element '{$wysiwygSelector|encodeJS}' for the editor.")
}
+ let enableAttachments = element.dataset.disableAttachments !== "true";
+ {if !$attachmentHandler|empty && !$attachmentHandler->canUpload()}
+ enableAttachments = false;
+ {/if}
+
const features = {
alignment: true,
- attachment: element.dataset.disableAttachments !== "true",
+ attachment: enableAttachments,
autosave: element.dataset.autosave || "",
code: true,
codeBlock: true,
#setupImage() {
if (this.#features.image) {
this.#toolbar.push("insertImage");
+ if (!this.#features.attachment) {
+ this.#removePlugins.push("ImageUpload", "ImageUploadUI", "WoltlabAttachment");
+ }
}
else {
this.#removePlugins.push("ImageInsertUI", "ImageToolbar", "ImageStyle", "ImageUpload", "ImageUploadUI");