summaryrefslogtreecommitdiff
path: root/scripts/onload.js
blob: 9d9226ee728bec9b7140537db8968769365f1ff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function addNodes() {
    const collection = document.getElementsByTagName("section");
    const container = document.getElementById("progressContainer");

    for (var i = 0; i < collection.length; i++) {
	var node = document.createElement("a");
	node.className = "node";
        container.appendChild(node);
	if (collection.item(i).getAttribute('id') == null) {
	    collection.item(i).setAttribute('id', `section-${i}`);
	}
	node.setAttribute('id', `node-${i}`)
	node.href = `#${collection.item(i).getAttribute('id')}`
    }
}

function blog(n) {
    // addNodes is called in loadPost(n);
    loadPost(n);
}