From 8e58ee3ebf586f5814c62b4bc868576499d2f8c0 Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Mon, 26 Dec 2022 21:55:01 -0600 Subject: [PATCH] add toggle for room history --- client/singleplayer/bonuses.html | 4 ++++ client/singleplayer/index.js | 15 +++++++++++++++ client/singleplayer/tossups.html | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/client/singleplayer/bonuses.html b/client/singleplayer/bonuses.html index 9e3f90703..ed83ba1a7 100644 --- a/client/singleplayer/bonuses.html +++ b/client/singleplayer/bonuses.html @@ -102,6 +102,10 @@ +
+ + +

diff --git a/client/singleplayer/index.js b/client/singleplayer/index.js index e499644f9..aced92aec 100644 --- a/client/singleplayer/index.js +++ b/client/singleplayer/index.js @@ -173,8 +173,23 @@ document.getElementById('toggle-select-by-set-name').addEventListener('click', f }); +document.getElementById('toggle-show-history').addEventListener('click', function () { + if (this.checked) { + document.getElementById('room-history').classList.remove('d-none'); + localStorage.setItem('showHistory', 'true'); + } else { + document.getElementById('room-history').classList.add('d-none'); + localStorage.setItem('showHistory', 'false'); + } +}); + if (localStorage.getItem('selectBySetName') === 'false') { document.getElementById('toggle-select-by-set-name').checked = false; document.getElementById('difficulty-settings').classList.remove('d-none'); document.getElementById('set-settings').classList.add('d-none'); } + +if (localStorage.getItem('showHistory') === 'false') { + document.getElementById('toggle-show-history').checked = false; + document.getElementById('room-history').classList.add('d-none'); +} diff --git a/client/singleplayer/tossups.html b/client/singleplayer/tossups.html index 781f20a1e..8a76ad4c0 100644 --- a/client/singleplayer/tossups.html +++ b/client/singleplayer/tossups.html @@ -104,6 +104,10 @@

+
+ + +