[libvirt PATCH 4/4] docs: update search form to use hyperkitty search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The hyperkitty search facility does a massively better job
than google docs for mailing lists.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 docs/js/main.js | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 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") {
-        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@xxxxxxxxxxxxxxxxx";
+        } else {
+            newl.value = "users@xxxxxxxxxxxxxxxxx";
+        }
     }
 
     document.body.appendChild(form);
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux