Aevann 2024-02-28 20:12:31 +02:00
parent 90720233eb
commit 5a64dc48cb
1 changed files with 6 additions and 11 deletions

View File

@ -523,9 +523,13 @@ function handle_files(input, newfiles) {
oldfiles[ta.id] = new DataTransfer();
}
const oldtext = ta.value;
for (let file of newfiles) {
if (oldfiles[ta.id].items.length == 20)
{
window.alert("You can't upload more than 20 files at one time!")
break
}
if (file.name == 'image.png') {
const blob = file.slice(0, file.size, 'image/png');
const new_name = Math.random().toString(32).substring(2,10) + '.png'
@ -537,15 +541,6 @@ function handle_files(input, newfiles) {
input.files = oldfiles[ta.id].files;
if (input.files.length > 20)
{
window.alert("You can't upload more than 20 files at one time!")
input.value = null
ta.value = oldtext
oldfiles[ta.id] = new DataTransfer();
return
}
markdown(ta)
autoExpand(ta)