diff options
author | altaf-creator <athaalaa@gmail.com> | 2024-04-04 16:41:10 +0700 |
---|---|---|
committer | altaf-creator <athaalaa@gmail.com> | 2024-04-04 16:41:10 +0700 |
commit | a26de243da1a42ea9abc4953c1906cf558493883 (patch) | |
tree | 9dd5d14afda5e451f52ef744bd1408c0e717629f /scripts/onload.js | |
parent | d9ef8a652594c782be0422184a8632588805db06 (diff) |
initial commit for personal git repo server
Diffstat (limited to 'scripts/onload.js')
-rw-r--r-- | scripts/onload.js | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/scripts/onload.js b/scripts/onload.js index 165f80d..9d9226e 100644 --- a/scripts/onload.js +++ b/scripts/onload.js @@ -1,15 +1,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 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);
+}
|