diff --git a/files/templates/submit_marseys.html b/files/templates/submit_marseys.html
index 95dd62603..851da226d 100644
--- a/files/templates/submit_marseys.html
+++ b/files/templates/submit_marseys.html
@@ -83,28 +83,16 @@
if (filename)
{
filename = filename.name.toLowerCase()
- if (document.activeElement.id == 'post-text') {
- let filename = ''
- for (const file of files)
- filename += file.name + ', '
- filename = filename.toLowerCase().slice(0, -2)
- document.getElementById('file-upload-submit').files = files;
- document.getElementById('filename-show-submit').textContent = filename;
+ f=document.getElementById('file-upload');
+ f.files = files;
+ document.getElementById('filename-show').textContent = filename;
+ if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".gif") || filename.endsWith(".webp"))
+ {
+ var fileReader = new FileReader();
+ fileReader.readAsDataURL(f.files[0]);
+ fileReader.addEventListener("load", function () {document.getElementById('image-preview').setAttribute('src', this.result);});
}
- else {
- f=document.getElementById('file-upload');
- f.files = files;
- document.getElementById('filename-show').textContent = filename;
- if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".gif") || filename.endsWith(".webp"))
- {
- var fileReader = new FileReader();
- fileReader.readAsDataURL(f.files[0]);
- fileReader.addEventListener("load", function () {document.getElementById('image-preview').setAttribute('src', this.result);});
- }
- document.getElementById('file-upload').setAttribute('required', 'false');
- }
- document.getElementById('post-url').value = null;
- localStorage.setItem("post-url", "")
+ document.getElementById('file-upload').setAttribute('required', 'false');
}
}