refactor: delete clipboardjs (#2727)

text copying can be done without using additional libraries
This commit is contained in:
Shishkevich D.
2025-03-07 02:43:46 +07:00
committed by GitHub
parent cf7fec1351
commit 2d8cca3a2e
7 changed files with 40 additions and 47 deletions

View File

@@ -64,6 +64,24 @@ 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;