Namespace wptheme.contextMenu.extension
Constructor Attributes | Constructor Name and Description |
---|---|
The namespace that holds various extensions that can be injected using other menu modules, for instance wp_simple_contextmenu_ext
|
Method Attributes | Method Name and Description |
---|---|
<static> |
wptheme.contextMenu.extension.actionUrlTarget(jsonObject)
Provides the actionUrlTarget extension for simple menus.
|
<static> |
wptheme.contextMenu.extension.menuItemScope(jsonObject)
Provides the menuItemScope extension for simple menus.
|
Namespace Detail
wptheme.contextMenu.extension
The namespace that holds various extensions that can be injected using other menu modules, for instance wp_simple_contextmenu_ext
Method Detail
<static>
{DOMWindow}
wptheme.contextMenu.extension.actionUrlTarget(jsonObject)
Provides the actionUrlTarget extension for simple menus. It allows to define the target window within the browser DOM
in which a given actionUrl of a menuitem should be executed. This is very helpful in case you want to execute a
menu within another iframe of the page for instance.
The menuitem json definitionn that is returned as part of the menu server side feed needs to define the additional metadata actionUrlTarget. Acceptable values are: "same", "master", "toolbar", "view", with "same" as the default.
Client-side menu functions (menu action and visibility function) are always executed in the window scope the respective contribution is from. As such it is possible to also define the contributor URI in the form of "nm:oid:<id of the page>"
actionUrlTarget example: { "type": "StaticMenuitem", "id": "myEditFct", ... "metadata": { ... "actionUrlTarget": "view" } }
contributor example: { "type": "StaticMenuitem", "id": "myEditFct", ... "metadata": { ... "contributor": nm:oid:toolbarPage } }
- Parameters:
- {JSON} jsonObject
- the object to pass the parameters
- Returns:
- {DOMWindow} the browser window handle that applies to the given target
<static>
{DOMWindow}
wptheme.contextMenu.extension.menuItemScope(jsonObject)
Provides the menuItemScope extension for simple menus. It allows to determine the window within the browser DOM
that contributed a menu item. The contribution window holds the client-side objects (e.g. the visibility or action
function) of a menu item that are referenced in its JSON descriptor.
contributor example: { "type": "StaticMenuitem", "id": "myEditFct", ... "metadata": { ... "contributor": nm:oid:toolbarPage } }
- Parameters:
- {JSON} jsonObject
- the object to pass the parameters
- Returns:
- {DOMWindow} the browser window handle representing the scope of the menu item.