Add JavaScript Function To Menu

Are you missing a feature? Request its implementation here.
jlpoole
Posts: 23
Joined: Sun Jan 15, 2017 3:15 pm
Location: Salem, Oregon

Add JavaScript Function To Menu

Post by jlpoole »

I've searched around and only found that I could add a JavaScript function call to the contextual pop-up menu. I could not find anything about adding to a Document Association menu or the Application's main menu.

I would like to be able to add a menu item on the topmost Menu, e.g. OurCompany, and then add submenu choices that invoke JavaScript.

Example:

...Document Window OurCompany Help
submenu1
submenu2
submenu2.1
submenu2.2

I'm guessing I might be able to accomplish the menu build-out in Java, but the question then becomes how do I tie my JavaScript code to the submenus?
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add JavaScript Function To Menu

Post by Radu »

Hi,

If we take as an example this Javascript code which adds the action to a popup menu for the Author visual editing mode:

https://github.com/oxygenxml/wsaccess-j ... sAccess.js

there is also a "customizeAuthorPageExtensionMenu" callback which would allow you to customize the framework-specific menu:

https://www.oxygenxml.com/InstData/Edit ... mizer.html

If you want to add a main menu on the main menu bar you can use the API:

https://www.oxygenxml.com/InstData/Edit ... ustomizer-

if you cannot get this to work in the Javascript code I can try to create a sample plugin for you.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply