make inserting files much more user-friendly
parent
88d90612ef
commit
146eb45122
|
@ -467,10 +467,7 @@ function handle_files(input, newfiles) {
|
||||||
if (span.innerHTML != ' ') span.innerHTML += ', '
|
if (span.innerHTML != ' ') span.innerHTML += ', '
|
||||||
span.innerHTML += file.name.substr(0, 30);
|
span.innerHTML += file.name.substr(0, 30);
|
||||||
if (location.pathname != '/chat')
|
if (location.pathname != '/chat')
|
||||||
if (ta.value)
|
ta.setRangeText(`[${file.name}]`);
|
||||||
ta.value += `\n[${file.name}]`
|
|
||||||
else
|
|
||||||
ta.value += `[${file.name}]`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
autoExpand(ta)
|
autoExpand(ta)
|
||||||
|
@ -538,6 +535,7 @@ document.onpaste = function(event) {
|
||||||
input = document.querySelector('input[type="file"]')
|
input = document.querySelector('input[type="file"]')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
handle_files(input, files);
|
handle_files(input, files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue