Add JavaScript Function To Menu

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

Add JavaScript Function To Menu

Post by jlpoole » Thu Apr 18, 2019 12:14 am

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.


...Document Window OurCompany Help

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?

Posts: 7094
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add JavaScript Function To Menu

Post by Radu » Mon Apr 22, 2019 8:58 am


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

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

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

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

Radu Coravu
<oXygen/> XML Editor

Post Reply