diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 6627012fb..d99657f89 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -669,7 +669,6 @@ Zotero_Browser.Tab.prototype._attemptLocalFileImport = function(doc) { Zotero_Browser.Tab.prototype.translate = function(libraryID, collectionID, translator) { if(this.page.translators && this.page.translators.length) { Zotero_Browser.progress.show(); - Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scraping")); Zotero_Browser.isScraping = true; if(collectionID) { @@ -679,6 +678,28 @@ Zotero_Browser.Tab.prototype.translate = function(libraryID, collectionID, trans var collection = false; } + if(Zotero.isConnector) { + Zotero.Connector.callMethod("getSelectedCollection", {}, function(response, status) { + if(status !== 200) return; + Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapingTo"), + "chrome://zotero/skin/treesource-"+(response.id ? "collection" : "library")+".png", + response.name+"\u2026"); + }); + } else { + var name; + if(collection) { + name = collection.name; + } else if(libraryID) { + name = Zotero.Libraries.getName(libraryID); + } else { + name = Zotero.getString("pane.collections.library"); + } + + Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapingTo"), + "chrome://zotero/skin/treesource-"+(collection ? "collection" : "library")+".png", + name+"\u2026"); + } + var me = this; // use first translator available diff --git a/chrome/content/zotero/progressWindow.xul b/chrome/content/zotero/progressWindow.xul index a220e008e..534b36058 100755 --- a/chrome/content/zotero/progressWindow.xul +++ b/chrome/content/zotero/progressWindow.xul @@ -8,8 +8,8 @@ windowtype="alert:alert"> - - diff --git a/chrome/content/zotero/xpcom/progressWindow.js b/chrome/content/zotero/xpcom/progressWindow.js index aa2b56c90..71f8369a0 100644 --- a/chrome/content/zotero/xpcom/progressWindow.js +++ b/chrome/content/zotero/xpcom/progressWindow.js @@ -159,8 +159,32 @@ Zotero.ProgressWindow = function(_window){ /** * Changes the "headline" shown at the top of the progress window */ - this.changeHeadline = _deferUntilWindowLoad(function changeHeadline(headline) { - _progressWindow.document.getElementById("zotero-progress-text-headline").value = headline; + this.changeHeadline = _deferUntilWindowLoad(function changeHeadline(text, icon, postText) { + var doc = _progressWindow.document, + headline = doc.getElementById("zotero-progress-text-headline"); + while(headline.hasChildNodes()) headline.removeChild(headline.firstChild); + + var preNode = doc.createElement("label"); + preNode.setAttribute("value", text); + preNode.setAttribute("crop", "end"); + headline.appendChild(preNode); + + if(icon) { + var img = doc.createElement("image"); + img.width = 16; + img.height = 16; + img.setAttribute("src", icon); + headline.appendChild(img); + } + + if(postText) { + var postNode = doc.createElement("label"); + postNode.style.marginLeft = 0; + postNode.setAttribute("value", " "+postText); + postNode.setAttribute("crop", "end"); + postNode.setAttribute("flex", "1"); + headline.appendChild(postNode); + } }); /** @@ -270,6 +294,8 @@ Zotero.ProgressWindow = function(_window){ if(parentItemProgress) { this._hbox.style.marginLeft = "16px"; this._hbox.zoteroIsChildItem; + } else { + this._hbox.setAttribute("parent", "true"); } this._hbox.style.opacity = "0.5"; diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 2431ba905..6f0a42cba 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -412,6 +412,7 @@ save.error.cannotAddFilesToCollection = You cannot add files to the currently se ingester.saveToZotero = Save to Zotero ingester.saveToZoteroUsing = Save to Zotero using "%S" ingester.scraping = Saving Item… +ingester.scrapingTo = Saving to ingester.scrapeComplete = Item Saved ingester.scrapeError = Could Not Save Item ingester.scrapeErrorDescription = An error occurred while saving this item. Check %S for more information. diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css index 040ba6c88..b95910d01 100644 --- a/chrome/skin/default/zotero/zotero.css +++ b/chrome/skin/default/zotero/zotero.css @@ -220,12 +220,18 @@ label.zotero-text-link { margin: 0; min-height: 50px; width: 250px; - padding-bottom: 3px; + padding: 3px 0 3px 0; } #zotero-progress-text-headline { font-weight: bold; + margin-bottom: 2px; +} + +.zotero-progress-icon-headline { + width: 16px; + height: 16px; } .zotero-progress-item-icon @@ -237,8 +243,13 @@ label.zotero-text-link { .zotero-progress-item-hbox { padding-left: 5px; - margin-top: 1px; - margin-bottom: 1px; + margin-top: 0; + margin-bottom: 0; +} + +.zotero-progress-item-hbox[parent] +{ + margin-top: 3px; } .zotero-progress-item-label