make inserting files much more user-friendly

master
Aevann 2023-03-17 15:20:11 +02:00
parent 88d90612ef
commit 146eb45122
1 changed files with 2 additions and 4 deletions

View File

@ -467,10 +467,7 @@ function handle_files(input, newfiles) {
if (span.innerHTML != ' ') span.innerHTML += ', '
span.innerHTML += file.name.substr(0, 30);
if (location.pathname != '/chat')
if (ta.value)
ta.value += `\n[${file.name}]`
else
ta.value += `[${file.name}]`
ta.setRangeText(`[${file.name}]`);
}
autoExpand(ta)
@ -538,6 +535,7 @@ document.onpaste = function(event) {
input = document.querySelector('input[type="file"]')
}
event.preventDefault();
handle_files(input, files);
}