Skip to content
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

TinyMCE 5 compatibility issue #376

Open
7 tasks done
Draghmar opened this issue Jan 22, 2019 · 5 comments
Open
7 tasks done

TinyMCE 5 compatibility issue #376

Draghmar opened this issue Jan 22, 2019 · 5 comments

Comments

@Draghmar
Copy link

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the Wiki. Especially deploy and configuration articles.
  • I have checked that the bug I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • 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.
  • 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):

  • PHP connector by servocoder

My familiarity with the project is as follows (check one):

  • 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.

@ahmadasm
Copy link

ahmadasm commented Mar 11, 2020

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

@SimJH
Copy link

SimJH commented Jun 11, 2021

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.

@ahmadasm
Copy link

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/

@SimJH
Copy link

SimJH commented Jun 13, 2021

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
Copy link

SimJH commented Jun 13, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants