从 CKEditor UI 源对话框插件中删除 "Source"

Remove "Source" from CKEditor UI Source Dialog plugin

我正在使用 CKEditor(v4.7.0 - 自定义构建)并且我已经添加了 Source Dialog 插件(http://ckeditor.com/addon/sourcedialog)。

从工具栏 UI 中删除单词 "Source" 的最佳方法是什么?

例如来自:

为此:

我正在使用 jQuery 适配器并像这样初始化编辑器:

$(el).ckeditor({
    removePlugins: 'maximize,floatingspace,resize',
    extraPlugins: 'autogrow,sharedspace,sourcedialog',
    autoGrow_onStartup: true,
    toolbarGroups: { name: 'main', groups: [ 'mode', 'document', 'doctools', 'find', 'selection', 'spellchecker', 'editing', 'clipboard', 'undo', 'forms', 'links', 'insert', 'basicstyles', 'cleanup', 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph', 'styles', 'tools', 'colors' ] },
    autoGrow_maxHeight: 800,
    sharedSpaces: {
        top: 'editorActions',
        bottom: 'editorFooter'
    },
    on: {
        blur: function(evt) {
            // blur functions
        },
        instanceReady: function (evt) {
            // initial functions
        },
        change: function(evt) {
            // save functions
        }
    }
});

目前我只是通过定位加载中的元素来删除文本。

$('#cke_[id]_label').html(' ');

但这感觉有点怪诞,我不想加载它而不是删除它。

可以隐藏标签,只留下图标 CSS:

.cke_button__source_label {
    display: none !important;
}

.cke_button_label.cke_button__source_label {
    display: none;
}

另请参阅此答案:

只需将此行添加到您的 config.js

config.removeButtons = 'Source';