whisper.cat/weboasis/js/index_search_links.min.js

1 line
1016 B
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
let selectedIndex=-1,searchInputText="";const linkSearch=document.getElementById("searchLinks"),defaultSearch=document.getElementById("searchBar");function handleSearchQuery(){let a=[];for(const b in defaultLinkMenu)for(j=0;j<defaultLinkMenu[b].length;j++)"-HEAD-"!=defaultLinkMenu[b][j][2]&&a.push(defaultLinkMenu[b][j]);for(j=0;j<hiddenLinksOne.length;j++)hiddenLinksOne[j][2]="",a.push(hiddenLinksOne[j]);for(j=0;j<hiddenLinksTwo.length;j++)hiddenLinksTwo[j][2]="",a.push(hiddenLinksTwo[j]);let b=a.filter(a=>a[0].toLowerCase().trim().includes(searchLinksInput.value.toLowerCase().trim())||a[1].toLowerCase().trim().includes(searchLinksInput.value.toLowerCase().trim())||a[2].toLowerCase().trim().includes(searchLinksInput.value.toLowerCase().trim()));initSearchLinks(b),buildHelp2(),searchLinksInput.value.toLowerCase().trim()!=searchInputText&&(selectedIndex=-1,searchInputText=searchLinksInput.value.toLowerCase().trim())}function handleSearchReset(){let a=new Event("keyup");searchLinksInput.dispatchEvent(a)}