Ticket #864: 864.patch
File 864.patch, 2.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/basicstyles/plugin.js
11 11 { 12 12 // All buttons use the same code to register. So, to avoid 13 13 // duplications, let's use this tool function. 14 var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )14 var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton, toggles ) 15 15 { 16 16 var style = new CKEDITOR.style( styleDefiniton ); 17 17 … … 20 20 !editor.readOnly && editor.getCommand( commandName ).setState( state ); 21 21 }); 22 22 23 editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );23 editor.addCommand( commandName, new CKEDITOR.styleCommand( style, toggles ) ); 24 24 25 25 editor.ui.addButton( buttonName, 26 26 { … … 36 36 addButtonCommand( 'Italic' , lang.italic , 'italic' , config.coreStyles_italic ); 37 37 addButtonCommand( 'Underline' , lang.underline , 'underline' , config.coreStyles_underline ); 38 38 addButtonCommand( 'Strike' , lang.strike , 'strike' , config.coreStyles_strike ); 39 addButtonCommand( 'Subscript' , lang.subscript , 'subscript' , config.coreStyles_subscript );40 addButtonCommand( 'Superscript' , lang.superscript , 'superscript' , config.coreStyles_superscript );39 addButtonCommand( 'Subscript' , lang.subscript , 'subscript' , config.coreStyles_subscript, 'superscript' ); 40 addButtonCommand( 'Superscript' , lang.superscript , 'superscript' , config.coreStyles_superscript, 'subscript' ); 41 41 } 42 42 }); 43 43 -
_source/plugins/styles/plugin.js
1532 1532 } 1533 1533 })(); 1534 1534 1535 CKEDITOR.styleCommand = function( style )1535 CKEDITOR.styleCommand = function( style, toggles ) 1536 1536 { 1537 1537 this.style = style; 1538 toggles && ( this.toggles = toggles ); 1538 1539 }; 1539 1540 1540 1541 CKEDITOR.styleCommand.prototype.exec = function( editor ) … … 1546 1547 if ( doc ) 1547 1548 { 1548 1549 if ( this.state == CKEDITOR.TRISTATE_OFF ) 1550 { 1551 var toggles = this.toggles && editor.getCommand( this.toggles ); 1552 toggles && ( toggles.state == CKEDITOR.TRISTATE_ON ) && toggles.style.remove( doc ); 1549 1553 this.style.apply( doc ); 1554 } 1550 1555 else if ( this.state == CKEDITOR.TRISTATE_ON ) 1551 1556 this.style.remove( doc ); 1552 1557 }