www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 80924040fb8bfb7510171a0ca4671635682135ad
parent b4fd20822adf703bf216eb5fa2a0c6f8e31c51a9
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 12 Jul 2010 11:37:47 +0000

closes #1427, PATCH: MODS [physicalDescription = "electronic" > itemType "webpage"] could cause problems
closes #1579, PATCH: MODS translator should separate titles and subTitles
once again, thanks to karnesky


Diffstat:
Mtranslators/MODS.js | 23++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/translators/MODS.js b/translators/MODS.js @@ -459,6 +459,12 @@ function doImport() { // dropping other title types so they don't overwrite the main title // we have same behaviour in the MARC translator if(!titleInfo.@type.toString()) { + if (titleInfo.m::title.length()){ + newItem.title = titleInfo.m::title.text().toString(); + if (titleInfo.m::subTitle.length()) { + newItem.title = newItem.title + ": " + titleInfo.m::subTitle.text().toString(); + } + } else { newItem.title = titleInfo.*.text(); // including text from sub elements } } @@ -485,19 +491,7 @@ function doImport() { } } - // check if this is an electronic resource - if(!newItem.itemType) { - for each(var form in mods.m::physicalDescription.m::form) { - if(form.@authority == "marcform" || form.@authority == "marc") { - if(form.text().toString() == "electronic") { - newItem.itemType = "webpage"; - break; - } - } - } - - if(!newItem.itemType) newItem.itemType = "document"; - } + if(!newItem.itemType) newItem.itemType = "document"; } var isPartialItem = Zotero.Utilities.inArray(newItem.itemType, partialItemTypes); @@ -709,4 +703,4 @@ function doImport() { newItem.complete(); } -} -\ No newline at end of file +}