Disable unresponsive script warning during translator initialization, since subsequent runs should be much quicker due to cache

(Change is just an indent, despite messiness of diff)
This commit is contained in:
Dan Stillman 2010-08-29 18:45:59 +00:00
parent 80f5047687
commit e17bffcdd4

View file

@ -52,6 +52,10 @@ Zotero.Translators = new function() {
var start = (new Date()).getTime();
var transactionStarted = false;
Zotero.UnresponsiveScriptIndicator.disable();
// Use try/finally so that we always reset the unresponsive script warning
try {
_cache = {"import":[], "export":[], "web":[], "search":[]};
_translators = {};
@ -144,6 +148,10 @@ Zotero.Translators = new function() {
for(var type in _cache) {
_cache[type].sort(cmp);
}
}
finally {
Zotero.UnresponsiveScriptIndicator.enable();
}
Zotero.debug("Cached "+i+" translators in "+((new Date()).getTime() - start)+" ms");
}