Skip to content
Permalink
Browse files

Merge branch 't/9284'

  • Loading branch information...
Reinmar committed Sep 7, 2012
2 parents a9fc93a + 25a2ccf commit d6f9f94235f7231d79abdc9773acc85732d6f36f
Showing with 26 additions and 3 deletions.
  1. +4 −0 core/config.js
  2. +18 −1 core/editor.js
  3. +4 −2 core/tools.js
@@ -263,6 +263,10 @@ CKEDITOR.config = {
* to avoid loading some plugins defined in the {@link CKEDITOR.config#plugins}
* setting, without having to touch it.
*
* **Note:** Plugin required by other plugin cannot be removed (error will be thrown).
* So e.g. if `contextmenu` is required by `tabletools`, then it can be removed
* only if `tabletools` isn't loaded.
*
* config.removePlugins = 'elementspath,save,font';
*
* @cfg
@@ -412,10 +412,27 @@

// Loop through all plugins, to build the list of language
// files to get loaded.
//
// Check also whether any of loaded plugins doesn't require plugins
// defined in config.removePlugins. Throw non-blocking error if this happens.
for ( var pluginName in plugins ) {
var plugin = plugins[ pluginName ],
pluginLangs = plugin.lang,
lang = null;
lang = null,
requires = plugin.requires,
match, name;

// Transform it into a string, if it's not one.
if ( CKEDITOR.tools.isArray( requires ) )
requires = requires.join( ',' );

if ( requires && ( match = requires.match( removeRegex ) ) ) {
while ( ( name = match.pop() ) ) {
CKEDITOR.tools.setTimeout( function( name, pluginName ) {
throw new Error( 'Plugin "' + name.replace( ',', '' ) + '" cannot be removed from the plugins list, because it\'s required by "' + pluginName + '" plugin.');
}, 0, null, [ name, pluginName ] );
}
}

// If the plugin has "lang".
if ( pluginLangs && !editor.lang[ pluginName ] ) {
@@ -758,9 +758,11 @@
* Create A "deferred" function which will not run immediately,
* rather runs as soon as the interpreter’s call stack is empty.
* Behaves much like window.setTimeout with a delay.
* <strong>Note:</strong> The return value of the original function will loose.
*
* **Note:** The return value of the original function will loose.
*
* @param {Function} fn The callee function.
* @param {Function} The new deferred function.
* @returns {Function} The new deferred function.
*/
defer: function( fn ) {
return function() {

0 comments on commit d6f9f94

Please sign in to comment.
You can’t perform that action at this time.