From 44225aa4d12284550dee993236d45c73f6b18f3c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 21 Aug 2011 05:27:23 +0000 Subject: [PATCH] Updated translators from GitHub --- repotime.txt | 2 +- translators/BibTeX.js | 15 ++++++++++++--- translators/Zotero RDF.js | 7 +++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/repotime.txt b/repotime.txt index a34fb7d90..c12d05019 100644 --- a/repotime.txt +++ b/repotime.txt @@ -1 +1 @@ -2011-08-03 01:05:00 +2011-08-21 05:25:00 diff --git a/translators/BibTeX.js b/translators/BibTeX.js index 66f543228..ba2cb4808 100644 --- a/translators/BibTeX.js +++ b/translators/BibTeX.js @@ -14,7 +14,7 @@ "inRepository": true, "translatorType": 3, "browserSupport": "gcs", - "lastUpdated": "2011-07-29 03:35:07" + "lastUpdated": "2011-08-16 15:07:38" } function detectImport() { @@ -2109,11 +2109,20 @@ function doExport() { if(Zotero.getOption("exportFileData")) { if(item.attachments) { var attachmentString = ""; + for(var i in item.attachments) { var attachment = item.attachments[i]; - attachmentString += ";" + attachment.title + ":" + attachment.path + ":" + attachment.mimeType; + if(attachment.defaultPath) { // For Zotero 3.0 + attachment.saveFile(attachment.defaultPath, true); + attachmentString += ";" + attachment.title + ":" + attachment.defaultPath + ":" + attachment.mimeType; + } else if(attachment.path) { // For Zotero 2.1 + attachmentString += ";" + attachment.title + ":" + attachment.path + ":" + attachment.mimeType; + } + } + + if(attachmentString) { + writeField("file", attachmentString.substr(1)); } - writeField("file", attachmentString.substr(1)); } } diff --git a/translators/Zotero RDF.js b/translators/Zotero RDF.js index 9d0b67363..27f21ded8 100644 --- a/translators/Zotero RDF.js +++ b/translators/Zotero RDF.js @@ -10,7 +10,7 @@ "configOptions":{"getCollections":"true", "dataMode":"rdf/xml"}, "displayOptions":{"exportNotes":true, "exportFileData":false}, "inRepository":true, - "lastUpdated":"2011-07-08 04:51:41" + "lastUpdated":"2011-08-16 15:07:21" } var item; @@ -323,7 +323,10 @@ function generateItem(item, zoteroType, resource) { } // relative file path for attachment items - if(item.path) { + if(item.defaultPath) { // For Zotero 3.0 + item.saveFile(item.defaultPath, true); + Zotero.RDF.addStatement(resource, rdf+"resource", item.defaultPath, false); + } else if(item.path) { // For Zotero 2.1 Zotero.RDF.addStatement(resource, rdf+"resource", item.path, false); }