I'm trying to implement a custom Image-Manager as a PlugIn into TinyMCE 4. My Image-Manager needs to be in an iFrame (Its a PHP page). This is how the code of my PlugIn looks like. The PlugIn code works alright.
How to return the image path from the PHP page inside the iframe back into the plugins ´scr` field?
A practical example would be wonderful (because I do not understand too much about javascript).
tinymce.PluginManager.add('example', function(editor, url) {
editor.addButton('example', {
text: 'My button',
icon: false,
onclick: function() {
editor.windowManager.open({
title: 'Example plugin',
width: 980,
height: 800,
body: [
{type: 'textbox', name: 'scr', label: 'URL'},
{type: 'textbox', name: 'title', label: 'image-Beschreibung'},
{type: 'iframe', name: 'imageframe', url: 'imagedb.php', minWidth: '690', minHeight: '670'}
],
onsubmit: function(e) {
editor.insertContent('<img src="' + e.data.scr + '">');
}
});
}
});
});