-addresses #1213, Bibliography customization broken (change to plug-in also needed)
-uses blocking IO to send integration responses to fix problems with very large documents on slow machines
This commit is contained in:
parent
12229b3509
commit
41d8b7b341
2 changed files with 4 additions and 5 deletions
|
@ -139,6 +139,7 @@ var Zotero_Bibliography_Dialog = new function () {
|
|||
if(_lastSelectedItem && editor.value != _originalBibEntry) {
|
||||
Zotero.debug("setting bibliography for "+_lastSelectedItem.getID()+" to "+editor.value);
|
||||
_lastSelectedItem.setProperty("bibliography-Integration", editor.value);
|
||||
_lastSelectedItem.setProperty("bibliography-RTF", editor.value);
|
||||
}
|
||||
|
||||
editor.readonly = !item;
|
||||
|
|
|
@ -232,7 +232,7 @@ Zotero.Integration.SocketListener = new function() {
|
|||
function onSocketAccepted(socket, transport) {
|
||||
// get an input stream
|
||||
var iStream = transport.openInputStream(0, 0, 0);
|
||||
var oStream = transport.openOutputStream(0, 0, 0);
|
||||
var oStream = transport.openOutputStream(0, 0, Components.interfaces.nsITransport.OPEN_BLOCKING);
|
||||
|
||||
var dataListener = new Zotero.Integration.DataListener(iStream, oStream);
|
||||
var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"]
|
||||
|
@ -389,9 +389,6 @@ Zotero.Integration.DataListener.prototype._requestFinished = function(response)
|
|||
|
||||
// write response
|
||||
intlStream.writeString(response);
|
||||
} catch(e) {
|
||||
Zotero.debug("An error occurred.");
|
||||
Zotero.debug(e);
|
||||
} finally {
|
||||
intlStream.close();
|
||||
}
|
||||
|
@ -1276,7 +1273,7 @@ Zotero.Integration.Session.prototype.updateItemSet = function() {
|
|||
var itemID = item.id;
|
||||
|
||||
// see if items were removed
|
||||
if(!this.citationsByItemID[itemID] && !this.uncitedItems[itemID]) {
|
||||
if(!this.citationsByItemID[itemID] && !this.uncitedItems[item.key]) {
|
||||
deleteItems.push(itemID);
|
||||
continue;
|
||||
}
|
||||
|
@ -1495,6 +1492,7 @@ Zotero.Integration.Session.prototype.loadBibliographyData = function(json) {
|
|||
if (!item) {
|
||||
continue;
|
||||
}
|
||||
item.setProperty("bibliography-Integration", documentData.custom[itemID]);
|
||||
item.setProperty("bibliography-RTF", documentData.custom[itemID]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue