| 863 | |
| 864 | // Read form control compatible setting from cookie |
| 865 | getSetting(name) { |
| 866 | const ctrl = document.getElementById('noVNC_setting_' + name); |
| 867 | let val = WebUtil.readSetting(name); |
| 868 | if (typeof val !== 'undefined' && val !== null && |
| 869 | ctrl !== null && ctrl.type === 'checkbox') { |
| 870 | if (val.toString().toLowerCase() in {'0': 1, 'no': 1, 'false': 1}) { |
| 871 | val = false; |
| 872 | } else { |
| 873 | val = true; |
| 874 | } |
| 875 | } |
| 876 | return val; |
| 877 | }, |
| 878 | |
| 879 | // These helpers compensate for the lack of parent-selectors and |
| 880 | // previous-sibling-selectors in CSS which are needed when we want to |