-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·149 lines (136 loc) · 5.32 KB
/
index.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
let plotArea = document.getElementById('plot');
plotArea.style.width = "100%";
var navLinks = document.getElementsByClassName("nav-link");
var navLink;
for (var i = 0; i < navLinks.length; i++) {
var navLink = navLinks[i];
if (navLink.getAttribute("aria-selected") == "true") {
navLink.style.color = "#7a7a7a";
}
}
document.getElementById("time-files").addEventListener("change", function(event) {
var timeFileInputElem = document.getElementById("time-files");
var timeFiles = timeFileInputElem.files;
if (timeFiles.length == 1) {
document.getElementById("choose-time-files").innerHTML = '<i class="fas fa-file-upload"></i> ' + timeFiles[0].name;
}
else {
document.getElementById("choose-time-files").innerHTML = '<i class="fas fa-file-upload"></i> ' + String(timeFiles.length) + " files uploaded";
}
});
document.getElementById("res-files").addEventListener("change", function(event) {
var resFileInputElem = document.getElementById("res-files");
var resFiles = resFileInputElem.files;
if (resFiles.length == 1) {
document.getElementById("choose-res-files").innerHTML = '<i class="fas fa-file-upload"></i> ' + resFiles[0].name;
}
else {
document.getElementById("choose-res-files").innerHTML = '<i class="fas fa-file-upload"></i> ' + String(resFiles.length) + " files uploaded";
}
});
//========== ADD CHECKBOX FUNCTIONALITY ==========
$(".error-button").click(function(event) {
var errorButtons = document.getElementsByClassName("error-button");
for (var i = 0; i < errorButtons.length; i++) {
if (errorButtons[i] !== event.currentTarget) {
errorButtons[i].checked = false;
}
}
});
$(".xaxis-tick-display-input").click(function(event) {
var buttons = document.getElementsByClassName("xaxis-tick-display-input");
for (var i = 0; i < buttons.length; i++) {
if (buttons[i] !== event.currentTarget) {
buttons[i].checked = false;
}
}
});
$(".yaxis-tick-display-input").click(function(event) {
var buttons = document.getElementsByClassName("yaxis-tick-display-input");
for (var i = 0; i < buttons.length; i++) {
if (buttons[i] !== event.currentTarget) {
buttons[i].checked = false;
}
}
});
$(".nav-link").click(function(event) {
var navLink = event.target;
if (navLink.getAttribute("aria-selected") == "false") {
switch (navLink.getAttribute("id")) {
case "bar-tab":
document.getElementById("bar-tab").style.color = "#7a7a7a";
document.getElementById("line-tab").style.color = "#fff";
break;
case "line-tab":
document.getElementById("line-tab").style.color = "#7a7a7a";
document.getElementById("bar-tab").style.color = "#fff";
break;
case "residue-tab":
document.getElementById("residue-tab").style.color = "#7a7a7a";
document.getElementById("time-tab").style.color = "#fff";
break;
case "time-tab":
document.getElementById("time-tab").style.color = "#7a7a7a";
document.getElementById("residue-tab").style.color = "#fff";
break;
default:
// code block
}
}
});
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function titleSearchDropdownClicked() {
document.getElementsByClassName("title-dropdown-content-container")[0].classList.toggle("show");
}
function filterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementsByClassName("title-font-family-input-options")[0];
filter = input.value.toUpperCase();
div = document.getElementsByClassName("title-dropdown-content-container")[0];
a = div.getElementsByTagName("label");
for (i = 0; i < a.length; i++) {
txtValue = a[i].textContent || a[i].innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}
function xaxisTitleSearchDropdownClicked() {
document.getElementsByClassName("title-dropdown-content-container")[1].classList.toggle("show");
}
function xaxisFilterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementsByClassName("title-font-family-input-options")[1];
filter = input.value.toUpperCase();
div = document.getElementsByClassName("title-dropdown-content-container")[1];
a = div.getElementsByTagName("label");
for (i = 0; i < a.length; i++) {
txtValue = a[i].textContent || a[i].innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}
function yaxisTitleSearchDropdownClicked() {
document.getElementsByClassName("title-dropdown-content-container")[2].classList.toggle("show");
}
function yaxisFilterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementsByClassName("title-font-family-input-options")[2];
filter = input.value.toUpperCase();
div = document.getElementsByClassName("title-dropdown-content-container")[2];
a = div.getElementsByTagName("label");
for (i = 0; i < a.length; i++) {
txtValue = a[i].textContent || a[i].innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}