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()
This commit is contained in:
parent
73b5634f62
commit
a37e699ba7
2 changed files with 14 additions and 7 deletions
|
@ -293,14 +293,19 @@ Scholar.Integration.DataListener.prototype._requestFinished = function(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.Integration.SOAP = new function() {
|
Scholar.Integration.SOAP = new function() {
|
||||||
var window = Components.classes["@mozilla.org/appshell/appShellService;1"]
|
this.init = init;
|
||||||
.getService(Components.interfaces.nsIAppShellService)
|
|
||||||
.hiddenDOMWindow;
|
|
||||||
|
|
||||||
this.getCitation = getCitation;
|
this.getCitation = getCitation;
|
||||||
this.getBibliography = getBibliography;
|
this.getBibliography = getBibliography;
|
||||||
this.setDocPrefs = setDocPrefs;
|
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
|
* generates a new citation for a given item
|
||||||
* ACCEPTS: style[, itemString, newItemIndex]
|
* ACCEPTS: style[, itemString, newItemIndex]
|
||||||
|
@ -375,6 +380,4 @@ Scholar.Integration.SOAP = new function() {
|
||||||
var styleClass = Scholar.Cite.getStyleClass(io.style);
|
var styleClass = Scholar.Cite.getStyleClass(io.style);
|
||||||
return [io.style, styleClass];
|
return [io.style, styleClass];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.Integration.init();
|
|
|
@ -84,6 +84,10 @@ var Scholar = new function(){
|
||||||
Scholar.Schema.updateSchema();
|
Scholar.Schema.updateSchema();
|
||||||
Scholar.Schema.updateScrapersRemote();
|
Scholar.Schema.updateScrapersRemote();
|
||||||
|
|
||||||
|
// Initialize integration web server
|
||||||
|
Scholar.Integration.SOAP.init();
|
||||||
|
Scholar.Integration.init();
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue