mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00: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:
parent
3aade50055
commit
a8e3bae5b1
@ -40,12 +40,13 @@ function advancedsearch(e) {
|
|||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.method = "get";
|
form.method = "get";
|
||||||
|
|
||||||
|
var q = document.getElementById("searchq");
|
||||||
var newq = document.createElement("input");
|
var newq = document.createElement("input");
|
||||||
newq.type = "hidden";
|
newq.type = "hidden";
|
||||||
newq.name = "q";
|
newq.name = "q";
|
||||||
|
newq.value = q.value;
|
||||||
form.appendChild(newq);
|
form.appendChild(newq);
|
||||||
|
|
||||||
var q = document.getElementById("searchq");
|
|
||||||
var whats = document.getElementsByName("what");
|
var whats = document.getElementsByName("what");
|
||||||
var what = "website";
|
var what = "website";
|
||||||
for (var i = 0; i < whats.length; i++) {
|
for (var i = 0; i < whats.length; i++) {
|
||||||
@ -56,15 +57,20 @@ function advancedsearch(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (what == "website" || what == "wiki") {
|
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") {
|
if (what == "website") {
|
||||||
newq.value = "site:libvirt.org " + q.value;
|
newsite.value = "libvirt.org";
|
||||||
} else {
|
} else {
|
||||||
newq.value = "site:wiki.libvirt.org " + q.value;
|
newsite.value = "wiki.libvirt.org";
|
||||||
}
|
}
|
||||||
} else if (what == "devs" || "users") {
|
} else if (what == "devs" || "users") {
|
||||||
form.action = "https://lists.libvirt.org/archives/search";
|
form.action = "https://lists.libvirt.org/archives/search";
|
||||||
newq.value = q.value;
|
|
||||||
|
|
||||||
var newl = document.createElement("input");
|
var newl = document.createElement("input");
|
||||||
newl.type = "hidden";
|
newl.type = "hidden";
|
||||||
|
@ -77,9 +77,9 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="search">
|
<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>
|
<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 id="searchq" name="q" type="text" size="12" value=""/>
|
||||||
<input name="submit" type="submit" value="Go"/>
|
<input name="submit" type="submit" value="Go"/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user