从CDN使用时如何在CKEditor上设置插件? [英] How do I set a plugin on CKEditor when is used from the CDN?
问题描述
我按照 CKEditior的CDN指南页上的步骤进行操作,但我无法正常工作。我正在尝试安装的插件是autoembed(或任何允许我从YouTube插入视频,Tweet和所有这些不同内容类型的插件),但即使我尝试了不同的方式,我也无法获得它可以工作。
I followed the steps on the CDN Guidelines page for CKEditior, but I can't make it work. The plugin that I'm trying to install is "autoembed" (or any plugin that lets me insert a video from YouTube, a Tweet and all of those different content types), but even when I tried different ways, I can't get it to work.
我还在阅读使用自定义配置文件的文档,显然它们可以让你创建一个自定义配置 config.js
文件,但它也不起作用,或者我没资格使它工作。
I was also reading the documentation on using a custom config file, where apparently they let you create a custom config config.js
file, but it too doesn't work, or I'm not qualified to make it work.
推荐答案
有一个 CKEDITOR.resourceManager
中的方法名为 addExternal
。您可以像
There's a method in CKEDITOR.resourceManager
called addExternal
. You can use it like
// Loads a plugin from '/myplugin/samples/plugin.js'.
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
然后只需将autoembed添加到 config.extraPlugins ='autoembed'
喜欢
Then simply add autoembed to config.extraPlugins = 'autoembed'
like
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
CKEDITOR.replace( 'element', {
extraPlugins: 'sample'
} );
或 config.js
:
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
CKEDITOR.editorConfig = function( config ) {
config.plugins =
'sample,' +
...
};
这篇关于从CDN使用时如何在CKEditor上设置插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!