【发布时间】:2014-02-03 13:53:16
【问题描述】:
我正在尝试将自定义图像管理器作为插件实现到 TinyMCE 4 中。 我的图像管理器需要在 iFrame 中(它是一个 PHP 页面)。 这就是我的插件代码的样子。插件代码工作正常。
如何将 iframe 内 PHP 页面的图片路径返回到插件的 ´scr` 字段中?
一个实际的例子会很棒(因为我对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 + '">');
}
});
}
});
});
【问题讨论】:
标签: javascript iframe plugins tinymce