From 29add89e3db07c7bc4b11e4fb890d633e86ec26a Mon Sep 17 00:00:00 2001 From: neri Date: Wed, 13 Apr 2022 18:41:24 +0200 Subject: [PATCH] add support for pasting files --- Cargo.toml | 2 +- static/paste.js | 4 ++++ template/index.html | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 static/paste.js diff --git a/Cargo.toml b/Cargo.toml index b704d50..a3a966e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datatrash" -version = "1.0.0" +version = "1.1.0" authors = ["neri"] edition = "2021" diff --git a/static/paste.js b/static/paste.js new file mode 100644 index 0000000..3a2ce64 --- /dev/null +++ b/static/paste.js @@ -0,0 +1,4 @@ +const fileInput = document.getElementById("file-upload"); +window.addEventListener('paste', e => { + fileInput.files = e.clipboardData.files; +}); diff --git a/template/index.html b/template/index.html index 1fa88e6..19ca714 100644 --- a/template/index.html +++ b/template/index.html @@ -68,5 +68,6 @@ authentifizieren repo +