diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 6843733d8..8c91b6b98 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -413,6 +413,13 @@ label.setAttribute("isButton", true); label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); + valueElement.setAttribute('contextmenu', 'zotero-doi-menu'); + + var openURLMenuItem = document.getElementById('zotero-doi-menu-view-online'); + openURLMenuItem.setAttribute("oncommand", "ZoteroPane_Local.loadURI('" + doi + "', event)"); + + var copyMenuItem = document.getElementById('zotero-doi-menu-copy'); + copyMenuItem.setAttribute("oncommand", "Zotero.Utilities.Internal.copyTextToClipboard('" + doi + "')"); } } else if (fieldName == 'abstractNote') { @@ -2479,6 +2486,10 @@ + + + + diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index eab37ea3d..9d8266396 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -30,6 +30,16 @@ * @class Utility functions not made available to translators */ Zotero.Utilities.Internal = { + + /** + * Unicode normalization + */ + "copyTextToClipboard":function(str) { + Components.classes["@mozilla.org/widget/clipboardhelper;1"] + .getService(Components.interfaces.nsIClipboardHelper) + .copyString(str); + }, + /* * Adapted from http://developer.mozilla.org/en/docs/nsICryptoHash * @@ -571,4 +581,4 @@ Zotero.Utilities.Internal.Base64 = { return string; } - } \ No newline at end of file + } diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index 95aa70721..3108af3ad 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -126,6 +126,8 @@ + +