RichFilemanager icon indicating copy to clipboard operation
RichFilemanager copied to clipboard

TinyMCE 5 compatibility issue

Open Draghmar opened this issue 7 years ago • 5 comments

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.

Draghmar avatar Jan 22 '19 10:01 Draghmar

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" }, { });

ahmadasm avatar Mar 11 '20 11:03 ahmadasm

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.

SimJH avatar Jun 11 '21 08:06 SimJH

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/

ahmadasm avatar Jun 12 '21 10:06 ahmadasm

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?

SimJH avatar Jun 13 '21 11:06 SimJH

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();
	}
}

SimJH avatar Jun 13 '21 13:06 SimJH