www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 92f2e383258bd1b384853831e33292b3e60f6b91
parent 8b1f10aee0ccaa2bc4bb53701a8f7999e7be9219
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sun, 27 Mar 2016 03:34:40 -0400

Remove Zotero.UnresponsiveScriptIndicator

If import/export can still trigger the warning (which hopefully they
can't), we should just asyncify those further.

Diffstat:
Mchrome/content/zotero/fileInterface.js | 4----
Mchrome/content/zotero/selectItemsDialog.js | 10++--------
Mchrome/content/zotero/xpcom/zotero.js | 37-------------------------------------
3 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js @@ -94,7 +94,6 @@ Zotero_File_Exporter.prototype.save = Zotero.Promise.coroutine(function* () { Zotero.updateZoteroPaneProgressMeter(translation.getProgress()); }); translation.setHandler("done", this._exportDone); - Zotero.UnresponsiveScriptIndicator.disable(); Zotero_File_Interface.Progress.show( Zotero.getString("fileInterface.itemsExported") ); @@ -106,7 +105,6 @@ Zotero_File_Exporter.prototype.save = Zotero.Promise.coroutine(function* () { */ Zotero_File_Exporter.prototype._exportDone = function(obj, worked) { Zotero_File_Interface.Progress.close(); - Zotero.UnresponsiveScriptIndicator.enable(); if(!worked) { window.alert(Zotero.getString("fileInterface.exportError")); @@ -332,7 +330,6 @@ var Zotero_File_Interface = new function() { yield Zotero.Promise.delay(0); - Zotero.UnresponsiveScriptIndicator.disable(); let failed = false; try { yield translation.translate(libraryID); @@ -340,7 +337,6 @@ var Zotero_File_Interface = new function() { Zotero.logError(e); failed = true; } - Zotero.UnresponsiveScriptIndicator.enable(); Zotero_File_Interface.Progress.close(); // Add items to import collection diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js @@ -69,14 +69,8 @@ function onCollectionSelected() var collection = collectionsView.getRow(collectionsView.selection.currentIndex); collection.setSearch(''); - try { - Zotero.UnresponsiveScriptIndicator.disable(); - itemsView = new Zotero.ItemTreeView(collection, (window.arguments[1] ? true : false)); - document.getElementById('zotero-items-tree').view = itemsView; - } - finally { - Zotero.UnresponsiveScriptIndicator.enable(); - } + itemsView = new Zotero.ItemTreeView(collection, (window.arguments[1] ? true : false)); + document.getElementById('zotero-items-tree').view = itemsView; if (collection.isLibrary()) { Zotero.Prefs.set('lastViewedFolder', 'L'); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -2793,43 +2793,6 @@ Zotero.Browser = new function() { } } -/** - * Functions for disabling and enabling the unresponsive script indicator - **/ -Zotero.UnresponsiveScriptIndicator = new function() { - this.disable = disable; - this.enable = enable; - - // stores the state of the unresponsive script preference prior to disabling - var _unresponsiveScriptPreference, _isDisabled; - - /** - * disables the "unresponsive script" warning; necessary for import and - * export, which can take quite a while to execute - **/ - function disable() { - // don't do anything if already disabled - if (_isDisabled) { - return false; - } - - _unresponsiveScriptPreference = Services.prefs.getIntPref("dom.max_chrome_script_run_time"); - Services.prefs.setIntPref("dom.max_chrome_script_run_time", 0); - - _isDisabled = true; - return true; - } - - /** - * restores the "unresponsive script" warning - **/ - function enable() { - Services.prefs.setIntPref("dom.max_chrome_script_run_time", _unresponsiveScriptPreference); - - _isDisabled = false; - } -} - /* * Implements nsIWebProgressListener