From: Alexander Ebert Date: Sun, 7 May 2023 13:20:52 +0000 (+0200) Subject: The media bbcode button is injected by the bbcode plugin X-Git-Tag: 6.0.0_Alpha_1~146 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=58b72f8c99792579780c424936bb59b13b663c73;p=GitHub%2FWoltLab%2FWCF.git The media bbcode button is injected by the bbcode plugin Fixes WoltLab/editor#48 --- diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts index 786b85dfa0..2ca76e50d1 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts @@ -186,12 +186,6 @@ class ConfigurationBuilder { this.#removePlugins.push("HtmlEmbed"); } - if (this.#features.media) { - items.push("woltlabBbcode_media"); - } else { - this.#removePlugins.push("WoltlabMedia"); - } - if (items.length > 0) { this.#toolbar.push({ label: getPhrase("wcf.editor.button.group.block"), @@ -205,6 +199,12 @@ class ConfigurationBuilder { this.#toolbar.push(this.#divider); } + #setupMedia(): void { + if (!this.#features.media) { + this.#removePlugins.push("WoltlabMedia"); + } + } + #setupMention(): void { if (!this.#features.mention) { this.#removePlugins.push("Mention", "WoltlabMention"); @@ -254,6 +254,7 @@ class ConfigurationBuilder { this.#insertDivider(); + this.#setupMedia(); this.#setupMention(); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js index 2b11a0ee77..45a9f935b9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js @@ -171,12 +171,6 @@ define(["require", "exports", "../../Language"], function (require, exports, Lan else { this.#removePlugins.push("HtmlEmbed"); } - if (this.#features.media) { - items.push("woltlabBbcode_media"); - } - else { - this.#removePlugins.push("WoltlabMedia"); - } if (items.length > 0) { this.#toolbar.push({ label: (0, Language_1.getPhrase)("wcf.editor.button.group.block"), @@ -188,6 +182,11 @@ define(["require", "exports", "../../Language"], function (require, exports, Lan #insertDivider() { this.#toolbar.push(this.#divider); } + #setupMedia() { + if (!this.#features.media) { + this.#removePlugins.push("WoltlabMedia"); + } + } #setupMention() { if (!this.#features.mention) { this.#removePlugins.push("Mention", "WoltlabMention"); @@ -223,6 +222,7 @@ define(["require", "exports", "../../Language"], function (require, exports, Lan this.#setupImage(); this.#setupBlocks(); this.#insertDivider(); + this.#setupMedia(); this.#setupMention(); } toConfig() {