使用MoxieManager时,从TinyMCE的"插入链接"对话框中删除"浏览"按钮

Dzh*_*eyt 1 tinymce

我已正确配置MoxieManager与TinyMCE集成,一切正常.但我想从"插入链接"对话框中删除"浏览"按钮(打开MoxieManager对话框).

因此,从下面的截图中,绿色应该保留,但红色应该去.

在此输入图像描述

Dzh*_*eyt 7

自我回答,但我想这对其他人也有帮助.

每个TinyMCE插件通常都有一个位于plugins/[plugin_name] /plugin.js(或plugin.min.js)下的JS文件,具体取决于你是否使用了缩小版本.这些插件通常调用editor.windowManager.open(),传递配置选项的对象以应用于新打开的窗口.

此对象可以具有的值之一是body要在对话框中显示的项目数组.每个项目都有一些可供选择的选项,包括type属性.

在下面的示例中,我使用了plugins/link/plugin.js来显示用文件浏览器按钮替换(默认)文本字段所需的差异 - 使用没有浏览按钮的标准文本字段.

win = editor.windowManager.open({
        // ...
        body: [
            {
                name: 'href',
                type: 'filepicker',
                filetype: 'file',
                // ...
            },
// More code follows here
Run Code Online (Sandbox Code Playgroud)

而新版本:

win = editor.windowManager.open({
        // ...
        body: [
            {
                name: 'href',
                type: 'textbox',
                filetype: 'file',
                // ...
            },
// More code follows here
Run Code Online (Sandbox Code Playgroud)