Add progress indicator to add item by identifier

This commit is contained in:
Simon Kornblith 2012-01-18 23:50:21 -05:00
parent 376ecba496
commit 865b3e0b21
2 changed files with 18 additions and 3 deletions

View file

@ -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();
}
/**

View file

@ -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>