From a056f7674f54381199e469b7288cd5f0ca53c59d Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sun, 24 Mar 2019 19:06:24 +0100 Subject: [PATCH] Expose attachments, as suggested by noctux --- src/utilities.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/utilities.js b/src/utilities.js index 5f88951..86fc1ed 100644 --- a/src/utilities.js +++ b/src/utilities.js @@ -65,8 +65,8 @@ Zotero.Utilities.itemToAPIJSON = function(item) { var fieldID, itemFieldID; for(var field in item) { - if(field === "complete" || field === "itemID" || field === "attachments" - || field === "seeAlso") continue; + if(field === "complete" || field === "itemID" || field === "seeAlso") + continue; var val = item[field]; @@ -149,6 +149,22 @@ Zotero.Utilities.itemToAPIJSON = function(item) { note: note.toString() }); } + } else if(field === "attachments") { + var n = val.length; + for(var j=0; j