14 lines
496 B
Plaintext
14 lines
496 B
Plaintext
import {flags} from ./adapptypes.ts
|
|
|
|
cache := await browser.storage.local.get flags
|
|
|
|
for each box of flags
|
|
checkbox := document.getElementById(box) as HTMLInputElement
|
|
unless checkbox then continue
|
|
checkbox.checked = cache[box] ?? (box is 'vrmlview' or box is 'joyce')
|
|
|
|
document.body.addEventListener 'click', (event) ->
|
|
elt := event.target as HTMLInputElement
|
|
unless elt.tagName is 'INPUT' and elt.type is 'checkbox' then return
|
|
browser.storage.local.set [elt.id]: elt.checked
|