简体   繁体   English

编辑ckeditor config.js没有任何影响

[英]Editing the ckeditor config.js has no impact

I changed my CKeditor config.js file to include all the buttons possible to this: 我更改了我的CKeditor config.js文件,以包含所有可能的按钮:

CKEDITOR.editorConfig = function( config ) {
    config.toolbarGroups = [
        { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
        { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
        { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
        { name: 'forms', groups: [ 'forms' ] },
        '/',
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
        { name: 'links', groups: [ 'links' ] },
        { name: 'insert', groups: [ 'insert' ] },
        '/',
        { name: 'styles', groups: [ 'styles' ] },
        { name: 'colors', groups: [ 'colors' ] },
        { name: 'tools', groups: [ 'tools' ] },
        { name: 'others', groups: [ 'others' ] },
        { name: 'about', groups: [ 'about' ] }
    ];
};

This config was generated using the CKeditor config generator tool. 此配置是使用CKeditor 配置生成器工具生成的。

After the change was deployed to my server and the page was refreshed using incognito mode in chrome none of the buttons changed. 将更改部署到我的服务器并使用chrome中的隐身模式刷新页面后,没有更改任何按钮。

If I add this code directly in my admin.master then the new button does show. 如果我直接在admin.master添加此代码, admin.master显示新按钮。

<script>
    jQuery(function() {
        CKEDITOR.config.extraPlugins = 'justify';
    });
</script>

Is it possible that I am not using the config.js at all? 我可能根本没有使用config.js吗?

There's a Github issue that was posted for this https://github.com/galetahub/ckeditor/pull/433 (a long time ago). 这个https://github.com/galetahub/ckeditor/pull/433 (很久以前)发布了一个Github问题。 Also, a discussion post about unreflected changes when using CKEDITOR.editorConfig here: https://ckeditor.com/old/forums/CKEditor-3.x/config.js-changes-not-reflected 此外,还有一篇关于在使用CKEDITOR.editorConfig时未反映的更改的讨论帖: https//ckeditor.com/old/forums/CKEditor-3.x/config.js-changes-not-reflected

My suggestion: 我的建议:

Try to clear the cache after you change the config. 更改配置后尝试清除缓存。 Check the "console" tab in your developpers inspector inside the browser to verify if there's is any errors. 检查浏览器内部开发人员检查器中的“控制台”选项卡,以验证是否存在任何错误。

As an alternative you could use the replace() method after destroying the loaded instance inside the instanceReady event callback like : 作为替代方法,您可以在销毁instanceReady事件回调中的已加载实例后使用replace()方法,如:

CKEDITOR.instances.editor1.on("instanceReady", function(event) {
  CKEDITOR.instances.editor1.destroy(); 
  CKEDITOR.replace('editor1', {
    toolbarGroups
  });
});

Working demo fiddle . 工作演示小提琴

I had this same problem and I had to delete the browser data. 我有同样的问题,我不得不删除浏览器数据。 In Chrome you can select a time range. 在Chrome中,您可以选择时间范围。 At first, I selected the last hour and this didn't work. 起初,我选择了最后一小时,但这不起作用。 Then I selected all times and it did. 然后我选择了所有的时间,它确实。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM