www

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

commit 76cab843730625613d0cda30e86a4d1d5aabe218
parent 17c082db203470d01b0489df10ed5bb2798269b2
Author: Simon Kornblith <simon@simonster.com>
Date:   Wed, 26 Aug 2009 21:24:40 +0000

- 2-3x speedup getting field codes in MacWord
- show field retrieval time in integration output
- activate Firefox before showing an error if the plug-in XPI is not installed


Diffstat:
Mchrome/content/zotero/xpcom/integration.js | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -126,6 +126,7 @@ Zotero.Integration = new function() { var application = Components.classes[componentClass] .getService(Components.interfaces.zoteroIntegrationApplication); } catch(e) { + Zotero.Integration.activate(); Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService) .alert(null, Zotero.getString("integration.error.title"), @@ -137,6 +138,7 @@ Zotero.Integration = new function() { try { var integration = new Zotero.Integration.Document(application); } catch(e) { + Zotero.Integration.activate(); Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService) .alert(null, Zotero.getString("integration.error.title"), @@ -327,11 +329,14 @@ Zotero.Integration.Document.prototype._getFields = function(require) { if(this._fields) return; if(!this._session && !this._getSession(require, true)) return; + var getFieldsTime = (new Date()).getTime(); var fields = this._doc.getFields(this._session.data.prefs['fieldType']); this._fields = []; while(fields.hasMoreElements()) { this._fields.push(fields.getNext().QueryInterface(Components.interfaces.zoteroIntegrationField)); } + var endTime = (new Date()).getTime();; + Zotero.debug("Got "+this._fields.length+" fields in "+(endTime-getFieldsTime)/1000+"; "+1000/((endTime-getFieldsTime)/this._fields.length)+" fields/second"); if(require && !this._fields.length) { throw new Zotero.Integration.DisplayException("mustInsertCitation");