Ticket #958: 958.patch

File 958.patch, 3.7 KB (added by Alfonso Martínez de Lizarrondo, 16 years ago)

Proposed SVN patch

  • editor/_source/classes/fckcontextmenu.js

     
    5757        }
    5858}
    5959
    60 FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
     60/**
     61 The tag parameter is just a value that will be send to the command that is executed, so it's possible
     62 to reuse the same command for several items just by assigning differen tags for each one.
     63*/
     64FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag )
    6165{
    62         var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled) ;
     66        var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag) ;
    6367        this._Redraw = true ;
    6468        return oItem ;
    6569}
  • editor/_source/classes/fckmenublock.js

     
    3333        return this._Items.length ;
    3434}
    3535
    36 FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
     36FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag )
    3737{
    38         var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;
     38        var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) ;
    3939
    4040        oItem.OnClick           = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ;
    4141        oItem.OnActivate        = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnActivate, this ) ;
  • editor/_source/classes/fckmenuitem.js

     
    2121 * Defines and renders a menu items in a menu block.
    2222 */
    2323
    24 var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled )
     24var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled, tag )
    2525{
    2626        this.Name               = name ;
    2727        this.Label              = label || name ;
     
    3232        this.SubMenu                    = new FCKMenuBlockPanel() ;
    3333        this.SubMenu.Parent             = parentMenuBlock ;
    3434        this.SubMenu.OnClick    = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ;
     35        this.Tag = tag ;
    3536
    3637        if ( FCK.IECleanup )
    3738                FCK.IECleanup.AddItem( this, FCKMenuItem_Cleanup ) ;
     
    3940
    4041FCKMenuItem.prototype.TypeName = 'FCKMenuItem' ;                // @Packager.RemoveLine
    4142
    42 FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
     43FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag )
    4344{
    4445        this.HasSubMenu = true ;
    45         return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;
     46        return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) ;
    4647}
    4748
    4849FCKMenuItem.prototype.AddSeparator = function()
  • editor/_source/internals/fck_contextmenu.js

     
    325325function FCK_ContextMenu_OnItemClick( item )
    326326{
    327327        FCK.Focus() ;
    328         FCKCommands.GetCommand( item.Name ).Execute() ;
     328        FCKCommands.GetCommand( item.Name ).Execute( item.Tag ) ;
    329329}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy