Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-DallOsto committed Aug 27, 2024
1 parent 76a0a59 commit 1e92ce5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
22 changes: 11 additions & 11 deletions src/cita/zoteroOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ class ZoteroOverlay {
// we do this because each tab (library and every reader) has a unique tab_id that we can get by walking
// up the DOM from the body
const tab_id: string =
body.parentElement?.parentElement?.parentElement
?.parentElement?.parentElement?.parentElement?.id!;
body.parentElement!.parentElement!.parentElement!
.parentElement!.parentElement!.parentElement!.id;
citationBoxRoots[tab_id] = createRoot(
body.firstChild! as Element,
);
Expand All @@ -605,8 +605,8 @@ class ZoteroOverlay {
return;
}
const tab_id: string =
body.parentElement?.parentElement?.parentElement
?.parentElement?.parentElement?.parentElement?.id!;
body.parentElement!.parentElement!.parentElement!
.parentElement!.parentElement!.parentElement!.id;
citationBoxRoots[tab_id].render(
<CitationsBoxContainer
key={"citationsBox-" + item.id}
Expand Down Expand Up @@ -1090,21 +1090,21 @@ class ZoteroOverlay {
zoteroPopup(menuName: MenuSelectionType, doc: Document) {
const ns =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var zoteroMenu = doc.getElementById(`zotero-${menuName}menu`);
const zoteroMenu = doc.getElementById(`zotero-${menuName}menu`);
if (zoteroMenu === null) {
// Don't do anything if elements not loaded yet
return;
}

var wikiciteSeparator = doc.createElementNS(ns, "menuseparator");
var wikiciteSeparatorID = `wikicite-${menuName}submenu-separator`;
const wikiciteSeparator = doc.createElementNS(ns, "menuseparator");
const wikiciteSeparatorID = `wikicite-${menuName}submenu-separator`;
wikiciteSeparator.setAttribute("id", wikiciteSeparatorID);
zoteroMenu.appendChild(wikiciteSeparator);
WikiciteChrome.registerXUL(wikiciteSeparatorID, doc);

// Wikicite submenu
var wikiciteSubmenu = doc.createElementNS(ns, "menu");
var wikiciteSubmenuID = `wikicite-${menuName}submenu`;
const wikiciteSubmenu = doc.createElementNS(ns, "menu");
const wikiciteSubmenuID = `wikicite-${menuName}submenu`;
wikiciteSubmenu.setAttribute("id", wikiciteSubmenuID);
wikiciteSubmenu.setAttribute(
"label",
Expand All @@ -1114,7 +1114,7 @@ class ZoteroOverlay {
WikiciteChrome.registerXUL(wikiciteSubmenuID, doc);

// Wikicite submenu popup
var wikiciteSubmenuPopup = doc.createElementNS(ns, "menupopup");
const wikiciteSubmenuPopup = doc.createElementNS(ns, "menupopup");
wikiciteSubmenuPopup.setAttribute(
"id",
`wikicite-${menuName}submenu-popup`,
Expand Down Expand Up @@ -1231,7 +1231,7 @@ class ZoteroOverlay {
) {
const ns =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var menuFunc = doc.createElementNS(ns, "menuitem");
const menuFunc = doc.createElementNS(ns, "menuitem");
menuFunc.setAttribute("id", IDPrefix + functionName);
menuFunc.setAttribute(
"label",
Expand Down
12 changes: 8 additions & 4 deletions src/components/itemPane/citationsBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ function CitationsBox(props: {
(citation: Citation, index: number) => {
let value;
switch (props.sortBy) {
case "ordinal":
case "ordinal": {
value = index;
break;
case "authors":
}
case "authors": {
value = citation.target.item.getField("firstCreator");
break;
case "date":
}
case "date": {
const date = Zotero.Date.strToISO(
citation.target.item.getField("date"),
);
Expand All @@ -64,9 +66,11 @@ function CitationsBox(props: {
value = new Date(date);
}
break;
case "title":
}
case "title": {
value = citation.target.title;
break;
}
default:
}
return { index: index, value: value };
Expand Down

0 comments on commit 1e92ce5

Please sign in to comment.