Skip to content

Commit

Permalink
Add preferences menu under Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-DallOsto committed Jul 9, 2024
1 parent 9933f69 commit f06437b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cita/zoteroOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,10 @@ class ZoteroOverlay {

overlayZoteroPane(doc: Document) {
// // add wikicite preferences command to tools popup menu
// var menuPopup
// menuPopup = doc.getElementById('menu_ToolsPopup')
// zoteroOverlay.prefsMenuItem(doc, menuPopup)
this.prefsMenuItem(
doc,
doc.getElementById("menu_ToolsPopup")! as HTMLMenuElement,
);

// // add wikicite submenu to item and collection menus
this.zoteroPopup("item", doc);
Expand Down Expand Up @@ -526,13 +527,15 @@ class ZoteroOverlay {
}

prefsMenuItem(doc: Document, menuPopup: HTMLMenuElement) {
const ns =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// Add Wikicite preferences item to Tools menu
if (menuPopup === null) {
// Don't do anything if elements not loaded yet
return;
}

const wikiciteMenuItem = doc.createElement("menuitem");
const wikiciteMenuItem = doc.createElementNS(ns, "menuitem");
const wikiciteMenuItemID = "wikicite-preferences";
wikiciteMenuItem.setAttribute("id", wikiciteMenuItemID);
wikiciteMenuItem.setAttribute(
Expand Down

0 comments on commit f06437b

Please sign in to comment.