From e6f4fdde99544d97bb9144ad530f8b5c88ef5de7 Mon Sep 17 00:00:00 2001 From: sfja Date: Thu, 3 Jul 2025 02:09:44 +0200 Subject: [PATCH] turn off scheduler --- public/index.html | 4 ++-- public/index.js | 58 ++++++++++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/public/index.html b/public/index.html index 731ca8f..225e537 100644 --- a/public/index.html +++ b/public/index.html @@ -18,7 +18,7 @@

This text is available both as text at MIA and as audiobook by Socialism For All.

The work can be read in 20 minutes. The plan is to start the event 20 minutes before the announced time, to give people time to read the work, if they haven't already. Then at the announced time, the presentation/discussion will start. I will go through what I think are the main points, and we will use this presentation as foundation for discussion.

I may put some notes here afterwards...

-

Scheduler

+ diff --git a/public/index.js b/public/index.js index 31a0fdf..760a916 100644 --- a/public/index.js +++ b/public/index.js @@ -85,32 +85,38 @@ async function makeScheduleTable() { scheduleTable.innerHTML = tableHtml; } -scheduleForm.onsubmit = async (ev) => { - ev.preventDefault(); - const formdata = new FormData(ev.target); - const data = [...formdata] - .reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {}); - if (!data.username) { - alert("please specify username"); - return; - } - if (!data.tos) { - alert("please check information agreement"); - return; - } +function initScheduler() { + scheduleForm.onsubmit = async (ev) => { + ev.preventDefault(); + const formdata = new FormData(ev.target); + const data = [...formdata] + .reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {}); + if (!data.username) { + alert("please specify username"); + return; + } + if (!data.tos) { + alert("please check information agreement"); + return; + } - const response = await fetch("/api/log", { - method: "post", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(data), - }).then((res) => res.json()); + const response = await fetch("/api/log", { + method: "post", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data), + }).then((res) => res.json()); - if (response.ok) { - alert("submitted!"); - } else { - alert("error occured!"); - console.log(response); - } -}; + if (response.ok) { + alert("submitted!"); + } else { + alert("error occured!"); + console.log(response); + } + }; -makeScheduleTable(); + makeScheduleTable(); +} + +if (scheduleTable !== null && scheduleForm !== null) { + initScheduler(); +}