Skip to content

Commit

Permalink
cleaning up unncessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
aborel committed Mar 24, 2024
1 parent 4ecbce0 commit 5ad7594
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
1 change: 0 additions & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ async function startup({ id, version, rootURI }) {
Services.scriptloader.loadSubScript(rootURI + 'zotero-ocr.js');
ZoteroOCR.init({ id, version, rootURI });
ZoteroOCR.addToAllWindows();
await ZoteroOCR.main();
}

function onMainWindowLoad({ window }) {
Expand Down
7 changes: 0 additions & 7 deletions src/style.css

This file was deleted.

35 changes: 2 additions & 33 deletions src/zotero-ocr.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,16 @@ ZoteroOCR = {
// Use Fluent for localization
window.MozXULElement.insertFTLIfNeeded("zotero-ocr.ftl");

// Add menu option
let menuitem = doc.createXULElement('menuitem');
menuitem.id = 'ocr-selected-pdfs';
menuitem.setAttribute('type', 'checkbox');
menuitem.setAttribute('data-l10n-id', 'ocr-selected-pdfs');
// MozMenuItem#checked is available in Zotero 7
menuitem.addEventListener('command', () => {
ZoteroOCR.recognize(window);
});
doc.getElementById('menu_ToolsPopup').appendChild(menuitem);
this.storeAddedElement(menuitem);


// Add context menu option
let popupmenuitem = doc.createXULElement('menuitem');
popupmenuitem.id = 'zotero-ocr-item-menu';
popupmenuitem.class = 'menuitem-iconic zotero-menuitem-ocr'
//popupmenuitem.setAttribute('type', 'checkbox');
popupmenuitem.setAttribute('data-l10n-id', 'ocr-selected-pdfs');
doc.getElementById('zotero-itemmenu').appendChild(popupmenuitem);
popupmenuitem.addEventListener('command', () => {
ZoteroOCR.recognize(window);
});
this.storeAddedElement(popupmenuitem);

/*
const menupopup = doc.getElementById("zotero-itemmenu").appendChild(elements.create("menu", {
id: "zotero-ocr-item-menu",
label: "Zotero-OCR" //,
//class: "menuitem-iconic",
//image: "chrome://zotero-better-bibtex/content/skin/bibtex-menu.svg"
})).appendChild(elements.create("menupopup"));
menupopup.appendChild(elements.create("menuitem", {
label: "Test OCR",
oncommand: () => ZoteroOCR.recognize(window)
}));
*/
},

addToAllWindows() {
Expand Down Expand Up @@ -313,10 +287,5 @@ ZoteroOCR = {
}
}
}
},

async main() {
// Global properties are included automatically in Zotero 7
var host = new URL('https://foo.com/path').host;
},
}
};
2 changes: 1 addition & 1 deletion updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
]
}
}
}
}

0 comments on commit 5ad7594

Please sign in to comment.