mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-18 13:14:39 +03:00
refactor: move copy function to utils.js
This commit is contained in:
@@ -53,24 +53,6 @@ function formatSecond(second) {
|
||||
}
|
||||
}
|
||||
|
||||
function copyToClipboard(text) {
|
||||
// !! here old way of copying is used because not everyone can afford https connection
|
||||
return new Promise((resolve) => {
|
||||
const textarea = document.createElement("textarea");
|
||||
|
||||
textarea.value = text;
|
||||
|
||||
document.body.appendChild(textarea);
|
||||
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
|
||||
document.body.removeChild(textarea);
|
||||
|
||||
resolve(text)
|
||||
})
|
||||
}
|
||||
|
||||
function addZero(num) {
|
||||
if (num < 10) {
|
||||
return "0" + num;
|
||||
|
||||
Reference in New Issue
Block a user