-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (20 loc) · 756 Bytes
/
index.js
File metadata and controls
22 lines (20 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let fileLoader = null;
// Listens for file upload event and initiates the interpolation process
document.getElementById("uploadInput").addEventListener("change", onChange, false);
document.getElementById("reset").addEventListener("click", onReset, false);
/**
* File upload onChange listener which initiates the interpolation process.
*/
function onChange() {
fileLoader = new FileLoader(this.files[0]);
fileLoader.resetFormContent();
fileLoader.loadFile();
}
/**
* Reset button onClick listener which resets the whole proces. After that,
* user can restart the interpolation process again.
*/
function onReset() {
document.getElementById('uploadInput').value = null; // Reset file input element
fileLoader.resetFormContent();
}