feat: Funktion hinzugefügt, um aktuelle URL beim Klicken auf den Button in die Zwischenablage zu kopieren
This commit is contained in:
parent
738b379fe5
commit
ded3425e31
@ -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>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user