]> gitweb.factorcode.org Git - factor.git/commitdiff
webapps.wiki: adding wiki.js
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 00:44:21 +0000 (17:44 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 00:44:21 +0000 (17:44 -0700)
extra/webapps/wiki/wiki.js [new file with mode: 0644]

diff --git a/extra/webapps/wiki/wiki.js b/extra/webapps/wiki/wiki.js
new file mode 100644 (file)
index 0000000..80112a9
--- /dev/null
@@ -0,0 +1,14 @@
+function toggleSidebar() {
+    var l = document.getElementById("left");
+    var m = document.getElementById("menu");
+    if (l.style.display === "") {
+        l.style.display = "inline";
+        var darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
+        if (!darkMode) {
+            m.style.backgroundColor = "#f3f2ea";
+        }
+    } else {
+        l.style.display = "";
+        m.style.backgroundColor = "";
+    }
+}