From a941279399689969026761921afde388eff754ed Mon Sep 17 00:00:00 2001 From: Colon <56617416+GDColon@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:55:46 -0500 Subject: [PATCH] Added GDPS Discord links to leaderboard --- html/leaderboard.html | 12 ++++++++++-- html/search.html | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/html/leaderboard.html b/html/leaderboard.html index 7fbac2e..db31b98 100644 --- a/html/leaderboard.html +++ b/html/leaderboard.html @@ -72,7 +72,7 @@ -
+ @@ -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(`
`) $('.ranking').remove() diff --git a/html/search.html b/html/search.html index 5f697b0..050eba5 100644 --- a/html/search.html +++ b/html/search.html @@ -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}` : ""}`) }