mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
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.
This commit is contained in:
parent
6e84f20de3
commit
bedd302bb3
1 changed files with 11 additions and 2 deletions
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue