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>
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>();
element: HTMLElement,
features: Features,
bbcodes: WoltlabBbcodeItem[],
- smileys: WoltlabSmileyItem[],
codeBlockLanguages: CKEditor5.CodeBlock.CodeBlockConfig["languages"],
modules: typeof CKEditor5,
): CKEditor5.Core.EditorConfig {
};
configuration.woltlabBbcode = bbcodes;
- configuration.woltlabSmileys = smileys;
if (features.autosave !== "") {
initializeAutosave(element, configuration, features.autosave);
element: HTMLElement,
features: Features,
bbcodes: WoltlabBbcodeItem[],
- smileys: WoltlabSmileyItem[],
codeBlockLanguages: CKEditor5.CodeBlock.CodeBlockConfig["languages"],
licenseKey: string,
): Promise<CKEditor> {
setupQuote(element);
}
- const configuration = initializeConfiguration(element, features, bbcodes, smileys, codeBlockLanguages, CKEditor5);
+ const configuration = initializeConfiguration(element, features, bbcodes, codeBlockLanguages, CKEditor5);
if (licenseKey) {
configuration.licenseKey = licenseKey;
}
}
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);
}
(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.`);
}
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;
}