Commit d4603b8c by Simon

Update ckeditor-plugins.js

parent e4bd0139
......@@ -4,30 +4,33 @@ if (typeof CKEDITOR !== 'undefined') {
jQuery(document).ready(function ($) {
var CKEDITORPluginExtras = false;
if (typeof(CKEDITOR) != 'undefined') {
console.log(ckeditorPlugins);
for (const plugin of ckeditorPlugins) {
CKEDITOR.plugins.addExternal(plugin, `${ckeditorPluginsPath}/${plugin}/`, 'plugin.js');
}
CKEDITOR.on('instanceReady', function (event, instance) {
if (CKEDITORPluginExtras) {
return;
if(typeof ckeditorPluginsPath !== 'undefined' && typeof ckeditorPlugins !== 'undefined') {
for (const plugin of ckeditorPlugins) {
CKEDITOR.plugins.addExternal(plugin, `${ckeditorPluginsPath}/${plugin}/`, 'plugin.js');
}
var config = event.editor.config,
name;
CKEDITOR.on('instanceReady', function (event, instance) {
if (CKEDITORPluginExtras) {
return;
}
var config = event.editor.config,
name;
config.extraPlugins += (config.extraPlugins ? ',' : '') + ckeditorPlugins.join(',');
config.extraPlugins += (config.extraPlugins ? ',' : '') + ckeditorPlugins.join(',');
for (name in CKEDITOR.instances) {
if (CKEDITOR.instances.hasOwnProperty(name)) {
CKEDITOR.instances[name].destroy();
CKEDITOR.replace(name, config);
for (name in CKEDITOR.instances) {
if (CKEDITOR.instances.hasOwnProperty(name)) {
CKEDITOR.instances[name].destroy();
CKEDITOR.replace(name, config);
}
}
}
CKEDITORPluginExtras = true;
});
CKEDITORPluginExtras = true;
});
} else {
console.error('Ckeditor-embed-plugin: Path or plugins not defined')
}
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment