diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 9c5a4d27a..88f1a2da2 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -1196,8 +1196,6 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) { } else { Zotero.debug("discarded field "+i+" for item: field not valid for type "+type); } - } else { - Zotero.debug("discarded field "+i+" for item: field does not exist"); } } } @@ -1223,6 +1221,11 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) { } } + // handle abstract + if(item.abstractNote) { + Zotero.Notes.add(item.abstractNote, myID, true); + } + // handle attachments if(item.attachments && Zotero.Prefs.get("automaticSnapshots")) { Zotero.debug("HANDLING ATTACHMENTS"); @@ -1850,6 +1853,23 @@ Zotero.Translate.prototype._exportGetItem = function() { } } else { var returnItemArray = returnItem.toArray(); + + // handle abstract as abstractNote + if(returnItem.isRegularItem()) { + var abstractID = returnItem.getAbstract(); + + if(abstractID) { + // look for the abstract in the notes array and remove it + for(var i in returnItemArray.notes) { + if(returnItemArray.notes[i].itemID == abstractID) { + returnItemArray.abstractNote = returnItemArray.notes[i].note; + returnItemArray.notes.splice(i, 1); + break; + } + } + } + } + // get attachments, although only urls will be passed if exportFileData // is off returnItemArray.attachments = new Array(); diff --git a/scrapers.sql b/scrapers.sql index c7a29086c..2d418364e 100644 --- a/scrapers.sql +++ b/scrapers.sql @@ -1,4 +1,4 @@ --- 125 +-- 126 -- ***** BEGIN LICENSE BLOCK ***** -- @@ -22,7 +22,7 @@ -- Set the following timestamp to the most recent scraper update date -REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-12-13 00:19:00')); +REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-12-14 17:53:00')); REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b3.r1', '', '2006-12-14 00:40:00', 1, 100, 4, 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', 'function detectWeb(doc, url) { @@ -2611,7 +2611,7 @@ REPLACE INTO translators VALUES ('c54d1932-73ce-dfd4-a943-109380e06574', '1.0.0b } }'); -REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2006-12-12 23:41:00', 1, 100, 12, 'NCBI PubMed', 'Simon Kornblith', '^http://www\.ncbi\.nlm\.nih\.gov/entrez/query\.fcgi\?.*db=PubMed', +REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2006-12-14 17:53:00', 1, 100, 12, 'NCBI PubMed', 'Simon Kornblith', '^http://www\.ncbi\.nlm\.nih\.gov/entrez/query\.fcgi\?.*db=PubMed', 'function detectWeb(doc, url) { var namespace = doc.documentElement.namespaceURI; var nsResolver = namespace ? function(prefix) { @@ -2728,6 +2728,8 @@ function detectSearch(item) { } } + newItem.abstractNote = article.Abstract.AbstractText.toString() + newItem.complete(); }