implement goto rating

This commit is contained in:
2019-06-09 01:31:46 +02:00
parent f41396c569
commit eb34339ceb
3 changed files with 19 additions and 4 deletions

View File

@@ -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
}
});