diff --git a/resource/js/docready.js b/resource/js/docready.js index bf220a57b..b464c0464 100644 --- a/resource/js/docready.js +++ b/resource/js/docready.js @@ -94,8 +94,8 @@ $(function() { // DOCUMENT READY countAndSetOffset(); // Make a selection of an element for copy pasting. - function makeSelection() { - var $clicked = $(this); + function makeSelection(e, elem) { + var $clicked = elem || $(this); var text = $clicked[0]; var range; if (document.body.createTextRange) { // ms @@ -127,6 +127,17 @@ $(function() { // DOCUMENT READY $(document).on('click','.uri-input-box', makeSelection); + // copy to clipboard + function copyToClipboard() { + var $btn = $(this); + var id = $btn.attr('for'); + $elem = $(id); + makeSelection(undefined, $elem); + document.execCommand('copy'); + } + + $(document).on('click', 'button.copy-clipboard', copyToClipboard); + var sidebarResizer = debounce(function() { countAndSetOffset(); }, 40); diff --git a/view/concept-shared.twig b/view/concept-shared.twig index 11af60311..7185b532d 100644 --- a/view/concept-shared.twig +++ b/view/concept-shared.twig @@ -49,7 +49,8 @@ {% else %}
{% if concept.notation %}{{ concept.notation }}{% endif %} - {% if concept.hasXlLabel %}
{% for key, val in concept.xlLabel.properties %}{% if key != 'rdf:type' and key != 'skosxl:literalForm' %}

{{ key|trans }}: {{ val }}

{% endif %}{% endfor %}
{{ concept.xlLabel }}{% else %}{{ concept.label }}{% if concept.label.lang != request.contentLang and concept.label.lang != '' %} ({{ concept.label.lang }}){% endif %}{% endif %} + {% if concept.hasXlLabel %}
{% for key, val in concept.xlLabel.properties %}{% if key != 'rdf:type' and key != 'skosxl:literalForm' %}

{{ key|trans }}: {{ val }}

{% endif %}{% endfor %}
{{ concept.xlLabel }}{% else %}{{ concept.label }}{% if concept.label.lang != request.contentLang and concept.label.lang != '' %} ({{ concept.label.lang }}){% endif %}{% endif %} +  
{% endif %}
@@ -158,7 +159,7 @@ {% endif %}
URI
-
{{ concept.uri }}
+
{{ concept.uri }}
{% trans %}Download this concept in SKOS format:{% endtrans %}