Job refactor 2: less hardcoded lists (#60578)

* Job refactor 2: less hardcoded lists

* Obsessed can happen
This commit is contained in:
Rohesie
2021-08-05 21:13:05 +02:00
committed by GitHub
parent 392a74693d
commit 6c4134d1ea
67 changed files with 644 additions and 489 deletions
+4
View File
@@ -72,3 +72,7 @@
.antagonistpositions {
background-color: #6d3f40;
}
.undefineddepartment {
background-color: #111cf7;
}
+7 -13
View File
@@ -1,16 +1,10 @@
function toggle_head(source, ext) {
document.getElementById(source.id.slice(0, -4) + ext).checked = source.checked;
}
function toggle_checkboxes(source, ext) {
var checkboxes = document.getElementsByClassName(source.name);
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
if (checkboxes[i].id) {
var idfound = document.getElementById(checkboxes[i].id.slice(0, -4) + ext);
if (idfound) {
idfound.checked = source.checked;
}
function toggle_other_checkboxes(source, copycats_str, our_index_str) {
const copycats = parseInt(copycats_str);
const our_index = parseInt(our_index_str);
for (var i = 1; i <= copycats; i++) {
if(i === our_index) {
continue;
}
document.getElementById(source.id.slice(0, -1) + i).checked = source.checked;
}
}