From b4848280561404257fff829412b9913c2fd746c2 Mon Sep 17 00:00:00 2001 From: Avram Lyon Date: Fri, 1 Apr 2011 21:10:31 +0000 Subject: [PATCH] Trans: Hackless versions for Z 2.1.3+ --- translators/BibTeX.js | 5 ++--- translators/RIS.js | 4 +--- translators/Readability.js | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/translators/BibTeX.js b/translators/BibTeX.js index b708ca4cb9..00cbec9a4f 100644 --- a/translators/BibTeX.js +++ b/translators/BibTeX.js @@ -4,7 +4,7 @@ "label":"BibTeX", "creator":"Simon Kornblith and Richard Karnesky", "target":"bib", - "minVersion":"1.0.0b4.r1", + "minVersion":"2.1.3", "maxVersion":"", "priority":200, "configOptions":{"dataMode":"block"}, @@ -1536,6 +1536,7 @@ var strings = {}; var keyRe = /[a-zA-Z0-9\-]/; function processField(item, field, value) { + if(Zotero.Utilities.trim(value) == '') return null; if(fieldMap[field]) { item[fieldMap[field]] = value; } else if(inputFieldMap[field]) { @@ -1786,8 +1787,6 @@ function beginRecord(type, closeChar) { } else if(read == closeChar) { if(item) { if(item.extra) item.extra = item.extra.substr(1); // chop \n - // hack for Zotero 2.1.1 bug (fixed in 2.1.2) - for each(var attachment in item.attachments) attachment.itemType = "attachment"; item.complete(); } return; diff --git a/translators/RIS.js b/translators/RIS.js index 2d6f80ca4f..8d227b9d52 100644 --- a/translators/RIS.js +++ b/translators/RIS.js @@ -4,7 +4,7 @@ "label":"RIS", "creator":"Simon Kornblith", "target":"ris", - "minVersion":"2.1b6", + "minVersion":"2.1.3", "maxVersion":"", "priority":100, "inRepository":true, @@ -368,8 +368,6 @@ function completeItem(item) { if(item.journalAbbreviation && !item.publicationTitle){ item.publicationTitle = item.journalAbbreviation; } - // hack for Zotero 2.1.1 bug (fixed in 2.1.2) - for each(var attachment in item.attachments) attachment.itemType = "attachment"; item.complete(); } diff --git a/translators/Readability.js b/translators/Readability.js index fca4ddff79..35bfa05fb6 100644 --- a/translators/Readability.js +++ b/translators/Readability.js @@ -3,7 +3,7 @@ "label": "Readability", "creator": "Avram Lyon", "target": "^https?://www\\.readability\\.com/articles", - "minVersion": "1.0", + "minVersion": "2.1.3", "maxVersion": "", "priority": 100, "inRepository": "0", @@ -74,7 +74,6 @@ function doWeb(doc, url){ if(time) item.date = time.textContent; // We snapshot the page, using the existing document - // TODO Eliminate the itemType:"attachment" when Z 2.1.2 is released - item.attachments = [{itemType:"attachment", document:doc, title:"Readability Snapshot"}] + item.attachments = [{document:doc, title:"Readability Snapshot"}] item.complete(); }