diff options
author | 2024-02-10 18:37:40 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | e1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch) | |
tree | 2dccff36a441916d7014037cef3f7ce84a790cad /public/js/transfer.js | |
parent | refactor: project maintenance (diff) | |
download | ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.gz ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.zst ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.zip |
updates
Diffstat (limited to 'public/js/transfer.js')
-rw-r--r-- | public/js/transfer.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/public/js/transfer.js b/public/js/transfer.js index 4bf46fa..b4ba14c 100644 --- a/public/js/transfer.js +++ b/public/js/transfer.js | |||
@@ -1,15 +1,15 @@ | |||
1 | /* eslint-env browser */ | 1 | /* eslint-env browser */ |
2 | const submitBtn = document.querySelector('#submit') | 2 | const submitBtn = document.querySelector('#submit'); |
3 | const fileInput = document.querySelector('#file') | 3 | const fileInput = document.querySelector('#file'); |
4 | const fileOutput = document.querySelector('#fileoutput') | 4 | const fileOutput = document.querySelector('#fileoutput'); |
5 | 5 | ||
6 | fileInput.addEventListener('change', () => { | 6 | fileInput.addEventListener('change', () => { |
7 | const reader = new FileReader() | 7 | const reader = new FileReader(); |
8 | reader.addEventListener('load', () => { | 8 | reader.addEventListener('load', () => { |
9 | const text = reader.result | 9 | const text = reader.result; |
10 | fileOutput.value = text | 10 | fileOutput.value = text; |
11 | submitBtn.disabled = false | 11 | submitBtn.disabled = false; |
12 | }) | 12 | }); |
13 | // eslint-disable-next-line unicorn/prefer-blob-reading-methods | 13 | // eslint-disable-next-line unicorn/prefer-blob-reading-methods |
14 | reader.readAsText(fileInput.files[0]) | 14 | reader.readAsText(fileInput.files[0]); |
15 | }) | 15 | }); |