Add .collections support to Zotero.Attachments.linkFromURL()

This commit is contained in:
Dan Stillman 2016-12-09 03:10:39 -05:00
parent 9fbd84b27e
commit 9836f33d41

View File

@ -425,7 +425,7 @@ Zotero.Attachments = new function(){
/** /**
* Create a link attachment from a URL * 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 * @return {Promise<Zotero.Item>} - A promise for the created attachment item
*/ */
this.linkFromURL = Zotero.Promise.coroutine(function* (options) { this.linkFromURL = Zotero.Promise.coroutine(function* (options) {
@ -435,6 +435,7 @@ Zotero.Attachments = new function(){
var parentItemID = options.parentItemID; var parentItemID = options.parentItemID;
var contentType = options.contentType; var contentType = options.contentType;
var title = options.title; var title = options.title;
var collections = options.collections;
/* Throw error on invalid URLs /* Throw error on invalid URLs
We currently accept the following protocols: We currently accept the following protocols:
@ -490,11 +491,12 @@ Zotero.Attachments = new function(){
} }
return _addToDB({ return _addToDB({
url: url, url,
title: title, title,
linkMode: this.LINK_MODE_LINKED_URL, linkMode: this.LINK_MODE_LINKED_URL,
contentType: contentType, contentType,
parentItemID: parentItemID parentItemID,
collections
}); });
}); });