hide copy buttons when js is not enabled

Fixes #5
This commit is contained in:
neri 2021-04-04 14:49:34 +02:00
parent e49800f05e
commit b8fac27511
4 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const button = document.getElementById("copy");
button.classList.remove("hidden");
button.onclick = () => {
if (!navigator.clipboard) {
button.innerText = "nicht unterstützt";

View File

@ -39,6 +39,7 @@ input,
select,
textarea,
.button {
display: inline-block;
background-color: var(--bg);
color: var(--fg);
padding: 0.5rem;
@ -48,6 +49,10 @@ textarea,
max-width: calc(100vw - 3rem - 4px);
}
*.hidden {
display: none;
}
input[type="checkbox"] {
margin-bottom: 1.5rem;
}

View File

@ -13,7 +13,7 @@
datei-link:
<a id="link" class="copy-content" href="{url}">{url}</a>
</p>
<button id="copy" class="main button">link kopieren</button>
<button id="copy" class="main button hidden">link kopieren</button>
</main>
<script src="/static/copy.js" lang="javascript"></script>
</body>

View File

@ -14,7 +14,7 @@
>
<br />
<a class="main button" href="?dl">herunterladen</a>
<button id="copy" class="button">text kopieren</button>
<button id="copy" class="button hidden">text kopieren</button>
</main>
<script src="/static/copy.js" lang="javascript"></script>
</body>