2023-12-12 00:17:05 +00:00
|
|
|
/**
|
|
|
|
* Code for the home page protocol picker.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
// show matching instructions
|
|
|
|
// console.log($('.instruction'))
|
|
|
|
for (instr of $('.instruction')) {
|
2023-12-13 00:17:04 +00:00
|
|
|
if (instr.id == 'front-instruction-placeholder') {
|
|
|
|
instr.style.display = 'none'
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2023-12-12 00:17:05 +00:00
|
|
|
let parts = instr.id.split('-')
|
|
|
|
let me = parts[1]
|
|
|
|
let them = parts[2]
|
|
|
|
// console.log(me, them, $(`#me-${me}`)[0].checked, $(`#them-${them}`)[0].checked)
|
|
|
|
instr.style.display =
|
|
|
|
($(`#me-${me}`)[0].checked && $(`#them-${them}`)[0].checked)
|
|
|
|
? 'block' : 'none'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
addEventListener('DOMContentLoaded', () => {
|
|
|
|
$('input').on('change', update)
|
|
|
|
})
|