This commit is contained in:
parent
abd9218561
commit
3f47b51aca
@ -1,5 +1,5 @@
|
||||
ssh /static/ssh
|
||||
pgp /static/pgp.asc
|
||||
termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh
|
||||
dotfiles.sh https://git.gmoker.com/ange/.dotfiles
|
||||
dotfiles.sh https://git.gmoker.com/ange/dotfiles
|
||||
arch.sh https://git.gmoker.com/ange/arch
|
||||
|
@ -2,7 +2,21 @@
|
||||
<html>
|
||||
<head>
|
||||
{{template "head.tmpl" .}}
|
||||
<script src="copy.js"></script>
|
||||
<script>
|
||||
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);
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{{template "header.tmpl" .}}
|
||||
|
13
js/copy.js
13
js/copy.js
@ -1,13 +0,0 @@
|
||||
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);
|
||||
})
|
||||
})
|
||||
}
|
@ -17,7 +17,7 @@ var routes = []struct {
|
||||
}{
|
||||
{[]string{"GET"}, url(""), index},
|
||||
{[]string{"GET"}, url("/static/.+"), static},
|
||||
{[]string{"GET"}, url("/(.+\\.(css|js))"), file},
|
||||
{[]string{"GET"}, url("/(.+\\.(css))"), file},
|
||||
{[]string{"GET"}, url("/([^/]+)"), html},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user