diff --git a/public/app.js b/public/app.js index 8962141..cb0f448 100644 --- a/public/app.js +++ b/public/app.js @@ -194,10 +194,14 @@ async function walkSearch(repos, term) { // ---- Search: Seafile files + libraries and Plex music, all best-effort (a missing backend never blocks the others) function viewSearch() { $('#view').innerHTML = `

Search

+
${icon('search')}Ask Duck.ai + ${icon('search')}Search the web
`; const q = $('#q'); q.focus(); let timer, seq = 0; - q.oninput = () => { clearTimeout(timer); timer = setTimeout(() => runSearch(q.value.trim(), ++seq), 350); }; + // Duck.ai and DuckDuckGo refuse to be shown inside other apps, so these hand the question over in a new tab. + const webLinks = () => { const t = encodeURIComponent(q.value.trim()); $('#duckai').href = 'https://duck.ai/' + (t ? '?q=' + t : ''); $('#ddg').href = 'https://duckduckgo.com/' + (t ? '?q=' + t : ''); }; + q.oninput = () => { webLinks(); clearTimeout(timer); timer = setTimeout(() => runSearch(q.value.trim(), ++seq), 350); }; async function runSearch(term, mySeq) { const res = $('#res'); if (term.length < 2) { res.innerHTML = ''; return; }