Index: _source/core/config.js
===================================================================
--- _source/core/config.js (revision 3415)
+++ _source/core/config.js (working copy)
@@ -153,6 +153,26 @@
plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,save,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
/**
+ * List of additional plugins to be loaded. This is a tool setting which
+ * makes it easier to add new plugins, whithout having to touch and
+ * possibly breaking the plugins setting.
+ * @type String
+ * @example
+ * config.addPlugins = 'myplugin,anotherplugin';
+ */
+ addPlugins : '',
+
+ /**
+ * List of plugins that must not be loaded. This is a tool setting which
+ * makes it easier to avoid loading plugins definied in the plugins
+ * setting, whithout having to touch and possibly breaking it.
+ * @type String
+ * @example
+ * config.removePlugins = 'elementspath,save,font';
+ */
+ removePlugins : '',
+
+ /**
* The editor tabindex value.
* @type Number
* @default 0 (zero)
Index: _source/core/editor.js
===================================================================
--- _source/core/editor.js (revision 3415)
+++ _source/core/editor.js (working copy)
@@ -35,7 +35,6 @@
var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = {} );
-
// If the custom config has already been downloaded, reuse it.
if ( loadedConfig.fn )
{
@@ -149,8 +148,28 @@
var loadPlugins = function( editor )
{
+ var config = editor.config,
+ plugins = config.plugins,
+ addPlugins = config.addPlugins,
+ removePlugins = config.removePlugins;
+
+ if ( addPlugins )
+ {
+ // Remove them first to avoid duplications.
+ var removeRegex = new RegExp( '(?:^|,)(?:' + addPlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
+ plugins = plugins.replace( removeRegex, '' );
+
+ plugins += ',' + addPlugins;
+ }
+
+ if ( removePlugins )
+ {
+ removeRegex = new RegExp( '(?:^|,)(?:' + removePlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
+ plugins = plugins.replace( removeRegex, '' );
+ }
+
// Load all plugins defined in the "plugins" setting.
- CKEDITOR.plugins.load( editor.config.plugins.split( ',' ), function( plugins )
+ CKEDITOR.plugins.load( plugins.split( ',' ), function( plugins )
{
// The list of plugins.
var pluginsArray = [];