From 921fa8c0fa5606eb27de43d0fcca12b98479d9fd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 29 May 2009 08:43:52 +0000 Subject: [PATCH] - Make DOI label clickable in metadata pane - Restore hand cursor when hovering over DOI/URL labels (which wasn't working in Fx3.5) --- chrome/content/zotero/bindings/itembox.xml | 10 ++++++++++ chrome/skin/default/zotero/bindings/itembox.css | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index aac8a62e4e..13669f8454 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -440,6 +440,16 @@ label.setAttribute("onclick", "ZoteroPane.loadURI(this.nextSibling.firstChild ? this.nextSibling.firstChild.nodeValue : this.nextSibling.value, event)"); label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip')); } + else if (fieldName == 'DOI' && val) { + // Pull out DOI, in case there's a prefix + var doi = val.match(/10\..*/); + if (doi) { + doi = "http://dx.doi.org/" + encodeURIComponent(doi); + label.setAttribute("isButton", true); + label.setAttribute("onclick", "ZoteroPane.loadURI('" + doi + "', event)"); + label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip')); + } + } else if (fieldName == 'abstractNote') { label.setAttribute("onclick", "if (this.nextSibling.inputField) { this.nextSibling.inputField.blur(); } " diff --git a/chrome/skin/default/zotero/bindings/itembox.css b/chrome/skin/default/zotero/bindings/itembox.css index b09d56a079..66ab3f8965 100644 --- a/chrome/skin/default/zotero/bindings/itembox.css +++ b/chrome/skin/default/zotero/bindings/itembox.css @@ -50,7 +50,7 @@ row > label:first-child, .creator-type-label row label:first-child[isButton=true]:hover { - cursor: pointer; + cursor: pointer !important; } row label