commit 9836f33d41ed1c50ea0bef7496c91efc42705892
parent 9fbd84b27eac7e34bf587c2649ed166d85a7ec01
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 9 Dec 2016 03:10:39 -0500
Add .collections support to Zotero.Attachments.linkFromURL()
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git 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<Zotero.Item>} - 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
});
});