如何设置一个插件CKEditor时使用自CDN? [英] How to set a plugin on CKEditor when is used since CDN?
问题描述
我按照网页上显示的步骤操作,但我无法使其正常工作。我试图安装的插件是autoembed或任何插件,让我插入一个视频从YouTube,Tweet和所有这些不同的内容类型,但即使我尝试不同的方式,我不能得到它。我还在阅读其他文章显然他们让你创建一个自定义配置 config.js
文件,但它不工作或我不能使它工作。
I followed the steps that appear on this page, 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. I was also reading other article where apparently they let you create a custom config config.js
file, but it doesn't work or I'm not qualified to make it works.
推荐答案
中有一个方法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'
like
Then simply add autoembed to config.extraPlugins = 'autoembed'
like
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
CKEDITOR.replace( 'element', {
extraPlugins: 'sample'
} );
或 config.js
:
or in config.js
:
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );
CKEDITOR.editorConfig = function( config ) {
config.plugins =
'sample,' +
...
};
这篇关于如何设置一个插件CKEditor时使用自CDN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!