yw5ncom/static/copy.js
ange e9fc659a5a
All checks were successful
/ deploy (push) Successful in 46s
feat: html static templates
2024-12-14 08:34:47 +00:00

14 lines
303 B
JavaScript

function copyElem(id, r='') {
navigator.clipboard.writeText(
document.getElementById(id).innerText.replaceAll(r, ''),
);
}
function copyFile(id) {
fetch(document.getElementById(id).childNodes[0].href).then(f => {
f.text().then(t => {
navigator.clipboard.writeText(t);
})
})
}