From d500a51d9739d839792643d9d3dba5ba3775dabd Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 7 Oct 2021 23:11:11 +0200 Subject: [PATCH] golf --- copyparty/web/md.html | 4 ++-- copyparty/web/mde.html | 4 ++-- copyparty/web/splash.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/copyparty/web/md.html b/copyparty/web/md.html index ab70cafc..f66d8f8e 100644 --- a/copyparty/web/md.html +++ b/copyparty/web/md.html @@ -135,13 +135,13 @@ var md_opt = { (function () { var l = localStorage, - drk = l.getItem('lightmode') != 1, + drk = l.lightmode != 1, btn = document.getElementById("lightswitch"), f = function (e) { if (e) { e.preventDefault(); drk = !drk; } document.documentElement.setAttribute("class", drk? "dark":"light"); btn.innerHTML = "go " + (drk ? "light":"dark"); -l.setItem('lightmode', drk? 0:1); +l.lightmode = drk? 0:1; }; btn.onclick = f; diff --git a/copyparty/web/mde.html b/copyparty/web/mde.html index 6ac9bd4f..97816e3b 100644 --- a/copyparty/web/mde.html +++ b/copyparty/web/mde.html @@ -33,11 +33,11 @@ var md_opt = { var lightswitch = (function () { var l = localStorage, - drk = l.getItem('lightmode') != 1, + drk = l.lightmode != 1, f = function (e) { if (e) drk = !drk; document.documentElement.setAttribute("class", drk? "dark":"light"); -l.setItem('lightmode', drk? 0:1); +l.lightmode = drk? 0:1; }; f(); return f; diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index c8c7d576..910b4f0b 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -80,7 +80,7 @@ π