Ticket #2912: 2912.patch
File 2912.patch, 3.8 KB (added by , 14 years ago) |
---|
-
_source/core/command.js
5 5 6 6 CKEDITOR.command = function( editor, commandDefinition ) 7 7 { 8 this.state = CKEDITOR.TRISTATE_OFF;8 this.state = ( 'state' in commandDefinition ) ? commandDefinition.state : CKEDITOR.TRISTATE_OFF; 9 9 10 10 this.exec = function() 11 11 { … … 18 18 CKEDITOR.event.call( this ); 19 19 }; 20 20 21 CKEDITOR.command.prototype = 22 { 23 setState : function( newState ) 24 { 25 // Do nothing if there is no state change. 26 if ( this.state == newState ) 27 return false; 28 29 // Set the new state. 30 this.state = newState; 31 32 // Fire the "state" event, so other parts of the code can react to the 33 // change. 34 this.fire( 'state' ); 35 36 return true; 37 } 38 } 39 21 40 CKEDITOR.event.implementOn( CKEDITOR.command.prototype ); -
_source/plugins/basicstyles/plugin.js
17 17 18 18 editor.attachStyleStateChange( style, function( state ) 19 19 { 20 var command = editor.getCommand( commandName ); 21 command.state = state; 22 command.fire( 'state' ); 20 editor.getCommand( commandName ).setState( state ); 23 21 }); 24 22 25 23 editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) ); -
_source/plugins/indent/plugin.js
13 13 14 14 function setState( editor, state ) 15 15 { 16 var command = editor.getCommand( this.name ); 17 command.state = state; 18 command.fire( 'state' ); 16 editor.getCommand( this.name ).setState( state ); 19 17 } 20 18 21 19 function onSelectionChange( evt ) -
_source/plugins/link/plugin.js
60 60 var command = editor.getCommand( 'unlink' ), 61 61 element = evt.data.path.lastElement.getAscendant( 'a', true ); 62 62 if ( element && element.getName() == 'a' && element.getAttribute( 'href' ) ) 63 command.s tate = CKEDITOR.TRISTATE_OFF;63 command.setState( CKEDITOR.TRISTATE_OFF ); 64 64 else 65 command.state = CKEDITOR.TRISTATE_DISABLED; 66 command.fire( 'state' ); 65 command.setState( CKEDITOR.TRISTATE_DISABLED ); 67 66 } ); 68 67 69 68 // Register a contentDom handler for displaying placeholders after mode change. -
_source/plugins/list/plugin.js
168 168 169 169 function setState( editor, state ) 170 170 { 171 var command = editor.getCommand( this.name ); 172 command.state = state; 173 command.fire( 'state' ); 171 editor.getCommand( this.name ).setState( state ); 174 172 } 175 173 176 174 function onSelectionChange( evt ) -
_source/plugins/sourcearea/plugin.js
113 113 114 114 editor.on( 'mode', function() 115 115 { 116 var command = editor.getCommand( 'source' ); 117 command.state = ( editor.mode == 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); 118 command.fire( 'state' ); 116 editor.getCommand( 'source' ).setState( 117 editor.mode == 'source' ? 118 CKEDITOR.TRISTATE_ON : 119 CKEDITOR.TRISTATE_OFF ); 119 120 }); 120 121 } 121 122 });