35 lines
1.0 KiB
HTML
35 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<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>
|
|
<textarea id="text" rows="20" cols="120" readonly>{text}</textarea>
|
|
<br />
|
|
<a class="main button" href="?raw">Herunterladen</a>
|
|
<button id="copy" class="button" onclick="copyToClipboard()">
|
|
Text kopieren
|
|
</button>
|
|
</main>
|
|
<script lang="javascript">
|
|
function copyToClipboard() {
|
|
const button = document.getElementById("copy");
|
|
if (!navigator.clipboard) {
|
|
button.innerText = "Nicht unterstützt";
|
|
return;
|
|
}
|
|
const textarea = document.getElementById("text");
|
|
navigator.clipboard.writeText(textarea.value).then(
|
|
_ => { button.innerText = "Kopiert!"; },
|
|
_ => { button.innerText = "Nicht unterstützt"; },
|
|
);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|