mirror of
https://github.com/searxng/searxng.git
synced 2025-09-10 12:18:24 +02:00
2 lines
No EOL
1.1 KiB
JavaScript
2 lines
No EOL
1.1 KiB
JavaScript
import{d as e,e as t,g as n}from"./searxng.core.min.js";let r;const i=async()=>{if(!r){try{let t=await e(`GET`,`engine_descriptions.json`);r=await t.json()}catch(e){console.error(`Error fetching engineDescriptions:`,e)}if(r)for(let[e,[t,i]]of Object.entries(r)){let r=document.querySelectorAll(`[data-engine-name="${e}"] .engine-description`),a=` (<i>${n.translations?.Source}: ${i}</i>)`;for(let e of r)e.innerHTML=t+a}}},a=(e,t)=>{for(let n of t)n.offsetParent&&(n.checked=!e)},o=document.querySelectorAll(`[data-engine-name]`);for(let e of o)t(`mouseenter`,e,i);const s=document.querySelectorAll(`tbody input[type=checkbox][class~=checkbox-onoff]`),c=document.querySelectorAll(`.enable-all-engines`);for(let e of c)t(`click`,e,()=>a(!0,s));const l=document.querySelectorAll(`.disable-all-engines`);for(let e of l)t(`click`,e,()=>a(!1,s));const u=document.querySelector(`#copy-hash`);u&&t(`click`,u,async e=>{e.preventDefault();let{copiedText:t,hash:n}=u.dataset;if(t&&n)try{await navigator.clipboard.writeText(n),u.innerText=t}catch(e){console.error(`Failed to copy hash:`,e)}});
|
|
//# sourceMappingURL=preferences.min.js.map
|