diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-04-30 22:01:53 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-04-30 22:01:53 +0800 |
| commit | db1c6676a13798ee57dbac429a1d5045b60356fb (patch) | |
| tree | 5ff305c09686de50bbcac404c1954e42c26ba494 /www/scripts/onload.js | |
| parent | 97fa8f57fbefcbfa6b3e56c31a1e5b60ef1a9e37 (diff) | |
quite a big commit
Diffstat (limited to 'www/scripts/onload.js')
| -rw-r--r-- | www/scripts/onload.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/www/scripts/onload.js b/www/scripts/onload.js new file mode 100644 index 0000000..1e15e8e --- /dev/null +++ b/www/scripts/onload.js @@ -0,0 +1,30 @@ +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);
+}
+
+function index() {
+ postList(2);
+ addNodes();
+}
+
+function library() {
+ postList();
+ addNodes();
+}
|
