gpt4 book ai didi

javascript - CKEditor 未设置配置

转载 作者:行者123 更新时间:2023-12-03 11:17:42 24 4
gpt4 key购买 nike

我从 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 中所述网站。

关于javascript - CKEditor 未设置配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27264137/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com