Ticket #1446 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

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:
Cc:

Description

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

context-menu-hook-HEAD.patch (0.7 kB) - added by guest 4 years ago.

Change History

Changed 4 years ago by guest

Changed 4 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' ] 
	      ] 
};

Changed 4 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

Changed 4 years ago by ray

good thing

Note: See TracTickets for help on using tickets.