search ranking
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ale 2024-10-15 01:09:37 +02:00
parent 957c721476
commit b8f927be2b

View File

@ -2,7 +2,7 @@ document.addEventListener('DOMContentLoaded', function () {
loading()
var hold, external, timeout, ac, last, darklight = document.getElementById('darkcss').getAttribute('href')
document.getElementById('instance').addEventListener('keydown', function (event) {
if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) {
if (event.key && !event.ctrlKey && !event.altKey) {
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
last = event.target.value
} else {
@ -15,9 +15,11 @@ document.addEventListener('DOMContentLoaded', function () {
}
})
document.getElementById('instance').addEventListener('keyup', function (event) {
if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) {
if (event.key && !event.ctrlKey && !event.altKey) {
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
keypress(event.target.value)
} else if (event.target.value === '' && document.getElementById('instancelist').firstChild?.innerText !== 'Top 100') {
ranking()
} else {
event.preventDefault()
event.stopPropagation()