mirror of
https://github.com/searxng/searxng.git
synced 2025-11-07 15:26:47 -05:00
* [upd] web-client (simple): Bump the minor group Bumps the minor group in /client/simple with 3 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [browserslist](https://github.com/browserslist/browserslist) and [sharp](https://github.com/lovell/sharp). Updates `@types/node` from 24.3.1 to 24.5.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `browserslist` from 4.25.4 to 4.26.2 - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](https://github.com/browserslist/browserslist/compare/4.25.4...4.26.2) Updates `sharp` from 0.34.3 to 0.34.4 - [Release notes](https://github.com/lovell/sharp/releases) - [Commits](https://github.com/lovell/sharp/compare/v0.34.3...v0.34.4) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 24.5.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: browserslist dependency-version: 4.26.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: sharp dependency-version: 0.34.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: minor ... Signed-off-by: dependabot[bot] <support@github.com> * update rolldown-vite --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivan Gabaldon <igabaldon@inetol.net>
2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
import{i as e,n as t,o as n,r}from"./searxng.core.min.js";var i=async(i,a)=>{try{let o;o=n.method===`GET`?await r(`GET`,`./autocompleter?q=${a}`):await r(`POST`,`./autocompleter`,{body:new URLSearchParams({q:a})});let s=await o.json(),c=document.querySelector(`.autocomplete`);t(c);let l=document.querySelector(`.autocomplete ul`);if(t(l),c.classList.add(`open`),l.replaceChildren(),s?.[1]?.length===0){let e=Object.assign(document.createElement(`li`),{className:`no-item-found`,textContent:n.translations?.no_item_found??`No results found`});l.append(e);return}let u=new DocumentFragment;for(let t of s[1]){let n=Object.assign(document.createElement(`li`),{textContent:t});e(`mousedown`,n,()=>{i.value=t,document.querySelector(`#search`)?.submit(),c.classList.remove(`open`)}),u.append(n)}l.append(u)}catch(e){console.error(`Error fetching autocomplete results:`,e)}},a=document.getElementById(`q`);t(a);var o;e(`input`,a,()=>{clearTimeout(o);let e=a.value,t=n.autocomplete_min??2;e.length<t||(o=window.setTimeout(async()=>{e===a.value&&await i(a,e)},300))});var s=document.querySelector(`.autocomplete`),c=document.querySelector(`.autocomplete ul`);c&&e(`keyup`,a,e=>{let t=[...c.children],n=t.findIndex(e=>e.classList.contains(`active`)),r=-1;switch(e.key){case`ArrowUp`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n-1+t.length)%t.length;break}case`ArrowDown`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n+1)%t.length;break}case`Tab`:case`Enter`:s&&s.classList.remove(`open`);break;default:break}if(r!==-1){let e=t[r];if(e&&(e.classList.add(`active`),!e.classList.contains(`no-item-found`))){let t=document.getElementById(`q`);t&&(t.value=e.textContent??``)}}});
|
|
//# sourceMappingURL=autocomplete.min.js.map
|