Ticket #76: default_combo_labels.patch

File default_combo_labels.patch, 4.6 KB (added by Frederico Caldeira Knabben, 17 years ago)

Implementation Proposal

  • editor/_source/classes/fcktoolbarfontformatcombo.js

     
    1515        this.NormalLabel = 'Normal' ;
    1616       
    1717        this.PanelWidth = 190 ;
     18
     19        this.DefaultLabel = FCKConfig.DefaultFontFormatLabel || '' ;
    1820}
    1921
    2022// Inherit from FCKToolbarSpecialCombo.
     
    8082        {
    8183//              FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;
    8284
    83                 // IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal.
     85                // IE returns normal for DIV and P, so to avoid confusion, we will not show it as normal.
    8486                if ( value == this.NormalLabel )
    8587                {
    8688                        if ( combo.Label != ' ' )
    8789                                combo.DeselectAll(true) ;
     90
     91                        combo.SetLabel( this.DefaultLabel ) ;
    8892                }
    8993                else
    9094                {
    9195                        if ( this._LastValue == value )
    9296                                return ;
    9397
     98                        if ( !value || value.length == 0 )
     99                        {
     100                                combo.DeselectAll() ;
     101                                combo.SetLabel( this.DefaultLabel ) ;
     102                        }
     103
    94104                        combo.SelectItemByLabel( value, true ) ;
    95105                }
    96106
  • editor/_source/classes/fcktoolbarfontscombo.js

     
    1111        this.Label              = this.GetLabel() ;
    1212        this.Tooltip    = tooltip ? tooltip : this.Label ;
    1313        this.Style              = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
     14
     15        this.DefaultLabel = FCKConfig.DefaultFontLabel || '' ;
    1416}
    1517
    1618// Inherit from FCKToolbarSpecialCombo.
  • editor/_source/classes/fcktoolbarfontsizecombo.js

     
    1111        this.Label              = this.GetLabel() ;
    1212        this.Tooltip    = tooltip ? tooltip : this.Label ;
    1313        this.Style              = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
     14
     15        this.DefaultLabel = FCKConfig.DefaultFontSizeLabel || '' ;
    1416}
    1517
    1618// Inherit from FCKToolbarSpecialCombo.
  • editor/_source/classes/fcktoolbarspecialcombo.js

     
    2121
    2222FCKToolbarSpecialCombo.prototype.TypeOf = 'FCKToolbarSpecialCombo' ;            // @Packager.RemoveLine
    2323
     24FCKToolbarSpecialCombo.prototype.DefaultLabel = '' ;
     25
    2426function FCKToolbarSpecialCombo_OnSelect( itemId, item )
    2527{
    2628        FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).Execute( itemId, item ) ;
     
    8183                                if ( this._LastValue != sValue )
    8284                                {
    8385                                        this._LastValue = sValue ;
    84                                         FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ;
     86
     87                                        if ( !sValue || sValue.length == 0 )
     88                                        {
     89                                                this._Combo.DeselectAll() ;
     90                                                this._Combo.SetLabel( this.DefaultLabel ) ;
     91                                        }
     92                                        else
     93                                                FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ;
    8594                                }
    8695                        }
    8796                }
  • editor/_source/classes/fcktoolbarstylecombo.js

     
    1111        this.Label              = this.GetLabel() ;
    1212        this.Tooltip    = tooltip ? tooltip : this.Label ;
    1313        this.Style              = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
     14
     15        this.DefaultLabel = FCKConfig.DefaultStyleLabel || '' ;
    1416}
    1517
    1618// Inherit from FCKToolbarSpecialCombo.
     
    7779                targetSpecialCombo.SetLabelById( aStyles[0].Name ) ;
    7880        }
    7981        else
    80                 targetSpecialCombo.SetLabel('') ;
     82                targetSpecialCombo.SetLabel(this.DefaultLabel) ;
    8183}
    8284
    8385FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( targetSpecialCombo )
  • fckconfig.js

     
    152152FCKConfig.BodyId = '' ;
    153153FCKConfig.BodyClass = '' ;
    154154
     155FCKConfig.DefaultStyleLabel = '' ;
     156FCKConfig.DefaultFontFormatLabel = '' ;
     157FCKConfig.DefaultFontLabel = '' ;
     158FCKConfig.DefaultFontSizeLabel = '' ;
     159
    155160// The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
    156161FCKConfig.CleanWordKeepsStructure = false ;
    157162
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy