Confirmed users
764
edits
m (→API Methods) |
|||
Line 56: | Line 56: | ||
; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ||
==== | ==== insertBefore(context, target, menuitem) ==== | ||
Inserts a new item before an existing one. If the target item does not exist, this function silently fails, and the context menu not modified. | |||
; context : A value describing the context under which to add the item. See [[#Specifying Contexts]]. | ; context : A value describing the context under which to add the item. See [[#Specifying Contexts]]. | ||
; target : A value describing the existing item to | ; target : A value describing the existing item before which to insert the new item. See [[#Specifying Existing Menuitems]]. | ||
; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ||
==== | ==== replace(context, target, menuitem) ==== | ||
Replaces an existing item in the context menu. If the target item does not exist, this function silently fails, and the context menu is not modified. | |||
; context : A value describing the context under which to add the item. See [[#Specifying Contexts]]. | ; context : A value describing the context under which to add the item. See [[#Specifying Contexts]]. | ||
; target : A value describing the existing item | ; target : A value describing the existing item to replace. See [[#Specifying Existing Menuitems]]. | ||
; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ; menuitem : The menuitem to add. See [[#Specifying New Menuitems]]. | ||