forked from neri/datatrash
38 lines
1.0 KiB
HTML
38 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de-DE">
|
|
<head>
|
|
<title>datatrash</title>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<link href="/static/index.css" rel="stylesheet" />
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<h1><a href="/">datatrash</a></h1>
|
|
<p>
|
|
datei-link:
|
|
<a id="link" href="{url}">
|
|
{url}
|
|
</a>
|
|
</p>
|
|
<button id="copy" class="main button" onclick="copyToClipboard()">
|
|
link kopieren
|
|
</button>
|
|
</main>
|
|
<script lang="javascript">
|
|
function copyToClipboard() {
|
|
const button = document.getElementById("copy");
|
|
if (!navigator.clipboard) {
|
|
button.innerText = "nicht unterstützt";
|
|
return;
|
|
}
|
|
const anchor = document.getElementById("link");
|
|
navigator.clipboard.writeText(anchor.href).then(
|
|
_ => { button.innerText = "kopiert!"; },
|
|
_ => { button.innerText = "nicht unterstützt"; },
|
|
);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|