TinyMCE 5 compatibility issue
In raising this issue, I confirm the following (please check boxes):
- [x] I have read and understood the Wiki. Especially deploy and configuration articles.
- [x] I have checked that the bug I am reporting can be replicated, or that the feature I am suggesting isn't already present.
- [x] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
- [x] I realise that server-side connectors are provided by various contributors. The implementations are vary due to programming language features/limitations or other factors. Thus a particular connector may not implement, or partially implement, the API features.
- [x] I realise that any changes in configuration options and/or plugin parameters affect the plugin behavior. I specified all the differences from defaults in details.
I use the following server-side connector (check one):
- [x] PHP connector by servocoder
My familiarity with the project is as follows (check one):
- [x] I have used the project briefly.
Hi.
TinyMCE is going to v5 and it breaks many things with previous version.
First of all is remove of file_browser_callback that is replaced with file_picker_callback. It works a little bit different by using callback function that inserts url along with optional attributes. My suggestion is to add new parameter that would recognize that it's v5 similar to current field_name that would get this callback function and do some magic with it. ;)
Second issue is making tinyMCE.activeEditor.windowManager.open much more restricted. I don't know if it's still possible to use TinyMCE directly to show file manager. Of course there is an option to use window.open but that would mean getting back a few years when there was no popup on layer...Or implementing own solution.
instead of tinyMCE.activeEditor.windowManager.open, you can use tinyMCE.activeEditor.windowManager.openUrl({ url: 'custom url', title: 'custom title', width: WinWidth, height: WinHeight, resizable : "yes", close_previous : "no" }, { });
I checked to open the rich file browser through the openUrl function.
How can I get the return value if I select the image?
I'd appreciate it if you could help me.
When your are initializing tinemce set this variables like this:
...
file_picker_types: 'image file media',
file_picker_callback:function(callback, value, meta){
...
tinyMCE.activeEditor.windowManager.openUrl(_urlDialogConfig);
},
...
This set the value automatically.
https://www.tiny.cloud/docs/configure/file-image-upload/
When Tinymce was initialized, I gave the parameters and opened rich file manager.
but, when i select an image and press the SELECT button, there is no response.
I can't get the image to text editor. Do you know what to do?
I found the following code in filemanager.js.
When executing the openurl function,
I confirmed that the parameter "field_name" should be sent.
The problem is that the "field_name" of the source input is variable,
so I don't know how to send it. Do you have any ideas?
// tinymce 4 and colorbox
if(_url_.param('field_name')) {
parent.document.getElementById(_url_.param('field_name')).value = previewUrl;
if(typeof parent.tinyMCE !== "undefined") {
parent.tinyMCE.activeEditor.windowManager.close();
}
if(typeof parent.$.fn.colorbox !== "undefined") {
parent.$.fn.colorbox.close();
}
}