删除“浏览"TinyMCE 的“插入链接"中的按钮;使用 MoxieManager 时的对话框 [英] Remove "Browse" button from TinyMCE's "Insert Link" dialog when using MoxieManager

查看:40
本文介绍了删除“浏览"TinyMCE 的“插入链接"中的按钮;使用 MoxieManager 时的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have correctly configured MoxieManager to be integrated with TinyMCE and all works fine. But I'd like to remove the "browse" button (which opens the MoxieManager dialog) from the "Insert link" dialog.

所以从下面的截图来看,绿色应该保留,但红色应该消失.

So from the following screenshot, the green should stay but the red should go.

推荐答案

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

Self answer, but I guess it will be helpful to other people as well.

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

Each TinyMCE plugin usually has a JS file located under plugins/[plugin_name]/plugin.js (or plugin.min.js, depending on if you are using the minified version). Those plugins usually call the editor.windowManager.open(), passing an object of configuration options to be applied to the newly opened window.

该对象可以具有的值之一是 body,它是要在对话框中显示的项目的数组.每个项目都有一些需要单独配置的选项,包括 type 属性.

One of the values this object can have is body which is an array of the items to be displayed in the dialog. Each item has some options to be configured on its own, including the type property.

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

In the below example, I have used plugins/link/plugin.js to show the difference needed to replace the (default) text field with the file browser button - with the standard text field without the browse button.

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

和新版本:

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

这篇关于删除“浏览"TinyMCE 的“插入链接"中的按钮;使用 MoxieManager 时的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆