mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
implement goto rating
This commit is contained in:
@@ -44,3 +44,17 @@ function firstPage(){
|
||||
window.location.href = href.split(parameterSeperator)[0]
|
||||
}
|
||||
}
|
||||
|
||||
/* input fields */
|
||||
var gotoRankInputField = document.getElementById("gotoRank");
|
||||
gotoRankInputField.addEventListener("keyup", function(event) {
|
||||
if (event.key == "Enter") {
|
||||
event.preventDefault();
|
||||
var url = new URL(window.location.href)
|
||||
var rank = gotoRankInputField.value
|
||||
var page = Math.trunc((rank - 1)/100)
|
||||
url.searchParams.set("page", page)
|
||||
url.searchParams.set("goto", rank)
|
||||
window.location.href = url.href
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user