Ticket #842: cslarchivalpatchfile

File cslarchivalpatchfile, 7.9 KB (added by erazlogo, 9 years ago)
Line 
1Index: chrome/content/zotero/xpcom/cite.js
2===================================================================
3--- chrome/content/zotero/xpcom/cite.js (revision 1934)
4+++ chrome/content/zotero/xpcom/cite.js (working copy)
5@@ -309,6 +309,8 @@
6 Zotero.CSL._namesVariables = {
7        "editor":true,
8        "translator":true,
9+       "recipient":true,
10+       "interviewer":true,
11        "author":true
12 }
13 
14@@ -1765,7 +1767,7 @@
15                "title":"title",
16                "container-title":"publicationTitle",
17                "collection-title":["seriesTitle", "series"],
18-               "publisher":"publisher",
19+               "publisher":["publisher", "distributor"],
20                "publisher-place":"place",
21                "page":"pages",
22                "volume":"volume",
23@@ -1773,6 +1775,11 @@
24                "number-of-volumes":"numberOfVolumes",
25                "edition":"edition",
26                "genre":"type",
27+               "medium":"medium",
28+               "archive":"repository",
29+               "archive_location":"archiveLocation",
30+               "event":"meetingName",
31+               "event-place":"place",
32                "abstract":"abstractNote",
33                "URL":"url",
34                "DOI":"DOI",
35@@ -1843,7 +1850,7 @@
36        film:"motion_picture",
37        artwork:"graphic",
38        webpage:"webpage",
39-       report:"paper-conference",      // ??
40+       report:"book",  // ??
41        bill:"bill",
42        case:"legal_case",
43        hearing:"bill",                         // ??
44@@ -1870,10 +1877,10 @@
45        journalArticle:"article",
46        magazineArticle:"article",
47        newspaperArticle:"article",
48-       thesis:"book",
49+       thesis:"article",
50        letter:"article",
51-       manuscript:"book",
52-       interview:"book",
53+       manuscript:"article",
54+       interview:"article",
55        film:"book",
56        artwork:"book",
57        webpage:"article",
58@@ -1888,9 +1895,9 @@
59        blogPost:"article",
60        instantMessage:"article",
61        forumPost:"article",
62-       audioRecording:"article",
63+       audioRecording:"book",
64        presentation:"article",
65-       videoRecording:"article",
66+       videoRecording:"book",
67        tvBroadcast:"article",
68        radioBroadcast:"article",
69        podcast:"article",
70@@ -2159,6 +2166,8 @@
71                var names = this.items[i].getNames("author");
72                if(!names) names = this.items[i].getNames("editor");
73                if(!names) names = this.items[i].getNames("translator");
74+               if(!names) names = this.items[i].getNames("recipient");
75+               if(!names) names = this.items[i].getNames("interviewer");
76                if(!names) continue;
77                namesByItem[i] = names;
78        }
79Index: chrome/content/zotero/xpcom/cite_compat.js
80===================================================================
81--- chrome/content/zotero/xpcom/cite_compat.js  (revision 1934)
82+++ chrome/content/zotero/xpcom/cite_compat.js  (working copy)
83@@ -74,6 +74,8 @@
84                author:"contributor",
85                editor:"contributor",
86                translator:"contributor",
87+               recipient:"contributor",
88+               interviewer:"contributor",
89                pages:"locator",
90                volume:"locator",
91                issue:"locator",
92@@ -92,7 +94,7 @@
93                "graphic":"article",
94                "interview":"article",
95                "legal case":"article",
96-               "manuscript":"book",
97+               "manuscript":"article",
98                "map":"article",
99                "motion picture":"book",
100                "musical score":"article",
101@@ -103,7 +105,7 @@
102                "report":"book",
103                "song":"article",
104                "speech":"article",
105-               "thesis":"book",
106+               "thesis":"article",
107                "treaty":"article",
108                "webpage":"article",
109        }
110@@ -401,11 +403,13 @@
111                        item._csl = new Object();
112                        item._csl.dateModified = dateModified;
113                       
114-                       // separate item into authors, editors, translators
115+                       // separate item into authors, editors, translators, recipients, interviewers
116                        var creators = this.csl._separateItemCreators(item);
117                        item._csl.authors = creators[0];
118                        item._csl.editors = creators[1];
119                        item._csl.translators = creators[2];
120+                       item._csl.recipients = creators[3];
121+                       item._csl.interviewers = creators[4];
122                       
123                        // parse date
124                        item._csl.date = Zotero.CSL.Compat.prototype._processDate(this.csl._getField(item, "date"));
125@@ -1284,6 +1288,10 @@
126                dataAppended = formattedString.concat(this._processCreators(name, element, item._csl.editors, formattedString.format, bibCitElement, position), element);
127        } else if(name == "translator") {
128                dataAppended = formattedString.concat(this._processCreators(name, element, item._csl.translators, formattedString.format, bibCitElement, position), element);
129+       } else if(name == "recipient") {
130+               dataAppended = formattedString.concat(this._processCreators(name, element, item._csl.recipients, formattedString.format, bibCitElement, position), element);
131+       } else if(name == "interviewer") {
132+               dataAppended = formattedString.concat(this._processCreators(name, element, item._csl.interviewers, formattedString.format, bibCitElement, position), element);
133        } else if(name == "titles") {
134                var data = new Zotero.CSL.Compat.FormattedString(this, formattedString.format);
135               
136@@ -1865,22 +1873,22 @@
137        magazineArticle:"article-magazine",
138        newspaperArticle:"article-newspaper",
139        thesis:"thesis",
140-       letter:"personal communication",
141+       letter:"personal_communication",
142        manuscript:"manuscript",
143        interview:"interview",
144        film:"motion picture",
145        artwork:"graphic",
146        webpage:"webpage",
147-       report:"paper-conference",      // ??
148+       report:"book",  // ??
149        bill:"bill",
150        case:"legal case",
151        hearing:"bill",                         // ??
152        patent:"patent",
153        statute:"bill",                         // ??
154-       email:"personal communication",
155+       email:"personal_communication",
156        map:"map",
157        blogPost:"webpage",
158-       instantMessage:"personal communication",
159+       instantMessage:"personal_communication",
160        forumPost:"webpage",
161        audioRecording:"song",          // ??
162        presentation:"paper-conference",
163@@ -1899,8 +1907,8 @@
164        newspaperArticle:"article",
165        thesis:"book",
166        letter:"article",
167-       manuscript:"book",
168-       interview:"book",
169+       manuscript:"article",
170+       interview:"article",
171        film:"book",
172        artwork:"book",
173        webpage:"article",
174@@ -1915,9 +1923,9 @@
175        blogPost:"article",
176        instantMessage:"article",
177        forumPost:"article",
178-       audioRecording:"article",
179+       audioRecording:"book",
180        presentation:"article",
181-       videoRecording:"article",
182+       videoRecording:"book",
183        tvBroadcast:"article",
184        radioBroadcast:"article",
185        podcast:"article",
186@@ -1948,16 +1956,20 @@
187 }
188 
189 /*
190- * separate creators object into authors, editors, and translators
191+ * separate creators object into authors, editors, translators, recipients, and interviewers
192  */
193 Zotero.CSL.Compat.prototype._separateItemCreators = function(item) {
194        var authors = new Array();
195        var editors = new Array();
196        var translators = new Array();
197+       var recipients = new Array();
198+       var interviewers = new Array();
199       
200        var authorID = Zotero.CreatorTypes.getPrimaryIDForType(item.getType());
201        var editorID = Zotero.CreatorTypes.getID("editor");
202        var translatorID = Zotero.CreatorTypes.getID("translator");
203+       var recipientID = Zotero.CreatorTypes.getID("recipient");
204+       var interviewerID = Zotero.CreatorTypes.getID("interviewer");
205       
206        var creators = item.getCreators();
207        for each(var creator in creators) {
208@@ -1965,13 +1977,17 @@
209                        editors.push(creator);
210                } else if(creator.creatorTypeID == translatorID) {
211                        translators.push(creator);
212+               } else if(creator.creatorTypeID == recipientID) {
213+                       recipients.push(creator);
214+               } else if(creator.creatorTypeID == interviewerID) {
215+                       interviewers.push(creator);
216                } else if(creator.creatorTypeID == authorID) {
217                        // TODO: do we just ignore contributors?
218                        authors.push(creator);
219                }
220        }
221       
222-       return [authors, editors, translators];
223+       return [authors, editors, translators, recipients, interviewers];
224 }
225 
226 /*
227Index: chrome/content/zotero/locale/csl/locales-en-US.xml
228===================================================================
229--- chrome/content/zotero/locale/csl/locales-en-US.xml  (revision 1934)
230+++ chrome/content/zotero/locale/csl/locales-en-US.xml  (working copy)
231@@ -12,6 +12,8 @@
232     <term name="no date">n.d.</term>
233     <term name="and">and</term>
234     <term name="et-al">et al.</term>
235+    <term name="interview">interview</term>
236+    <term name="letter">letter</term>
237     
238     <!-- LONG LOCATOR FORMS -->
239     <term name="book">
240@@ -129,6 +131,8 @@
241     <!-- VERB ROLE FORMS -->
242     <term name="editor" form="verb">edited by</term>
243     <term name="translator" form="verb">translated by</term>
244+    <term name="recipient" form="verb">to</term>
245+    <term name="interviewer" form="verb">interview by</term>
246     
247     <!-- SHORT VERB ROLE FORMS -->
248     <term name="editor" form="verb-short">ed</term>