diff --git a/api/leaderboards/scores.js b/api/leaderboards/scores.js index efaf8ea..aa1f8f0 100644 --- a/api/leaderboards/scores.js +++ b/api/leaderboards/scores.js @@ -13,9 +13,12 @@ module.exports = async (app, req, res) => { let params = req.gdParams({ count: amount, - type: (req.query.hasOwnProperty("creator") || req.query.hasOwnProperty("creators")) ? "creators" : "top", + type: "top", }) + if (["creators", "creator", "cp"].some(x => req.query.hasOwnProperty(x) || req.query.type == x)) type = "creators" + else if (["week", "weekly"].some(x => req.query.hasOwnProperty(x) || req.query.type == x)) type = "weekly" // i think GDPS'es use this + request.post(app.endpoint + 'getGJScores20.php', params, async function(err, resp, body) { if (err || body == '-1' || !body) return res.send("-1") diff --git a/api/messages/countMessages.js b/api/messages/countMessages.js index 9eddecb..1902325 100644 --- a/api/messages/countMessages.js +++ b/api/messages/countMessages.js @@ -15,7 +15,7 @@ module.exports = async (app, req, res) => { request.post(app.endpoint + 'getGJUserInfo20.php', params, async function (err, resp, body) { - if (err || body == '-1' || body == '-2' || !body) return res.status(400).send("Error fetching profile! Make sure your username and password are entered correctly. (this is not an issue with gdbrowser)") + if (err || body == '-1' || body == '-2' || !body) return res.status(400).send("Error counting messages! Messages get blocked a lot so try again later, or make sure your username and password are entered correctly. (this is not an issue with gdbrowser)") let count = app.parseResponse(body)[38] if (!count) return res.status(400).send("Error fetching unread messages!") else res.status(200).send(count) diff --git a/api/messages/getMessages.js b/api/messages/getMessages.js index 77f02b0..f3f6772 100644 --- a/api/messages/getMessages.js +++ b/api/messages/getMessages.js @@ -17,7 +17,7 @@ module.exports = async (app, req, res, api) => { request.post(app.endpoint + 'getGJMessages20.php', params, async function (err, resp, body) { - if (err || body == '-1' || body == '-2' || !body) return res.status(400).send("Error fetching messages!") + if (err || body == '-1' || body == '-2' || !body) return res.status(400).send("Error fetching messages! Messages get blocked a lot so try again later, or make sure your username and password are entered correctly. (this is not an issue with gdbrowser)") let messages = body.split("|").map(msg => app.parseResponse(msg)) let messageArray = [] diff --git a/html/level.html b/html/level.html index dfe523e..c837374 100644 --- a/html/level.html +++ b/html/level.html @@ -116,13 +116,14 @@
@@ -310,7 +311,7 @@ $('#checkSong').click(function() { $('#songLoading').show() fetch(`../api/song/[[SONGID]]`).then(res => res.json()).then(info => { $('#songLoading').hide() - $(info.song.allowed ? '#songAllowed' : '#songNotAllowed').show() + $(info.song.allowed ? '#songAllowed' : '#songNotAllowed').show().addClass('songStatus') if (!info.artist.scouted) { $('#scout').attr('src', '../assets/x.png') $('#scout').attr('title', $('#scout').attr('title').replace('is ', 'is NOT ')) @@ -324,6 +325,17 @@ $('#checkSong').click(function() { }) }) +$('.artistIcon').hover(function() { + let title = $(this).attr('title') + $('#artistInfo').css('color', title.includes("NOT") ? "red" : "lime") + $('.songStatus').hide() + $('#artistInfo').show() + $('#artistInfo').text(title) +}, function() { + $('#artistInfo').hide() + $('.songStatus').show() +}) + // let like; // let likedLevels = localStorage.likedLevels ? JSON.parse(localStorage.likedLevels) : [] // if (likedLevels.includes('[[ID]]')) $('#likeButton').attr('src', '../assets/voted.png').removeClass('gdButton').prop("onclick", null) diff --git a/html/messages.html b/html/messages.html index e0ca743..b02c469 100644 --- a/html/messages.html +++ b/html/messages.html @@ -267,16 +267,16 @@ if (!res || res == "-1") { $('.postbutton').show(); return $('#message').text("The username you provided doesn't exist!") } else accountID = res.accountID - $.post("../messages", { password, accountID, count: true }) - .done(count => { - $('#msgCount').html(`Loading ${count} unread messages...`) - $('#access').hide() - $('#loading').show() + // $.post("../messages", { password, accountID, count: true }) + // .done(count => { + // $('#msgCount').html(`Loading ${count} unread messages...`) + // $('#access').hide() + // $('#loading').show() $.post("../messages", { password, accountID }) .done(msgs => { messages = msgs - $('#loading').hide() + $('#access').hide() appendMessages() $('#messages').show() @@ -299,8 +299,8 @@ }) } - }) - .fail(e => { $('#loadingicon').hide(); $('#msgCount').text(e.responseText.includes("DOCTYPE") ? "Something went wrong..." : e.responseText) }) + // }) + // .fail(e => { $('#loadingicon').hide(); $('#msgCount').text(e.responseText.includes("DOCTYPE") ? "Something went wrong..." : e.responseText) }) }) .fail(e => { $('.postbutton').show(); $('#message').text(e.responseText.includes("DOCTYPE") ? "Something went wrong..." : e.responseText) })