[英]CKEditor not setting configuration
我正在从CDN加载CKEditor,然后使用其他文件来更改默认配置:
<script type="text/javascript" src="//cdn.ckeditor.com/4.3.3/standard/ckeditor.js"></script>
<script type="text/javascript" src="/js/ckeditor/config.js"></script>
我的配置文件如下所示:
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'tools' },
{ name: 'others' },
{ name: 'about' }
];
// The default plugins included in the basic setup define some buttons that
// we don't want too have in a basic editor. We remove them here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
// Let's have it basic on dialogs as well.
config.removeDialogTabs = 'link:advanced';
};
实际上,我是从以前的开发人员那里继承了此应用程序,并且我正尝试移至CDN,而不是必须为每个安装手动下载文件。
我也尝试从功能中删除配置,然后像这样直接访问它们:
CKEDITOR.config.removeDialogTabs = 'link:advanced';
..但这也不起作用。
我在控制台中没有任何错误,当我执行console.log(CKEDITOR)
我可以看到该对象在那里。 有什么明显的地方我做错了吗? 谢谢
加载CDN的CKEditor不知道您要为其提供自定义配置,而是使用其自己的默认配置。 您应该定义config.customConfig
配置选项,该选项指向您的自定义配置文件,如CKEditor CDN站点上所述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.