www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b0f52a0f0737e0a9f89e7b40afdb56021bc710d8
parent 93a6a4ffdb8087306c07ef336b97fcabbdc0dd0d
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  5 May 2015 14:07:48 -0400

Allow attachmentLinkMode to be specified as a string ('linked_url')

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -2699,13 +2699,21 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentLinkMode', { throw (".attachmentLinkMode can only be set for attachment items"); } + // Allow 'imported_url', etc. + if (typeof val == 'string') { + let code = Zotero.Attachments["LINK_MODE_" + val.toUpperCase()]; + if (code !== undefined) { + val = code; + } + } + switch (val) { case Zotero.Attachments.LINK_MODE_IMPORTED_FILE: case Zotero.Attachments.LINK_MODE_IMPORTED_URL: case Zotero.Attachments.LINK_MODE_LINKED_FILE: case Zotero.Attachments.LINK_MODE_LINKED_URL: break; - + default: throw ("Invalid attachment link mode '" + val + "' in Zotero.Item.attachmentLinkMode setter");