Ticket #5345: 5345.patch
File 5345.patch, 6.6 KB (added by , 15 years ago) |
---|
-
_source/core/editor.js
505 505 if ( this._.filebrowserFn ) 506 506 CKEDITOR.tools.removeFunction( this._.filebrowserFn ); 507 507 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 508 this.fire( 'destroy' ); 516 509 CKEDITOR.remove( this ); 517 510 CKEDITOR.fire( 'instanceDestroyed', null, this ); -
_source/plugins/elementspath/plugin.js
44 44 45 45 var idBase = 'cke_elementspath_' + CKEDITOR.tools.getNextNumber() + '_'; 46 46 47 editor._.elementsPath = { idBase : idBase };47 editor._.elementsPath = { idBase : idBase, filters : [] }; 48 48 49 49 editor.on( 'themeSpace', function( event ) 50 50 { … … 56 56 } 57 57 }); 58 58 59 var filters = editor.config.elementsPath_filters;60 61 59 editor.on( 'selectionChange', function( ev ) 62 60 { 63 var env = CKEDITOR.env; 64 65 var selection = ev.data.selection; 66 67 var element = selection.getStartElement(), 61 var env = CKEDITOR.env, 62 selection = ev.data.selection, 63 element = selection.getStartElement(), 68 64 html = [], 69 elementsList = this._.elementsPath.list = []; 65 editor = ev.editor, 66 elementsList = editor._.elementsPath.list = [], 67 filters = editor._.elementsPath.filters; 70 68 71 69 while ( element ) 72 70 { … … 114 112 ( ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ? 115 113 ' onfocus="event.preventBubble();"' : '' ) + 116 114 ' hidefocus="true" ' + 117 ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', this.name, '\',', index, ', event);"' +115 ' onkeydown="return CKEDITOR._.elementsPath.keydown(\'', editor.name, '\',', index, ', event);"' + 118 116 extra , 119 ' onclick="return CKEDITOR._.elementsPath.click(\'', this.name, '\',', index, ');"',117 ' onclick="return CKEDITOR._.elementsPath.click(\'', editor.name, '\',', index, ');"', 120 118 ' role="button" aria-labelledby="' + idBase + index + '_label">', 121 119 name, 122 120 '<span id="', idBase, index, '_label" class="cke_label">' + label + '</span>', … … 204 202 } 205 203 }; 206 204 207 /**208 * A list of filter functions to determinate whether an element should display in elements path bar.209 * @type Array Array of functions that optionaly return 'false' to prevent the element from displaying.210 * @default []211 * @example212 * // Prevent elements with attribute 'myAttribute' to appear in elements path.213 * editor.config.elementsPath_filters.push( function( element )214 * {215 * if( element.hasAttribute( 'myAttribute') )216 * return false;217 * });218 */219 CKEDITOR.config.elementsPath_filters = []; -
_source/plugins/scayt/plugin.js
46 46 oParams.customDictionaryIds = editor.config.scayt_customDictionaryIds || ''; 47 47 oParams.userDictionaryName = editor.config.scayt_userDictionaryName || ''; 48 48 oParams.sLang = editor.config.scayt_sLang || "en_US"; 49 50 49 51 50 var scayt_custom_params = window.scayt_custom_params; 52 51 if ( typeof scayt_custom_params == 'object') … … 56 55 oParams[ k ] = scayt_custom_params[ k ]; 57 56 } 58 57 } 59 58 60 59 if ( scayt_control_id ) 61 60 oParams.id = scayt_control_id; 62 61 63 62 var scayt_control = new window.scayt( oParams ); 64 63 65 64 // Copy config. … … 124 123 }); 125 124 126 125 127 editor.on( 'destroy', function( )126 editor.on( 'destroy', function( ev ) 128 127 { 128 var editor = ev.editor, 129 scayt_instanse = plugin.getScayt( editor ); 130 129 131 scayt_control_id = scayt_instanse.id; 130 132 plugin.getScayt( editor ).destroy( true ); 131 133 }); … … 133 135 editor.on( 'afterSetData', function() 134 136 { 135 137 if ( plugin.isScaytEnabled( editor ) ) { 136 window.setTimeout( function(){ plugin.getScayt( editor ).refresh() }, 10 );138 window.setTimeout( function(){ plugin.getScayt( editor ).refresh(); }, 10 ); 137 139 } 138 140 }); 139 141 … … 149 151 editor.getSelection().unlock( true ); 150 152 151 153 // Swallow any SCAYT engine errors. 152 window.setTimeout( function(){ scayt_instance.refresh() }, 10 );154 window.setTimeout( function(){ scayt_instance.refresh(); }, 10 ); 153 155 } 154 156 }, this, null, 50 ); 155 157 … … 165 167 editor.getSelection().unlock( true ); 166 168 167 169 // Swallow any SCAYT engine errors. 168 169 window.setTimeout( function(){ scayt_instance.refresh() },10 );170 170 171 window.setTimeout( function(){ scayt_instance.refresh(); },10 ); 172 171 173 } 172 174 }, this, null, 50 ); 173 175 … … 239 241 }, 240 242 this, 241 243 null, 242 0 244 0 243 245 ); // First to run. 244 246 245 247 this.engineLoaded = -1; // Loading in progress. … … 475 477 476 478 var scayt_control = plugin.getScayt( editor ), 477 479 node = scayt_control.getScaytNode(); 478 480 479 481 if ( !node ) 480 482 return null; 481 483 … … 609 611 editor.on( 'showScaytState', showInitialState ); 610 612 plugin.loadEngine( editor ); 611 613 } 614 }, 612 615 616 afterInit : function( editor ) 617 { 613 618 // Prevent word marker line from displaying in elements path. (#3570) 614 619 var elementsPathFilters; 615 if ( e lementsPathFilters = editor.config.elementsPath_filters)620 if ( editor._.elementsPath && ( elementsPathFilters = editor._.elementsPath.filters ) ) 616 621 { 617 622 elementsPathFilters.push( function( element ) 618 623 { … … 620 625 return false; 621 626 } ); 622 627 } 628 } 623 629 624 }625 630 }); 626 631 })(); 627 632 … … 656 661 */ 657 662 658 663 /** 659 * Sets the customer ID for SCAYT. Required for migration from free version 664 * Sets the customer ID for SCAYT. Required for migration from free version 660 665 * with banner to paid version. 661 666 * @name CKEDITOR.config.scayt_customerid 662 667 * @type String … … 732 737 733 738 /** 734 739 * Links SCAYT to custom dictionaries. It's a string containing dictionary ids 735 * separared by commas (","). Available only for licensed version. 740 * separared by commas (","). Available only for licensed version. 736 741 * Further details at http://wiki.spellchecker.net/doku.php?id=custom_dictionary_support . 737 742 * @name CKEDITOR.config.scayt_customDictionaryIds 738 743 * @type String