【发布时间】:2013-05-29 04:04:28
【问题描述】:
我正在尝试使用 CKEditor 的 wordcouter 插件。我跟着this,但它似乎不起作用。经过一番探索,我发现有许多不同的config.js 文件和许多plugin 目录。我应该使用哪一个?
app/assets/ckeditor/plugins/
app/assets/ckeditor/_source/plugins/
app/assets/javascripts/ckeditor/plugins/
app/assets/javascripts/ckeditor/_source/plugins/
app/assets/javascripts/ckeditor/_source/core/plugins.js
app/assets/ckeditor/_source/core/plugins.js
当我解压缩 wordcount 时,它给了我一个标题为 wordcount_1.05 的目录,我应该将其重命名为 wordcount 吗?
我在我的config.js 文件中输入以下内容:
config.extraPlugins = 'wordcount';
config.wordcount = {
// Whether or not you want to show the Word Count
showWordCount: true,
// Whether or not you want to show the Char Count
showCharCount: false
};
但这似乎根本没有做任何事情。如果我稍微修改它(这只适用于我的 app/assets/javascripts/ckeditor/config.js 文件)以使其:
CKEDITOR.config
然后我的文本框完全停止显示。所以我觉得这是要修改的正确文件。
感谢您的帮助!
【问题讨论】:
-
我在这里遇到了同样的问题,我不确定把我的插件放在哪里!我正在使用宝石'CKEditor'。我的文件夹结构目前是:app/assets/javascripts/ckeditor/config.js 这是有效的,但不确定在哪里添加插件文件夹!
-
你有想过这个吗?我遇到了同样的问题
-
@scientiffic,实际上我最终完全放弃了该项目并使用 Rails4 重建它。我最好的选择是,它只是一些杂乱无章的遗留代码,不会让我让步。如果您可以从头开始,萨尔曼的答案应该可行。
-
嗯,这对我来说不是一个真正的选择,但感谢您的回复。
-
@scientiffic,我也不认为这对我来说是一个选择,但 2 年后我有了一个全新的应用程序哈哈!
标签: javascript ruby-on-rails ruby-on-rails-3 ckeditor