diff --git a/src/bootstrap.js b/src/bootstrap.js index b270d45..e2db3b8 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -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 }) { diff --git a/src/style.css b/src/style.css deleted file mode 100644 index 57e6e0a..0000000 --- a/src/style.css +++ /dev/null @@ -1,7 +0,0 @@ -.row { - color: red; -} - -window[data-green-instead] .row { - color: green; -} diff --git a/src/zotero-ocr.js b/src/zotero-ocr.js index 5518379..136e722 100644 --- a/src/zotero-ocr.js +++ b/src/zotero-ocr.js @@ -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() { @@ -313,10 +287,5 @@ ZoteroOCR = { } } } - }, - - async main() { - // Global properties are included automatically in Zotero 7 - var host = new URL('https://foo.com/path').host; - }, + } }; diff --git a/updates.json b/updates.json index fad9e10..05292a3 100644 --- a/updates.json +++ b/updates.json @@ -14,4 +14,4 @@ ] } } -} \ No newline at end of file +}