From 3510e1dda8929a988078e5a2b0c9391452ea59aa Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 12 Feb 2012 18:56:04 -0500 Subject: [PATCH 01/26] Fix Linux integration issue reported by fbennett at http://groups.google.com/group/zotero-dev/browse_thread/thread/e6618d5f27d1cd7e (ultimate cause appears to be some kind of Linux-specific bug relating to dialogs) --- chrome/content/zotero/integration/addCitationDialog.xul | 1 + chrome/content/zotero/integration/editBibliographyDialog.xul | 2 +- chrome/content/zotero/integration/integrationDocPrefs.xul | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/integration/addCitationDialog.xul b/chrome/content/zotero/integration/addCitationDialog.xul index cdf1bb3c4f..6c60557505 100644 --- a/chrome/content/zotero/integration/addCitationDialog.xul +++ b/chrome/content/zotero/integration/addCitationDialog.xul @@ -41,6 +41,7 @@ onunload="doUnload();" ondialogaccept="return Zotero_Citation_Dialog.accept();" ondialogcancel="Zotero_Citation_Dialog.cancel();" + onclose="Zotero_Citation_Dialog.cancel(); event.preventDefault(); event.stopPropagation();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" persist="screenX screenY width height" resizable="true" diff --git a/chrome/content/zotero/integration/editBibliographyDialog.xul b/chrome/content/zotero/integration/editBibliographyDialog.xul index eb7e673286..f1123cbc49 100644 --- a/chrome/content/zotero/integration/editBibliographyDialog.xul +++ b/chrome/content/zotero/integration/editBibliographyDialog.xul @@ -38,7 +38,7 @@ onload="Zotero_Bibliography_Dialog.load();" ondialogaccept="Zotero_Bibliography_Dialog.accept();" ondialogcancel="Zotero_Bibliography_Dialog.close();" - onclose="Zotero_Bibliography_Dialog.close();" + onclose="Zotero_Bibliography_Dialog.close(); event.preventDefault(); event.stopPropagation();" onunload="doUnload();" buttons="extra1,extra2,accept,cancel" buttonpack="end" xmlns:html="http://www.w3.org/1999/xhtml" diff --git a/chrome/content/zotero/integration/integrationDocPrefs.xul b/chrome/content/zotero/integration/integrationDocPrefs.xul index f80ee1a138..4f47d8960c 100644 --- a/chrome/content/zotero/integration/integrationDocPrefs.xul +++ b/chrome/content/zotero/integration/integrationDocPrefs.xul @@ -35,6 +35,7 @@ title="&zotero.integration.docPrefs.title;" onload="Zotero_File_Interface_Bibliography.init();" ondialogaccept="Zotero_File_Interface_Bibliography.acceptSelection();" + onclose="document.documentElement.cancelDialog(); event.preventDefault(); event.stopPropagation();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" persist="screenX screenY" style="width: 600px"> From c5a2572c91e05347f58bfe3fa11bd3521941262f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 12 Feb 2012 19:30:32 -0500 Subject: [PATCH 02/26] Always sort translators alphabetically --- .../content/zotero/tools/testTranslators/testTranslators.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/tools/testTranslators/testTranslators.js b/chrome/content/zotero/tools/testTranslators/testTranslators.js index c6b73b5044..191b7cd52d 100644 --- a/chrome/content/zotero/tools/testTranslators/testTranslators.js +++ b/chrome/content/zotero/tools/testTranslators/testTranslators.js @@ -416,6 +416,10 @@ function haveTranslators(translators, type) { translatorTestViews[type] = []; translatorTestViewsToRun[type] = []; + translators = translators.sort(function(a, b) { + return a.label.localeCompare(b.label); + }); + for(var i in translators) { var translatorTestView = new TranslatorTestView(); translatorTestView.initWithTranslatorAndType(translators[i], type); From a01fcd360f310a1f2f466434498799a6b66e06ac Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 12 Feb 2012 23:35:39 -0500 Subject: [PATCH 03/26] Remove redundant code --- components/zotero-service.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/zotero-service.js b/components/zotero-service.js index 4bf06bf98f..01d9277adc 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -330,10 +330,6 @@ function isStandalone() { */ function ZoteroCommandLineHandler() {} ZoteroCommandLineHandler.prototype = { - /* nsISupports */ - QueryInterface : XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler, - Components.interfaces.nsIFactory, Components.interfaces.nsISupports]), - /* nsICommandLineHandler */ handle : function(cmdLine) { // handler for Zotero integration commands From 544c8a1fa7410bfd840d4f2beba8a7fbb1f5a3c2 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 03:13:28 -0500 Subject: [PATCH 04/26] Send Content-Type even when body is empty --- chrome/content/zotero/xpcom/server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/server.js b/chrome/content/zotero/xpcom/server.js index f549709939..1d7867c6bd 100755 --- a/chrome/content/zotero/xpcom/server.js +++ b/chrome/content/zotero/xpcom/server.js @@ -303,10 +303,11 @@ Zotero.Server.DataListener.prototype._generateResponse = function(status, conten } } + if(contentType) { + response += "Content-Type: "+contentType+"\r\n"; + } + if(body) { - if(contentType) { - response += "Content-Type: "+contentType+"\r\n"; - } response += "\r\n"+body; } else { response += "Content-Length: 0\r\n\r\n"; From cb656c9456569bd58830b0ed6676a55d3351c981 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 13 Feb 2012 16:44:06 +0800 Subject: [PATCH 05/26] Upgrade citeproc-js to version 1.0.280 --- chrome/content/zotero/xpcom/citeproc.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js index fc64f51060..be9a00e22d 100644 --- a/chrome/content/zotero/xpcom/citeproc.js +++ b/chrome/content/zotero/xpcom/citeproc.js @@ -2133,7 +2133,7 @@ CSL.DateParser = function () { }; CSL.Engine = function (sys, style, lang, forceLang) { var attrs, langspec, localexml, locale; - this.processor_version = "1.0.279"; + this.processor_version = "1.0.280"; this.csl_version = "1.0"; this.sys = sys; this.sys.xml = new CSL.System.Xml.Parsing(); @@ -10847,6 +10847,9 @@ CSL.Output.Formats.prototype.html = { }; CSL.Output.Formats.prototype.text = { "text_escape": function (text) { + if (!text) { + text = ""; + } return text; }, "bibstart": "", @@ -10898,6 +10901,9 @@ CSL.Output.Formats.prototype.text = { }; CSL.Output.Formats.prototype.rtf = { "text_escape": function (text) { + if (!text) { + text = ""; + } return text .replace(/([\\{}])/g, "\\$1", "g") .replace(CSL.SUPERSCRIPTS_REGEXP, From 81c33f49dd854b2a3d8562516304a24a1aaad318 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 12:18:22 -0500 Subject: [PATCH 06/26] Closes #52: Allow to use empty string as delimiter in xpathText --- chrome/content/zotero/xpcom/utilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 7bbe74ffd5..cc484142d8 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -972,7 +972,7 @@ Zotero.Utilities = { strings[i] = elements[i].textContent; } - return strings.join(delimiter ? delimiter : ", "); + return strings.join(delimiter !== undefined ? delimiter : ", "); }, /** From bd152fa3624ae4e5bd0522d4574229c8ff1edd53 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 13:24:53 -0500 Subject: [PATCH 07/26] Mark compatible up to Firefox 13 --- install.rdf | 2 +- update.rdf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.rdf b/install.rdf index 5ca89c7e43..fb3c1cbbe5 100644 --- a/install.rdf +++ b/install.rdf @@ -26,7 +26,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.6 - 10.* + 13.* diff --git a/update.rdf b/update.rdf index 0213f2183d..18219ff11d 100644 --- a/update.rdf +++ b/update.rdf @@ -12,7 +12,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.6 - 10.* + 13.* http://download.zotero.org/extension/zotero.xpi sha1: From 10a09884f4b1c6674fe68325646bdd6afbd824d9 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 13:33:48 -0500 Subject: [PATCH 08/26] Cancelling the "replace this field" box should not break integration --- chrome/content/zotero/xpcom/integration.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index cfcd6dba0d..1e5e9ee2a3 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1653,7 +1653,9 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field, callback) } else { newField = true; var field = this.addField(true); - if(!field) return; + if(!field) { + throw new Zotero.Integration.UserCancelledException; + } } if(!citation) { From b21dbbace4165de459af981c3bc67ae6d83cd1cc Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 13:36:18 -0500 Subject: [PATCH 09/26] Also don't break if replacing a field with a bibliography is cancelled --- chrome/content/zotero/xpcom/integration.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 1e5e9ee2a3..23e713d023 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1142,7 +1142,9 @@ Zotero.Integration.Fields.prototype.addField = function(note) { if(field) { if(!this._doc.displayAlert(Zotero.getString("integration.replace"), Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP, - Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK_CANCEL)) return false; + Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK_CANCEL)) { + throw new Zotero.Integration.UserCancelledException; + } } if(!field) { @@ -1653,9 +1655,6 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field, callback) } else { newField = true; var field = this.addField(true); - if(!field) { - throw new Zotero.Integration.UserCancelledException; - } } if(!citation) { From 10cef4c06fdfca4d758996b3255711fa293534fc Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 13 Feb 2012 14:03:49 -0500 Subject: [PATCH 10/26] Fix giant integration doc prefs window --- chrome/content/zotero/bibliography.js | 2 +- .../integration/integrationDocPrefs.xul | 55 ++++++++++--------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index c3846a14d2..5a7b5b940a 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -45,7 +45,7 @@ var Zotero_File_Interface_Bibliography = new function() { function init() { // Set font size from pref // Affects bibliography.xul and integrationDocPrefs.xul - Zotero.setFontSize(document.documentElement); + Zotero.setFontSize(document.getElementById("zotero-bibliography-container")); if(window.arguments && window.arguments.length) { _io = window.arguments[0]; diff --git a/chrome/content/zotero/integration/integrationDocPrefs.xul b/chrome/content/zotero/integration/integrationDocPrefs.xul index 4f47d8960c..a3f9f60dae 100644 --- a/chrome/content/zotero/integration/integrationDocPrefs.xul +++ b/chrome/content/zotero/integration/integrationDocPrefs.xul @@ -42,33 +42,34 @@