all repos — honk @ 8ca7aa8cee064bf5405e4f7690257fbf0bf90a0a

my fork of honk

paste from clipboard
Anirudh Oppiliappan x@icyphox.sh
Thu, 14 Mar 2024 01:04:08 +0200
commit

8ca7aa8cee064bf5405e4f7690257fbf0bf90a0a

parent

b602d33e4b4c03dc9a1a172ec4a850152d4bc11b

2 files changed, 13 insertions(+), 3 deletions(-)

jump to
M views/honkform.htmlviews/honkform.html

@@ -9,7 +9,7 @@ <p>

<details> <summary>more options</summary> <p> -<label class=button id="donker">attach: <input type="file" multiple name="donk"><span>{{ .SavedFile }}</span></label><input type="hidden" id="saveddonkxid" name="donkxid" value="{{ .SavedFile }}"> +<label class=button id="donker">attach: <input id="donkinput" type="file" multiple name="donk"><span>{{ .SavedFile }}</span></label><input type="hidden" id="saveddonkxid" name="donkxid" value="{{ .SavedFile }}"> <p id="donkdescriptor"><label for=donkdesc>description:</label><br> <input type="text" name="donkdesc" value="{{ .DonkDesc }}" autocomplete=off> {{ with .SavedPlace }}
M views/honkpage.jsviews/honkpage.js

@@ -355,6 +355,18 @@ })

} function showhonkform(elem, rid, hname) { var form = lehonkform + var donker = document.getElementById("donker") + var honknoise = document.getElementById("honknoise") + var forminput = document.getElementById("donkinput") + forminput.addEventListener('change', () => { + form.submit(); + }); + + honknoise.addEventListener('paste', e => { + forminput.files = e.clipboardData.files + donker.children[1].textContent = e.clipboardData.files[0].name + }); + form.style = "display: block" form.reset() if (elem) {

@@ -365,10 +377,8 @@ hideelement(lehonkbutton)

elem = document.getElementById("honkformhost") elem.insertAdjacentElement('afterend', form) } - var donker = document.getElementById("donker") donker.children[1].textContent = "" var ridinput = document.getElementById("ridinput") - var honknoise = document.getElementById("honknoise") if (rid) { ridinput.value = rid if (hname) {