mirror of https://github.com/shadowfacts/type.git
Add repo link to complete page
This commit is contained in:
parent
81b730ff23
commit
27e7357e52
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
|
||||
<p id="congrats"></p>
|
||||
<p>Return to <a href="/">start</a>.</p>
|
||||
<p>Return to <a id="repo">repo</a> or <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>
|
||||
|
|
|
@ -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 <code>${file}</code> in <code>${repo}</code>!`);
|
||||
$("#congrats").html(`Congratulations, you've completed <code>${file}</code> in <code>${repoName}</code>!`);
|
||||
|
||||
$("#repo").attr("href", `/repo.html#${repo}`);
|
||||
|
|
Loading…
Reference in New Issue