searxng/searx/static/themes/simple/js/keyboard.min.js
dependabot[bot] 687121d584
[upd] web-client (simple): Bump the minor group in /client/simple with 2 updates (#5202)
* [upd] web-client (simple): Bump the minor group

Bumps the minor group in /client/simple with 2 updates: [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) and [stylelint](https://github.com/stylelint/stylelint).


Updates `@biomejs/biome` from 2.2.2 to 2.2.4
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.2.4/packages/@biomejs/biome)

Updates `stylelint` from 16.23.1 to 16.24.0
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.23.1...16.24.0)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: stylelint
  dependency-version: 16.24.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* update biome schema

* update rolldown

---------

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>
2025-09-12 10:59:25 +02:00

2 lines
5.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{a as e,i as t,n,o as r}from"./searxng.core.min.js";var i={Escape:{key:`ESC`,fun:e=>f(e),des:`remove focus from the focused input`,cat:`Control`},c:{key:`c`,fun:()=>S(),des:`copy url of the selected result to the clipboard`,cat:`Results`},h:{key:`h`,fun:()=>x(o),des:`toggle help window`,cat:`Other`},i:{key:`i`,fun:()=>v(),des:`focus on the search input`,cat:`Control`},n:{key:`n`,fun:()=>m(),des:`go to next page`,cat:`Results`},o:{key:`o`,fun:()=>y(!1),des:`open search result`,cat:`Results`},p:{key:`p`,fun:()=>h(),des:`go to previous page`,cat:`Results`},r:{key:`r`,fun:()=>d(),des:`reload page from the server`,cat:`Control`},t:{key:`t`,fun:()=>y(!0),des:`open the result in a new tab`,cat:`Results`}},a={default:{ArrowLeft:{key:``,fun:()=>u(`up`)(),des:`select previous search result`,cat:`Results`},ArrowRight:{key:``,fun:()=>u(`down`)(),des:`select next search result`,cat:`Results`},...i},vim:{b:{key:`b`,fun:()=>g(-window.innerHeight),des:`scroll one page up`,cat:`Navigation`},d:{key:`d`,fun:()=>g(window.innerHeight/2),des:`scroll half a page down`,cat:`Navigation`},f:{key:`f`,fun:()=>g(window.innerHeight),des:`scroll one page down`,cat:`Navigation`},g:{key:`g`,fun:()=>_(-document.body.scrollHeight,`top`),des:`scroll to the top of the page`,cat:`Navigation`},j:{key:`j`,fun:()=>u(`down`)(),des:`select next search result`,cat:`Results`},k:{key:`k`,fun:()=>u(`up`)(),des:`select previous search result`,cat:`Results`},u:{key:`u`,fun:()=>g(-window.innerHeight/2),des:`scroll half a page up`,cat:`Navigation`},v:{key:`v`,fun:()=>_(document.body.scrollHeight,`bottom`),des:`scroll to the bottom of the page`,cat:`Navigation`},y:{key:`y`,fun:()=>S(),des:`copy url of the selected result to the clipboard`,cat:`Results`},...i}},o=r.hotkeys&&r.hotkeys in a?a[r.hotkeys]:a.default,s=e=>(e?.closest(`.detail, .result`))?.classList.contains(`detail`)??!1,c=e=>e?.closest(`.result`)??void 0,l=e=>e?.classList.contains(`result-images`)??!1,u=t=>(n,r)=>{let i=t,a=document.querySelector(`.result[data-vim-selected]`);if(!a){if(a=document.querySelector(`.result`),!a)return;(t===`down`||t===`up`)&&(i=a)}let o=Array.from(document.querySelectorAll(`.result`)),s;if(typeof i!=`string`)s=i;else switch(i){case`visible`:{let e=document.documentElement.scrollTop||document.body.scrollTop,t=e+document.documentElement.clientHeight;for(let n of o){let r=n.offsetTop;if(r+n.clientHeight<=t&&r>e){s=n;break}}break}case`down`:s=o[o.indexOf(a)+1]||a;break;case`up`:s=o[o.indexOf(a)-1]||a;break;case`bottom`:s=o.at(-1);break;case`top`:default:s=o[0]}s&&(a.removeAttribute(`data-vim-selected`),s.setAttribute(`data-vim-selected`,`true`),r||(s.querySelector(`h3 a`)||s.querySelector(`a`))?.focus(),n||e.scrollPageToSelected?.())},d=()=>{document.location.reload()},f=t=>{let n=t.target?.tagName?.toLowerCase();document.activeElement&&(n===`input`||n===`select`||n===`textarea`)?document.activeElement.blur():e.closeDetail?.()},p=e=>{let t=document.querySelector(e);t&&t.click()},m=()=>{p(`nav#pagination .next_page button[type="submit"]`)},h=()=>{p(`nav#pagination .previous_page button[type="submit"]`)};e.scrollPageToSelected=()=>{let e=document.querySelector(`.result[data-vim-selected]`);if(!e)return;let t=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientHeight,r=e.offsetTop,i=r+e.clientHeight;if(!e.previousElementSibling&&i<n){window.scroll(window.scrollX,0);return}t>r-120?window.scroll(window.scrollX,r-120):t+n<i+120&&window.scroll(window.scrollX,i-n+120)};var g=e=>{window.scrollBy(0,e),u(`visible`)()},_=(e,t)=>{window.scrollTo(0,e),u(t)()},v=()=>{window.scrollTo(0,0);let e=document.querySelector(`#q`);if(e&&(e.focus(),e.setSelectionRange)){let t=e.value.length;e.setSelectionRange(t,t)}},y=e=>{let t=document.querySelector(`.result[data-vim-selected] h3 a`);if(t||=document.querySelector(`.result[data-vim-selected] > a`),!t)return;let n=t.getAttribute(`href`);n&&(e?window.open(n):window.location.href=n)},b=(e,t)=>{let n={};for(let e of Object.values(t)){let t=e.cat;n[t]??=[],n[t].push(e)}let r=Object.keys(n).sort((e,t)=>(n[t]?.length??0)-(n[e]?.length??0)),i=`<a href="#" class="close" aria-label="close" title="close">×</a>`;i+=`<h3>How to navigate SearXNG with hotkeys</h3>`,i+=`<table>`;for(let[e,t]of r.entries()){let a=n[t];if(!a||a.length===0)continue;let o=e%2==0,s=e===r.length-1;o&&(i+=`<tr>`),i+=`<td>`,i+=`<h4>${t}</h4>`,i+=`<ul class="list-unstyled">`;for(let e of a)i+=`<li><kbd>${e.key}</kbd> ${e.des}</li>`;i+=`</ul>`,i+=`</td>`,(!o||s)&&(i+=`</tr>`)}i+=`</table>`,e.innerHTML=i},x=e=>{let t=document.querySelector(`#vim-hotkeys-help`);if(t)t.classList.toggle(`invisible`);else{t=Object.assign(document.createElement(`div`),{id:`vim-hotkeys-help`,className:`dialog-modal`}),b(t,e);let n=document.getElementsByTagName(`body`)[0];n&&n.appendChild(t)}},S=async()=>{let e=document.querySelector(`.result[data-vim-selected] h3 a`);n(e);let t=e.getAttribute(`href`);t&&await navigator.clipboard.writeText(t)};t(`click`,`.result`,function(t){if(!s(t.target)){u(this)(!0,!0);let n=c(t.target);n&&l(n)&&(t.preventDefault(),e.selectImage?.(n))}}),t(`focus`,`.result a`,t=>{if(!s(t.target)){let n=c(t.target);n&&!n.hasAttribute(`data-vim-selected`)&&u(n)(!0),n&&l(n)&&(t.preventDefault(),e.selectImage?.(n))}},{capture:!0}),t(`keydown`,document,e=>{if(Object.hasOwn(o,e.key)&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey){let t=e.target?.tagName?.toLowerCase();e.key===`Escape`?o[e.key]?.fun(e):(e.target===document.body||t===`a`||t===`button`)&&(e.preventDefault(),o[e.key]?.fun(e))}}),e.selectNext=u(`down`),e.selectPrevious=u(`up`);
//# sourceMappingURL=keyboard.min.js.map