Ticket #5915: 5915_11.patch
File 5915_11.patch, 2.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/dialog/plugin.js
188 188 definition : definition 189 189 } 190 190 , editor ).definition; 191 192 var tabsToRemove = {}; 193 // Cache tabs that should be removed. 194 if ( !( 'removeDialogContents' in editor._ ) && editor.config.removeDialogContents ) 195 { 196 var removeContents = editor.config.removeDialogContents.split( ';' ); 197 198 for ( i = 0; i < removeContents.length; i++ ) 199 { 200 var parts = removeContents[ i ].split( ':' ); 201 if ( parts.length == 2 ) 202 { 203 var removeDialogName = parts[ 0 ].toLowerCase(); 204 if ( !tabsToRemove[ removeDialogName ] ) 205 tabsToRemove[ removeDialogName ] = []; 206 tabsToRemove[ removeDialogName ].push( parts[ 1 ] ); 207 } 208 } 209 editor._.removeDialogContents = tabsToRemove; 210 } 211 212 // Remove tabs of this dialog. 213 if ( editor._.removeDialogContents && ( tabsToRemove = editor._.removeDialogContents[ dialogName.toLowerCase() ] ) ) 214 { 215 for ( i = 0; i < tabsToRemove.length; i++ ) 216 definition.removeContents( tabsToRemove[ i ] ); 217 } 218 191 219 // Initialize load, show, hide, ok and cancel events. 192 220 if ( definition.onLoad ) 193 221 this.on( 'load', definition.onLoad ); … … 1401 1429 // Tool function used to remove an item from an array based on its id. 1402 1430 var removeById = function( array, id, recurse ) 1403 1431 { 1432 id = id.toLowerCase(); 1404 1433 for ( var i = 0, item ; ( item = array[ i ] ) ; i++ ) 1405 1434 { 1406 if ( item.id == id )1435 if ( item.id.toLowerCase() == id ) 1407 1436 return array.splice( i, 1 ); 1408 1437 if ( recurse && item[ recurse ] ) 1409 1438 { … … 3010 3039 * @since 3.5 3011 3040 * @example 3012 3041 * config.dialog_buttonsOrder = 'rtl'; 3013 */3042 */ 3014 3043 3015 /** 3044 /** 3045 * The dialog contents to removed. It's a string composed by dialog name and tab name with a colon between them. 3046 * Separate each pair with semicolon (see example). 3047 * <b>Note: All names are case-insensitive.</b> 3048 * <b>Note: Be cautious when specifying dialog tabs that are mandatory, like "info", dialog functionality might be broken because of this!<b> 3049 * @name CKEDITOR.config.removeDialogContents 3050 * @type String 3051 * @since 3.5 3052 * @default '' 3053 * @example 3054 * config.removeDialogContents = 'flash:advanced;Image:Link'; 3055 */ 3056 3057 /** 3016 3058 * Fired when a dialog definition is about to be used to create a dialog into 3017 3059 * an editor instance. This event makes it possible to customize the definition 3018 3060 * before creating it.