Skip to content

Commit

Permalink
Remove leftover code from old preferences menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-DallOsto committed Aug 5, 2024
1 parent 1f16c5f commit 9e5d3af
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
29 changes: 0 additions & 29 deletions src/cita/wikiciteChrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,6 @@ class WikiciteChrome {

static showUpgradeMessage = function () {};

/******************************************/
// UI functions
/******************************************/

// Fix: did changing this to a class break this scoping here?
// Open Wikicite preferences window
static openPreferences = function () {
// if (
// !("_preferencesWindow" in this) ||
// this._preferencesWindow === null ||
// this._preferencesWindow.closed
// ) {
// var featureStr = "chrome, titlebar, toolbar=yes, centerscreen, ";
// var modalStr = Services.prefs.getBoolPref(
// "browser.preferences.instantApply",
// )
// ? "dialog=no"
// : "modal";
// featureStr = featureStr + modalStr;
// this._preferencesWindow = window.openDialog(
// "chrome://cita/content/preferences.xul",
// "wikicite-prefs-window",
// featureStr,
// { Wikicite: Wikicite, Prefs: window.Wikicite.Prefs },
// );
// }
// this._preferencesWindow.focus();
};

/******************************************/
// XUL related functions
/******************************************/
Expand Down
38 changes: 0 additions & 38 deletions src/cita/zoteroOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,19 +515,10 @@ class ZoteroOverlay {
}

overlayZoteroPane(doc: Document) {
// // add wikicite preferences command to tools popup menu
// this.prefsMenuItem(
// doc,
// doc.getElementById("menu_ToolsPopup")! as HTMLMenuElement,
// );
const prefOptions = {
pluginID: config.addonID,
src: `chrome://${config.addonRef}/content/preferences.xhtml`,
// src: rootURI + "chrome/content/preferences.xhtml",
// label: getString("prefs-title"),
// label: "CITA",
label: Wikicite.getString("wikicite.global.name"),
// image: `chrome://${config.addonRef}/content/icons/favicon.png`,
image: `chrome://${config.addonRef}/content/skin/default/cita.svg`,
defaultXUL: true,
};
Expand Down Expand Up @@ -568,35 +559,6 @@ class ZoteroOverlay {
?.remove();
}

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.createElementNS(ns, "menuitem");
const wikiciteMenuItemID = "wikicite-preferences";
wikiciteMenuItem.setAttribute("id", wikiciteMenuItemID);
wikiciteMenuItem.setAttribute(
"label",
Wikicite.getString("wikicite.preferences.menuitem"),
);
wikiciteMenuItem.addEventListener(
"command",
function () {
WikiciteChrome.openPreferences();
},
false,
);

menuPopup.appendChild(wikiciteMenuItem);

WikiciteChrome.registerXUL(wikiciteMenuItemID, doc);
}

/******************************************/
// Item pane functions
/******************************************/
Expand Down

0 comments on commit 9e5d3af

Please sign in to comment.