我有一个主题,它有一个用于编辑器模式的注册短代码按钮。当您单击它时,会打开一个带有不同选项/简码 (popup.php) 的弹出窗口。
一般来说,这很好用,但在某些域上,弹出窗口不会显示短代码选项,但会显示我的主题/网站的前端。
希望有人遇到过类似的问题来提供帮助,因为我真的不知道如何解决这个问题。
也许是域的重定向问题???
通过单击按钮打开弹出窗口的代码。
(function() {
tinymce.create('tinymce.plugins.popup', {
init : function(ed, url) {
// Register commands
ed.addCommand('mcepopup', function() {
ed.windowManager.open({
file : url + '/popup.php', // file that contains HTML for our modal window
width : 700 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
height : 700 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
inline : 1
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('popup', {title : 'Insert Columns', cmd : 'mcepopup', image: url + '/images/button.png' });
}
});
// Register plugin
// first parameter is the button ID and must match ID elsewhere
// second parameter must match the first parameter of the tinymce.create() function above
tinymce.PluginManager.add('popup', tinymce.plugins.popup);
})();