- closes #586, scraped item doesn't get added to collection

- removes nonfunctional popup menu code
This commit is contained in:
Simon Kornblith 2007-03-27 00:06:50 +00:00
parent 07db0d8fe3
commit bc6d24882f
3 changed files with 12 additions and 9 deletions

View File

@ -386,7 +386,7 @@ var Zotero_Browser = new function() {
/* /*
* Callback to be executed when scraping is complete * Callback to be executed when scraping is complete
*/ */
function finishScraping(obj, returnValue, collection) { function finishScraping(obj, returnValue) {
if(!returnValue) { if(!returnValue) {
Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError")); Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError"));
// Include link to Known Translator Issues page // Include link to Known Translator Issues page
@ -585,10 +585,11 @@ Zotero_Browser.Tab.prototype.translate = function(saveLocation) {
// use first translator available // use first translator available
this.page.translate.setTranslator(this.page.translators[0]); this.page.translate.setTranslator(this.page.translators[0]);
this.page.translate.setHandler("select", me._selectItems); 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) });
this.page.translate.setHandler("done", function(obj, item) { Zotero_Browser.finishScraping(obj, item, saveLocation) });
this.page.hasBeenTranslated = true; 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(); this.page.translate.translate();
} }

View File

@ -326,12 +326,7 @@
<!-- Scrape Code --> <!-- Scrape Code -->
<hbox id="urlbar-icons"> <hbox id="urlbar-icons">
<popupset> <image src="chrome://zotero/skin/treeitem-book.png" id="zotero-status-image" onclick="Zotero_Browser.scrapeThisPage()" position="1" hidden="true"/>
<popup id="zotero-scrape-popup" onpopupshowing="Zotero_Browser.showPopup(null, this)" onpopuphidden="Zotero_Browser.hidePopup(null, this)">
</popup>
</popupset>
<image src="chrome://zotero/skin/treeitem-book.png" id="zotero-status-image" onclick="Zotero_Browser.scrapeThisPage()" position="1" hidden="true" context="zotero-scrape-popup" />
</hbox> </hbox>
<statusbar id="status-bar"> <statusbar id="status-bar">

View File

@ -416,6 +416,13 @@ Zotero.Translate.prototype.setHandler = function(type, handler) {
this._handlers[type].push(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) * calls a handler (see setHandler above)
*/ */