【问题标题】:CkEditor gives error when using config.jsCkEditor 使用 config.js 时出错
【发布时间】:2013-06-29 22:28:46
【问题描述】:

我正在使用 ckeditor gem。 https://github.com/galetahub/ckeditor

当我在assets/javascripts/ckeditor 下创建一个名为config.js 的文件时,

我收到以下错误:

Cannot call method 'split' of undefined

gem 提供了一个缩小版本,因此我无法获得导致问题的确切陈述。但检查时会显示以下行:

a[g].$.styleSheet.cssText=a[g].$.styleSheet.cssText+f:a[g].$.innerHTML=a[g].$.innerHTML+f}}var d={};CKEDITOR.skin={path:b,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(b()+"skin.js"),function(){a(c,d)}):a(c,d)},getPath:function(a){return CKEDITOR.getUrl(c(a))},icons:{},addIcon:function(a,b,c){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0})},getIconStyle:function(a,b,c,d){var e;if(a){a=a.toLowerCase();b&&
Uncaught TypeError: Cannot call method 'split' of undefined

如果我删除 config.js 的内容,我不会收到任何错误。

编辑:

我使用了以下生成器:

rails generate ckeditor:install --orm=active_record --backend=paperclip

而且 :( 当我按下图像按钮时,我根本没有上传按钮。之前它工作得很好! 出了什么问题?

【问题讨论】:

    标签: ruby-on-rails ckeditor


    【解决方案1】:

    显然您需要通过设置config.skinconfig.js 中定义CKEDITOR.skinName

    很难说为什么,但也许它没有设置为该 gem 包中的任何默认值。很可能应该是moono

    【讨论】:

    • 非常感谢您!让我开心:)
    • 但现在我在图像对话框中看不到“浏览服务器”按钮 :( :( 如果我删除 config.js 它又回来了!!:(
    • 这是一个不同的问题,但由相同的事实引起 - 如果配置文件存在,则某些默认选项未设置,您需要自己设置它们。例如。 extraPlugins = 'filebrowser';.
    • 值未提交:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多