Replace all setTimeout(string, ms) calls with setTimeout(func, ms) for AMO
This commit is contained in:
parent
84246d46c0
commit
b2dda2ec23
4 changed files with 25 additions and 8 deletions
|
@ -139,7 +139,10 @@ var ZoteroOverlay = new function()
|
||||||
|
|
||||||
// Used for loading pages from upgrade wizard
|
// Used for loading pages from upgrade wizard
|
||||||
if (Zotero && Zotero.initialURL) {
|
if (Zotero && Zotero.initialURL) {
|
||||||
setTimeout("gBrowser.selectedTab = gBrowser.addTab(Zotero.initialURL); Zotero.initialURL = null;", 1);
|
setTimeout(function () {
|
||||||
|
gBrowser.selectedTab = gBrowser.addTab(Zotero.initialURL);
|
||||||
|
Zotero.initialURL = null;
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide browser chrome on Zotero tab
|
// Hide browser chrome on Zotero tab
|
||||||
|
|
|
@ -277,7 +277,7 @@ To add a new preference:
|
||||||
<hbox>
|
<hbox>
|
||||||
<textbox id="storage-username"
|
<textbox id="storage-username"
|
||||||
preference="pref-storage-username"
|
preference="pref-storage-username"
|
||||||
onkeypress="if (Zotero.isMac && event.keyCode == 13) { this.blur(); setTimeout('verifyStorageServer();', 1); }"
|
onkeypress="if (Zotero.isMac && event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }"
|
||||||
onsynctopreference="unverifyStorageServer();"
|
onsynctopreference="unverifyStorageServer();"
|
||||||
onchange="var pass = document.getElementById('storage-password'); if (pass.value) { Zotero.Sync.Storage.Session.WebDAV.prototype.password = pass.value; }"/>
|
onchange="var pass = document.getElementById('storage-password'); if (pass.value) { Zotero.Sync.Storage.Session.WebDAV.prototype.password = pass.value; }"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
@ -286,7 +286,7 @@ To add a new preference:
|
||||||
<label value="&zotero.preferences.sync.password;"/>
|
<label value="&zotero.preferences.sync.password;"/>
|
||||||
<hbox>
|
<hbox>
|
||||||
<textbox id="storage-password" flex="0" type="password"
|
<textbox id="storage-password" flex="0" type="password"
|
||||||
onkeypress="if (Zotero.isMac && event.keyCode == 13) { this.blur(); setTimeout('verifyStorageServer();', 1); }"
|
onkeypress="if (Zotero.isMac && event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }"
|
||||||
oninput="unverifyStorageServer()"
|
oninput="unverifyStorageServer()"
|
||||||
onchange="Zotero.Sync.Storage.Session.WebDAV.prototype.password = this.value"/>
|
onchange="Zotero.Sync.Storage.Session.WebDAV.prototype.password = this.value"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
|
@ -396,7 +396,10 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Focus the quicksearch on pane open
|
// Focus the quicksearch on pane open
|
||||||
setTimeout("document.getElementById('zotero-tb-search').inputField.select();", 1);
|
var searchBar = document.getElementById('zotero-tb-search');
|
||||||
|
setTimeout(function () {
|
||||||
|
searchBar.inputField.select();
|
||||||
|
}, 1);
|
||||||
|
|
||||||
// Auto-empty trashed items older than a certain number of days
|
// Auto-empty trashed items older than a certain number of days
|
||||||
var days = Zotero.Prefs.get('trashAutoEmptyDays');
|
var days = Zotero.Prefs.get('trashAutoEmptyDays');
|
||||||
|
@ -1749,11 +1752,17 @@ var ZoteroPane = new function()
|
||||||
if (event.keyCode == event.DOM_VK_ESCAPE) {
|
if (event.keyCode == event.DOM_VK_ESCAPE) {
|
||||||
textbox.value = '';
|
textbox.value = '';
|
||||||
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
||||||
setTimeout("ZoteroPane_Local.search(); ZoteroPane_Local.clearItemsPaneMessage();", 1);
|
setTimeout(function () {
|
||||||
|
ZoteroPane_Local.search();
|
||||||
|
ZoteroPane_Local.clearItemsPaneMessage();
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
else if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_ENTER) {
|
else if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_ENTER) {
|
||||||
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
||||||
setTimeout("ZoteroPane_Local.search(true); ZoteroPane_Local.clearItemsPaneMessage();", 1);
|
setTimeout(function () {
|
||||||
|
ZoteroPane_Local.search(true);
|
||||||
|
ZoteroPane_Local.clearItemsPaneMessage();
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1763,7 +1772,10 @@ var ZoteroPane = new function()
|
||||||
// result of Undo or Redo
|
// result of Undo or Redo
|
||||||
if (!textbox.value.length) {
|
if (!textbox.value.length) {
|
||||||
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('searchInProgress'));
|
||||||
setTimeout("ZoteroPane_Local.search(); ZoteroPane_Local.clearItemsPaneMessage();", 1);
|
setTimeout(function () {
|
||||||
|
ZoteroPane_Local.search();
|
||||||
|
ZoteroPane_Local.clearItemsPaneMessage();
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
else if (textbox.value.indexOf('"') != -1) {
|
else if (textbox.value.indexOf('"') != -1) {
|
||||||
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('advancedSearchMode'));
|
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('advancedSearchMode'));
|
||||||
|
|
|
@ -87,7 +87,9 @@ function doKeyPress(e)
|
||||||
checkDate(lastJumpToYearValue);
|
checkDate(lastJumpToYearValue);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
jumpToYearTimer = setTimeout('wasChanged(document.getElementById("jumpYear").value);', 1000)
|
jumpToYearTimer = setTimeout(function () {
|
||||||
|
wasChanged(document.getElementById("jumpYear").value);
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue