mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
- closes #458, chicago manual of style bibliography style. Sean and others, please test this if you have the time.
- fixes conditional bugs in cite.js. i haven't had to use the conditionals until now, but Chicago has some bizarre formatting rules (especially 17.169) - removes extraneous debug code
This commit is contained in:
parent
8515b0551a
commit
5ddd30eed8
4 changed files with 174 additions and 23 deletions
|
|
@ -652,7 +652,9 @@ Zotero.CSL.prototype._parseFields = function(ref, position, type, bibCitElement,
|
|||
}
|
||||
|
||||
// parse group children
|
||||
if(itemDesc.name == "group") {
|
||||
if(itemDesc.name == "group" || itemDesc.name == "conditional" ||
|
||||
itemDesc.name == "if" || itemDesc.name == "else-if" ||
|
||||
itemDesc.name == "else") {
|
||||
// parse attributes on this field, but ignore children
|
||||
this._parseFieldAttrChildren(element, itemDesc, true);
|
||||
|
||||
|
|
@ -1276,9 +1278,9 @@ Zotero.CSL.prototype._getFieldValue = function(name, element, item, formattedStr
|
|||
status = true;
|
||||
}
|
||||
} else if(condition.field) {
|
||||
var formattedString = new Zotero.CSL.FormattedString(this, "Text");
|
||||
var testString = new Zotero.CSL.FormattedString(this, "Text");
|
||||
status = this._getFieldValue(condition.field, this._getFieldDefaults(condition.field), item,
|
||||
formattedString, bibCitElement);
|
||||
testString, bibCitElement);
|
||||
}
|
||||
} else if(condition.name == "else") {
|
||||
status = true;
|
||||
|
|
@ -1293,7 +1295,7 @@ Zotero.CSL.prototype._getFieldValue = function(name, element, item, formattedStr
|
|||
this._getFieldValue(child.name, child, item, data, bibCitElement,
|
||||
position, typeName);
|
||||
}
|
||||
dataAppended = formattedString.concat(data, element);
|
||||
dataAppended = formattedString.concat(data, condition);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1407,8 +1409,6 @@ Zotero.CSL.FormattedString.prototype.concat = function(formattedString, element)
|
|||
* appends a string (with format parameters) to the current one
|
||||
*/
|
||||
Zotero.CSL.FormattedString.prototype.append = function(string, element, dontDelimit, dontEscape) {
|
||||
Zotero.debug("CSL: ordered to append "+string);
|
||||
|
||||
if(!string) return false;
|
||||
if(typeof(string) != "string") {
|
||||
string = string.toString();
|
||||
|
|
@ -1444,7 +1444,7 @@ Zotero.CSL.FormattedString.prototype.append = function(string, element, dontDeli
|
|||
string = string.toUpperCase();
|
||||
} else if(element["text-transform"] == "capitalize") {
|
||||
// capitalize first
|
||||
string = string[0].toUpperCase()+string.substr(1).toLowerCase();
|
||||
string = string[0].toUpperCase()+string.substr(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1742,11 +1742,7 @@ Zotero.CSL.prototype._separateItemCreators = function(item) {
|
|||
var translatorID = Zotero.CreatorTypes.getID("translator");
|
||||
|
||||
var creators = item.getCreators();
|
||||
Zotero.debug("here come the creators");
|
||||
Zotero.debug(creators);
|
||||
for each(var creator in creators) {
|
||||
Zotero.debug(creator);
|
||||
|
||||
if(creator.creatorTypeID == editorID) {
|
||||
editors.push(creator);
|
||||
} else if(creator.creatorTypeID == translatorID) {
|
||||
|
|
@ -1757,9 +1753,6 @@ Zotero.CSL.prototype._separateItemCreators = function(item) {
|
|||
}
|
||||
}
|
||||
|
||||
Zotero.debug(authorID+", "+editorID+", "+translatorID);
|
||||
Zotero.debug(creators);
|
||||
|
||||
return [authors, editors, translators];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -933,7 +933,6 @@ Zotero.Date = new function(){
|
|||
date.day = m[2];
|
||||
}
|
||||
}
|
||||
Zotero.debug(date);
|
||||
|
||||
if(date.year) date.year = parseInt(date.year, 10);
|
||||
if(date.day) date.day = parseInt(date.day, 10);
|
||||
|
|
@ -948,8 +947,6 @@ Zotero.Date = new function(){
|
|||
}
|
||||
}
|
||||
|
||||
Zotero.debug(date);
|
||||
|
||||
if(!date.month || date.month <= 12) {
|
||||
if(date.year && date.year < 100) { // for two digit years, determine proper
|
||||
// four digit year
|
||||
|
|
@ -976,8 +973,6 @@ Zotero.Date = new function(){
|
|||
Zotero.debug("DATE: algorithms failed sanity check");
|
||||
date = {"part":string};
|
||||
}
|
||||
|
||||
Zotero.debug(date);
|
||||
} else {
|
||||
Zotero.debug("DATE: could not apply algorithms");
|
||||
date.part = string;
|
||||
|
|
@ -1043,8 +1038,6 @@ Zotero.Date = new function(){
|
|||
}
|
||||
}
|
||||
|
||||
Zotero.debug(date);
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@
|
|||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- SHORT VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
|
|
|
|||
165
scrapers.sql
165
scrapers.sql
|
|
@ -1,4 +1,4 @@
|
|||
-- 149
|
||||
-- 150
|
||||
|
||||
-- ***** BEGIN LICENSE BLOCK *****
|
||||
--
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
-- Set the following timestamp to the most recent scraper update date
|
||||
REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-12-19 21:25:46'));
|
||||
REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-12-19 23:51:00'));
|
||||
|
||||
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b3.r1', '', '2006-12-15 03:40:00', 1, 100, 4, 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
|
||||
'function detectWeb(doc, url) {
|
||||
|
|
@ -9677,6 +9677,167 @@ REPLACE INTO "csl" VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '200
|
|||
</bibliography>
|
||||
</style>');
|
||||
|
||||
REPLACE INTO "csl" VALUES('http://www.zotero.org/namespaces/CSL/chicago-author-date.csl', '2006-12-19 23:51:00', 'Chicago Manual of Style (Author-Date)',
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
<style xmlns="http://purl.org/net/xbiblio/csl" class="author-date" xml:lang="en">
|
||||
<info>
|
||||
<title>Chicago Reference List Style</title>
|
||||
<id>http://www.zotero.org/namespaces/CSL/chicago-author-date.csl</id>
|
||||
<author>
|
||||
<name>Simon Kornblith</name>
|
||||
<email>simon@simonster.com</email>
|
||||
</author>
|
||||
<updated>2006-09-04T20:27:00+05:00</updated>
|
||||
<summary>The author-date variant of the Chicago style.</summary>
|
||||
</info>
|
||||
<defaults>
|
||||
<contributor name-as-sort-order="no">
|
||||
<label form="verb-short" suffix=". "/>
|
||||
<name and="text" delimiter=", "/>
|
||||
</contributor>
|
||||
<author name-as-sort-order="first">
|
||||
<name and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
|
||||
<label form="verb-short" prefix=", " suffix="."/>
|
||||
<substitute>
|
||||
<choose>
|
||||
<editor/>
|
||||
<translator/>
|
||||
<titles relation="container" font-style="italic"/>
|
||||
<titles/>
|
||||
</choose>
|
||||
</substitute>
|
||||
</author>
|
||||
<locator>
|
||||
<number/>
|
||||
</locator>
|
||||
<identifier>
|
||||
<number/>
|
||||
</identifier>
|
||||
<titles>
|
||||
<title/>
|
||||
</titles>
|
||||
<date>
|
||||
<month text-transform="capitalize"/>
|
||||
<day prefix=" "/>
|
||||
</date>
|
||||
<publisher>
|
||||
<place suffix=": "/>
|
||||
<name/>
|
||||
</publisher>
|
||||
<access>
|
||||
<url/>
|
||||
<text term-name="accessed" prefix=" (" suffix=" "/>
|
||||
<date suffix=")">
|
||||
<month suffix=" " text-transform="capitalize"/>
|
||||
<day suffix=", "/>
|
||||
<year/>
|
||||
</date>
|
||||
</access>
|
||||
</defaults>
|
||||
<citation prefix="(" suffix=")" delimiter="; ">
|
||||
<et-al min-authors="3" use-first="1"/>
|
||||
<layout>
|
||||
<item>
|
||||
<author form="short">
|
||||
<name and="text" delimiter=", "/>
|
||||
</author>
|
||||
<date prefix=" ">
|
||||
<year/>
|
||||
</date>
|
||||
<locator prefix=", "/>
|
||||
</item>
|
||||
</layout>
|
||||
</citation>
|
||||
<bibliography hanging-indent="true" subsequent-author-substitute="---">
|
||||
<sort algorithm="author-date"/>
|
||||
<et-al min-authors="6" use-first="6"/>
|
||||
<layout>
|
||||
<list>
|
||||
<heading>
|
||||
<text term-name="works cited"/>
|
||||
</heading>
|
||||
</list>
|
||||
<item suffix=".">
|
||||
<choose>
|
||||
<type name="book">
|
||||
<author suffix="."/>
|
||||
<date prefix=" " suffix=".">
|
||||
<year/>
|
||||
</date>
|
||||
<titles prefix=" " suffix="." font-style="italic"/>
|
||||
<group prefix=" " suffix="." delimiter=", " text-transform="capitalize">
|
||||
<editor/>
|
||||
<translator/>
|
||||
</group>
|
||||
<publisher prefix=" " suffix="."/>
|
||||
<access prefix=" "/>
|
||||
</type>
|
||||
<type name="chapter">
|
||||
<author suffix="."/>
|
||||
<date prefix=" " suffix=".">
|
||||
<year/>
|
||||
</date>
|
||||
<titles prefix=" " suffix="."/>
|
||||
<group class="container" suffix=".">
|
||||
<text prefix=" " term-name="in" text-transform="capitalize"/>
|
||||
<titles prefix=" " relation="container" font-style="italic"/>
|
||||
<editor prefix=", "/>
|
||||
<translator prefix=", "/>
|
||||
<pages prefix=", "/>
|
||||
<publisher prefix=". "/>
|
||||
</group>
|
||||
<access prefix=" "/>
|
||||
</type>
|
||||
<type name="article">
|
||||
<author suffix="."/>
|
||||
<date prefix=" " suffix=".">
|
||||
<year/>
|
||||
</date>
|
||||
<titles prefix=" " suffix="."/>
|
||||
<group prefix=" " suffix="." delimiter=", " text-transform="capitalize">
|
||||
<editor/>
|
||||
<translator/>
|
||||
</group>
|
||||
<date prefix=" " suffix="."/>
|
||||
<access prefix=" "/>
|
||||
</type>
|
||||
<type name="article-journal">
|
||||
<author suffix="."/>
|
||||
<date prefix=" " suffix=".">
|
||||
<year/>
|
||||
</date>
|
||||
<titles prefix=" " suffix="."/>
|
||||
<group prefix=" " suffix="." delimiter=", " text-transform="capitalize">
|
||||
<editor/>
|
||||
<translator/>
|
||||
</group>
|
||||
<group class="container" prefix=" " suffix=".">
|
||||
<titles relation="container" font-style="italic"/>
|
||||
<volume prefix=" "/>
|
||||
<conditional>
|
||||
<if field="issue">
|
||||
<conditional>
|
||||
<if field="date">
|
||||
<issue prefix=", no. "/>
|
||||
<date prefix=" (" suffix=")"/>
|
||||
</if><else>
|
||||
<issue prefix=" (" suffix=")"/>
|
||||
</else>
|
||||
</conditional>
|
||||
<pages prefix=": "/>
|
||||
</if><else>
|
||||
<pages prefix=":"/>
|
||||
</else>
|
||||
</conditional>
|
||||
</group>
|
||||
<access prefix=" "/>
|
||||
</type>
|
||||
</choose>
|
||||
</item>
|
||||
</layout>
|
||||
</bibliography>
|
||||
</style>');
|
||||
|
||||
REPLACE INTO "csl" VALUES('http://purl.org/net/xbiblio/csl/styles/chicago-note.csl', '2006-10-02 17:00:00', 'Chicago Manual of Style (Note)',
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?oxygen RNGSchema="../schema/trunk/csl.rnc" type="compact"?>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue