From 6746c59983658006103bc6cc3e54ca804c3ed9a2 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Sun, 26 Jan 2020 09:19:12 +0200 Subject: [PATCH] relative folders --- example_links.txt | 4 +++- index.html | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example_links.txt b/example_links.txt index 37512db..50b327f 100644 --- a/example_links.txt +++ b/example_links.txt @@ -53,6 +53,8 @@ are parsed. - C: clear filter - S: enter filter editor - +## Search bar tricks + +- Start search with / to enter relative URL diff --git a/index.html b/index.html index 6331ff8..50d12f4 100644 --- a/index.html +++ b/index.html @@ -147,6 +147,10 @@ function filter(ev) { if (ev == null) { return } var key=ev.keyCode; if (key==13){ + /* If search starts with / "cd" to that folder. (also /.. works)*/ + if (needle.startsWith("/")) { + window.location.href = needle.substring(1); + } if (c==0) { document.getElementById('filter').focus(); } if (c==1) { open_link(lastHit); } if (c>1) {