diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 9fb08bbba7..c022192e89 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -40,7 +40,6 @@ var Zotero_Browser = new function() { this.init = init; - this.scrapeThisPage = scrapeThisPage; this.annotatePage = annotatePage; this.toggleMode = toggleMode; this.toggleCollapsed = toggleCollapsed; @@ -155,13 +154,25 @@ var Zotero_Browser = new function() { * Scrapes a page (called when the capture icon is clicked * @return void */ - function scrapeThisPage(translator) { + this.scrapeThisPage = function (translator, event) { // Perform translation var tab = _getTabObject(Zotero_Browser.tabbrowser.selectedBrowser); if(tab.page.translators && tab.page.translators.length) { tab.page.translate.setTranslator(translator || tab.page.translators[0]); Zotero_Browser.performTranslation(tab.page.translate); } + else { + // Keep in sync with cmd_zotero_newItemFromCurrentPage + // + // DEBUG: Possible to just trigger command directly with event? Assigning it to the + // command property of the icon doesn't seem to work, and neither does goDoCommand() + // from chrome://global/content/globalOverlay.js. Getting the command by id and + // running doCommand() works but doesn't pass the event. + ZoteroPane.addItemFromPage( + 'temporaryPDFHack', + (event && event.shiftKey) ? !Zotero.Prefs.get('automaticSnapshots') : null + ); + } } /* @@ -449,6 +460,11 @@ var Zotero_Browser = new function() { var tab = _getTabObject(this.tabbrowser.selectedBrowser); var translators = tab.page.translators; + + // Don't show context menu for web page items, for now + // TODO: Show with/without snapshots option? + if (!translators) return; + for(var i=0, n=translators.length; i diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 603c2f4bd4..36c8a7f7fb 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -60,6 +60,7 @@ + @@ -139,7 +140,6 @@ -