www

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

commit 41de3876d844a2c867456e6bc31d44d8153878f7
parent 0eb4db7c33b47308cfe39a0d28d42b1f71041ae3
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Thu, 31 Jan 2013 16:17:53 -0600

Fall back to link attachments for opening item

Diffstat:
Mchrome/content/zotero/zoteroPane.js | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -3369,6 +3369,7 @@ var ZoteroPane = new function() for each(var item in items) { if (item.isRegularItem()) { + //Prefer physical attachments (not links) var uri = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIURI); var snapID = item.getBestAttachment(); @@ -3383,6 +3384,7 @@ var ZoteroPane = new function() } } + //fall back to URI field then DOI var uri = item.getField('url'); if (!uri) { var doi = item.getField('DOI'); @@ -3394,6 +3396,16 @@ var ZoteroPane = new function() } } } + + //fall back to first link attachment + if(!uri) { + var link = item.getAttachments()[0]; + if(link) { + link = Zotero.Items.get(link); + if(link) uri = link.getField('url'); + } + } + if (uri) { ZoteroPane_Local.loadURI(uri, event); }