From ba12583b221d574a9b3013c2623e92ac0da02cf1 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 11 Jul 2011 17:38:25 +0000 Subject: [PATCH] - Fix download overlay - Fix RIS/Refer intercept progress --- chrome/content/zotero/downloadOverlay.js | 16 ++++++++++++---- chrome/content/zotero/xpcom/mimeTypeHandler.js | 8 ++++++-- chrome/locale/en-US/zotero/zotero.properties | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/downloadOverlay.js b/chrome/content/zotero/downloadOverlay.js index ae13a414ed..727295b49b 100644 --- a/chrome/content/zotero/downloadOverlay.js +++ b/chrome/content/zotero/downloadOverlay.js @@ -70,9 +70,15 @@ var Zotero_DownloadOverlay = new function() { // set up callback var callback = function(item) { if(!win) return; - - if(item) win.Zotero_Browser.itemDone(null, item); - win.Zotero_Browser.finishScraping(null, !!item); + + if(item) { + progressWin.addLines([item.getDisplayTitle()], [item.getImageSrc()]); + progressWin.startCloseTimer(); + if(collection) collection.addItem(item.id); + } else { + progressWin.addDescription(Zotero.getString("save.link.error")); + progressWin.startCloseTimer(8000); + } if(recognizePDF) { var timer = Components.classes["@mozilla.org/timer;1"] @@ -90,7 +96,9 @@ var Zotero_DownloadOverlay = new function() { }; // show progress dialog - win.Zotero_Browser.progress.show(); + var progressWin = new Zotero.ProgressWindow(); + progressWin.changeHeadline(Zotero.getString("save.link")); + progressWin.show(); // perform import Zotero.Attachments.importFromURL(url, false, false, false, diff --git a/chrome/content/zotero/xpcom/mimeTypeHandler.js b/chrome/content/zotero/xpcom/mimeTypeHandler.js index c0b5819bde..b0a9ace15a 100644 --- a/chrome/content/zotero/xpcom/mimeTypeHandler.js +++ b/chrome/content/zotero/xpcom/mimeTypeHandler.js @@ -159,8 +159,12 @@ Zotero.MIMETypeHandler = new function () { libraryID = frontWindow.ZoteroPane.getSelectedLibraryID(); collection = frontWindow.ZoteroPane.getSelectedCollection(); } catch(e) {} - translation.setHandler("itemDone", function(obj, item) { frontWindow.Zotero_Browser.itemDone(obj, item, collection) }); - translation.setHandler("done", function(obj, item) { frontWindow.Zotero_Browser.finishScraping(obj, item, collection) }); + translation.setHandler("itemDone", function(obj, dbItem, item) { + frontWindow.Zotero_Browser.itemDone(obj, dbItem, item, collection); + }); + translation.setHandler("done", function(obj, item) { + frontWindow.Zotero_Browser.finishScraping(obj, item, collection); + }); // attempt to retrieve translators var translators = translation.getTranslators(); diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 5785430345..03e41b1091 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -395,6 +395,7 @@ fileTypes.document = Document save.attachment = Saving Snapshot... save.link = Saving Link... +save.link.error = An error occurred while saving this link. ingester.saveToZotero = Save to Zotero ingester.scraping = Saving Item...