closes #1771, citeproc-js breaks initial Quick Copy drag after Firefox startup
caused by an XHR, which inexplicably breaks dragging behavior
This commit is contained in:
parent
3b78e8ff39
commit
156f2be269
1 changed files with 12 additions and 9 deletions
|
@ -196,15 +196,18 @@ Zotero.Cite.System.retrieveItem = function(item){
|
||||||
};
|
};
|
||||||
|
|
||||||
Zotero.Cite.System.retrieveLocale = function(lang) {
|
Zotero.Cite.System.retrieveLocale = function(lang) {
|
||||||
var xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
|
let protHandler = Components.classes["@mozilla.org/network/protocol;1?name=chrome"]
|
||||||
xhr.open("GET", "chrome://zotero/content/locale/csl/locales-"+lang+".xml", false);
|
.createInstance(Components.interfaces.nsIProtocolHandler);
|
||||||
xhr.overrideMimeType("application/octet-stream");
|
let channel = protHandler.newChannel(protHandler.newURI("chrome://zotero/content/locale/csl/locales-"+lang+".xml", "UTF-8", null));
|
||||||
try {
|
let rawStream = channel.open();
|
||||||
xhr.send();
|
let converterStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||||
return xhr.responseText;
|
.createInstance(Components.interfaces.nsIConverterInputStream);
|
||||||
} catch(e) {
|
converterStream.init(rawStream, "UTF-8", 65535,
|
||||||
return false;
|
Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
|
||||||
}
|
let str = {};
|
||||||
|
converterStream.readString(channel.contentLength, str);
|
||||||
|
converterStream.close();
|
||||||
|
return str.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
Zotero.Cite.System.getAbbreviations = function() {
|
Zotero.Cite.System.getAbbreviations = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue