From 3705a7e862c2fb360cf2bb2602eb79158b113468 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 28 May 2016 13:40:48 +0000 Subject: Simplify search form: minus two visible control elements, minus one table, minus twenty lines of code, no loss of functionality. No idea why i didn't do this earlier... --- cgi.c | 37 +++++++++---------------------------- man.cgi.8 | 27 +++++++++++---------------- 2 files changed, 20 insertions(+), 44 deletions(-) diff --git a/cgi.c b/cgi.c index 779b9eb6..81040abf 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.131 2016/04/29 10:45:36 schwarze Exp $ */ +/* $Id: cgi.c,v 1.132 2016/05/28 13:40:48 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016 Ingo Schwarze @@ -385,8 +385,7 @@ resp_searchform(const struct req *req, enum focus focus) /* Write query input box. */ - printf( "
\n" - "q.query != NULL) html_print(req->q.query); printf( "\" size=\"40\""); @@ -394,24 +393,16 @@ resp_searchform(const struct req *req, enum focus focus) printf(" autofocus"); puts(">"); - /* Write submission and reset buttons. */ + /* Write submission buttons. */ - printf( "\n" - "\n"); - - /* Write show radio button */ - - printf( "\n" - "q.equal) - printf("checked=\"checked\" "); - printf( "name=\"apropos\" id=\"show\" value=\"0\">\n" - "\n"); + printf( "\n" + "\n
\n"); /* Write section selector. */ - puts( "
\n" - ""); for (i = 0; i < sec_MAX; i++) { printf("\n" - "q.equal) - printf("checked=\"checked\" "); - printf( "name=\"apropos\" id=\"search\" value=\"1\">\n" - "\n"); - - puts("
\n" - "\n" + puts("\n" "\n" ""); puts(""); diff --git a/man.cgi.8 b/man.cgi.8 index 05a374d0..4b0f64fa 100644 --- a/man.cgi.8 +++ b/man.cgi.8 @@ -1,4 +1,4 @@ -.\" $Id: man.cgi.8,v 1.16 2016/03/19 13:29:22 schwarze Exp $ +.\" $Id: man.cgi.8,v 1.17 2016/05/28 13:40:49 schwarze Exp $ .\" .\" Copyright (c) 2014, 2015, 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 19 2016 $ +.Dd $Mdocdate: May 28 2016 $ .Dt MAN.CGI 8 .Os .Sh NAME @@ -26,9 +26,9 @@ The CGI program searches for manual pages on a WWW server and displays them to HTTP clients, providing functionality equivalent to the -.Xr apropos 1 -and .Xr man 1 +and +.Xr apropos 1 utilities. It can use multiple manual trees in parallel. .Ss HTML search interface @@ -51,20 +51,15 @@ The effect of prepending a backslash to another character is undefined; in the current implementation, it has no effect. .It A -.Dq Submit -button to send a search request from the client to the server. -.It -A -.Dq Reset -button to undo any changes to the input boxes and the dropdown menus -and reset them to the values contained in the -.Ev QUERY_STRING . -.It -Radio buttons to select pages either by name like in .Xr man 1 -or using +submit button. +The string in the input box is interpreted as the name of a manual page. +.It +An .Xr apropos 1 -queries. +submit button. +The string in the input box is interpreted as a search +.Ar expression . .It A dropdown menu to optionally select a manual section. If one is provided, it has the same effect as the -- cgit v1.2.3-56-ge451