From d260bcf601dd4ae43731d3882f9e072444860487 Mon Sep 17 00:00:00 2001
From: echicken <echicken@bbs.electronicchicken.com>
Date: Wed, 17 Feb 2021 16:50:05 -0500
Subject: [PATCH] Added 'darkmode_allow' setting, which defaults to true.
 'darkmode_off' will still work if set, but is deprecated. Added 'darkmode_on'
 setting, which defaults to false; if set, darkmode is turned on until the
 user turns it off.

---
 webv4/lib/init.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/webv4/lib/init.js b/webv4/lib/init.js
index e97b089669..80c1cb88dd 100644
--- a/webv4/lib/init.js
+++ b/webv4/lib/init.js
@@ -46,9 +46,13 @@ var defaults = {
 			if (typeof v !== 'string') return new Error('Invalid files_inline_blacklist setting ' + v);
 			return v.split(',');
 		}
-	}
+	},
+	darkmode_allow: { default: true },
+	darkmode_on: { default: false },
 };
 
+if (settings.darkmode_off) settings.darkmode_allow = false;
+
 function doError(e) {
 	log(LOG_ERROR, e);
 	http_reply.status = '500 Internal Server Error';
-- 
GitLab