Browse Source

add support for pasting files

master
neri 1 month ago
parent
commit
29add89e3d
  1. 2
      Cargo.toml
  2. 4
      static/paste.js
  3. 1
      template/index.html

2
Cargo.toml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
[package]
name = "datatrash"
version = "1.0.0"
version = "1.1.0"
authors = ["neri"]
edition = "2021"

4
static/paste.js

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
const fileInput = document.getElementById("file-upload");
window.addEventListener('paste', e => {
fileInput.files = e.clipboardData.files;
});

1
template/index.html

@ -68,5 +68,6 @@ authentifizieren @@ -68,5 +68,6 @@ authentifizieren
repo
</a>
</footer>
<script src="/static/paste.js" lang="javascript"></script>
</body>
</html>

Loading…
Cancel
Save