简体   繁体   中英

CKEditor: Ignoring its config.js

I have a fresh installation of CKEditor 4.7.1. Following the tutorial on creating a plugin, I did that and then modified the config.js file to enable it. But it won't enable. I had posted a separate question about that, but during that, I discovered that at least part of the problem is that the config.js is being totally ignored. For example, here's the current config.js:

CKEDITOR.editorConfig = function( config ) {
config.language = 'en';
config.uiColor = '#FFFFEE';
config.width = '100%';
config.height = 500;
config.toolbarCanCollapse = true;   
config.extraPlugins = 'timestamp';
config.allowedContent = true;
};  

And none of those settings does anything. But if I put them in the .replace code:

var editor = CKEDITOR.replace('pageCKeditor', {
    language: 'en',
    width: '100%',
    height: '500',
    extraPlugins: 'timestamp',
    toolbarCanCollapse: true,
    uiColor: '#FFFFEE'
});

CKFinder.setupCKEditor( editor, '/includes/ckfinder/' );

...they work fine. If I remove those settings from the .replace code, it will only show the default values for the editor window, thus indicating that config.js is being ignored.

I'm currently using the Full version of CKEditor, but I was having the same problem with the Standard one as well (hence why I tried a different version).

I have tried this on both my local dev machine -- a Mac running Apache 2.4, and a Windows server running IIS and the results are the same. I tried loading the config.js on its own (after ckeditor.js) but it made no difference, so I removed it.

I've run out of things to try... any input is appreciated!

Per the OP's comment, indeed the file permissions on config.js did matter for some reason.

Fix with:

$ chmod 664 /path/to/ckeditor/config.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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