-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Call link/image plugins on the correct tiny6 instance #1352
Conversation
@mauritsvanrees I've tested this with |
|
||
// image plugin | ||
// eslint-disable-next-line no-unused-vars | ||
tinymce.PluginManager.add("ploneimage", (editor, url) => { |
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.
It looks like that these plugins are added globally to the imported tinymce module.
But as long as it works this code is OK to me.
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 is in fact a restore of the original plugin registration from the 5.1.x
branch here: https://github.com/plone/mockup/blob/5.1.x/src/pat/tinymce/js/links.js#L347 ... due to the fact, that in Tiny6 you cannot inject custom methods on initialization anymore, I changed the onAction
caller to simply fetch the instantinated tinypattern from the DOM and call its add(Link|Image)Clicked
method.
There might be a more "tinyish" way to use the new EditorOptions
API and register a custom callable object for this (see https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.editoroptions/) but I thought its also feasible to use patternslib API for now.
One remark though ^^ |
Sorry, I am slightly too late testing it. |
fixes #1351