mirror of
https://github.com/ivabus/www
synced 2024-11-14 08:55:06 +03:00
'copy' => 'copied!' onClick
This commit is contained in:
parent
fdd6de57b6
commit
21aace98da
2 changed files with 7 additions and 2 deletions
|
@ -29,7 +29,7 @@
|
||||||
<input class="one-liner" type="text" value="$ sh <(curl tea.xyz) install {{- .Title -}}" id="myInput" readonly>
|
<input class="one-liner" type="text" value="$ sh <(curl tea.xyz) install {{- .Title -}}" id="myInput" readonly>
|
||||||
|
|
||||||
<!-- The button used to copy the text -->
|
<!-- The button used to copy the text -->
|
||||||
<button class="clipboard-copy" onclick="myFunction()" data-bs-toggle="modal" data-bs-target="#exampleModal"><i class="icon-clipboard"></i></button>
|
<button class="clipboard-copy" id="copy-icon" onclick="myFunction()" data-bs-toggle="modal" data-bs-target="#exampleModal">copy</button>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
@ -167,6 +167,8 @@
|
||||||
|
|
||||||
/* Alert the copied text
|
/* Alert the copied text
|
||||||
alert("Copied " + copyText.value + " to clipboard");*/
|
alert("Copied " + copyText.value + " to clipboard");*/
|
||||||
|
|
||||||
|
document.getElementById("copy-icon").innerHTML = "copied!";
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<input class="one-liner" type="text" value="$ sh <(curl tea.xyz) install {{- .Title -}}" id="myInput" readonly>
|
<input class="one-liner" type="text" value="$ sh <(curl tea.xyz) install {{- .Title -}}" id="myInput" readonly>
|
||||||
|
|
||||||
<!-- The button used to copy the text -->
|
<!-- The button used to copy the text -->
|
||||||
<button class="clipboard-copy" onclick="myFunction()"><i class="icon-clipboard"></i></button>
|
<button class="clipboard-copy" onclick="myFunction()" id="copy-icon"><i class="icon-clipboard"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
@ -66,6 +66,9 @@
|
||||||
|
|
||||||
// Alert the copied text
|
// Alert the copied text
|
||||||
alert("Copied " + copyText.value + " to clipboard");
|
alert("Copied " + copyText.value + " to clipboard");
|
||||||
|
|
||||||
|
// Copy icon
|
||||||
|
document.getElementById("copy-icon").innerHTML = "copied!";
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue