【发布时间】:2017-12-18 01:53:49
【问题描述】:
我正在尝试按照this guide 为CKeditor 创建一个自定义插件。我按照指示创建了文件(myplugin.png、myplugin.js、plugin.js)并添加了
CKEDITOR_CONFIGS = { 'default': { 'extraPlugins': ','.join( [ 'myplugin' ] ), } }
到设置。
但是,当我尝试加载页面时,编辑器没有出现,并且我在控制台中收到以下错误:
获取 http://127.0.0.1:8000/static/ckeditor/ckeditor/plugins/myplugin/plugin.js?t=GB8C 404(未找到)
在 Firebug 中:
错误:[CKEDITOR.resourceManager.load] 资源名称“myplugin”是 找不到 “http://127.0.0.1:8000/static/ckeditor/ckeditor/plugins/myplugin/plugin.js?t=GB8C”。
所有文件都在此处显示的路径中。 我可能做错了什么,但我找不到什么。感谢您的帮助,我将不胜感激。这是我的 plugin.js 文件的内容:
CKEDITOR.plugins.add( 'myplugin', {
icons: 'myplugin',
init: function( editor ) {
// Plugin logic goes here...
editor.addCommand( 'myplugin', new CKEDITOR.dialogCommand( 'mypluginDialog' ) );
editor.ui.addButton( 'myplugin', {
label: 'My Plugin',
command: 'myplugin',
toolbar: 'insert'
});
}
});
干杯
【问题讨论】:
标签: plugins ckeditor ckeditor4.x django-ckeditor