I make an extra button on the TinyMCE toolbar (this is for Wordpress, but I don't think it matters).
A button is clicked and the form is displayed, I’ll just completely lose it when setting up, so the values entered into the form are actually passed to the rest of the tinyMce plugin.
The only relevant documents I found is this page where they show you how to implement a custom browser. But this is pretty cryptic for the first timer (or at least for me).
Here is what I have:
This is done when the button is clicked:
ed.windowManager.open({ file : url + '/dialog.html', width : 400, height : 120, inline : 1 }, { plugin_url : url, // Plugin absolute URL some_custom_arg : 'custom arg' // Custom argument });
This is the contents of the dialog.html file
<html> <head> <title>Hello world!</title> </head> <body> <form name="Hello world" method="post"> <input size="30" name="textbox1" type="text" id="textbox1" /> <input type="submit" value="" name="submitbutton" /> </form> </body> </html>
Obviously, this does nothing (it doesn’t even close the dialog), but I don’t know where to start looking for something.
tinymce
joon
source share