Changeset 2336
- Timestamp:
- 2008-08-06 12:12:10 (5 months ago)
- Location:
- CKEditor/branches/prototype
- Files:
-
- 12 modified
-
fckpackager.xml (modified) (1 diff)
-
_source/core/config.js (modified) (1 diff)
-
_source/core/editor.js (modified) (1 diff)
-
_source/core/pluginDefinition.js (modified) (1 diff)
-
_source/core/plugins.js (modified) (1 diff)
-
_source/core/resourcemanager.js (modified) (6 diffs)
-
_source/core/tools.js (modified) (1 diff)
-
_source/plugins/elementspath/plugin.js (modified) (1 diff)
-
_source/plugins/htmldataprocessor/plugin.js (modified) (1 diff)
-
_source/plugins/htmlwriter/plugin.js (modified) (1 diff)
-
_source/plugins/sourcearea/plugin.js (modified) (1 diff)
-
_source/plugins/wysiwygarea/plugin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/prototype/fckpackager.xml
r2334 r2336 96 96 <File path="_source/plugins/basicstyles/plugin.js" /> 97 97 <File path="_source/plugins/button/plugin.js" /> 98 <File path="_source/plugins/editingblock/plugin.js" />99 98 <File path="_source/plugins/elementspath/plugin.js" /> 100 99 <File path="_source/plugins/htmldataprocessor/plugin.js" /> 101 <File path="_source/plugins/htmlwriter/plugin.js" />102 <File path="_source/plugins/selection/plugin.js" />103 100 <File path="_source/plugins/sourcearea/plugin.js" /> 104 101 <File path="_source/plugins/toolbar/plugin.js" /> 105 102 <File path="_source/plugins/wysiwygarea/plugin.js" /> 103 <File path="_source/plugins/selection/plugin.js" /> 104 <File path="_source/plugins/htmlwriter/plugin.js" /> 105 <File path="_source/plugins/editingblock/plugin.js" /> 106 106 <File path="_source/themes/default/theme.js" /> 107 107 </PackageFile> -
CKEditor/branches/prototype/_source/core/config.js
r2334 r2336 134 134 * @default 'editingblock,elementspath,sourcearea,toolbar,wysiwygarea' 135 135 * @example 136 * config.plugins = 'e ditingblock,toolbar,wysiwygarea';136 * config.plugins = 'elementspath,toolbar,wysiwygarea'; 137 137 */ 138 plugins : 'basicstyles,button,e ditingblock,elementspath,htmldataprocessor,htmlwriter,selection,sourcearea,toolbar,wysiwygarea',138 plugins : 'basicstyles,button,elementspath,htmldataprocessor,sourcearea,toolbar,wysiwygarea', 139 139 140 140 /** -
CKEditor/branches/prototype/_source/core/editor.js
r2278 r2336 152 152 for ( var m = 0 ; m < methods.length ; m++ ) 153 153 { 154 for ( var i = 0 ; i < plugins.length ; i++)154 for ( var pluginName in plugins ) 155 155 { 156 var pluginName = plugins[ i ]; 157 var plugin = CKEDITOR.plugins.get( pluginName ); 156 var plugin = plugins[ pluginName ]; 158 157 if ( plugin && plugin[ methods[ m ] ] ) 159 158 plugin[ methods[ m ] ]( editor, CKEDITOR.plugins.getPath( pluginName ) ); -
CKEditor/branches/prototype/_source/core/pluginDefinition.js
r2278 r2336 33 33 * @constructor 34 34 * @example 35 */ 36 37 /** 38 * A list of plugins that are required by this plugin. Note that this property 39 * doesn't guarantee the loading order of the plugins. 40 * @name CKEDITOR.pluginDefinition.prototype.requires 41 * @type Array 42 * @example 43 * CKEDITOR.plugins.add( 'sample', 44 * { 45 * requires : [ 'button', 'selection' ] 46 * }); 35 47 */ 36 48 -
CKEditor/branches/prototype/_source/core/plugins.js
r2214 r2336 34 34 '_source/' + // @Packager.RemoveLine 35 35 'plugins/', 'plugin' ); 36 37 CKEDITOR.plugins.load = CKEDITOR.tools.override( CKEDITOR.plugins.load, function( originalLoad ) 38 { 39 return function( name, callback, scope ) 40 { 41 var allPlugins = {}; 42 43 var loadPlugins = function( names ) 44 { 45 originalLoad.call( this, names, function( plugins ) 46 { 47 CKEDITOR.tools.extend( allPlugins, plugins ); 48 49 var requiredPlugins = []; 50 for ( var pluginName in plugins ) 51 { 52 var plugin = plugins[ pluginName ], 53 requires = plugin && plugin.requires; 54 55 if ( requires ) 56 { 57 for ( var i = 0 ; i < requires.length ; i++ ) 58 { 59 if ( !allPlugins[ requires[ i ] ] ) 60 requiredPlugins.push( requires[ i ] ); 61 } 62 } 63 } 64 65 if ( requiredPlugins.length ) 66 loadPlugins.call( this, requiredPlugins ); 67 else 68 callback.call( scope || window, allPlugins ); 69 } 70 , this); 71 72 }; 73 74 loadPlugins.call( this, name ); 75 }; 76 }); -
CKEditor/branches/prototype/_source/core/resourcemanager.js
r2261 r2336 164 164 { 165 165 // Ensure that we have an Array of names. 166 var names = CKEDITOR.tools.isArray( name ) ? name : [ name ]; 167 var total = names.length; 166 var names = CKEDITOR.tools.isArray( name ) ? name : name ? [ name ] : [], 167 total = names.length, 168 resources = {}; 168 169 169 170 // Nothing to load, just call the callback. 170 171 if ( !total ) 171 172 { 172 callback.call( scope || window, names );173 callback.call( scope || window, resources ); 173 174 return; 174 175 } … … 181 182 { 182 183 if ( ++callback._loaded == callback._total ) 183 callback.call( scope || window, names );184 callback.call( scope || window, resources ); 184 185 }; 185 186 … … 190 191 { 191 192 // Calculate the plugin script path. 192 var path = this.externals[ name ] || ( this.basePath + name + '/' ) ;193 varfilePath = CKEDITOR.getUrl( path + this.fileName + '.js' );193 var path = this.externals[ name ] || ( this.basePath + name + '/' ), 194 filePath = CKEDITOR.getUrl( path + this.fileName + '.js' ); 194 195 195 196 // Load the plugin script. … … 201 202 loaded[ name ] = path; 202 203 204 resources[ name ] = this.get( name ); 205 203 206 // Check all callbacks that were waiting for this 204 207 // resource. … … 207 210 208 211 delete waitingList[ name ]; 209 } );212 }, this); 210 213 }; 211 214 … … 215 218 name = names[ i ]; 216 219 217 // If not loaded already. 218 if ( name && !loaded[ name ] && !this.registered[ name ] ) 220 if ( name && typeof resources[ name ] == 'undefined' ) 219 221 { 220 var waitingInfo = waitingList[ name ] || ( waitingList[ name ] = [] ); 221 waitingInfo.push( callback ); 222 223 // If this is the first call for it, go ahead loading. 224 if ( waitingInfo.length == 1 ) 225 loadPlugin.call( this, name ); 222 resources[ name ] = this.get( name ); 223 224 // If not loaded already. 225 if ( !loaded[ name ] && !this.registered[ name ] ) 226 { 227 var waitingInfo = waitingList[ name ] || ( waitingList[ name ] = [] ); 228 waitingInfo.push( callback ); 229 230 // If this is the first call for it, go ahead loading. 231 if ( waitingInfo.length == 1 ) 232 loadPlugin.call( this, name ); 233 234 continue; 235 } 226 236 } 227 else 228 loadCheck( callback ); 237 loadCheck( callback ); 229 238 } 230 239 } -
CKEditor/branches/prototype/_source/core/tools.js
r2334 r2336 201 201 }; 202 202 })(), 203 204 /** 205 * Creates a function override. 206 * @param {Function} originalFunction The function to be overridden. 207 * @param {Function} functionBuilder A function that returns the new 208 * function. The original function reference will be passed to this 209 * function. 210 * @returns {Function} The new function. 211 * @example 212 * var example = 213 * { 214 * myFunction : function( name ) 215 * { 216 * alert( 'Name: ' + name ); 217 * } 218 * }; 219 * 220 * example.myFunction = CKEDITOR.tools.override( example.myFunction, function( myFunctionOriginal ) 221 * { 222 * return function( name ) 223 * { 224 * alert( 'Override Name: ' + name ); 225 * myFunctionOriginal.call( this, name ); 226 * }; 227 * }); 228 */ 229 override : function( originalFunction, functionBuilder ) 230 { 231 return functionBuilder( originalFunction ); 232 }, 203 233 204 234 /** -
CKEditor/branches/prototype/_source/plugins/elementspath/plugin.js
r2278 r2336 27 27 CKEDITOR.plugins.add( 'elementspath', 28 28 { 29 requires : [ 'selection' ], 30 29 31 init : function( editor, pluginPath ) 30 32 { -
CKEditor/branches/prototype/_source/plugins/htmldataprocessor/plugin.js
r2334 r2336 22 22 CKEDITOR.plugins.add( 'htmldataprocessor', 23 23 { 24 requires : [ 'htmlwriter' ], 25 24 26 init : function( editor, pluginPath ) 25 27 { -
CKEditor/branches/prototype/_source/plugins/htmlwriter/plugin.js
r2335 r2336 316 316 }; 317 317 318 CKEDITOR.plugins.add( 'htmlwriter' , {});318 CKEDITOR.plugins.add( 'htmlwriter' ); -
CKEditor/branches/prototype/_source/plugins/sourcearea/plugin.js
r2278 r2336 27 27 CKEDITOR.plugins.add( 'sourcearea', 28 28 { 29 requires : [ 'editingblock' ], 30 29 31 init : function( editor, pluginPath ) 30 32 { -
CKEditor/branches/prototype/_source/plugins/wysiwygarea/plugin.js
r2254 r2336 62 62 CKEDITOR.plugins.add( 'wysiwygarea', 63 63 { 64 requires : [ 'editingblock' ], 65 64 66 init : function( editor, pluginPath ) 65 67 {