From aec3c4381f28bdd6f1889de7f826983529c33404 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 26 Jul 2010 01:01:18 +0000 Subject: [PATCH] closes #1699, Simplified _zoteroFieldMap for citeproc-js (thanks to Frank) --- chrome/content/zotero/xpcom/cite.js | 69 +++++++++++++---------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index 4e1d65cb68..256d425483 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -18,41 +18,36 @@ Zotero.Cite.System._zoteroNameMap = { * Mappings for text variables */ Zotero.Cite.System._zoteroFieldMap = { - "long":{ - "title":["title"], - "container-title":["publicationTitle", "reporter", "code"], /* reporter and code should move to SQL mapping tables */ - "collection-title":["seriesTitle", "series"], - "collection-number":["seriesNumber"], - "publisher":["publisher", "distributor"], /* distributor should move to SQL mapping tables */ - "publisher-place":["place"], - "authority":["court"], - "page":["pages"], - "volume":["volume"], - "issue":["issue"], - "number-of-volumes":["numberOfVolumes"], - "edition":["edition"], - "version":["version"], - "section":["section"], - "genre":["type", "artworkSize"], /* artworkSize should move to SQL mapping tables, or added as a CSL variable */ - "medium":["medium"], - "archive":["archive"], - "archive_location":["archiveLocation"], - "event":["meetingName", "conferenceName"], /* these should be mapped to the same base field in SQL mapping tables */ - "event-place":["place"], - "abstract":["abstractNote"], - "URL":["url"], - "DOI":["DOI"], - "ISBN":["ISBN"], - "call-number":["callNumber"], - "note":["extra"], - "number":["number"], - "references":["history"] - }, - "short":{ - "title":["shortTitle", "title"], - "container-title":["journalAbbreviation"], - "genre":["shortTitle", "type"] /* needed for subsequent citations of items with no title */ - } + "title":["title"], + "container-title":["publicationTitle", "reporter", "code"], /* reporter and code should move to SQL mapping tables */ + "collection-title":["seriesTitle", "series"], + "collection-number":["seriesNumber"], + "publisher":["publisher", "distributor"], /* distributor should move to SQL mapping tables */ + "publisher-place":["place"], + "authority":["court"], + "page":["pages"], + "volume":["volume"], + "issue":["issue"], + "number-of-volumes":["numberOfVolumes"], + "edition":["edition"], + "version":["version"], + "section":["section"], + "genre":["type", "artworkSize"], /* artworkSize should move to SQL mapping tables, or added as a CSL variable */ + "medium":["medium"], + "archive":["archive"], + "archive_location":["archiveLocation"], + "event":["meetingName", "conferenceName"], /* these should be mapped to the same base field in SQL mapping tables */ + "event-place":["place"], + "abstract":["abstractNote"], + "URL":["url"], + "DOI":["DOI"], + "ISBN":["ISBN"], + "call-number":["callNumber"], + "note":["extra"], + "number":["number"], + "references":["history"], + "shortTitle":["shortTitle"], + "journalAbbreviation":["journalAbbreviation"] } Zotero.Cite.System._zoteroDateMap = { @@ -132,8 +127,8 @@ Zotero.Cite.System.retrieveItem = function(item){ // get all text variables (there must be a better way) // TODO: does citeproc-js permit short forms? - for(var variable in Zotero.Cite.System._zoteroFieldMap["long"]) { - var fields = Zotero.Cite.System._zoteroFieldMap["long"][variable]; + for(var variable in Zotero.Cite.System._zoteroFieldMap) { + var fields = Zotero.Cite.System._zoteroFieldMap[variable]; if(variable == "URL" && ignoreURL) continue; for each(var field in fields) { var value = zoteroItem.getField(field, false, true).toString();