From b8f927be2bde5cb17066ead795be0156c0697d23 Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 15 Oct 2024 01:09:37 +0200 Subject: [PATCH] search ranking --- public/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/main.js b/public/main.js index 7e2fff2..5bd3734 100644 --- a/public/main.js +++ b/public/main.js @@ -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()