From 59ef5f5ae640736d820763b907febd556c42169f Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Tue, 16 Jul 2019 08:19:11 +0200 Subject: add function to copy checksum data to clipboard --- en/downloads/get/index.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'en/downloads/get/index.php') diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index 222d01ab4..3ec90ebd2 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -254,7 +254,7 @@ $chksm_cmd = ''; $sig_links = array(); foreach ($checksums as $checksum) { if (isset($product[$checksum])) { - $sum_links[] = "" . basename($download) . ".$checksum"; + $sum_links[] = "" . basename($download) . '.' . $checksum .''; $chksm_cmd .= '$ ' . $checksum . 'sum -c ' . basename($download) . '.' . $checksum . ' # ' . _r('You need both iso and checksum file in the same folder'); $chksm_cmd .= "\n" . basename($download) . ": " . _r("OK") . " \n" . PHP_EOL; if (isset($product["$checksum.gpg"])) { @@ -398,7 +398,23 @@ $(function() { {lang: ''} }); + + $('[data-toggle="tooltip"]').tooltip() + + $('.copy-icon').click(function() { + var el = $(this); + var text = document.createElement("textarea"); + text.value = el.data('clip'); + document.body.appendChild(text); + text.select(); + document.execCommand('copy'); + el.attr('data-original-title', '').tooltip('show'); + document.body.removeChild(text); + el.attr('data-original-title', ''); + }); }); + + -- cgit v1.2.1