X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/blobdiff_plain/65641ab439f507b8cf0f24bca67b03fbcfbfa218..b307aaa9dfa368f039b2ea79efadfc217d3f3355:/source/global.js diff --git a/source/global.js b/source/global.js new file mode 100644 index 0000000..f7ecb6b --- /dev/null +++ b/source/global.js @@ -0,0 +1,11 @@ +!function(t){ + t.addEventListener('DOMContentLoaded', function () { + var l = t.querySelector('#light-off'); + if (l !== null) { + l.checked = t.cookie.match(/lightOff=true/) !== null; + l.addEventListener('change', function () { + t.cookie = 'lightOff=' + JSON.stringify(l.checked) + ';path=/'; + }); + } + }) +}(document);