mirror of
https://github.com/ivabus/www
synced 2024-11-14 07:25:06 +03:00
Added copy text in variable
This commit is contained in:
parent
dd66800c9f
commit
5ab8547076
1 changed files with 2 additions and 3 deletions
|
@ -181,15 +181,14 @@
|
||||||
function changeCopied() {
|
function changeCopied() {
|
||||||
// Get the text field
|
// Get the text field
|
||||||
var copyText = document.getElementById("shortcodeCopy");
|
var copyText = document.getElementById("shortcodeCopy");
|
||||||
|
var copiedValue = "sh <(curl https://tea.xyz)";
|
||||||
copyText.value = "sh <(curl https://tea.xyz)";
|
|
||||||
|
|
||||||
// Select the text field
|
// Select the text field
|
||||||
copyText.select();
|
copyText.select();
|
||||||
copyText.setSelectionRange(0, 99999); // For mobile devices
|
copyText.setSelectionRange(0, 99999); // For mobile devices
|
||||||
|
|
||||||
// Copy the text inside the text field
|
// Copy the text inside the text field
|
||||||
navigator.clipboard.writeText(copyText.value);
|
navigator.clipboard.writeText(copiedValue);
|
||||||
|
|
||||||
document.getElementById("liveToastBtn").innerHTML = "copied!";
|
document.getElementById("liveToastBtn").innerHTML = "copied!";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue