Ticket #864: 864.patch

File 864.patch, 2.5 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/basicstyles/plugin.js

     
    1111        {
    1212                // All buttons use the same code to register. So, to avoid
    1313                // duplications, let's use this tool function.
    14                 var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )
     14                var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton, toggles )
    1515                {
    1616                        var style = new CKEDITOR.style( styleDefiniton );
    1717
     
    2020                                        !editor.readOnly && editor.getCommand( commandName ).setState( state );
    2121                                });
    2222
    23                         editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );
     23                        editor.addCommand( commandName, new CKEDITOR.styleCommand( style, toggles ) );
    2424
    2525                        editor.ui.addButton( buttonName,
    2626                                {
     
    3636                addButtonCommand( 'Italic'              , lang.italic           , 'italic'              , config.coreStyles_italic );
    3737                addButtonCommand( 'Underline'   , lang.underline                , 'underline'   , config.coreStyles_underline );
    3838                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' );
    4141        }
    4242});
    4343
  • _source/plugins/styles/plugin.js

     
    15321532        }
    15331533})();
    15341534
    1535 CKEDITOR.styleCommand = function( style )
     1535CKEDITOR.styleCommand = function( style, toggles )
    15361536{
    15371537        this.style = style;
     1538        toggles && ( this.toggles = toggles );
    15381539};
    15391540
    15401541CKEDITOR.styleCommand.prototype.exec = function( editor )
     
    15461547        if ( doc )
    15471548        {
    15481549                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 );
    15491553                        this.style.apply( doc );
     1554                }
    15501555                else if ( this.state == CKEDITOR.TRISTATE_ON )
    15511556                        this.style.remove( doc );
    15521557        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy