Ticket #2906: 2906.patch
File 2906.patch, 3.0 KB (added by , 14 years ago) |
---|
-
_source/core/resourcemanager.js
115 115 116 116 /** 117 117 * Registers a resource to be loaded from an external path instead of the core base path. 118 * @param {String} name The resource name.118 * @param {String} names The resource names, separated by commas. 119 119 * @param {String} path The resource external path. 120 120 * @example 121 121 * // Loads a plugin from '/myplugin/samples/plugin.js'. 122 122 * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' ); 123 123 */ 124 addExternal : function( name , path )124 addExternal : function( names, path ) 125 125 { 126 if ( this.registered[ name ] || this.externals[ name ] ) 127 throw '[CKEDITOR.resourceManager.import] The resource name "' + name + '" is already registered or imported.'; 126 names = names.split( ',' ); 127 for ( var i = 0 ; i < names.length ; i++ ) 128 { 129 var name = names[ i ]; 130 if ( this.registered[ name ] || this.externals[ name ] ) 131 throw '[CKEDITOR.resourceManager.import] The resource name "' + name + '" is already registered or imported.'; 128 132 129 this.externals[ name ] = path; 133 this.externals[ name ] = path; 134 } 130 135 }, 131 136 132 137 /** … … 169 174 { 170 175 var url = CKEDITOR.getUrl( this.getPath( name ) + this.fileName + '.js' ); 171 176 urls.push( url ); 172 urlsNames[ url ] = name; 177 if ( !( url in urlsNames ) ) 178 urlsNames[ url ] = []; 179 urlsNames[ url ].push( name ); 173 180 } 174 181 else 175 182 resources[ name ] = this.get( name ); … … 178 185 CKEDITOR.scriptLoader.load( urls, function( completed, failed ) 179 186 { 180 187 if ( failed.length ) 181 throw '[CKEDITOR.resourceManager.load] Resource name "' + urlsNames[ failed[ 0 ] ] + '" was not found at "' + failed[ 0 ] + '".'; 188 { 189 throw '[CKEDITOR.resourceManager.load] Resource name "' + urlsNames[ failed[ 0 ] ].join( ',' ) 190 + '" was not found at "' + failed[ 0 ] + '".'; 191 } 182 192 183 193 for ( var i = 0 ; i < completed.length ; i++ ) 184 194 { 185 var name = urlsNames[ completed[ i ] ]; 186 resources[ name ] = this.get( name ); 195 var nameList = urlsNames[ completed[ i ] ]; 196 for ( var j = 0 ; j < nameList.length ; j++ ) 197 { 198 var name = nameList[ j ]; 199 resources[ name ] = this.get( name ); 187 200 188 loaded[ name ] = 1; 201 loaded[ name ] = 1; 202 } 189 203 } 190 204 191 205 callback.call( scope, resources ); -
config.js
8 8 // Define changes to default configuration here. For example: 9 9 // config.autoLanguage = false; 10 10 // config.defaultLanguage = 'pt-br'; 11 12 CKEDITOR.plugins.addExternal( 'api_dialog,api_dialog2,api_dialog3','file:///C:/external_plugin/'); 13 14 // Append the "peopletools" plugin to the list of plugins 15 // to be loaded. 16 config.plugins += ',api_dialog,api_dialog2'; 11 17 };