From fb9df5396098d4dc9b1566fc1656c5c8a3da8684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 27 Oct 2023 12:24:26 +0100 Subject: [PATCH] docs: update search form to use hyperkitty search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- docs/js/main.js | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) 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" || 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; - 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; + 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);