diff --git a/js/tree-edam-stand-alone.js b/js/tree-edam-stand-alone.js index f48bb219..f8d375c9 100644 --- a/js/tree-edam-stand-alone.js +++ b/js/tree-edam-stand-alone.js @@ -434,20 +434,26 @@ function interactive_edam_browser(){ text=value; } }else{ - text=value; + text=value.substring(value.lastIndexOf('/')+1); } /* jshint -W014 */ - return ""+ text+ - "" + ""+ + ''+ + '' //+' ' //+''+branch_of_term+'' //+''+branch_of_term+'' @@ -766,3 +772,27 @@ function toggleFullscreen(){ $('#go-fullscreen').show(); } } + +/** + * + * @param {string} value Copies the value of the passed uri to the clipboard + */ +function cpyToClipboard(value){ + //copying the uri value to the clipboard + navigator.clipboard.writeText(value); + + const element = event.srcElement; + + //showing a tooltip indicating the value is copied + $(element).attr('title', "URI copied!") + .tooltip('show'); + + //changing the icon to a check shape indicating success + $(element).addClass("fa-check").removeClass("fa-copy"); + + //toggling back the icon and removing the copied tooltip + setTimeout(function(){ + $(element).addClass("fa-copy").removeClass("fa-check"); + $(element).tooltip('destroy'); + }, 1000); +}