Closes #23, "Saving item..." notification should show the name of the library where item is imported
This commit is contained in:
parent
48f7dd5b6e
commit
3a6669c66f
5 changed files with 67 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
windowtype="alert:alert">
|
||||
|
||||
<hbox id="zotero-progress-box">
|
||||
<vbox id="zotero-progress-text-box">
|
||||
<label id="zotero-progress-text-headline"/>
|
||||
<vbox id="zotero-progress-text-box" flex="1">
|
||||
<hbox id="zotero-progress-text-headline" pack="start"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</window>
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue