turn off scheduler

This commit is contained in:
sfja 2025-07-03 02:09:44 +02:00
parent 04c54e6a37
commit e6f4fdde99
2 changed files with 34 additions and 28 deletions

View File

@ -18,7 +18,7 @@
<p>This text is available both <a href="https://www.marxists.org/archive/lenin/works/1913/mar/x01.htm" target="_blank">as text at MIA</a> and <a href="https://www.youtube.com/watch?v=MOAII71GaFY" target="_blank">as audiobook by Socialism For All</a>.</p>
<p>The work can be read in 20 minutes. The plan is to start the event 20 minutes <b>before</b> the announced time, to give people time to read the work, if they haven't already. Then <b>at</b> 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.</p>
<p>I may put some notes here afterwards...</p>
<h1>Scheduler</h1>
<!--<h1>Scheduler</h1>
<div id="scheduler">
<p>
Select as many options as possible. I will try and find the
@ -51,7 +51,7 @@
<input type="submit" value="Submit">
</div>
</form>
</div>
</div>-->
</main>
<script></script>
</body>

View File

@ -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();
}