From eb14677f8a2e9d54c53e92bf4e726a717eb1ba01 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 22 Aug 2023 21:57:21 +0800 Subject: [PATCH] save screensaver settings --- static/app.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/static/app.js b/static/app.js index 7425fed..f171f08 100755 --- a/static/app.js +++ b/static/app.js @@ -3573,3 +3573,53 @@ slider.oninput = function() { } +// save screensaver settings +function saveScreensaverSettings() { + let clock1_timecolor = document.getElementById("clock1-timecolor").value; + let clock1_weekdaycolor = document.getElementById("clock1-weekdaycolor").value; + let clock1_datecolor = document.getElementById("clock1-datecolor").value; + let clock1_timezone = document.getElementById("clock1-timezone").value; + let clock1_displaypm = document.getElementById("clock1-displaypm").checked; + let clock1_displayseconds = document.getElementById("clock1-displayseconds").checked; + let clock1_12hour = document.getElementById("clock1-12hour").checked; + + let clock2_timecolor = document.getElementById("clock2-timecolor").value; + let clock2_datecolor = document.getElementById("clock2-datecolor").value; + let clock2_timezone = document.getElementById("clock2-timezone").value; + let clock2_displaypm = document.getElementById("clock2-displaypm").checked; + let clock2_12hour = document.getElementById("clock2-12hour").checked; + + let worldclock_citycolor = document.getElementById("worldclock-citycolor").value; + let worldclock_displaypm = document.getElementById("worldclock-displaypm").checked; + let worldclock_displayseconds = document.getElementById("worldclock-displayseconds").checked; + let worldclock_12hour = document.getElementById("worldclock-12hour").checked; + + let settings = { + clock1_timecolor: clock1_timecolor, + clock1_weekdaycolor: clock1_weekdaycolor, + clock1_datecolor: clock1_datecolor, + clock1_timezone: clock1_timezone, + clock1_displaypm: clock1_displaypm, + clock1_displayseconds: clock1_displayseconds, + clock1_12hour: clock1_12hour, + clock2_timecolor: clock2_timecolor, + clock2_datecolor: clock2_datecolor, + clock2_timezone: clock2_timezone, + clock2_displaypm: clock2_displaypm, + clock2_12hour: clock2_12hour, + worldclock_citycolor: worldclock_citycolor, + worldclock_displaypm: worldclock_displaypm, + worldclock_displayseconds: worldclock_displayseconds, + worldclock_12hour: worldclock_12hour, + }; + + console.log(settings); + // fetch("/saveSchedulerSettings", { + // method: "POST", + // body: JSON.stringify(settings), + // }); + document.getElementById('screensaver-saved').style.display = "block"; +} + + +