From 02e0ff39d90cf9d6d0c7d3e56b35f63815b4c8bd Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 1 Oct 2016 13:50:59 -0400 Subject: [PATCH] Add basic completion page --- complete.html | 15 +++++++++++++++ js/complete.js | 7 +++++++ js/main.js | 2 ++ 3 files changed, 24 insertions(+) create mode 100644 complete.html create mode 100644 js/complete.js diff --git a/complete.html b/complete.html new file mode 100644 index 0000000..9cf7784 --- /dev/null +++ b/complete.html @@ -0,0 +1,15 @@ + + + + + Type + + + +

+

Return to start.

+ + + + + diff --git a/js/complete.js b/js/complete.js new file mode 100644 index 0000000..9081d4e --- /dev/null +++ b/js/complete.js @@ -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 ${file} in ${repo}!`); diff --git a/js/main.js b/js/main.js index 6532b26..434d673 100644 --- a/js/main.js +++ b/js/main.js @@ -310,6 +310,8 @@ function completeChunk() { }); } else { // TODO: show completion screen + let hash = window.location.hash; + window.location.href = `/complete.html${hash}`; } }) .catch((e) => {