Add checkmark read timer

This commit is contained in:
flaviut 2014-06-19 23:58:43 -04:00
commit 0438be29f2

View file

@ -18,13 +18,15 @@
<%= yield %>
</div>
<script>
localStorage.setItem(window.location.pathname, true);
function setVisibleTags(){
var tocLinks = document.querySelectorAll("#sidebar a:link, a:visited");
for(var i = 0; i < tocLinks.length; i++){
if(localStorage.getItem(tocLinks[i].getAttribute("href")) != null){
tocLinks[i].classList.add("visited");
}
}
}
function updateStarCounter(){
var request = new XMLHttpRequest();
request.open("GET", "https://api.github.com/repos/flaviut/nimrod-by-example/stargazers", true);
request.onload = function (e) {
@ -36,6 +38,13 @@
console.error(request.statusText);
};
request.send(null);
}
setTimeout(function() {
localStorage.setItem(window.location.pathname, true);
setVisibleTags();
}, 10000);
setVisibleTags()
updateStarCounter()
</script>
</body>
</html>