-
-
Notifications
You must be signed in to change notification settings - Fork 99
fix(pat tinymce): init plugins "help" and "emoticons" #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works perfectly, just some code comments.
@@ -264,6 +280,8 @@ export default class TinyMCE { | |||
|
|||
await self.initLanguage(); | |||
|
|||
await self.initPluginFixes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling a fixing factory I'd prefer to check these plugins in the loop above
mockup/src/pat/tinymce/tinymce--implementation.js
Lines 189 to 209 in ec95477
let valid_plugins = []; | |
// tinyMCE Plugins | |
for (const plugin of this.options.tiny.plugins) { | |
if (plugin == "plonelink" || plugin == "ploneimage") { | |
valid_plugins.push(plugin); | |
continue; | |
} else if (plugin == "template") { | |
// load backported template plugin | |
const TemplatePlugin = (await import("./js/template")).default; | |
TemplatePlugin(); | |
valid_plugins.push(plugin); | |
continue; | |
} | |
try { | |
await import("tinymce/plugins/" + plugin); | |
valid_plugins.push(plugin); | |
} catch { | |
log.debug("Could not load TinyMCE plugin: ", plugin); | |
} | |
} | |
this.options.tiny.plugins = valid_plugins; |
here are already some "if/else if -> continue" checks for other plugins ... that would be the place for me to search for customizations in plugin loading.
This would also need to put the await self.initLanguage();
before this loop, but that's fine.
What you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For even better readability we could refactor the whole plugin loading loop into a class function ...
@petschki Done, I have implemented your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've tried this also with pt_BR
and de_CH
and it works.
can you make a new release of plone.staticresources? |
Preparing it here, but I need to look closer at #1468 because the tab markup has changed and the autotoc id generator seems to be broken ... |
fix to load the chunk files for init the plugins correctly
enable the Plugins "help" and "emoticons" in the Tinymce Controlpanel under "Plugins and Toolbar"
in the "menu" config enable emoticons and change the entry to: