Pārlūkot izejas kodu

seems finished

master
SeraphJACK pirms 3 gadiem
vecāks
revīzija
395bb612d9
Parakstījis: SeraphJACK <seraphjack@outlook.com> GPG atslēgas ID: 14162B46567AB06F
3 mainītis faili ar 32 papildinājumiem un 0 dzēšanām
  1. +14
    -0
      static/fail.html
  2. +14
    -0
      static/finish.html
  3. +4
    -0
      static/js/vote.js

+ 14
- 0
static/fail.html Parādīt failu

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<title>投票失败</title>
</head>
<body>
<div class="box">
<p>投票发生错误,可能是由于你此前已经投过,或是网络问题。</p>
</div>
</body>
</html>

+ 14
- 0
static/finish.html Parādīt failu

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<title>投票完成</title>
</head>
<body>
<div class="box">
<p>投票成功!</p>
</div>
</body>
</html>

+ 4
- 0
static/js/vote.js Parādīt failu

@@ -13,6 +13,7 @@ function doVote() {
response.text().then(body => {
if (!response.ok) {
alert(body)
location.href="fail.html"
} else {
let magicString = findMagic(body)
fetch("/submit", {
@@ -24,6 +25,9 @@ function doVote() {
}).then(res => {
if (!res.ok) {
res.text().then(res => alert(res))
location.href="fail.html"
} else {
location.href="finish.html"
}
})
}


Notiek ielāde…
Atcelt
Saglabāt