feat: Funktion hinzugefügt, um aktuelle URL beim Klicken auf den Button in die Zwischenablage zu kopieren

This commit is contained in:
Developer 02 2024-10-09 16:53:44 +02:00
parent 738b379fe5
commit ded3425e31

View File

@ -67,7 +67,7 @@
} }
else else
{ {
<button type="button" data-bs-toggle="modal" id="btn-download" data-bs-target="#staticBackdrop"> <button type="button" data-bs-toggle="modal" id="btn-copy" data-bs-target="#staticBackdrop">
<span class="material-symbols-outlined"> <span class="material-symbols-outlined">
content_copy content_copy
</span> </span>
@ -166,8 +166,13 @@
else else
{ {
<script nonce="@nonce"> <script nonce="@nonce">
document.getElementById('btn-download').addEventListener('click', async () => { document.getElementById('btn-copy').addEventListener('click', function () {
alert("foo") const url = window.location.href;
navigator.clipboard.writeText(url).then(function () {
console.log('URL panoya başarıyla kopyalandı!');
}).catch(function (err) {
console.error('URL kopyalanamadı: ', err);
});
}); });
</script> </script>
} }