Remove smiley from ckeditor initialization
authorCyperghost <olaf_schmitz_1@t-online.de>
Tue, 15 Oct 2024 06:33:59 +0000 (08:33 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Tue, 15 Oct 2024 06:33:59 +0000 (08:33 +0200)
com.woltlab.wcf/templates/shared_wysiwyg.tpl
ts/WoltLabSuite/Core/Component/Ckeditor.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js

index 543552246c5448b3c2fa016fbe18efe00c86c884..f8875342848e3a60c4ba9592edce961990fbb100 100644 (file)
                                label: '{jslang}wcf.editor.button.media{/jslang}',
                        });
                }
-               const smileys = [
-                       {foreach from=$__wcf->getSmileyCache()->getEmojis() key=__code item=__smiley}
-                       {
-                               code: '{@$__code|encodeJS}',
-                               html: '{@$__smiley->getHtml()|encodeJS}',
-                       },
-                       {/foreach}
-               ];
 
                const codeBlockLanguages = [
                        { language: "", label: '{jslang}wcf.editor.code.highlighter.detect{/jslang}' },
                        {/foreach}
                ];
 
-               void setupCkeditor(element, features, bbcodes, smileys, codeBlockLanguages, '{@$__wcf->getBBCodeHandler()->getCkeditorLicenseKey()|encodeJS}');
+               void setupCkeditor(element, features, bbcodes, codeBlockLanguages, '{@$__wcf->getBBCodeHandler()->getCkeditorLicenseKey()|encodeJS}');
        });
 </script>
index 257a6727841b393f6255d58d1d3e950a2287fed2..637a8778f0ad92c8cb440b14f49bb18d4cae5cb3 100644 (file)
@@ -28,7 +28,6 @@ import Devtools from "../Devtools";
 import { setupSubmitShortcut } from "./Ckeditor/Keyboard";
 import { setup as setupLayer } from "./Ckeditor/Layer";
 import { browser, touch } from "../Environment";
-import { WoltlabSmileyItem } from "@woltlab/editor/plugins/ckeditor5-woltlab-smiley";
 
 const instances = new WeakMap<HTMLElement, CKEditor>();
 
@@ -215,7 +214,6 @@ function initializeConfiguration(
   element: HTMLElement,
   features: Features,
   bbcodes: WoltlabBbcodeItem[],
-  smileys: WoltlabSmileyItem[],
   codeBlockLanguages: CKEditor5.CodeBlock.CodeBlockConfig["languages"],
   modules: typeof CKEditor5,
 ): CKEditor5.Core.EditorConfig {
@@ -225,7 +223,6 @@ function initializeConfiguration(
   };
 
   configuration.woltlabBbcode = bbcodes;
-  configuration.woltlabSmileys = smileys;
 
   if (features.autosave !== "") {
     initializeAutosave(element, configuration, features.autosave);
@@ -275,7 +272,6 @@ export async function setupCkeditor(
   element: HTMLElement,
   features: Features,
   bbcodes: WoltlabBbcodeItem[],
-  smileys: WoltlabSmileyItem[],
   codeBlockLanguages: CKEditor5.CodeBlock.CodeBlockConfig["languages"],
   licenseKey: string,
 ): Promise<CKEditor> {
@@ -304,7 +300,7 @@ export async function setupCkeditor(
     setupQuote(element);
   }
 
-  const configuration = initializeConfiguration(element, features, bbcodes, smileys, codeBlockLanguages, CKEditor5);
+  const configuration = initializeConfiguration(element, features, bbcodes, codeBlockLanguages, CKEditor5);
   if (licenseKey) {
     configuration.licenseKey = licenseKey;
   }
index 89412aec808897205f1688e6af353d915d3b326e..bed4524ba802de7e994aa22a75757765239db0ff 100644 (file)
@@ -154,13 +154,12 @@ define(["require", "exports", "tslib", "./Ckeditor/Attachment", "./Ckeditor/Medi
         }
         Object.freeze(features);
     }
-    function initializeConfiguration(element, features, bbcodes, smileys, codeBlockLanguages, modules) {
+    function initializeConfiguration(element, features, bbcodes, codeBlockLanguages, modules) {
         const configuration = (0, Configuration_1.createConfigurationFor)(features);
         configuration.codeBlock = {
             languages: codeBlockLanguages,
         };
         configuration.woltlabBbcode = bbcodes;
-        configuration.woltlabSmileys = smileys;
         if (features.autosave !== "") {
             (0, Autosave_1.initializeAutosave)(element, configuration, features.autosave);
         }
@@ -197,7 +196,7 @@ define(["require", "exports", "tslib", "./Ckeditor/Attachment", "./Ckeditor/Medi
             (0, Event_1.dispatchToCkeditor)(element).changeData();
         });
     }
-    async function setupCkeditor(element, features, bbcodes, smileys, codeBlockLanguages, licenseKey) {
+    async function setupCkeditor(element, features, bbcodes, codeBlockLanguages, licenseKey) {
         if (instances.has(element)) {
             throw new TypeError(`Cannot initialize the editor for '${element.id}' twice.`);
         }
@@ -217,7 +216,7 @@ define(["require", "exports", "tslib", "./Ckeditor/Attachment", "./Ckeditor/Medi
         if (features.quoteBlock) {
             (0, Quote_1.setup)(element);
         }
-        const configuration = initializeConfiguration(element, features, bbcodes, smileys, codeBlockLanguages, CKEditor5);
+        const configuration = initializeConfiguration(element, features, bbcodes, codeBlockLanguages, CKEditor5);
         if (licenseKey) {
             configuration.licenseKey = licenseKey;
         }