type/js/complete.js

15 lines
446 B
JavaScript
Raw Normal View History

2016-10-01 17:50:59 +00:00
let hash = window.location.hash.substring(1);
let hashBits = hash.split("/");
2016-10-02 15:06:53 +00:00
let repo = hashBits.slice(0, 3).join("/");
let repoName = hashBits.slice(0, 2).join("/");
2016-10-01 17:50:59 +00:00
let file = hashBits[hashBits.length - 1];
2016-10-02 15:06:53 +00:00
$("#congrats").html(`Congratulations, you've completed <code>${file}</code> in <code>${repoName}</code>!`);
2017-11-29 08:04:23 +00:00
$("#repo").attr("href", `./repo.html#${repo}`);
2016-10-02 15:10:08 +00:00
$("#back").click(() => {
2017-11-29 08:04:23 +00:00
window.location.href = `./type.html#${hash}`;
2016-10-02 15:10:08 +00:00
});