commit a37e699ba7d8e53e0336fc7caea1f2bda66e0dc0
parent 73b5634f6253fe9aba4283667a77a7cfbd5f1617
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 30 Aug 2006 00:16:07 +0000
XPCOM calls can't be made in top-level code, as the XPCOM components may not be available yet -- breakage can (and did, on my system) ensue via a race condition
Moved integration init()'s to Scholar.init()
Diffstat:
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/xpcom/integration.js b/chrome/chromeFiles/content/scholar/xpcom/integration.js
@@ -293,14 +293,19 @@ Scholar.Integration.DataListener.prototype._requestFinished = function(response)
}
Scholar.Integration.SOAP = new function() {
- var window = Components.classes["@mozilla.org/appshell/appShellService;1"]
- .getService(Components.interfaces.nsIAppShellService)
- .hiddenDOMWindow;
-
+ this.init = init;
this.getCitation = getCitation;
this.getBibliography = getBibliography;
this.setDocPrefs = setDocPrefs;
+ var window;
+
+ function init() {
+ window = Components.classes["@mozilla.org/appshell/appShellService;1"]
+ .getService(Components.interfaces.nsIAppShellService)
+ .hiddenDOMWindow;
+ }
+
/*
* generates a new citation for a given item
* ACCEPTS: style[, itemString, newItemIndex]
@@ -375,6 +380,4 @@ Scholar.Integration.SOAP = new function() {
var styleClass = Scholar.Cite.getStyleClass(io.style);
return [io.style, styleClass];
}
-}
-
-Scholar.Integration.init();
-\ No newline at end of file
+}
+\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/xpcom/scholar.js b/chrome/chromeFiles/content/scholar/xpcom/scholar.js
@@ -84,6 +84,10 @@ var Scholar = new function(){
Scholar.Schema.updateSchema();
Scholar.Schema.updateScrapersRemote();
+ // Initialize integration web server
+ Scholar.Integration.SOAP.init();
+ Scholar.Integration.init();
+
_initialized = true;
return true;
}