(checkbox)
| 142 | } |
| 143 | |
| 144 | function getStoredCheckboxRefs(checkbox) { |
| 145 | function convert(ref) { |
| 146 | var intref = parseInt(ref); |
| 147 | if (isNaN(intref)) { |
| 148 | for (var i = 0; i < pcbdata.footprints.length; i++) { |
| 149 | if (pcbdata.footprints[i].ref == ref) { |
| 150 | return i; |
| 151 | } |
| 152 | } |
| 153 | return -1; |
| 154 | } else { |
| 155 | return intref; |
| 156 | } |
| 157 | } |
| 158 | if (!(checkbox in settings.checkboxStoredRefs)) { |
| 159 | var val = readStorage("checkbox_" + checkbox); |
| 160 | settings.checkboxStoredRefs[checkbox] = val ? val : ""; |
| 161 | } |
| 162 | if (!settings.checkboxStoredRefs[checkbox]) { |
| 163 | return new Set(); |
| 164 | } else { |
| 165 | return new Set(settings.checkboxStoredRefs[checkbox].split(",").map(r => convert(r)).filter(a => a >= 0)); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | function getCheckboxState(checkbox, references) { |
| 170 | var storedRefsSet = getStoredCheckboxRefs(checkbox); |
no test coverage detected