diff --git a/lib/client/editorConfig.ts b/lib/client/editorConfig.ts index 7af8f88..9c4742b 100644 --- a/lib/client/editorConfig.ts +++ b/lib/client/editorConfig.ts @@ -1,6 +1,18 @@ +const plugins = + "a11ychecker advcode advtable advtemplate typography casechange checklist editimage mediaembed export footnotes formatpainter inlinecss mergetags pageembed permanentpen powerpaste autocorrect tableofcontents accordion advlist anchor autolink autoresize autosave charmap code codesample directionality emoticons fullscreen help image importcss insertdatetime link lists media nonbreaking pagebreak preview quickbars save searchreplace table template visualblocks visualchars wordcount".split( + " ", + ); +const reducer = (pv, cv) => { + return { ...pv, [cv]: `plugins/${cv}/plugin.min.js` }; +}; + +const external_plugins = plugins.reduce((pv, cv) => { + return { ...pv, [cv]: `plugins/${cv}/plugin.min.js` }; +}, {}); +const base_url = "/tinymce"; export const fancy = { branding: false, - selector: "textarea#txt", + base_url, menubar: false, elementpath: false, formats: { @@ -31,12 +43,12 @@ export const fancy = { items: [ { title: "Image Left", - selector: "img", + styles: { float: "left", margin: "0 10px 0 10px" }, }, { title: "Image Right", - selector: "img", + styles: { float: "right", margin: "0 0 10px 10px" }, }, { title: "Rounded corners", styles: { "border-radius": "0.7em" } }, @@ -44,7 +56,7 @@ export const fancy = { }, { title: "Code/Monospace", - selector: "p,div,h1,h2,h3,h4,h5,h6", + classes: ["font-mono"], }, ], @@ -62,16 +74,11 @@ export const fancy = { }, toolbar: "undo redo | paste | bold italic underline | hr image link | forecolor styles | heading alignment | code", contextmenu: "bold italic underline | hr | link | image | paste", - external_plugins: { - mentions: "/plugins/mentions/plugin.min.js", - }, - plugins: - `advlist autolink lists link image charmap preview anchor searchreplace visualblocks advcode fullscreen insertdatetime media table help wordcount save mentions`.split( - " ", - ), + external_plugins, }; export const comment = { branding: false, + base_url, height: 200, menubar: false, elementpath: false, @@ -86,21 +93,15 @@ export const comment = { inline: "u", }, }, - external_plugins: { - mentions: "/plugins/mentions/plugin.min.js", - }, schema: "html5", - plugins: - `advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table code help save mentions`.split( - " ", - ), + external_plugins, toolbar: "bold italic underline | link", contextmenu: "bold italic underline | paste | link", }; export const story = { + base_url, branding: false, - selector: "textarea#txt", height: 500, menubar: false, elementpath: false, @@ -117,14 +118,12 @@ export const story = { }, content_css: ["/test.css", "/quickfix.css"], schema: "html5", - plugins: - `advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table advcode help wordcount save`.split( - " ", - ), + external_plugins, toolbar: "undo redo | paste |" + "bold italic underline | hr | alignleft aligncenter " + "alignright alignjustify | " + "| code", contextmenu: "bold italic underline | hr | paste | link", }; export const bare = { + base_url, branding: false, height: 200, menubar: false, @@ -141,13 +140,7 @@ export const bare = { }, }, schema: "html5", - external_plugins: { - mentions: "/plugins/mentions/plugin.min.js", - }, - plugins: - `advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table advcode help save mentions`.split( - " ", - ), + external_plugins, toolbar: "bold italic underline | hr link", contextmenu: "bold italic underline | paste | hr link", };