Page 1 of 1

Add JavaScript Function To Menu

Posted: Thu Apr 18, 2019 12:14 am
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?

Re: Add JavaScript Function To Menu

Posted: Mon Apr 22, 2019 8:58 am
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