From dc5ccffe43441bf5ee5912f90555582b64d28c24 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Tue, 26 Aug 2014 03:11:24 -0500 Subject: [PATCH 01/10] Use Mozilla's colors for itembox and tagbox background This way, the colors play nicely with Windows themes (e.g. high contrast) Re https://forums.zotero.org/discussion/38870/make-zotero-fully-recognize-windowsff-high-contrast-themes/ and https://twitter.com/stuffilike2know/status/504167872567189504 --- chrome/content/zotero-platform/win/overlay.css | 2 +- chrome/skin/default/zotero/bindings/tagselector.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index b90ec7c58..5a384e911 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -90,7 +90,7 @@ #zotero-view-item { padding: 0 !important; -moz-appearance: none; - background-color: white; + background-color: -moz-field; border-width: 1px 0 0 1px; } diff --git a/chrome/skin/default/zotero/bindings/tagselector.css b/chrome/skin/default/zotero/bindings/tagselector.css index e67b6211b..f5f11e569 100644 --- a/chrome/skin/default/zotero/bindings/tagselector.css +++ b/chrome/skin/default/zotero/bindings/tagselector.css @@ -11,7 +11,7 @@ groupbox overflow-x: hidden; overflow-y: auto; display: block; /* allow labels to wrap instead of all being in one line */ - background-color: white; + background-color: -moz-field; } checkbox From ee35f7df41bda236309d08182a3c1b1e614b31fa Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 1 Sep 2014 12:26:36 -0400 Subject: [PATCH 02/10] Small fix to copyObject --- chrome/content/zotero/xpcom/translation/translate_firefox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 5d3e3ed99..46204c6d4 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -512,7 +512,7 @@ Zotero.Translate.SandboxManager.prototype = { "_copyObject":function(obj, wm) { if(!this._canCopy(obj)) return obj if(!wm) wm = new WeakMap(); - var obj2 = (obj instanceof Array ? this.sandbox.Array() : this.sandbox.Object()); + var obj2 = (obj.constructor.name === "Array" ? this.sandbox.Array() : this.sandbox.Object()); var wobj2 = obj2.wrappedJSObject ? obj2.wrappedJSObject : obj2; for(var i in obj) { if(!obj.hasOwnProperty(i)) continue; From 14a5643f385217f0c25640373bec958132fec60f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 1 Sep 2014 14:56:01 -0400 Subject: [PATCH 03/10] Update submodules, repotime, versions --- chrome/content/zotero/locale/csl | 2 +- chrome/content/zotero/xpcom/zotero.js | 2 +- install.rdf | 2 +- resource/schema/renamed-styles.json | 1 + resource/schema/repotime.txt | 2 +- styles | 2 +- translators | 2 +- update.rdf | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/locale/csl b/chrome/content/zotero/locale/csl index 6c4c38a01..76af97414 160000 --- a/chrome/content/zotero/locale/csl +++ b/chrome/content/zotero/locale/csl @@ -1 +1 @@ -Subproject commit 6c4c38a013f58dea82d683e4c8b70ff25da8172c +Subproject commit 76af9741424cc1432ffa0165d7b7bd5bbebe0d26 diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 82c20cd75..9065168b2 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -39,7 +39,7 @@ const ZOTERO_CONFIG = { BOOKMARKLET_ORIGIN : 'https://www.zotero.org', HTTP_BOOKMARKLET_ORIGIN : 'http://www.zotero.org', BOOKMARKLET_URL: 'https://www.zotero.org/bookmarklet/', - VERSION: "4.0.21.SOURCE" + VERSION: "4.0.22.SOURCE" }; // Commonly used imports accessible anywhere diff --git a/install.rdf b/install.rdf index 45704c9dd..f024e2d0b 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ zotero@chnm.gmu.edu Zotero - 4.0.21.5.SOURCE + 4.0.22.SOURCE Center for History and New Media
George Mason University
Dan Cohen Sean Takats diff --git a/resource/schema/renamed-styles.json b/resource/schema/renamed-styles.json index e3c4809d3..424270afa 100644 --- a/resource/schema/renamed-styles.json +++ b/resource/schema/renamed-styles.json @@ -23,6 +23,7 @@ "annual-reviews-alphabetically": "annual-reviews-alphabetical", "annual-reviews-by-appearance": "annual-reviews", "apa5th": "apa-5th-edition", + "apa-fr": "apa-fr-provost", "apsa": "american-political-science-association", "archives-of-dermatology": "jama-dermatology", "asa": "american-sociological-association", diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt index ea0164d7f..f6d5eacc2 100644 --- a/resource/schema/repotime.txt +++ b/resource/schema/repotime.txt @@ -1 +1 @@ -2014-06-24 00:00:01 +2014-09-01 18:06:00 diff --git a/styles b/styles index feb40111b..c8aed347a 160000 --- a/styles +++ b/styles @@ -1 +1 @@ -Subproject commit feb40111bacae97b61cfbf8b4948054ead1b4570 +Subproject commit c8aed347aed9a6350a48f3d6f9d4b0df13fc1f6f diff --git a/translators b/translators index 1c919d5c3..821eda178 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit 1c919d5c3d9e6be7106c36cbacd34ae850167497 +Subproject commit 821eda178b2fe1c7e7bbabc5d7a3113923a4f9c7 diff --git a/update.rdf b/update.rdf index 6a56078ab..9976ca5fd 100644 --- a/update.rdf +++ b/update.rdf @@ -7,7 +7,7 @@ - 4.0.21.5.SOURCE + 4.0.22.SOURCE {ec8030f7-c20a-464f-9b0e-13a3a9e97384} From 5857368131f4f4508e8174aeaed74217090db675 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 1 Sep 2014 15:04:36 -0400 Subject: [PATCH 04/10] Update citeproc-js to 1.0.539 --- chrome/content/zotero/xpcom/citeproc.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js index fb38d5228..202b5ef53 100644 --- a/chrome/content/zotero/xpcom/citeproc.js +++ b/chrome/content/zotero/xpcom/citeproc.js @@ -80,7 +80,7 @@ if (!Array.indexOf) { }; } var CSL = { - PROCESSOR_VERSION: "1.0.536", + PROCESSOR_VERSION: "1.0.539", CONDITION_LEVEL_TOP: 1, CONDITION_LEVEL_BOTTOM: 2, PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/, @@ -1029,11 +1029,16 @@ CSL.getSortCompare = function (default_locale) { return CSL.stringCompare; } var strcmp; + var strcmp_opts = { + sensitivity:"base", + ignorePunctuation:true, + numeric:true + } if (!default_locale) { default_locale = "en-US"; } strcmp = function (a, b) { - return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()); + return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase(),default_locale,strcmp_opts); }; var stripPunct = function (str) { return str.replace(/^[\[\]\'\"]*/g, ""); @@ -4262,6 +4267,7 @@ CSL.getAmbiguousCite = function (Item, disambig, visualForm) { }; if (this.registry.registry[Item.id] && this.registry.citationreg.citationsByItemId + && this.registry.citationreg.citationsByItemId[Item.id] && this.registry.citationreg.citationsByItemId[Item.id].length && visualForm) { if (this.citation.opt["givenname-disambiguation-rule"] === "by-cite") { @@ -7362,7 +7368,9 @@ CSL.NameOutput.prototype._runDisambigNames = function (lst, pos) { param = paramx; } if (!this.state.tmp.just_looking && this.item && this.item.position === CSL.POSITION_FIRST) { - param = paramx; + if (paramx > param) { + param = paramx; + } } if (!this.state.tmp.sort_key_flag) { this.state.tmp.disambig_settings.givens[pos][i] = param; From f973897d76deb37f601057ae0cdc2bcec7f9317c Mon Sep 17 00:00:00 2001 From: adam3smith Date: Mon, 1 Sep 2014 14:31:51 -0500 Subject: [PATCH 05/10] test for presence of author's firstName before using it --- chrome/content/zotero/xpcom/openurl.js | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/content/zotero/xpcom/openurl.js b/chrome/content/zotero/xpcom/openurl.js index d28156275..8482dfd46 100644 --- a/chrome/content/zotero/xpcom/openurl.js +++ b/chrome/content/zotero/xpcom/openurl.js @@ -480,6 +480,7 @@ Zotero.OpenURL = new function() { // same last name, and the same first name up to a point), keep // the plain author, since it might have a middle initial if(item.creators[j].lastName == complexAu[i].lastName && + item.creators[j].firstName && (item.creators[j].firstName == complexAu[i].firstName == "" || (item.creators[j].firstName.length >= complexAu[i].firstName.length && item.creators[j].firstName.substr(0, complexAu[i].firstName.length) == complexAu[i].firstName))) { From a09ff9c9ec036cf5783cd11cf4a371e14f6cd909 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 1 Sep 2014 18:42:24 -0400 Subject: [PATCH 06/10] Don't unwrap objects passed to chrome Unwrapping objects also waives the Xray wrappers for contained objects, which we need. --- chrome/content/zotero/xpcom/openurl.js | 19 +++++++++++-------- .../xpcom/translation/translate_firefox.js | 10 ---------- chrome/content/zotero/xpcom/utilities.js | 3 +++ 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/chrome/content/zotero/xpcom/openurl.js b/chrome/content/zotero/xpcom/openurl.js index d28156275..b0545b612 100644 --- a/chrome/content/zotero/xpcom/openurl.js +++ b/chrome/content/zotero/xpcom/openurl.js @@ -243,6 +243,13 @@ Zotero.OpenURL = new function() { if(asObj) return entries; return entries.join("&"); } + + function _cloneIfNecessary(obj1, obj2) { + if(Zotero.isFx && !Zotero.isBookmarklet && Zotero.platformMajorVersion >= 32) { + return Components.utils.cloneInto(obj1, obj2); + } + return obj1; + } /* * Generates an item in the format returned by item.fromArray() given an @@ -380,14 +387,14 @@ Zotero.OpenURL = new function() { if(complexAu.length && !lastCreator.lastName && !lastCreator.institutional) { lastCreator.lastName = value; } else { - complexAu.push({lastName:value, creatorType:(key == "rft.aulast" ? "author" : "inventor"), offset:item.creators.length}); + complexAu.push(_cloneIfNecessary({lastName:value, creatorType:(key == "rft.aulast" ? "author" : "inventor"), offset:item.creators.length}, item)); } } else if(key == "rft.aufirst" || key == "rft.invfirst") { var lastCreator = complexAu[complexAu.length-1]; if(complexAu.length && !lastCreator.firstName && !lastCreator.institutional) { lastCreator.firstName = value; } else { - complexAu.push({firstName:value, creatorType:(key == "rft.aufirst" ? "author" : "inventor"), offset:item.creators.length}); + complexAu.push(_cloneIfNecessary({firstName:value, creatorType:(key == "rft.aufirst" ? "author" : "inventor"), offset:item.creators.length}, item)); } } else if(key == "rft.au" || key == "rft.creator" || key == "rft.contributor" || key == "rft.inventor") { if(key == "rft.contributor") { @@ -398,13 +405,9 @@ Zotero.OpenURL = new function() { var type = "author"; } - if(value.indexOf(",") !== -1) { - item.creators.push(Zotero.Utilities.cleanAuthor(value, type, true)); - } else { - item.creators.push(Zotero.Utilities.cleanAuthor(value, type, false)); - } + item.creators.push(_cloneIfNecessary(Zotero.Utilities.cleanAuthor(value, type, value.indexOf(",") !== -1), item)); } else if(key == "rft.aucorp") { - complexAu.push({lastName:value, isInstitution:true}); + complexAu.push(_cloneIfNecessary({lastName:value, isInstitution:true}, item)); } else if(key == "rft.isbn" && !item.ISBN) { item.ISBN = value; } else if(key == "rft.pub" || key == "rft.publisher") { diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 46204c6d4..bff1f2d00 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -462,16 +462,6 @@ Zotero.Translate.SandboxManager.prototype = { if(isFunction) { attachTo[localKey] = function() { var args = Array.prototype.slice.apply(arguments); - if(Zotero.platformMajorVersion >= 32) { - // This is necessary on Nightly and works - // fine on 31, but apparently breaks - // ZU.xpath in an unusual way on 24 - for(var i=0; i Date: Mon, 1 Sep 2014 19:29:45 -0400 Subject: [PATCH 07/10] Fix MODS under Fx 32 --- chrome/content/zotero/xpcom/utilities.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index c21ef09b5..2f092f9cd 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1043,11 +1043,20 @@ Zotero.Utilities = { var results = []; for(var i=0, n=elements.length; i Date: Mon, 1 Sep 2014 20:00:31 -0400 Subject: [PATCH 08/10] Fix DataCite under Fx 32 --- chrome/content/zotero/xpcom/utilities.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 2f092f9cd..e143dce7e 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1542,7 +1542,7 @@ Zotero.Utilities = { }, /** - * Converts an item in CSL JSON format to a Zotero tiem + * Converts an item in CSL JSON format to a Zotero item * @param {Zotero.Item} item * @param {Object} cslItem */ @@ -1614,6 +1614,9 @@ Zotero.Utilities = { item.setCreator(item.getCreators().length, creator, creatorTypeID); } else { creator.creatorType = Zotero.CreatorTypes.getName(creatorTypeID); + if(Zotero.isFx && !Zotero.isBookmarklet && Zotero.platformMajorVersion >= 32) { + creator = Components.utils.cloneInto(creator, item); + } item.creators.push(creator); } } From 17c0f44e66c5c64b181c95e49095403a78b2eee4 Mon Sep 17 00:00:00 2001 From: adam3smith Date: Mon, 1 Sep 2014 19:25:10 -0500 Subject: [PATCH 09/10] fix indenting --- chrome/content/zotero/xpcom/openurl.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/chrome/content/zotero/xpcom/openurl.js b/chrome/content/zotero/xpcom/openurl.js index 8482dfd46..5a2c4d374 100644 --- a/chrome/content/zotero/xpcom/openurl.js +++ b/chrome/content/zotero/xpcom/openurl.js @@ -475,18 +475,18 @@ Zotero.OpenURL = new function() { var pushMe = true; var offset = complexAu[i].offset; delete complexAu[i].offset; - for(var j=0; j= complexAu[i].firstName.length && - item.creators[j].firstName.substr(0, complexAu[i].firstName.length) == complexAu[i].firstName))) { - pushMe = false; - break; - } + for (var j = 0; j < item.creators.length; j++) { + // if there's a plain author that is close to this author (the + // same last name, and the same first name up to a point), keep + // the plain author, since it might have a middle initial + if (item.creators[j].lastName == complexAu[i].lastName && + item.creators[j].firstName && + (item.creators[j].firstName == complexAu[i].firstName == "" || + (item.creators[j].firstName.length >= complexAu[i].firstName.length && + item.creators[j].firstName.substr(0, complexAu[i].firstName.length) == complexAu[i].firstName))) { + pushMe = false; + break; + } } // Splice in the complex creator at the correct location, // accounting for previous insertions From 57da88ac3df3134e0e577693613db98327ec187b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 1 Sep 2014 23:19:12 -0400 Subject: [PATCH 10/10] Fix == use --- chrome/content/zotero/xpcom/openurl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/openurl.js b/chrome/content/zotero/xpcom/openurl.js index 2ef6bc278..941288307 100644 --- a/chrome/content/zotero/xpcom/openurl.js +++ b/chrome/content/zotero/xpcom/openurl.js @@ -484,7 +484,7 @@ Zotero.OpenURL = new function() { // the plain author, since it might have a middle initial if (item.creators[j].lastName == complexAu[i].lastName && item.creators[j].firstName && - (item.creators[j].firstName == complexAu[i].firstName == "" || + ((item.creators[j].firstName == "" && complexAu[i].firstName == "") || (item.creators[j].firstName.length >= complexAu[i].firstName.length && item.creators[j].firstName.substr(0, complexAu[i].firstName.length) == complexAu[i].firstName))) { pushMe = false;