From 9836f33d41ed1c50ea0bef7496c91efc42705892 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 9 Dec 2016 03:10:39 -0500 Subject: [PATCH] Add .collections support to Zotero.Attachments.linkFromURL() --- chrome/content/zotero/xpcom/attachments.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index a46cf7969..c9a2a03a4 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -425,7 +425,7 @@ Zotero.Attachments = new function(){ /** * Create a link attachment from a URL * - * @param {Object} options - 'url', 'parentItemID', 'contentType', 'title' + * @param {Object} options - 'url', 'parentItemID', 'contentType', 'title', 'collections' * @return {Promise} - A promise for the created attachment item */ this.linkFromURL = Zotero.Promise.coroutine(function* (options) { @@ -435,6 +435,7 @@ Zotero.Attachments = new function(){ var parentItemID = options.parentItemID; var contentType = options.contentType; var title = options.title; + var collections = options.collections; /* Throw error on invalid URLs We currently accept the following protocols: @@ -490,11 +491,12 @@ Zotero.Attachments = new function(){ } return _addToDB({ - url: url, - title: title, + url, + title, linkMode: this.LINK_MODE_LINKED_URL, - contentType: contentType, - parentItemID: parentItemID + contentType, + parentItemID, + collections }); });