diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-02-18 02:29:48 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-02-18 02:29:48 +0100 |
commit | 63b2ff187e290d8eafd39a902af56a88c6ab53e9 (patch) | |
tree | f85e5df75b46c799c511c953bc93f995f4bf4042 /src/index.html | |
download | simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.tar.gz simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.tar.bz2 simghost-63b2ff187e290d8eafd39a902af56a88c6ab53e9.zip |
Initial commit
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..97191f0 --- /dev/null +++ b/src/index.html @@ -0,0 +1,33 @@ +<html> + <head> + <title>Simple Image Host</title> + </head> + <body> + <form method="POST" enctype="multipart/form-data"> + <input type="hidden" name="imagecontent"> + <table> + <tr><td colspan="2"><input type="file" name="imagefile"></td></tr> + <tr><td colspan="2"><div contenteditable="true" id="paster">Paste image</div></td></tr> + <tr><td>Duration:</td><td><input type="number" name="duration" value="500"></td></tr> + <tr><td>User:</td><td><input type="text" name="username"></td></tr> + <tr><td>Password:</td><td><input type="password" name="password"></td></tr> + <tr><td></td><td><input type="submit" value="Upload"></td></tr> + </table> + </form> + <script> + document.querySelector("#paster").onpaste = function(e) { + for (let item of e.clipboardData.items) { + if (item.type.startsWith("image/")) { + console.log(item); + let data = document.querySelector("input[name=imagecontent]"); + item.getAsFile().arrayBuffer().then((bytes) => { + data.value = btoa(String.fromCharCode(...new Uint8Array(bytes))); + console.log(bytes); + }); + } + } + e.preventDefault(); + }; + </script> + </body> +</html> |