简体   繁体   English

CKEditor:忽略其config.js

[英]CKEditor: Ignoring its config.js

I have a fresh installation of CKEditor 4.7.1. 我重新安装了CKEditor 4.7.1。 Following the tutorial on creating a plugin, I did that and then modified the config.js file to enable it. 遵循有关创建插件的教程之后,我进行了此操作,然后修改了config.js文件以启用它。 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. 我对此发布了一个单独的问题,但是在此期间,我发现问题的至少一部分是config.js被完全忽略了。 For example, here's the current config.js: 例如,这是当前的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: 但是,如果我将它们放在.replace代码中:

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. 如果从.replace代码中删除这些设置,它将仅显示编辑器窗口的默认值,从而表明config.js被忽略。

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). 我当前使用的是CKEditor的完整版,但是我也遇到了与Standard Edition相同的问题(因此为什么尝试使用其他版本)。

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. 我已经在我的本地开发机器上进行了尝试-一台运行Apache 2.4的Mac和一台运行IIS的Windows服务器,结果是相同的。 I tried loading the config.js on its own (after ckeditor.js) but it made no difference, so I removed it. 我尝试自行加载config.js(在ckeditor.js之后),但没有影响,因此我将其删除。

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. 根据OP的评论,确实出于某些原因,对config.js的文件权限确实很重要。

Fix with: 修正:

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

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

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