1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

docs: Use DuckDuckGo for website/wiki search

Ideally we'd just perform the search ourselves, but as long as
we have to rely on an external provider, at least make it a
somewhat privacy-conscious one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-12-04 12:09:32 +01:00
parent 3aade50055
commit a8e3bae5b1
2 changed files with 13 additions and 7 deletions

View File

@ -40,12 +40,13 @@ function advancedsearch(e) {
var form = document.createElement("form");
form.method = "get";
var q = document.getElementById("searchq");
var newq = document.createElement("input");
newq.type = "hidden";
newq.name = "q";
newq.value = q.value;
form.appendChild(newq);
var q = document.getElementById("searchq");
var whats = document.getElementsByName("what");
var what = "website";
for (var i = 0; i < whats.length; i++) {
@ -56,15 +57,20 @@ function advancedsearch(e) {
}
if (what == "website" || what == "wiki") {
form.action = "https://google.com/search";
form.action = "https://duckduckgo.com/";
var newsite = document.createElement("input");
newsite.type = "hidden";
newsite.name = "sites";
form.appendChild(newsite);
if (what == "website") {
newq.value = "site:libvirt.org " + q.value;
newsite.value = "libvirt.org";
} else {
newq.value = "site:wiki.libvirt.org " + q.value;
newsite.value = "wiki.libvirt.org";
}
} 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";

View File

@ -77,9 +77,9 @@
</ul>
</div>
<div id="search">
<form id="simplesearch" action="https://www.google.com/search" enctype="application/x-www-form-urlencoded" method="get">
<form id="simplesearch" action="https://duckduckgo.com/" enctype="application/x-www-form-urlencoded" method="get">
<div>
<input id="searchsite" name="sitesearch" type="hidden" value="libvirt.org"/>
<input id="searchsite" name="sites" type="hidden" value="libvirt.org"/>
<input id="searchq" name="q" type="text" size="12" value=""/>
<input name="submit" type="submit" value="Go"/>
</div>