TinyMCE modal box dialog box

I want to make a button, and when she clicked, a modal checkbox will appear where the user must enter the URL, click "Paste", and then the URL will be inserted into the editor. So far I have added a button and opened a modal box, but how can I return these values? Thank.

+3
source share
1 answer

If you use window.showModalDialog to open your modal dialog, then according to MSDN , it looks like you can return a value from a modal dialog by setting the returnValue property in the window. It looks like it will work in Firefox too, based on the Mozilla documentation . In the dialog box, you must set the returnValue property:

window.returnValue = GetTheUrlThatWasTypedIn();

And then in the parent window, extract it into a variable when opening a modal dialog:

var theUrl = window.showModalDialog(/* parameters go here */);
0
source

Source: https://habr.com/ru/post/1748827/


All Articles