diff options
-rw-r--r-- | web/template/pkg_details.php | 10 | ||||
-rw-r--r-- | web/template/pkgbase_details.php | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index c6bb32d8..047de9a7 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -308,14 +308,10 @@ endif; </div> <script> -$(document).ready(function() { - $('.copy').click(function(e) { - var tmp = $("<input>"); - $("body").append(tmp); - tmp.val($(this).text()).select(); - document.execCommand("copy"); - tmp.remove(); +document.addEventListener('DOMContentLoaded', function() { + document.querySelector('.copy').addEventListener('click', function(e) { e.preventDefault(); + navigator.clipboard.writeText(event.target.text); }); }); </script> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index a6857c4e..35ad217a 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -137,14 +137,10 @@ endif; </div> <script> -$(document).ready(function() { - $('.copy').click(function(e) { - var tmp = $("<input>"); - $("body").append(tmp); - tmp.val($(this).text()).select(); - document.execCommand("copy"); - tmp.remove(); +document.addEventListener('DOMContentLoaded', function() { + document.querySelector('.copy').addEventListener('click', function(e) { e.preventDefault(); + navigator.clipboard.writeText(event.target.text); }); }); </script> |