diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-01 11:07:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 16:37:57 +0530 |
commit | 419933f6505caf4c5e685f8436b1ff735185e55a (patch) | |
tree | 152dcb9d2b35d29f862cc57a605b9ae2a0f7c300 /src/internal-server/public/js/transfer.js | |
parent | Removed duplicated contributors badge. (diff) | |
download | ferdium-app-419933f6505caf4c5e685f8436b1ff735185e55a.tar.gz ferdium-app-419933f6505caf4c5e685f8436b1ff735185e55a.tar.zst ferdium-app-419933f6505caf4c5e685f8436b1ff735185e55a.zip |
Moved 'internal-server' into a sub-folder as opposed to a git submodule. (#1715)
* Ignored tests in 'internal-server' folder since there are none.
* Linter fixes
Diffstat (limited to 'src/internal-server/public/js/transfer.js')
-rw-r--r-- | src/internal-server/public/js/transfer.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/internal-server/public/js/transfer.js b/src/internal-server/public/js/transfer.js new file mode 100644 index 000000000..c04a6d3b1 --- /dev/null +++ b/src/internal-server/public/js/transfer.js | |||
@@ -0,0 +1,14 @@ | |||
1 | /* eslint-env browser */ | ||
2 | const submitBtn = document.getElementById('submit'); | ||
3 | const fileInput = document.getElementById('file'); | ||
4 | const fileOutput = document.getElementById('fileoutput'); | ||
5 | |||
6 | fileInput.addEventListener('change', () => { | ||
7 | const reader = new FileReader(); | ||
8 | reader.onload = function () { | ||
9 | const text = reader.result; | ||
10 | fileOutput.value = text; | ||
11 | submitBtn.disabled = false; | ||
12 | }; | ||
13 | reader.readAsText(fileInput.files[0]); | ||
14 | }); | ||