aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-05-29 20:32:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-05-29 20:32:45 +0000
commit2568d499c74ba9bba7ed379f8fa8717b62bdadf9 (patch)
tree05c94697a678e0c16336883bdfeedcf412675852
parent1b77b3206799accd714dfcfe5e1d600716383372 (diff)
downloadmandoc-2568d499c74ba9bba7ed379f8fa8717b62bdadf9.tar.gz
mandoc-2568d499c74ba9bba7ed379f8fa8717b62bdadf9.tar.zst
mandoc-2568d499c74ba9bba7ed379f8fa8717b62bdadf9.zip
Remove redundant value= attributes from option elements,
and use type=search rather than type=text for the input element because it tends to better support autocompletion. Both suggested by John Gardner <gardnerjohng at gmail dot com>.
-rw-r--r--cgi.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/cgi.c b/cgi.c
index ddbc52bb..8098352d 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.157 2018/05/18 14:23:00 schwarze Exp $ */
+/* $Id: cgi.c,v 1.158 2018/05/29 20:32:45 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@usta.de>
@@ -400,7 +400,7 @@ resp_searchform(const struct req *req, enum focus focus)
/* Write query input box. */
- printf(" <input type=\"text\" name=\"query\" value=\"");
+ printf(" <input type=\"search\" name=\"query\" value=\"");
if (req->q.query != NULL)
html_print(req->q.query);
printf( "\" size=\"40\"");
@@ -436,7 +436,7 @@ resp_searchform(const struct req *req, enum focus focus)
printf(" selected=\"selected\"");
puts(">All Architectures</option>");
for (i = 0; i < arch_MAX; i++) {
- printf(" <option value=\"%s\"", arch_names[i]);
+ printf(" <option");
if (NULL != req->q.arch &&
0 == strcmp(arch_names[i], req->q.arch))
printf(" selected=\"selected\"");
@@ -449,12 +449,10 @@ resp_searchform(const struct req *req, enum focus focus)
if (req->psz > 1) {
puts(" <select name=\"manpath\">");
for (i = 0; i < (int)req->psz; i++) {
- printf(" <option ");
+ printf(" <option");
if (strcmp(req->q.manpath, req->p[i]) == 0)
- printf("selected=\"selected\" ");
- printf("value=\"");
- html_print(req->p[i]);
- printf("\">");
+ printf(" selected=\"selected\"");
+ printf(">");
html_print(req->p[i]);
puts("</option>");
}