From nobody Mon May 6 00:50:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155447719983448.293536364164424; Fri, 5 Apr 2019 08:13:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E03C970D6A; Fri, 5 Apr 2019 15:13:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9E415D735; Fri, 5 Apr 2019 15:13:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 715D341F3C; Fri, 5 Apr 2019 15:13:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x35FCq9b023354 for ; Fri, 5 Apr 2019 11:12:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id B35E61A91D; Fri, 5 Apr 2019 15:12:52 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A8321A7CE; Fri, 5 Apr 2019 15:12:51 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 5 Apr 2019 16:12:43 +0100 Message-Id: <20190405151245.18665-2-berrange@redhat.com> In-Reply-To: <20190405151245.18665-1-berrange@redhat.com> References: <20190405151245.18665-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v2 1/3] docs: ensure javascript files are included in dist & install rules X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Apr 2019 15:13:18 +0000 (UTC) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- docs/Makefile.am | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index ebdc734ddd..2a9d99071c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -55,6 +55,12 @@ css =3D \ mobile.css \ main.css =20 +javascript =3D \ + js/jquery-3.1.1.min.js \ + js/jquery.rss.min.js \ + js/moment.min.js + + fonts =3D \ fonts/LICENSE.md \ fonts/stylesheet.css \ @@ -171,7 +177,7 @@ EXTRA_DIST=3D \ $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \ $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \ $(xml) $(qemu_xml) $(lxc_xml) $(admin_xml) $(fig) $(png) $(css) \ - $(logofiles) \ + $(javascript) $(logofiles) \ $(internals_html_in) $(internals_html) $(fonts) \ aclperms.htmlinc \ hvsupport.pl \ @@ -353,6 +359,9 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) for f in $(css) $(dot_html) $(gif) $(png); do \ $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done + $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/js + for f in $(javascript); do \ + $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/js/; done $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/logos for f in $(logofiles); do \ $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/logos; done @@ -380,6 +389,9 @@ uninstall-local: for f in $(logofiles); do \ rm -f $(DESTDIR)$(HTML_DIR)/$$f; \ done + for f in $(javascript); do \ + rm -f $(DESTDIR)$(HTML_DIR)/$$f; \ + done for h in $(apihtml); do rm -f $(DESTDIR)$(HTML_DIR)/$$h; done for p in $(apipng); do rm -f $(DESTDIR)$(HTML_DIR)/$$p; done for f in $(internals_html); do \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 00:50:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554477188451687.3949923603352; Fri, 5 Apr 2019 08:13:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A18B33027C; Fri, 5 Apr 2019 15:13:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2136D60BFB; Fri, 5 Apr 2019 15:13:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C44EF181AC45; Fri, 5 Apr 2019 15:12:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x35FCsJa023360 for ; Fri, 5 Apr 2019 11:12:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7826226341; Fri, 5 Apr 2019 15:12:54 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 245712718E; Fri, 5 Apr 2019 15:12:52 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 5 Apr 2019 16:12:44 +0100 Message-Id: <20190405151245.18665-3-berrange@redhat.com> In-Reply-To: <20190405151245.18665-1-berrange@redhat.com> References: <20190405151245.18665-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v2 2/3] docs: move javascript logic into a standalone file X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Apr 2019 15:13:01 +0000 (UTC) Instead of duplicating javascript in every single page, put it in a standalone file which can be cached by the browser. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- docs/Makefile.am | 1 + docs/main.js | 25 +++++++++++++++++++++++++ docs/page.xsl | 35 +++-------------------------------- 3 files changed, 29 insertions(+), 32 deletions(-) create mode 100644 docs/main.js diff --git a/docs/Makefile.am b/docs/Makefile.am index 2a9d99071c..29b0761a2b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -56,6 +56,7 @@ css =3D \ main.css =20 javascript =3D \ + js/main.js \ js/jquery-3.1.1.min.js \ js/jquery.rss.min.js \ js/moment.min.js diff --git a/docs/main.js b/docs/main.js new file mode 100644 index 0000000000..723e2fb16d --- /dev/null +++ b/docs/main.js @@ -0,0 +1,25 @@ +function pageload() { + window.addEventListener('scroll', function(e){ + var distanceY =3D window.pageYOffset || document.documentElement.s= crollTop + var shrinkOn =3D 94 + home =3D document.getElementById("home"); + links =3D document.getElementById("jumplinks"); + search =3D document.getElementById("search"); + body =3D document.getElementById("body"); + if (distanceY > shrinkOn) { + if (home.className !=3D "navhide") { + body.className =3D "navhide" + home.className =3D "navhide" + links.className =3D "navhide" + search.className =3D "navhide" + } + } else { + if (home.className =3D=3D "navhide") { + body.className =3D "" + home.className =3D "" + links.className =3D "" + search.className =3D "" + } + } + }); +} diff --git a/docs/page.xsl b/docs/page.xsl index beb864f26b..136f3106e4 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -99,40 +99,11 @@ =20 - - + --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 00:50:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554477270336561.3655554151909; Fri, 5 Apr 2019 08:14:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 226E1883BA; Fri, 5 Apr 2019 15:14:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6D1860C14; Fri, 5 Apr 2019 15:14:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1B32F3FB11; Fri, 5 Apr 2019 15:14:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x35FCu3u023372 for ; Fri, 5 Apr 2019 11:12:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 264C726341; Fri, 5 Apr 2019 15:12:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id D21912639A; Fri, 5 Apr 2019 15:12:54 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 5 Apr 2019 16:12:45 +0100 Message-Id: <20190405151245.18665-4-berrange@redhat.com> In-Reply-To: <20190405151245.18665-1-berrange@redhat.com> References: <20190405151245.18665-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v2 3/3] docs: add advanced search capabilities X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 05 Apr 2019 15:14:28 +0000 (UTC) Allow targetting the search scope to the website, wiki or mailing lists only. When javascript is disabled this should gracefully fallback to only searching the website. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- docs/js/main.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ docs/libvirt.css | 39 ++++++++++++++++++++++++ docs/main.js | 25 ---------------- docs/mobile.css | 7 +++++ docs/page.xsl | 16 +++++++--- 5 files changed, 135 insertions(+), 29 deletions(-) create mode 100644 docs/js/main.js delete mode 100644 docs/main.js diff --git a/docs/js/main.js b/docs/js/main.js new file mode 100644 index 0000000000..aea7c999fc --- /dev/null +++ b/docs/js/main.js @@ -0,0 +1,77 @@ +function pageload() { + window.addEventListener('scroll', function(e){ + var distanceY =3D window.pageYOffset || document.documentElement.s= crollTop + var shrinkOn =3D 94 + home =3D document.getElementById("home"); + links =3D document.getElementById("jumplinks"); + search =3D document.getElementById("search"); + body =3D document.getElementById("body"); + if (distanceY > shrinkOn) { + if (home.className !=3D "navhide") { + body.className =3D "navhide" + home.className =3D "navhide" + links.className =3D "navhide" + search.className =3D "navhide" + } + } else { + if (home.className =3D=3D "navhide") { + body.className =3D "" + home.className =3D "" + links.className =3D "" + search.className =3D "" + } + } + }); + + /* Setting this class makes the advanced search options visible */ + advancedSearch =3D document.getElementById("advancedsearch") + advancedSearch.className =3D "advancedsearch" + + simpleSearch =3D document.getElementById("simplesearch") + simplesearch.addEventListener("submit", advancedsearch) +} + +function advancedsearch(e) { + e.preventDefault(); + e.stopPropagation(); + + form =3D document.createElement("form"); + form.setAttribute("method", "get"); + + newq =3D document.createElement("input"); + newq.setAttribute("type", "hidden"); + form.appendChild(newq); + + q =3D document.getElementById("searchq"); + whats =3D document.getElementsByName("what"); + what =3D "website"; + for (var i =3D 0; i < whats.length; i++) { + if (whats[i].checked) { + what =3D whats[i].value; + break; + } + } + + if (what =3D=3D "website") { + form.setAttribute("action", "https://google.com/search"); + newq.setAttribute("name", "q"); + newq.value =3D "site:libvirt.org " + q.value; + } else if (what =3D=3D "wiki") { + form.setAttribute("action", "https://wiki.libvirt.org/index.php"); + newq.setAttribute("name", "search"); + newq.value =3D q.value; + } else if (what =3D=3D "devs") { + form.setAttribute("action", "https://google.com/search"); + newq.setAttribute("name", "q"); + newq.value =3D "site:redhat.com inurl:/archives/libvir-list " + q.= value; + } else if (what =3D=3D "users") { + form.setAttribute("action", "https://google.com/search"); + newq.setAttribute("name", "q"); + newq.value =3D "site:redhat.com inurl:/archives/libvirt-users " + = q.value; + } + + document.body.appendChild(form); + form.submit(); + + return false; +} diff --git a/docs/libvirt.css b/docs/libvirt.css index ed797d5d91..0d2d5f8ace 100644 --- a/docs/libvirt.css +++ b/docs/libvirt.css @@ -542,3 +542,42 @@ dl.mail dt a:hover { td.enumvalue { white-space: nowrap; } + +#advancedsearch { + display: none; + vertical-align: bottom; + position: absolute; + padding: 1em; + padding-top: 0em; + margin-top: 0em; + top: 100px; + right: 0px; + width: 13em; + text-align: left; + color: white; + background: rgb(0, 95, 97); + border-left: 3px solid rgb(60, 133, 124); + border-bottom: 3px solid rgb(60, 133, 124); +} + +/* Use div.advancedsearch, not #advancedsearch because the + * 'advancedsearch' class is set dynamically when javascript + * loads. This ensures that the advancedsearch options are + * not displayed when javascript is disabled. +*/ +#search:hover div.advancedsearch { + display: table; +} + +#advancedsearch span { + display: block; +} + +#advancedsearch input[type=3Dradio] { + height: inherit; + display: inline; +} + +#advancedsearch label { + display: inline; +} diff --git a/docs/main.js b/docs/main.js deleted file mode 100644 index 723e2fb16d..0000000000 --- a/docs/main.js +++ /dev/null @@ -1,25 +0,0 @@ -function pageload() { - window.addEventListener('scroll', function(e){ - var distanceY =3D window.pageYOffset || document.documentElement.s= crollTop - var shrinkOn =3D 94 - home =3D document.getElementById("home"); - links =3D document.getElementById("jumplinks"); - search =3D document.getElementById("search"); - body =3D document.getElementById("body"); - if (distanceY > shrinkOn) { - if (home.className !=3D "navhide") { - body.className =3D "navhide" - home.className =3D "navhide" - links.className =3D "navhide" - search.className =3D "navhide" - } - } else { - if (home.className =3D=3D "navhide") { - body.className =3D "" - home.className =3D "" - links.className =3D "" - search.className =3D "" - } - } - }); -} diff --git a/docs/mobile.css b/docs/mobile.css index 85ca497525..366d0f1a5d 100644 --- a/docs/mobile.css +++ b/docs/mobile.css @@ -15,6 +15,7 @@ margin: 0px; background: white; padding: 0px; + height: 2em; } #search form { padding: 5px; @@ -91,4 +92,10 @@ float: none; margin-bottom: 2em; } + #advancedsearch { + margin-top: 4em; + border: 0px; + background: white; + color: black; + } } diff --git a/docs/page.xsl b/docs/page.xsl index 136f3106e4..65ddeb2bb7 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -126,11 +126,19 @@
-
- - - + +
+ + + +
+
+ + + + +
--=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list