3

我已经安装了 django-ckeditor 并且管理页面很好地显示了编辑器。但是我在将 oembed 插件添加到编辑器时遇到问题。

这是我所拥有的:

# virtualenv
Django==1.6.1
South==0.8.4
django-ckeditor-updated==4.2.6
elpy==1.2.1
flake8==2.1.0
ipython==1.1.0
jedi==0.7.0
mccabe==0.2.1
pep8==1.4.6
pyflakes==0.7.3
wsgiref==0.1.2

# settings.py

CKEDITOR_CONFIGS = {
    'default': {
        'extraPlugins': 'dialog,widget,lineutils,oembed',
        'toolbar': [
            ['About', 'oembed', ],
        ]
    }
}

注意 oembed 需要对话框、小部件(可能还有 lineutils)。

现在我的编辑器显示了 oembed 按钮,但它不会显示表单供您输入视频网址。Firebug显示有两个错误:

TypeError: this.editor.editable(...).find is not a function
http://localhost:8000/static/ckeditor/ckeditor/plugins/widget/plugin.js?t=D8AD
Line 494
TypeError: widget.wrapper.findOne is not a function
http://localhost:8000/static/ckeditor/ckeditor/plugins/widget/plugin.js?t=D8AD
Line 2746

Django 控制台显示所有 .js、.css 文件都已加载。

[27/Jan/2014 21:25:57] "GET /admin/blog/blog/add/ HTTP/1.1" 200 4423
[27/Jan/2014 21:25:57] "GET /static/ckeditor/ckeditor/ckeditor.js HTTP/1.1" 304 0
[27/Jan/2014 21:25:57] "GET /admin/jsi18n/ HTTP/1.1" 200 2372
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/config.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/skins/moono/editor_gecko.css?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/lang/en.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/styles.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/widget/plugin.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/lineutils/plugin.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/oembed/plugin.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/widget/lang/en.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/oembed/lang/en.js?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/skins/moono/icons.png HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/oembed/icons/oembed.png?t=D8AD HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/contents.css HTTP/1.1" 304 0
[27/Jan/2014 21:25:58] "GET /static/ckeditor/ckeditor/plugins/oembed/libs/jquery.oembed.min.js?t=D8AD HTTP/1.1" 304 0

我在 javascript 方面的经验有限,我是否在 django-ckeditor 插件设置中遗漏了什么?谢谢,

4

0 回答 0