Changeset 1602
- Timestamp:
- 2008-02-24 16:52:48 (4 months ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 5 modified
-
editor/_source/classes/fckcontextmenu.js (modified) (1 diff)
-
editor/_source/classes/fckmenublock.js (modified) (1 diff)
-
editor/_source/classes/fckmenuitem.js (modified) (3 diffs)
-
editor/_source/internals/fck_contextmenu.js (modified) (1 diff)
-
_whatsnew.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckcontextmenu.js
r1598 r1602 58 58 } 59 59 60 FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) 61 { 62 var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled) ; 60 /** 61 The customData parameter is just a value that will be send to the command that is executed, 62 so it's possible to reuse the same command for several items just by assigning different data for each one. 63 */ 64 FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) 65 { 66 var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ; 63 67 this._Redraw = true ; 64 68 return oItem ; -
FCKeditor/trunk/editor/_source/classes/fckmenublock.js
r1565 r1602 34 34 } 35 35 36 FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )36 FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) 37 37 { 38 var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;38 var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ; 39 39 40 40 oItem.OnClick = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ; -
FCKeditor/trunk/editor/_source/classes/fckmenuitem.js
r1565 r1602 22 22 */ 23 23 24 var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled )24 var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled, customData ) 25 25 { 26 26 this.Name = name ; … … 33 33 this.SubMenu.Parent = parentMenuBlock ; 34 34 this.SubMenu.OnClick = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ; 35 this.CustomData = customData ; 35 36 36 37 if ( FCK.IECleanup ) … … 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, customData ) 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, customData ) ; 46 47 } 47 48 -
FCKeditor/trunk/editor/_source/internals/fck_contextmenu.js
r1565 r1602 326 326 { 327 327 FCK.Focus() ; 328 FCKCommands.GetCommand( item.Name ).Execute( ) ;329 } 328 FCKCommands.GetCommand( item.Name ).Execute( item.CustomData ) ; 329 } -
FCKeditor/trunk/_whatsnew.html
r1598 r1602 139 139 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml() in IE will no 140 140 longer turn the preceding normal whitespace into &nbsp;.</li> 141 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem method now has an 142 additional fifth parameter "customData" that will be send to the Execute method of the command for that 143 menu item, allowing a single command to be used for different menu items..</li> 141 144 </ul> 142 145 <p>