aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoni Sawicki <tenox@google.com>2022-08-29 01:15:34 -0700
committerAntoni Sawicki <tenox@google.com>2022-08-29 01:15:34 -0700
commit35459bfbee163d38c9b1136db2db0c53b5cb0983 (patch)
treef747bbefdc007f840be1066ef1bdab5add7a960e
parentb36dc47ddfc75bbca2f147ec339f12e79e63084e (diff)
downloadwfm-35459bfbee163d38c9b1136db2db0c53b5cb0983.tar.gz
refresh do redirect with naked dir
-rw-r--r--handlers.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/handlers.go b/handlers.go
index f747302..b5eb577 100644
--- a/handlers.go
+++ b/handlers.go
@@ -74,10 +74,6 @@ func wfmMain(w http.ResponseWriter, r *http.Request) {
case r.FormValue("save") != "":
wfm.saveText(r.FormValue("text"))
return
- case r.FormValue("home") != "":
- wfm.uDir = "/"
- wfm.listFiles(filepath.Base(r.FormValue("hi")))
- return
case r.FormValue("up") != "":
up := *wfmPfx + "/" + url.QueryEscape(filepath.Dir(wfm.uDir))
if wfm.eSort != "" {
@@ -85,6 +81,17 @@ func wfmMain(w http.ResponseWriter, r *http.Request) {
}
redirect(w, up)
return
+ case r.FormValue("refresh") != "":
+ re := *wfmPfx + "/" + url.QueryEscape(wfm.uDir)
+ if wfm.eSort != "" {
+ re = re + "?sort=" + wfm.eSort
+ }
+ redirect(w, re)
+ return
+ case r.FormValue("home") != "":
+ wfm.uDir = "/"
+ wfm.listFiles(filepath.Base(r.FormValue("hi")))
+ return
case r.FormValue("cancel") != "":
wfm.listFiles(filepath.Base(r.FormValue("hi")))
return