Skip to content

Commit

Permalink
Bump version update CHANGES, bundle as 1.2.15
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Jul 10, 2019
1 parent c27e4fa commit 9a9efe9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 147 deletions.
8 changes: 8 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,13 @@
Summary of changes to citeproc-js since version 1.2 release.

=========================
Changes in version 1.2.15
=========================

- Housekeeping update. Remove decommissioned attributes from schema, tests,
docs, and processor code. Still work to be done on docs, some things
remain to be covered.

=========================
Changes in version 1.2.14
=========================
Expand Down
82 changes: 10 additions & 72 deletions citeproc.js
Expand Up @@ -59,7 +59,7 @@ Copyright (c) 2009-2019 Frank Bennett

var CSL = {

PROCESSOR_VERSION: "1.2.14",
PROCESSOR_VERSION: "1.2.15",

error: function(str) { // default error function
if ("undefined" === typeof Error) {
Expand Down Expand Up @@ -15115,18 +15115,6 @@ CSL.Node.intext = {

CSL.Attributes = {};

CSL.Attributes["@genre"] = function (state, arg) {
this.tests ? {} : this.tests = [];
arg = arg.replace("-", " ");
var func = function (Item) {
if (arg === Item.genre) {
return true;
}
return false;
};
this.tests.push(func);
};

CSL.Attributes["@disambiguate"] = function (state, arg) {
this.tests ? {} : this.tests = [];
if (arg === "true") {
Expand Down Expand Up @@ -15701,25 +15689,6 @@ CSL.Attributes["@has-day"] = function (state, arg) {
}
};

CSL.Attributes["@subjurisdictions"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var trysubjurisdictions = parseInt(arg, 10);
var func = function (Item) {
var subjurisdictions = 0;
if (Item.jurisdiction) {
subjurisdictions = Item.jurisdiction.split(":").length;
}
if (subjurisdictions) {
subjurisdictions += -1;
}
if (subjurisdictions >= trysubjurisdictions) {
return true;
}
return false;
};
this.tests.push(func);
};

CSL.Attributes["@is-plural"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var func = function (Item) {
Expand Down Expand Up @@ -15857,26 +15826,6 @@ CSL.Attributes["@locale"] = function (state, arg) {
}
};

CSL.Attributes["@authority-residue"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var maketest = function () {
var succeed = (arg === "true") ? true : false;
return function(Item) {
if (!Item.authority || !Item.authority[0] || !Item.authority[0].family) {
return !succeed;
}
var varLen = Item.authority[0].family.split("|").length;
var stopLast = state.tmp.authority_stop_last;
if ((varLen + stopLast) > 0) {
return succeed;
} else {
return !succeed;
}
};
};
this.tests.push(maketest());
};

CSL.Attributes["@alternative-node-internal"] = function (state) {
this.tests ? {} : this.tests = [];
var maketest = function () {
Expand Down Expand Up @@ -15981,10 +15930,6 @@ CSL.Attributes["@no-repeat"] = function (state, arg) {
};


CSL.Attributes["@jurisdiction-depth"] = function (state, arg) {
this.strings.jurisdiction_depth = parseInt(arg, 10);
};


CSL.Attributes["@require"] = function (state, arg) {
this.strings.require = arg;
Expand Down Expand Up @@ -16254,9 +16199,6 @@ CSL.Attributes["@publisher-and"] = function (state, arg) {
this.strings["publisher-and"] = arg;
};

CSL.Attributes["@newdate"] = function () {};


CSL.Attributes["@givenname-disambiguation-rule"] = function (state, arg) {
if (CSL.GIVENNAME_DISAMBIGUATION_RULES.indexOf(arg) > -1) {
state.citation.opt["givenname-disambiguation-rule"] = arg;
Expand Down Expand Up @@ -16703,7 +16645,7 @@ CSL.Parallel.prototype.getRepeats = function(prev, curr) {
if (key.match(rex)) {
continue;
}
if (typeof prev[key] === "string") {
if (typeof prev[key] === "string" || !prev[key]) {
if (prev[key] && prev[key] === curr[key]) {
ret[key] = true;
}
Expand Down Expand Up @@ -16763,6 +16705,7 @@ CSL.Parallel.prototype.StartCitation = function (sortedItems, out) {
sortedItems[i-1][1].parallel = "first";
sortedItems[i][1].parallel = "mid";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
sortedItems[i-1][1].repeats = sortedItems[i][1].repeats;
if (!sortedItems[i][1].prefix) {
sortedItems[i][1].prefix = ", ";
}
Expand All @@ -16779,15 +16722,20 @@ CSL.Parallel.prototype.StartCitation = function (sortedItems, out) {
}
delete seriesRels[curr.id];
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
//sortedItems[i-1][1].repeats = sortedItems[i][1].repeats;
this.state.registry.registry[masterID].siblings.push(curr.id);
} else {
sortedItems[i-1][1].parallel = "last";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
seriesRels = false;
}
}
if (i === (sortedItems.length-1)) {
if (sortedItems[i][1].parallel === "mid") {
sortedItems[i][1].parallel = "last";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
} else if (sortedItems[i][1].parallel !== "last") {
delete sortedItems[i][1].repeats;
}
}
}
Expand All @@ -16799,22 +16747,17 @@ CSL.Parallel.prototype.purgeGroupsIfParallel = function () {
for (var i = this.parallel_conditional_blobs_list.length - 1; i > -1; i += -1) {
var obj = this.parallel_conditional_blobs_list[i];
if (!obj.result && !obj.repeats) {
//this.state.sys.print(i + " No action [render] " + obj.id);
purgeme = false;
} else {
if (obj.condition) {
var purgeme = true;
if (obj.result === obj.condition) {
//this.state.sys.print(i + " Position match [render] "+obj.id);
purgeme = false;
}
//else {
// this.state.sys.print(i + " Position non-match [not-render] "+obj.id + " " + obj.condition + " " + obj.result);
//}
} else if (obj.repeats) {
}
if (purgeme && obj.norepeat && obj.repeats) {
purgeme = false;
var matches = 0;
//this.state.sys.print(obj.norepeat)
for (var j=0,jlen=obj.norepeat.length; j<jlen; j++) {
if (obj.repeats[obj.norepeat[j]]) {
matches += 1;
Expand All @@ -16825,11 +16768,6 @@ CSL.Parallel.prototype.purgeGroupsIfParallel = function () {
}
}
}
//if (purgeme) {
// this.state.sys.print(i + " Repetition check [not-render] "+obj.id + " (" + obj.norepeat + " / " + JSON.stringify(obj.repeats) + ")");
//} else {
// this.state.sys.print(i + " Repetition check [render] "+obj.id + " (" + obj.norepeat + " / " + JSON.stringify(obj.repeats) + ")");
//}
if (purgeme) {
var buffer = [];
while (obj.blobs.length > obj.pos) {
Expand Down
82 changes: 10 additions & 72 deletions citeproc_commonjs.js
Expand Up @@ -59,7 +59,7 @@ Copyright (c) 2009-2019 Frank Bennett

var CSL = {

PROCESSOR_VERSION: "1.2.14",
PROCESSOR_VERSION: "1.2.15",

error: function(str) { // default error function
if ("undefined" === typeof Error) {
Expand Down Expand Up @@ -15115,18 +15115,6 @@ CSL.Node.intext = {

CSL.Attributes = {};

CSL.Attributes["@genre"] = function (state, arg) {
this.tests ? {} : this.tests = [];
arg = arg.replace("-", " ");
var func = function (Item) {
if (arg === Item.genre) {
return true;
}
return false;
};
this.tests.push(func);
};

CSL.Attributes["@disambiguate"] = function (state, arg) {
this.tests ? {} : this.tests = [];
if (arg === "true") {
Expand Down Expand Up @@ -15701,25 +15689,6 @@ CSL.Attributes["@has-day"] = function (state, arg) {
}
};

CSL.Attributes["@subjurisdictions"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var trysubjurisdictions = parseInt(arg, 10);
var func = function (Item) {
var subjurisdictions = 0;
if (Item.jurisdiction) {
subjurisdictions = Item.jurisdiction.split(":").length;
}
if (subjurisdictions) {
subjurisdictions += -1;
}
if (subjurisdictions >= trysubjurisdictions) {
return true;
}
return false;
};
this.tests.push(func);
};

CSL.Attributes["@is-plural"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var func = function (Item) {
Expand Down Expand Up @@ -15857,26 +15826,6 @@ CSL.Attributes["@locale"] = function (state, arg) {
}
};

CSL.Attributes["@authority-residue"] = function (state, arg) {
this.tests ? {} : this.tests = [];
var maketest = function () {
var succeed = (arg === "true") ? true : false;
return function(Item) {
if (!Item.authority || !Item.authority[0] || !Item.authority[0].family) {
return !succeed;
}
var varLen = Item.authority[0].family.split("|").length;
var stopLast = state.tmp.authority_stop_last;
if ((varLen + stopLast) > 0) {
return succeed;
} else {
return !succeed;
}
};
};
this.tests.push(maketest());
};

CSL.Attributes["@alternative-node-internal"] = function (state) {
this.tests ? {} : this.tests = [];
var maketest = function () {
Expand Down Expand Up @@ -15981,10 +15930,6 @@ CSL.Attributes["@no-repeat"] = function (state, arg) {
};


CSL.Attributes["@jurisdiction-depth"] = function (state, arg) {
this.strings.jurisdiction_depth = parseInt(arg, 10);
};


CSL.Attributes["@require"] = function (state, arg) {
this.strings.require = arg;
Expand Down Expand Up @@ -16254,9 +16199,6 @@ CSL.Attributes["@publisher-and"] = function (state, arg) {
this.strings["publisher-and"] = arg;
};

CSL.Attributes["@newdate"] = function () {};


CSL.Attributes["@givenname-disambiguation-rule"] = function (state, arg) {
if (CSL.GIVENNAME_DISAMBIGUATION_RULES.indexOf(arg) > -1) {
state.citation.opt["givenname-disambiguation-rule"] = arg;
Expand Down Expand Up @@ -16703,7 +16645,7 @@ CSL.Parallel.prototype.getRepeats = function(prev, curr) {
if (key.match(rex)) {
continue;
}
if (typeof prev[key] === "string") {
if (typeof prev[key] === "string" || !prev[key]) {
if (prev[key] && prev[key] === curr[key]) {
ret[key] = true;
}
Expand Down Expand Up @@ -16763,6 +16705,7 @@ CSL.Parallel.prototype.StartCitation = function (sortedItems, out) {
sortedItems[i-1][1].parallel = "first";
sortedItems[i][1].parallel = "mid";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
sortedItems[i-1][1].repeats = sortedItems[i][1].repeats;
if (!sortedItems[i][1].prefix) {
sortedItems[i][1].prefix = ", ";
}
Expand All @@ -16779,15 +16722,20 @@ CSL.Parallel.prototype.StartCitation = function (sortedItems, out) {
}
delete seriesRels[curr.id];
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
//sortedItems[i-1][1].repeats = sortedItems[i][1].repeats;
this.state.registry.registry[masterID].siblings.push(curr.id);
} else {
sortedItems[i-1][1].parallel = "last";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
seriesRels = false;
}
}
if (i === (sortedItems.length-1)) {
if (sortedItems[i][1].parallel === "mid") {
sortedItems[i][1].parallel = "last";
sortedItems[i][1].repeats = this.getRepeats(prev, curr);
} else if (sortedItems[i][1].parallel !== "last") {
delete sortedItems[i][1].repeats;
}
}
}
Expand All @@ -16799,22 +16747,17 @@ CSL.Parallel.prototype.purgeGroupsIfParallel = function () {
for (var i = this.parallel_conditional_blobs_list.length - 1; i > -1; i += -1) {
var obj = this.parallel_conditional_blobs_list[i];
if (!obj.result && !obj.repeats) {
//this.state.sys.print(i + " No action [render] " + obj.id);
purgeme = false;
} else {
if (obj.condition) {
var purgeme = true;
if (obj.result === obj.condition) {
//this.state.sys.print(i + " Position match [render] "+obj.id);
purgeme = false;
}
//else {
// this.state.sys.print(i + " Position non-match [not-render] "+obj.id + " " + obj.condition + " " + obj.result);
//}
} else if (obj.repeats) {
}
if (purgeme && obj.norepeat && obj.repeats) {
purgeme = false;
var matches = 0;
//this.state.sys.print(obj.norepeat)
for (var j=0,jlen=obj.norepeat.length; j<jlen; j++) {
if (obj.repeats[obj.norepeat[j]]) {
matches += 1;
Expand All @@ -16825,11 +16768,6 @@ CSL.Parallel.prototype.purgeGroupsIfParallel = function () {
}
}
}
//if (purgeme) {
// this.state.sys.print(i + " Repetition check [not-render] "+obj.id + " (" + obj.norepeat + " / " + JSON.stringify(obj.repeats) + ")");
//} else {
// this.state.sys.print(i + " Repetition check [render] "+obj.id + " (" + obj.norepeat + " / " + JSON.stringify(obj.repeats) + ")");
//}
if (purgeme) {
var buffer = [];
while (obj.blobs.length > obj.pos) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "citeproc",
"version": "2.2.14",
"description": "The citeproc-js citation formatting module, in CommonJS format. This version is based on citeproc-js 1.2.14",
"version": "2.2.15",
"description": "The citeproc-js citation formatting module, in CommonJS format. This version is based on citeproc-js 1.2.15",
"main": "citeproc_commonjs.js",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/load.js
Expand Up @@ -35,7 +35,7 @@

var CSL = {

PROCESSOR_VERSION: "1.2.14",
PROCESSOR_VERSION: "1.2.15",

error: function(str) { // default error function
if ("undefined" === typeof Error) {
Expand Down

0 comments on commit 9a9efe9

Please sign in to comment.