Add basic completion page

This commit is contained in:
Shadowfacts 2016-10-01 13:50:59 -04:00
parent b6549dcbb9
commit 02e0ff39d9
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
3 changed files with 24 additions and 0 deletions

15
complete.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Type</title>
</head>
<body>
<p id="congrats"></p>
<p>Return to <a href="/">start</a>.</p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/complete.js"></script>
</body>
</html>

7
js/complete.js Normal file
View File

@ -0,0 +1,7 @@
let hash = window.location.hash.substring(1);
let hashBits = hash.split("/");
let repo = hashBits.slice(0, 2).join("/");
let file = hashBits[hashBits.length - 1];
$("#congrats").html(`Congratulations, you've completed <code>${file}</code> in <code>${repo}</code>!`);

View File

@ -310,6 +310,8 @@ function completeChunk() {
});
} else {
// TODO: show completion screen
let hash = window.location.hash;
window.location.href = `/complete.html${hash}`;
}
})
.catch((e) => {