有人知道如何禁用CKEditor的上下文(右键单击)菜单吗?我希望有一个配置选项,但我找不到。我使用的是3.1版。谢谢。
发布于 2012-08-31 21:26:14
从版本3.6.4开始,此问题中的其他答案不再有效。See bug #9284
需要禁用的三个插件(使用这个问题中讨论的方法)是contextmenu
、liststyle
和tabletools
。例如,使用配置文件:
CKEDITOR.editorConfig = function(config) {
/* Your config options */
...
config.removePlugins = 'contextmenu,liststyle,tabletools';
};
发布于 2017-07-31 19:01:05
检查器4.7.1
CKEDITOR.editorConfig = function (config) {
config.language = 'en';
config.toolbar = "mini";
config.removePlugins = 'elementspath,contextmenu,liststyle,tabletools,tableselection';
config.disableNativeSpellChecker = false;
}
Ckeditor 4.8.0
('elementspath‘插件不再需要删除)
CKEDITOR.editorConfig = function (config) {
config.language = 'en';
config.toolbar = "mini";
config.removePlugins = 'contextmenu,liststyle,tabletools,tableselection';
config.disableNativeSpellChecker = false;
}
发布于 2014-11-12 16:58:09
仍然有一个实用的解决方案,通过覆盖初始化contextmenu
行为的原型函数:
CKEDITOR.dom.element.prototype.disableContextMenu = function () {
this.on( 'contextmenu', function( event ) {
// your contextmenu behavior
});
};
注意:当CKEDITOR动态加载其JS资源时,您需要将其放在replace
调用之前。
https://stackoverflow.com/questions/2246631
复制相似问题