From 52d0ab537f32b34b726790b3d79b770386a0b7fe Mon Sep 17 00:00:00 2001 From: booosy Date: Wed, 24 Aug 2022 00:57:33 -0700 Subject: [PATCH] add search help dropdown --- files/assets/css/main.css | 13 +++++++- files/assets/js/search.js | 8 +++++ files/templates/search.html | 66 +++++++++++++++++++++++++++---------- 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 files/assets/js/search.js diff --git a/files/assets/css/main.css b/files/assets/css/main.css index f1b0ca277..a299089c4 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -3637,7 +3637,7 @@ small, .small { color: var(--muted); font-weight: 600; font-size: 12px; - z-index: 3; + z-index: 100; } .dropdown-actions .fa, .dropdown-actions .fas, .dropdown-actions .far { font-size: 12px; @@ -6239,4 +6239,15 @@ div.custom-control:last-of-type { div.custom-control:last-of-type { margin-bottom: 7px; } +} + +.dropdown-menu button.searchparam { + color: var(--gray-100); + text-decoration: none; + text-transform: none; + background-color: transparent; + border: 2px solid gray; + border-radius: 3px; + padding: 6px; + width: 150px; } \ No newline at end of file diff --git a/files/assets/js/search.js b/files/assets/js/search.js new file mode 100644 index 000000000..3f70b202d --- /dev/null +++ b/files/assets/js/search.js @@ -0,0 +1,8 @@ +function addParam(e) { + e = e || window.event; + let paramExample = e.target.innerText; + let param = paramExample.split(":")[0]; + let searchInput = document.querySelector("#large_searchbar input"); + searchInput.value = `${searchInput.value} ${param}:`; + searchInput.focus(); +} \ No newline at end of file diff --git a/files/templates/search.html b/files/templates/search.html index 1cbf1320c..3fd7a9b43 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -7,7 +7,7 @@ {% endblock %} {% block PseudoSubmitForm %} -