Using the JQuery wrapper, we have set up my editor like so:
$("#tab-question-text-textarea").ckeditor({
extraPlugins : 'togglebg,piping',
toolbar: [
[ 'Bold', 'Italic', 'Underline', 'Subscript', 'Superscript' ],
[ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
[ 'Indent', 'Outdent', 'BulletedList', 'NumberedList' ],
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ],
'/',
[ 'Font', 'FontSize', 'TextColor', 'BGColor' ],
[ 'Undo', 'Redo' ],
[ 'Link', 'Unlink', 'Table', 'CreateDiv', 'HorizontalRule', 'SpecialChar' ],
[ 'Source', 'ToggleBg', 'Piping' ]
]
});
We have a couple of custom plugins that we've written. One of those plugins, requires a value passed into it but I can't seem to find a way to do this from the documentation.
I was hoping I could just add something like this:
this.$("#tab-question-text-textarea").ckeditor({
extraPlugins : 'togglebg,piping',
extraConfig : {
param1 : 'value'
},
toolbar: [
[ 'Bold', 'Italic', 'Underline', 'Subscript', 'Superscript' ],
[ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
[ 'Indent', 'Outdent', 'BulletedList', 'NumberedList' ],
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ],
'/',
[ 'Font', 'FontSize', 'TextColor', 'BGColor' ],
[ 'Undo', 'Redo' ],
[ 'Link', 'Unlink', 'Table', 'CreateDiv', 'HorizontalRule', 'SpecialChar' ],
[ 'Source', 'ToggleBg', 'Piping' ]
]
});
Could I extend the editor.config object somehow? Any ideas much appreciated.
Not sure about using the
Not sure about using the wrapper but in standard way, you would have something like:
-- config.js --
config.somePlugin = {
param1 : 'nonDefaultValue'
};
-- plugin.js --
CKEDITOR.plugins.add('somePlugin', {
init: function(editor) {
var defaultConfig = {
param1 : 'defaultValue'
};
var config = CKEDITOR.tools.extend(defaultConfig, editor.config.somePlugin || {}, true);
}
});