type/js/complete.js

15 lines
444 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>!`);
$("#repo").attr("href", `/repo.html#${repo}`);
2016-10-02 15:10:08 +00:00
$("#back").click(() => {
window.location.href = `/type.html#${hash}`;
});