diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index e14243162..d3bdeff1f 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -386,7 +386,7 @@ var Zotero_Browser = new function() { /* * Callback to be executed when scraping is complete */ - function finishScraping(obj, returnValue, collection) { + function finishScraping(obj, returnValue) { if(!returnValue) { Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError")); // Include link to Known Translator Issues page @@ -585,10 +585,11 @@ Zotero_Browser.Tab.prototype.translate = function(saveLocation) { // use first translator available this.page.translate.setTranslator(this.page.translators[0]); this.page.translate.setHandler("select", me._selectItems); - this.page.translate.setHandler("itemDone", function(obj, item) { Zotero_Browser.itemDone(obj, item, saveLocation) }); - this.page.translate.setHandler("done", function(obj, item) { Zotero_Browser.finishScraping(obj, item, saveLocation) }); + this.page.translate.setHandler("done", function(obj, item) { Zotero_Browser.finishScraping(obj, item) }); this.page.hasBeenTranslated = true; } + this.page.translate.clearHandlers("itemDone"); + this.page.translate.setHandler("itemDone", function(obj, item) { Zotero_Browser.itemDone(obj, item, saveLocation) }); this.page.translate.translate(); } diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 2bb49d57a..6332ece4a 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -326,12 +326,7 @@ - - - - - - + diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 3e5b197f6..ea04e5b29 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -416,6 +416,13 @@ Zotero.Translate.prototype.setHandler = function(type, handler) { this._handlers[type].push(handler); } +/* + * clears all handlers for a given function + */ +Zotero.Translate.prototype.clearHandlers = function(type) { + this._handlers[type] = new Array(); +} + /* * calls a handler (see setHandler above) */