From bedd302bb3125ec9585f4f91249935daa2d47341 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 12 Dec 2006 19:53:26 +0000 Subject: [PATCH] addresses #365, update import/export/bibliography to handle new item types Dan S's recommendations for handling the bibliography are now implemented. "article" is the default type mapping, and we use Zotero.CreatorTypes.getPrimaryIDForType to determine which type to treat as the author. --- chrome/content/zotero/xpcom/cite.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index a9c85df019..a6d56f065a 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -1718,7 +1718,13 @@ Zotero.CSL.prototype._getTypeFromItem = function(item) { // get type Zotero.debug("CSL: parsing item of Scholar type "+scholarType); - return [Zotero.CSL.Global.optionalTypeMappings[scholarType], Zotero.CSL.Global.fallbackTypeMappings[scholarType]]; + if(Zotero.CSL.Global.optionalTypeMappings[scholarType]) { + return [Zotero.CSL.Global.optionalTypeMappings[scholarType], Zotero.CSL.Global.fallbackTypeMappings[scholarType]]; + } else if(Zotero.CSL.Global.fallbackTypeMappings[scholarType]) { + return [Zotero.CSL.Global.fallbackTypeMappings[scholarType]]; + } else { // use article as backup type mapping + return ["article"]; + } } /* @@ -1729,7 +1735,7 @@ Zotero.CSL.prototype._separateItemCreators = function(item) { var editors = new Array(); var translators = new Array(); - var authorID = Zotero.CreatorTypes.getID("author"); + var authorID = Zotero.CreatorTypes.getPrimaryIDForType(item.getType()); var editorID = Zotero.CreatorTypes.getID("editor"); var translatorID = Zotero.CreatorTypes.getID("translator"); @@ -1749,6 +1755,9 @@ Zotero.CSL.prototype._separateItemCreators = function(item) { } } + Zotero.debug(authorID+", "+editorID+", "+translatorID); + Zotero.debug(creators); + return [authors, editors, translators]; }