Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1446 closed enhancement (fixed)

PATCH: Provide some means for own menu entries in ContextMenu

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Plugins Version: trunk
Severity: normal Keywords:


Inspired by the DoubleClick? plugin, I implemented some means to get my own entries into the ContextMenu?. It is basically an object that contains arrays of menu-items in form of properties that match a tag name (e.g. { 'a' : [array of menu items], ... } )

The patch would make the plugin create such an (empty) object within the Xinha object. Upon menu generation, the plugin would then check for an array under the name of the current tag, and add any menu item it may find there to the context menu.

With this proposed patch, plugins could check for the existence of the container object, and if it does, easily add their own menu entries.

It was tested with 0.94, 0.95 and current trunk (rev1188).

The patch is against rev1188 (HEAD at the time of writing :-) )

Attachments (1)

context-menu-hook-HEAD.patch (738 bytes) - added by guest 11 years ago.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by guest

comment:1 Changed 11 years ago by gogo

Good idea, changeset:1196 implements this, excepting that the location for these hooks was moved to the plugin's own configuration. Example usage follows...

xinha_config.ContextMenu.customHooks = {
	 'a': [ 
		['Label', function() { alert('Action'); }, 'Tooltip', '/xinha/images/ed_copy.gif' ] 

comment:2 Changed 11 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 11 years ago by ray

good thing

Note: See TracTickets for help on using tickets.