From 8fa0e7f093718ca4c2e963343c31c3a50d9f0ced Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:26:54 -0400 Subject: [PATCH 1/4] Bump py from 1.8.1 to 1.10.0 (#293) Bumps [py](https://github.com/pytest-dev/py) from 1.8.1 to 1.10.0. - [Release notes](https://github.com/pytest-dev/py/releases) - [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/py/compare/1.8.1...1.10.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0e4cdf0..ad18435 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ MarkupSafe==1.1.1 more-itertools==8.3.0 packaging==20.4 pluggy==0.13.1 -py==1.8.1 +py==1.10.0 pycodestyle==2.6.0 pycparser==2.19 pyOpenSSL==19.1.0 From 2eb33007f7b353d215eadab503fcf7874ad90031 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 21 Apr 2021 10:48:26 -0400 Subject: [PATCH 2/4] Disable autocorrect on mobile search inputs Fixes #292 --- app/templates/header.html | 28 ++++++++++++++++++++++------ app/templates/index.html | 22 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/app/templates/header.html b/app/templates/header.html index 5973274..e9ab529 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -11,11 +11,19 @@
- + type="text" + value="{{ query }}">
@@ -37,9 +45,17 @@
- diff --git a/app/templates/index.html b/app/templates/index.html index 336b159..41c33ae 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -42,7 +42,16 @@
- +
@@ -132,7 +141,16 @@
- +
  From 7136197e5d6c882bd7743d82b644240c8b9e0d10 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 21 Apr 2021 10:49:27 -0400 Subject: [PATCH 3/4] Fix missing text style for active search suggestions --- app/static/css/light-theme.css | 1 + 1 file changed, 1 insertion(+) diff --git a/app/static/css/light-theme.css b/app/static/css/light-theme.css index de76eb6..9221b02 100644 --- a/app/static/css/light-theme.css +++ b/app/static/css/light-theme.css @@ -122,6 +122,7 @@ input { .autocomplete-items div:hover { background-color: var(--whoogle-element-bg); + color: var(--whoogle-contrast-text) !important; } .autocomplete-active { From 01fe0c02a50b2fddd3bbdb03f5ef88019b413d2a Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 21 Apr 2021 11:38:19 -0400 Subject: [PATCH 4/4] Add button to clear search input on mobile This was unfortunately a bit more complex than just adding an HTML reset button, since reset buttons only "reset" input content to its original value rather than clearing it. This doesn't work for Whoogle's needs, since inputs on search result pages are auto populated with the search content as their default value. A reset button was introduced anyways, but is controlled by a few lines of javascript to allow completely clearing the search input. The button will only appear on mobile searches. At the moment, it isn't particularly pretty, but is functional. It uses just a plain "x" character and is always visible on mobile search result pages. This leaves plenty of room for improvement moving forward. Fixes #291 --- app/static/css/input.css | 14 ++++++++++++++ app/static/js/utils.js | 8 ++++++++ app/templates/display.html | 1 + app/templates/header.html | 9 +++++---- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 app/static/css/input.css diff --git a/app/static/css/input.css b/app/static/css/input.css new file mode 100644 index 0000000..96cc108 --- /dev/null +++ b/app/static/css/input.css @@ -0,0 +1,14 @@ +#search-bar { + background: transparent !important; + padding-right: 50px; +} + +#search-reset { + all: unset; + margin-left: -50px; + text-align: center; + background-color: transparent !important; + cursor: pointer; + height: 40px; + width: 50px; +} diff --git a/app/static/js/utils.js b/app/static/js/utils.js index 56e052f..3cf4a5d 100644 --- a/app/static/js/utils.js +++ b/app/static/js/utils.js @@ -57,4 +57,12 @@ const checkForTracking = () => { document.addEventListener("DOMContentLoaded", function() { checkForTracking(); + + // Clear input if reset button tapped + const search = document.getElementById("search-bar"); + const resetBtn = document.getElementById("search-reset"); + resetBtn.addEventListener("click", event => { + event.preventDefault(); + search.value = ""; + }); }); diff --git a/app/templates/display.html b/app/templates/display.html index d21bd6b..398e276 100644 --- a/app/templates/display.html +++ b/app/templates/display.html @@ -5,6 +5,7 @@ + diff --git a/app/templates/header.html b/app/templates/header.html index e9ab529..1e0cbd3 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -20,10 +20,11 @@ class="noHIxc" name="q" style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; - color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; - border: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '' }}; border-radius: 8px;" + color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; + border: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '' }}; border-radius: 8px;" type="text" value="{{ query }}"> +
@@ -56,8 +57,8 @@ type="text" value="{{ query }}" style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; - color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; - border: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '' }}; border-radius: 8px;"> + color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; + border: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '0px' }}; border-radius: 8px;">