Ticket #958: 958.patch
File 958.patch, 3.7 KB (added by , 16 years ago) |
---|
-
editor/_source/classes/fckcontextmenu.js
57 57 } 58 58 } 59 59 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 */ 64 FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) 61 65 { 62 var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;66 var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag) ; 63 67 this._Redraw = true ; 64 68 return oItem ; 65 69 } -
editor/_source/classes/fckmenublock.js
33 33 return this._Items.length ; 34 34 } 35 35 36 FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )36 FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) 37 37 { 38 var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;38 var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) ; 39 39 40 40 oItem.OnClick = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ; 41 41 oItem.OnActivate = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnActivate, this ) ; -
editor/_source/classes/fckmenuitem.js
21 21 * Defines and renders a menu items in a menu block. 22 22 */ 23 23 24 var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled )24 var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled, tag ) 25 25 { 26 26 this.Name = name ; 27 27 this.Label = label || name ; … … 32 32 this.SubMenu = new FCKMenuBlockPanel() ; 33 33 this.SubMenu.Parent = parentMenuBlock ; 34 34 this.SubMenu.OnClick = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ; 35 this.Tag = tag ; 35 36 36 37 if ( FCK.IECleanup ) 37 38 FCK.IECleanup.AddItem( this, FCKMenuItem_Cleanup ) ; … … 39 40 40 41 FCKMenuItem.prototype.TypeName = 'FCKMenuItem' ; // @Packager.RemoveLine 41 42 42 FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )43 FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) 43 44 { 44 45 this.HasSubMenu = true ; 45 return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;46 return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, tag ) ; 46 47 } 47 48 48 49 FCKMenuItem.prototype.AddSeparator = function() -
editor/_source/internals/fck_contextmenu.js
325 325 function FCK_ContextMenu_OnItemClick( item ) 326 326 { 327 327 FCK.Focus() ; 328 FCKCommands.GetCommand( item.Name ).Execute( ) ;328 FCKCommands.GetCommand( item.Name ).Execute( item.Tag ) ; 329 329 }