mirror of https://github.com/dirtbags/moth.git
Notices + simpler example theme content
This commit is contained in:
parent
aeadde8e17
commit
4f3c3fbd04
|
@ -10,7 +10,9 @@
|
|||
<body>
|
||||
<h1 id="title">MOTH</h1>
|
||||
<section>
|
||||
<div id="messages"></div>
|
||||
<div id="messages">
|
||||
<div id="notices"></div>
|
||||
</div>
|
||||
|
||||
<form id="login">
|
||||
<!--
|
||||
|
|
|
@ -14,6 +14,13 @@ function toast(message, timeout=5000) {
|
|||
)
|
||||
}
|
||||
|
||||
function renderNotices(obj) {
|
||||
let ne = document.getElementById("notices")
|
||||
if (ne) {
|
||||
ne.innerHTML = obj
|
||||
}
|
||||
}
|
||||
|
||||
function renderPuzzles(obj) {
|
||||
let puzzlesElement = document.createElement('div')
|
||||
|
||||
|
@ -78,6 +85,17 @@ function renderPuzzles(obj) {
|
|||
}
|
||||
|
||||
function heartbeat(teamId, participantId) {
|
||||
let noticesUrl = new URL("notices.html", window.location)
|
||||
fetch(noticesUrl)
|
||||
.then(resp => {
|
||||
if (resp.ok) {
|
||||
resp.text()
|
||||
.then(renderNotices)
|
||||
.catch(err => console.log)
|
||||
}
|
||||
})
|
||||
.catch(err => console.log)
|
||||
|
||||
let url = new URL("puzzles.json", window.location)
|
||||
url.searchParams.set("id", teamId)
|
||||
if (participantId) {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue