mirror of
https://github.com/searxng/searxng.git
synced 2025-11-21 14:03:10 -05:00
2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
import{i as e,n as t,o as n,r}from"./searxng.core.min.js";var i,a=async()=>{if(!i){try{i=await(await r(`GET`,`engine_descriptions.json`)).json()}catch(e){console.error(`Error fetching engineDescriptions:`,e)}if(i)for(let[e,[t,r]]of Object.entries(i)){let i=document.querySelectorAll(`[data-engine-name="${e}"] .engine-description`),a=` (<i>${n.translations?.Source}: ${r}</i>)`;for(let e of i)e.innerHTML=t+a}}},o=(e,t)=>{for(let n of t)n.offsetParent&&(n.checked=!e)},s=document.querySelectorAll(`[data-engine-name]`);for(let t of s)e(`mouseenter`,t,a);var c=document.querySelectorAll(`tbody input[type=checkbox][class~=checkbox-onoff]`),l=document.querySelectorAll(`.enable-all-engines`);for(let t of l)e(`click`,t,()=>o(!0,c));var u=document.querySelectorAll(`.disable-all-engines`);for(let t of u)e(`click`,t,()=>o(!1,c));e(`click`,`#copy-hash`,async function(){let e=this.parentElement?.querySelector(`pre`);if(t(e),window.isSecureContext)await navigator.clipboard.writeText(e.innerText);else{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand(`copy`)}}let n=this.dataset.copiedText;n&&(this.innerText=n)});
|
|
//# sourceMappingURL=preferences.min.js.map
|