Upgrade citeproc-js to version 1.0.290

This commit is contained in:
Frank 2012-02-25 06:10:41 +08:00 committed by Simon Kornblith
parent 96bf57c216
commit 17094cfb30

View file

@ -2149,7 +2149,7 @@ CSL.DateParser = function () {
}; };
CSL.Engine = function (sys, style, lang, forceLang) { CSL.Engine = function (sys, style, lang, forceLang) {
var attrs, langspec, localexml, locale; var attrs, langspec, localexml, locale;
this.processor_version = "1.0.289"; this.processor_version = "1.0.290";
this.csl_version = "1.0"; this.csl_version = "1.0";
this.sys = sys; this.sys = sys;
this.sys.xml = new CSL.System.Xml.Parsing(); this.sys.xml = new CSL.System.Xml.Parsing();
@ -6651,12 +6651,6 @@ CSL.NameOutput.prototype.fixupInstitution = function (name, varname, listpos) {
jurisdiction = this.state.transform.loadAbbreviation(jurisdiction, "institution-part", long_form[j]); jurisdiction = this.state.transform.loadAbbreviation(jurisdiction, "institution-part", long_form[j]);
if (this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]]) { if (this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]]) {
short_form[j] = this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]]; short_form[j] = this.state.transform.abbrevs[jurisdiction]["institution-part"][long_form[j]];
if (this.Item["container-title"]) {
var suppressing_partner = this.state.transform.abbrevs[jurisdiction]["container-title"][this.Item["container-title"]];
if (varname === "authority" && suppressing_partner && suppressing_partner === short_form[j]) {
short_form[j] = false;
}
}
} }
} }
} }
@ -7537,9 +7531,6 @@ CSL.Node.text = {
} else { } else {
state.transform.setTransformFallback(true); state.transform.setTransformFallback(true);
state.transform.setAbbreviationFallback(true); state.transform.setAbbreviationFallback(true);
if (this.variables_real[0] === "subjurisdiction") {
state.transform.setSuppressMonitor("container-title");
}
func = state.transform.getOutputFunction(this.variables); func = state.transform.getOutputFunction(this.variables);
} }
if (this.variables_real[0] === "container-title") { if (this.variables_real[0] === "container-title") {
@ -8631,8 +8622,7 @@ CSL.Transform = function (state) {
opt = { opt = {
abbreviation_fallback: false, abbreviation_fallback: false,
alternative_varname: false, alternative_varname: false,
transform_fallback: false, transform_fallback: false
suppress_monitor: false
}; };
} }
this.init = init; this.init = init;
@ -8708,10 +8698,6 @@ CSL.Transform = function (state) {
opt.abbreviation_fallback = b; opt.abbreviation_fallback = b;
} }
this.setAbbreviationFallback = setAbbreviationFallback; this.setAbbreviationFallback = setAbbreviationFallback;
function setSuppressMonitor(b) {
opt.suppress_monitor = b;
}
this.setSuppressMonitor = setSuppressMonitor;
function setAlternativeVariableName(s) { function setAlternativeVariableName(s) {
opt.alternative_varname = s; opt.alternative_varname = s;
} }
@ -8785,7 +8771,6 @@ CSL.Transform = function (state) {
var abbreviation_fallback = opt.abbreviation_fallback; var abbreviation_fallback = opt.abbreviation_fallback;
var alternative_varname = opt.alternative_varname; var alternative_varname = opt.alternative_varname;
var transform_fallback = opt.transform_fallback; var transform_fallback = opt.transform_fallback;
var suppress_monitor = opt.suppress_monitor;
var localesets; var localesets;
var langPrefs = CSL.LangPrefsMap[myfieldname]; var langPrefs = CSL.LangPrefsMap[myfieldname];
if (!langPrefs) { if (!langPrefs) {
@ -8849,10 +8834,13 @@ CSL.Transform = function (state) {
} }
if (myabbrev_family) { if (myabbrev_family) {
primary = abbreviate(state, Item, alternative_varname, primary, myabbrev_family, true); primary = abbreviate(state, Item, alternative_varname, primary, myabbrev_family, true);
if (suppress_monitor && primary) { if (primary) {
var suppressing_partner = abbreviate(state, Item, false, Item["container-title"], "container-title", true); var m = primary.match(/^!([-_a-z]+)<<</);
if (suppressing_partner && suppressing_partner.slice(0, primary.length) === primary) { if (m) {
return null; primary = primary.slice(m[0].length);
if (state.tmp.done_vars.indexOf(m[1]) === -1) {
state.tmp.done_vars.push(m[1]);
}
} }
} }
secondary = abbreviate(state, Item, false, secondary, myabbrev_family, true); secondary = abbreviate(state, Item, false, secondary, myabbrev_family, true);