commit 865b3e0b21af5aa0fac71e93dc1a7635a1ae168c
parent 376ecba496a9cadaca5cbe4c36c6212b7ae54d52
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 18 Jan 2012 23:50:21 -0500
Add progress indicator to add item by identifier
Diffstat:
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js
@@ -58,6 +58,9 @@ const Zotero_Lookup = new function () {
translate.setTranslator(translators);
translate.setHandler("done", function(translate, success) {
+ identifierElement.style.opacity = 1;
+ identifierElement.disabled = false;
+ document.getElementById("zotero-lookup-progress").hidden = true;
if(success) {
document.getElementById("zotero-lookup-panel").hidePopup();
} else {
@@ -78,6 +81,10 @@ const Zotero_Lookup = new function () {
if(collection) collection.addItem(item.id);
});
+ identifierElement.style.opacity = 0.5;
+ identifierElement.disabled = true;
+ document.getElementById("zotero-lookup-progress").hidden = false;
+
translate.translate(libraryID);
return false;
}
@@ -102,7 +109,12 @@ const Zotero_Lookup = new function () {
if(!Zotero.isFx4) {
document.getElementById("zotero-lookup-panel").style.padding = "10px";
}
- document.getElementById("zotero-lookup-textbox").focus();
+
+ document.getElementById("zotero-lookup-progress").hidden = false;
+ var identifierElement = document.getElementById("zotero-lookup-textbox");
+ identifierElement.style.opacity = 1;
+ identifierElement.disabled = false;
+ identifierElement.focus();
}
/**
diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul
@@ -142,10 +142,13 @@
<toolbarbutton id="zotero-tb-item-from-page" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newItemFromPage.label;" command="cmd_zotero_newItemFromCurrentPage"/>
<toolbarbutton id="zotero-tb-lookup" class="zotero-tb-button" tooltiptext="&zotero.toolbar.lookup.label;" type="panel">
<panel id="zotero-lookup-panel" type="arrow" onpopupshown="Zotero_Lookup.onShowing()"
- onpopuphidden="Zotero_Lookup.onHidden()" noautohide="true">
+ onpopuphidden="Zotero_Lookup.onHidden()">
<vbox>
<description>&zotero.lookup.description;</description>
- <textbox id="zotero-lookup-textbox" style="margin: 2px 0 2px 0" onkeypress="return Zotero_Lookup.onKeyPress(event)" flex="1"/>
+ <stack>
+ <progressmeter id="zotero-lookup-progress" mode="undetermined" hidden="true"/>
+ <textbox id="zotero-lookup-textbox" onkeypress="return Zotero_Lookup.onKeyPress(event)" flex="1"/>
+ </stack>
</vbox>
</panel>
</toolbarbutton>