我正在使用CKEditor(v4.7.0 - 自定义版本),我添加了源对话插件(http://ckeditor.com/addon/sourcedialog)。
从工具栏用户界面中删除“来源”一词的最佳方法是什么?
e.g。从这个:
对此:
我正在使用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(' ');
但这感觉有点不太讨厌,我不想加载而不是删除它。
答案 0 :(得分:3)
您可以隐藏标签,只留下带有CSS的图标:
.cke_button__source_label {
display: none !important;
}
或
.cke_button_label.cke_button__source_label {
display: none;
}
答案 1 :(得分:-1)
只需在config.js中包含此行
即可config.removeButtons = 'Source';