|
|
@@ -8,14 +8,16 @@ function voteIsNotDL() { |
|
|
|
location.href = "pending.html" |
|
|
|
} |
|
|
|
|
|
|
|
async function doVote() { |
|
|
|
function doVote() { |
|
|
|
fetch("/challenge").then(response => { |
|
|
|
response.text().then(body => { |
|
|
|
if (!response.ok) { |
|
|
|
alert(body) |
|
|
|
location.href = "fail.html" |
|
|
|
} else { |
|
|
|
findMagic(body).then((magicString) => { |
|
|
|
let worker = new Worker("js/worker.js") |
|
|
|
worker.postMessage(body) |
|
|
|
worker.onmessage = (magicString) => { |
|
|
|
fetch("/submit", { |
|
|
|
method: "POST", |
|
|
|
headers: { |
|
|
@@ -30,7 +32,7 @@ async function doVote() { |
|
|
|
location.href = "finish.html" |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|