Swap the inline code and code editor buttons
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Nov 2023 12:40:15 +0000 (13:40 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Nov 2023 12:40:15 +0000 (13:40 +0100)
The code block is more likely to be used and the inline code being the first one makes it easy to misuse it for larger blocks.

ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js

index 98e816c71c101b745b301baaa787deb6a541c261..f3ac00b3f3a4b2ab335b04090c9aab400079ff61 100644 (file)
@@ -165,17 +165,17 @@ class ConfigurationBuilder {
   }
 
   #setupCodeFormat(): void {
-    if (this.#features.code) {
-      this.#toolbar.push("code");
-    } else {
-      this.#removePlugins.push("Code", "WoltlabCode");
-    }
-
     if (this.#features.codeBlock) {
       this.#toolbar.push("codeBlock");
     } else {
       this.#removePlugins.push("CodeBlock", "WoltlabCodeBlock");
     }
+
+    if (this.#features.code) {
+      this.#toolbar.push("code");
+    } else {
+      this.#removePlugins.push("Code", "WoltlabCode");
+    }
   }
 
   #setupBlocks(): void {
index 3def50882409d102b40cd46ed40ddc11c0a0c95b..687404b063491952d7591ec9d9ca4c64f487f3cf 100644 (file)
@@ -149,18 +149,18 @@ define(["require", "exports", "../../Language"], function (require, exports, Lan
             }
         }
         #setupCodeFormat() {
-            if (this.#features.code) {
-                this.#toolbar.push("code");
-            }
-            else {
-                this.#removePlugins.push("Code", "WoltlabCode");
-            }
             if (this.#features.codeBlock) {
                 this.#toolbar.push("codeBlock");
             }
             else {
                 this.#removePlugins.push("CodeBlock", "WoltlabCodeBlock");
             }
+            if (this.#features.code) {
+                this.#toolbar.push("code");
+            }
+            else {
+                this.#removePlugins.push("Code", "WoltlabCode");
+            }
         }
         #setupBlocks() {
             if (this.#features.table) {