Some more work

This commit is contained in:
dginovker 2020-12-09 08:35:42 -05:00
parent 12bd698e33
commit 7d7f7240d4
2 changed files with 35 additions and 14 deletions

View File

@ -587,12 +587,12 @@ English
<div class="arrow_back">
<div class="buttons_arrows">
<a id="button-up"
href="http://services/m=hiscore/overall.ws?rank=1&amp;table=0&amp;scroll=true&amp;category_type=0">
href="./hiscores.html">
<span class="lev1_arrow"></span>
U
</a>
<a id="button-down"
href="http://services/m=hiscore/overall.ws?rank=23&amp;table=0&amp;scroll=true&amp;category_type=0">
href="./hiscores.html">
<span class="lev1_arrow"></span>
D
</a>

View File

@ -1,15 +1,36 @@
for (let i = 1; i <= 22; i++) {
row = document.getElementsByClassName(`row row${i}`)[0];
let page = 0;
row.childNodes[3].replaceWith(document.createElement("td"));
row.childNodes[3].className = "alL";
row.childNodes[3].innerHTML = "PlayerName";
function populateHSTable() {
for (let i = 1; i <= 22; i++) {
row = document.getElementsByClassName(`row row${i}`)[0];
row.childNodes[5].replaceWith(document.createElement("td"));
row.childNodes[5].className = "alL";
row.childNodes[5].innerHTML = "Level";
row.childNodes[3].replaceWith(document.createElement("td"));
row.childNodes[3].className = "alL";
row.childNodes[3].innerHTML = "PlayerName";
row.childNodes[7].replaceWith(document.createElement("td"));
row.childNodes[7].className = "alL";
row.childNodes[7].innerHTML = "XP,XP";
}
row.childNodes[5].replaceWith(document.createElement("td"));
row.childNodes[5].className = "alL";
row.childNodes[5].innerHTML = "Level";
row.childNodes[7].replaceWith(document.createElement("td"));
row.childNodes[7].className = "alL";
row.childNodes[7].innerHTML = "XP,XP";
}
}
// Handle page arrows
document.getElementById("button-up").addEventListener("click", function (e) {
e.preventDefault();
if (page > 0) {
page--;
}
populateHSTable();
});
document.getElementById("button-down").addEventListener("click", function (e) {
e.preventDefault();
page++;
populateHSTable();
});
populateHSTable();