Port the site to GNU Emacs + Org mode (using org-publish)
[~bandali/bndl.org] / source / global.js
diff --git a/source/global.js b/source/global.js
new file mode 100644 (file)
index 0000000..f7ecb6b
--- /dev/null
@@ -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);