Added GDPS Discord links to leaderboard

This commit is contained in:
Colon 2021-12-08 13:55:46 -05:00
parent 571baaf0d8
commit a941279399
2 changed files with 12 additions and 4 deletions

View file

@ -72,7 +72,7 @@
<img class="gdButton" src="../assets/smallinfo.png" width="32%" onclick="$('#infoDiv').show()">
</div>
<div style="position:absolute; top: 12%; right: 1.5%; width: 21%; text-align: right;">
<div id="discordLinks" style="display: none; position:absolute; top: 12%; right: 1.5%; width: 21%; text-align: right;">
<a id="discord" target="_blank" title="Official leaderboard Discord!" href="https://discord.gg/leaderboard"><img class="gdButton" src="../assets/discord.png" width="20%"></a>
<a id="altDiscord" target="_blank" title="Accurate leaderboard Discord!" style="display: none; filter: hue-rotate(300deg)" href="https://discord.gg/Uz7pd4"><img class="gdButton" src="../assets/discord.png" width="20%"></a>
</div>
@ -139,9 +139,17 @@ function leaderboard(val) {
if (weekly) return
else if (ps.weeklyLeaderboard) { $('#weeklyTabOff').show(); weekly = true }
else $('#scoreTabs').css('margin-left', '-29vh')
if (ps.link.includes("https://discord.gg")) {
$('#discord').attr('href', ps.link).attr('title', `${ps.name} Discord!`)
$('#discordLinks').show()
}
})
}
else $('#boomling').show()
else {
$('#boomling').show()
$('#discordLinks').show()
}
$('#searchBox').html(`<div style="height: 4.5%"></div>`)
$('.ranking').remove()

View file

@ -167,7 +167,7 @@ function Append(firstLoad, noCache) {
else $('#lastPage').removeClass('grayscale').find('img').addClass('gdButton')
if (!noCache && pageCache[page]) appendLevels(pageCache[page])
else Fetch(searchFilters.replace("[PAGE]", page)).then(appendLevels)
else Fetch(searchFilters.replace("[PAGE]", page)).then(appendLevels).catch(e => $('#loading').hide())
function appendLevels(res) {
@ -183,7 +183,7 @@ function Append(firstLoad, noCache) {
else $('#shuffle').css('filter', 'hue-rotate(100deg)')
}
$('#shuffle').show()
$('#lastPage').show()
if (pages > 1) $('#lastPage').show()
$('#pagenum').text(`Page ${page + 1}${pages ? ` of ${pages}` : ""}`)
}