aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js
diff options
context:
space:
mode:
authorMarvin Borner2019-05-13 18:18:57 +0200
committerMarvin Borner2019-05-13 18:18:57 +0200
commitb9a392f5f1db5c7de60e929fdcc0ca42885f81ca (patch)
tree0f9aa014bcabfc3d7205898ada71f15d4490cb0a /src/main/resources/js
parent72073df2c225f96889620e30c963dd807ca01a90 (diff)
Added user based dark theme support
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/resources/js')
-rw-r--r--src/main/resources/js/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/resources/js/index.js b/src/main/resources/js/index.js
new file mode 100644
index 0000000..4939622
--- /dev/null
+++ b/src/main/resources/js/index.js
@@ -0,0 +1,6 @@
+document.querySelector("#toggle").addEventListener("click", () => {
+ const request = new XMLHttpRequest();
+ request.open("POST", "/user/theme");
+ request.onload = () => location.reload();
+ request.send();
+});