-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (34 loc) · 1.37 KB
/
script.js
File metadata and controls
37 lines (34 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function updateLabel(input) {
const fileName = input.files.length > 0 ? input.files[0].name : "Add File";
input.previousElementSibling.textContent = `${fileName}`;
}
function configtoggle(config){
const onetime = document.getElementById('onetime');
const directdownload = document.getElementById('directdownload');
if(config){
if (config == "onetimeuse"){
if (onetime.getAttribute('enabled') === "on") {
// Set border to red and set 'enabled' to 'off'
onetime.style.borderColor = 'red';
onetime.setAttribute('enabled', 'off');
} else {
// Set border to green and set 'enabled' to 'on'
onetime.style.borderColor = 'green';
onetime.setAttribute('enabled', 'on');
}
}
if (config == "directdownload"){
if (directdownload.getAttribute('enabled') === "on") {
// Set border to red and set 'enabled' to 'off'
directdownload.style.borderColor = 'red';
directdownload.setAttribute('enabled', 'off');
} else {
// Set border to green and set 'enabled' to 'on'
directdownload.style.borderColor = 'green';
directdownload.setAttribute('enabled', 'on');
}
}
} else {
return
}
}