From: Daniel P. Berrangé Date: Fri, 27 Oct 2023 11:24:26 +0000 (+0100) Subject: docs: update search form to use hyperkitty search X-Git-Tag: v9.9.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb9df5396098d4dc9b1566fc1656c5c8a3da8684;p=thirdparty%2Flibvirt.git docs: update search form to use hyperkitty search The hyperkitty search facility does a massively better job than google docs for mailing lists. Reviewed-by: Ján Tomko Signed-off-by: Daniel P. Berrangé --- diff --git a/docs/js/main.js b/docs/js/main.js index c37f9756a7..57e1faf030 100644 --- a/docs/js/main.js +++ b/docs/js/main.js @@ -38,10 +38,11 @@ function advancedsearch(e) { e.stopPropagation(); var form = document.createElement("form"); - form.setAttribute("method", "get"); + form.method = "get"; var newq = document.createElement("input"); - newq.setAttribute("type", "hidden"); + newq.type = "hidden"; + newq.name = "q"; form.appendChild(newq); var q = document.getElementById("searchq"); @@ -54,17 +55,27 @@ function advancedsearch(e) { } } - form.setAttribute("action", "https://google.com/search"); - newq.setAttribute("name", "q"); - - if (what == "website") { - newq.value = "site:libvirt.org " + q.value; - } else if (what == "wiki") { - newq.value = "site:wiki.libvirt.org " + q.value; - } else if (what == "devs") { - newq.value = "site:redhat.com/archives/libvir-list " + q.value; - } else if (what == "users") { - newq.value = "site:redhat.com/archives/libvirt-users " + q.value; + if (what == "website" || what == "wiki") { + form.action = "https://google.com/search"; + if (what == "website") { + newq.value = "site:libvirt.org " + q.value; + } else { + newq.value = "site:wiki.libvirt.org " + q.value; + } + } else if (what == "devs" || "users") { + form.action = "https://lists.libvirt.org/archives/search"; + newq.value = q.value; + + var newl = document.createElement("input"); + newl.type = "hidden"; + newl.name = "mlist"; + form.appendChild(newl); + + if (what == "devs") { + newl.value = "devel@lists.libvirt.org"; + } else { + newl.value = "users@lists.libvirt.org"; + } } document.body.appendChild(form);