Commit e4bd0139 by Frédéric

Test

parent 10c44725
plugins:
- dialog
- colordialog
public_path: /public/bolt-public/js/ckeditor/plugins
......@@ -48,11 +48,12 @@ class CkEditorEmbedPluginsExtension extends SimpleExtension
*/
public function loadConfig() {
$config = $this->getConfig();
if (empty($config['plugins'])) {
if (empty($config['plugins']) && !empty($config['public_path'])) {
return '';
}
return '<script type="text/javascript">
const ckefdsditorPlugins = '.\json_encode($config['plugins']).';
const ckeditorPluginsPath = "'.$config['public_path'].'";
const ckeditorPlugins = '.\json_encode($config['plugins']).';
</script>';
}
}
......@@ -6,12 +6,8 @@ jQuery(document).ready(function ($) {
if (typeof(CKEDITOR) != 'undefined') {
console.log(ckeditorPlugins);
//CKEDITOR.plugins.addExternal('fontawesome', '/extensions/mycompany/customckeditor/plugins/fontawesome/', 'plugin.js');
//CKEDITOR.plugins.addExternal('dialog', '/extensions/vendor/mycompany/customckeditor/plugins/dialog/', 'plugin.js');
for (const plugin of ckeditorPlugins) {
console.log(plugin)
CKEDITOR.plugins.addExternal(plugin, `/extensions/vendor/appolo/bolt-extension-ckeditor-embed-plugins/plugins/${plugin}/`, 'plugin.js');
CKEDITOR.plugins.addExternal(plugin, `${ckeditorPluginsPath}/${plugin}/`, 'plugin.js');
}
CKEDITOR.on('instanceReady', function (event, instance) {
......@@ -22,9 +18,6 @@ jQuery(document).ready(function ($) {
var config = event.editor.config,
name;
console.log()
config.extraPlugins += (config.extraPlugins ? ',' : '') + ckeditorPlugins.join(',');
for (name in CKEDITOR.instances) {
......@@ -37,4 +30,4 @@ jQuery(document).ready(function ($) {
CKEDITORPluginExtras = true;
});
}
});
\ No newline at end of file
});
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