From 27e7357e524bafd64b9a3b5f03b8507bd1818c51 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 2 Oct 2016 11:06:53 -0400 Subject: [PATCH] Add repo link to complete page --- complete.html | 2 +- js/complete.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/complete.html b/complete.html index 9cf7784..26f470e 100644 --- a/complete.html +++ b/complete.html @@ -7,7 +7,7 @@

-

Return to start.

+

Return to repo or start.

diff --git a/js/complete.js b/js/complete.js index 9081d4e..42bbf28 100644 --- a/js/complete.js +++ b/js/complete.js @@ -1,7 +1,10 @@ let hash = window.location.hash.substring(1); let hashBits = hash.split("/"); -let repo = hashBits.slice(0, 2).join("/"); +let repo = hashBits.slice(0, 3).join("/"); +let repoName = hashBits.slice(0, 2).join("/"); let file = hashBits[hashBits.length - 1]; -$("#congrats").html(`Congratulations, you've completed ${file} in ${repo}!`); +$("#congrats").html(`Congratulations, you've completed ${file} in ${repoName}!`); + +$("#repo").attr("href", `/repo.html#${repo}`);