Ticket #5345: 5345_3.patch
File 5345_3.patch, 4.1 KB (added by , 15 years ago) |
---|
-
_source/core/editor.js
230 230 // Load all plugin specific language files in a row. 231 231 CKEDITOR.scriptLoader.load( languageFiles, function() 232 232 { 233 // Add-in all other config options that been defined on CKEDITOR in plugin files. 234 // TODO: Remove this line when we're free of global config definition in all plugins. 235 CKEDITOR.tools.extend( editor.config, CKEDITOR.tools.clone( CKEDITOR.config ) ); 236 233 237 // Initialize all plugins that have the "beforeInit" and "init" methods defined. 234 238 var methods = [ 'beforeInit', 'init', 'afterInit' ]; 235 239 for ( var m = 0 ; m < methods.length ; m++ ) … … 390 394 * var editor = CKEDITOR.instances.editor1; 391 395 * alert( <b>editor.config.theme</b> ); "default" e.g. 392 396 */ 393 this.config = CKEDITOR.tools. prototypedCopy( CKEDITOR.config );397 this.config = CKEDITOR.tools.clone( CKEDITOR.config ); 394 398 395 399 /** 396 400 * Namespace containing UI features related to this editor instance. … … 505 509 if ( this._.filebrowserFn ) 506 510 CKEDITOR.tools.removeFunction( this._.filebrowserFn ); 507 511 508 items = editor.config.elementsPath_filters;509 if ( items )510 {511 for ( index= 0 ; index < items.length ; index++ )512 items[ index ] = null;513 }514 515 512 this.fire( 'destroy' ); 516 513 CKEDITOR.remove( this ); 517 514 CKEDITOR.fire( 'instanceDestroyed', null, this ); -
_source/plugins/elementspath/plugin.js
33 33 34 34 init : function( editor ) 35 35 { 36 var config = editor.config, 37 pathFilters = config.elementsPath_filters; 38 39 config.elementsPath_filters = ( pathFilters || [] ); 40 36 41 var spaceId = 'cke_path_' + editor.name; 37 42 var spaceElement; 38 43 var getSpaceElement = function() … … 56 61 } 57 62 }); 58 63 59 var filters = editor.config.elementsPath_filters;60 61 64 editor.on( 'selectionChange', function( ev ) 62 65 { 63 var env = CKEDITOR.env; 64 65 var selection = ev.data.selection; 66 67 var element = selection.getStartElement(), 66 var env = CKEDITOR.env, 67 selection = ev.data.selection, 68 element = selection.getStartElement(), 68 69 html = [], 69 elementsList = this._.elementsPath.list = []; 70 editor = ev.editor, 71 elementsList = editor._.elementsPath.list = [], 72 filters = editor.config.elementsPath_filters; 70 73 71 74 while ( element ) 72 75 { … … 114 117 ( ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ? 115 118 ' onfocus="event.preventBubble();"' : '' ) + 116 119 ' hidefocus="true" ' + 117 ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', this.name, '\',', index, ', event);"' +120 ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', editor.name, '\',', index, ', event);"' + 118 121 extra , 119 ' onclick="return CKEDITOR._.elementsPath.click(\'', this.name, '\',', index, ');"',122 ' onclick="return CKEDITOR._.elementsPath.click(\'', editor.name, '\',', index, ');"', 120 123 ' role="button" aria-labelledby="' + idBase + index + '_label">', 121 124 name, 122 125 '<span id="', idBase, index, '_label" class="cke_label">' + label + '</span>', … … 206 209 207 210 /** 208 211 * A list of filter functions to determinate whether an element should display in elements path bar. 212 * @name CKEDITOR.config.elementsPath_filters 209 213 * @type Array Array of functions that optionaly return 'false' to prevent the element from displaying. 210 * @default 214 * @default [] 211 215 * @example 212 216 * // Prevent elements with attribute 'myAttribute' to appear in elements path. 213 217 * editor.config.elementsPath_filters.push( function( element ) … … 216 220 * return false; 217 221 * }); 218 222 */ 219 CKEDITOR.config.elementsPath_filters = [];