TinyMCE custom pop-up menu button

I add a button to the TinyMCE setting as follows:

setup : function(ed) { // Add a custom button ed.addButton('mybutton', { title : 'My button', image : 'mybutton.jpg', onclick : function() { // Add you own code to execute something on click ed.focus(); ed.selection.setContent('Hello world!'); } }); }, 

I don't know if it is possible to open a popup in the onclick event and get some input from the popup. Which can then be inserted into the editor. Just like if you are making a plugin, I just want to create my own without using the whole style and functions of the plugin.

Thanks in advance.

+4
source share
1 answer

There are 2 options:

First you can set or disable all css for a regular popup.

The second option is to open a classic pop-up or modal dialog by clicking a button or clicking on a specified element in the editor. When you close the popup, you can write something back to the editor using a command like

 tinyMCE.get("my_editor_id").execCommand("mceInsertContent",false,'whatever'); 
0
source

All Articles