about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-07 19:10:33 -0400
committerJune McEnroe <june@causal.agency>2021-05-07 19:29:21 -0400
commit299c4334ab7f3cabfad2ee74d441ebb2d4e27e80 (patch)
tree849ce92eec665878d7f95f0a9b80dadeb7cf518d
parentUse LDADD variables, support BINDIR (diff)
downloadscooper-299c4334ab7f3cabfad2ee74d441ebb2d4e27e80.tar.gz
scooper-299c4334ab7f3cabfad2ee74d441ebb2d4e27e80.zip
Try to keep query at end of parameters
-rw-r--r--html.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/html.c b/html.c
index aebb104..321d731 100644
--- a/html.c
+++ b/html.c
@@ -138,6 +138,8 @@ enum kcgi_err htmlNav(struct khtmlreq *html, struct kreq *req) {
 			KATTR_ACTION, Pages[Search],
 			KATTR__MAX
 		)
+		|| htmlHidden(html, req, Network)
+		|| htmlHidden(html, req, Context)
 		|| khtml_attr(
 			html, KELEM_INPUT,
 			KATTR_TYPE, "search",
@@ -145,8 +147,6 @@ enum kcgi_err htmlNav(struct khtmlreq *html, struct kreq *req) {
 			KATTR_VALUE, (query ? query : ""),
 			KATTR__MAX
 		)
-		|| htmlHidden(html, req, Network)
-		|| htmlHidden(html, req, Context)
 		|| khtml_elem(html, KELEM_BUTTON)
 		|| khtml_printf(
 			html, "Search %s",
@@ -312,8 +312,8 @@ eventNetwork(struct khtmlreq *html, struct kreq *req, struct Event *event) {
 	}
 	char *href = khttp_urlpart(
 		NULL, NULL, Pages[Search],
-		Keys[Query].name, req->fieldmap[Query]->parsed.s,
 		Keys[Network].name, event->network,
+		Keys[Query].name, req->fieldmap[Query]->parsed.s,
 		NULL
 	);
 	if (!href) err(EX_OSERR, "khttp_urlpart");
@@ -337,9 +337,9 @@ eventContext(struct khtmlreq *html, struct kreq *req, struct Event *event) {
 	}
 	char *href = khttp_urlpart(
 		NULL, NULL, Pages[Search],
-		Keys[Query].name, req->fieldmap[Query]->parsed.s,
 		Keys[Network].name, event->network,
 		Keys[Context].name, event->context,
+		Keys[Query].name, req->fieldmap[Query]->parsed.s,
 		NULL
 	);
 	if (!href) err(EX_OSERR, "khttp_urlpart");