diff --git a/app/filter.py b/app/filter.py index 54029c5..5ff46b7 100644 --- a/app/filter.py +++ b/app/filter.py @@ -183,7 +183,9 @@ class Filter: result_link = urlparse.urlparse(href) query_link = parse_qs(result_link.query)['q'][0] if '?q=' in href else '' - if '/search?q=' in href: + if query_link.startswith('/'): + a['href'] = 'https://google.com' + query_link + elif '/search?q=' in href: enc_result = Fernet(self.secret_key).encrypt(query_link.encode()) new_search = '/search?q=' + enc_result.decode() diff --git a/app/models/config.py b/app/models/config.py index 0976400..544d2d1 100644 --- a/app/models/config.py +++ b/app/models/config.py @@ -300,7 +300,7 @@ class Config: self.url = '' self.lang = 'lang_en' self.ctry = '' - self.safe = True + self.safe = False self.dark = False self.nojs = False self.near = '' diff --git a/app/routes.py b/app/routes.py index 7d497b4..8c7bc01 100644 --- a/app/routes.py +++ b/app/routes.py @@ -144,9 +144,11 @@ def search(): 'display.html', query=urlparse.unquote(q), search_type=search_type, + dark_mode=g.user_config.dark, response=formatted_results, search_header=render_template( 'header.html', + dark_mode=g.user_config.dark, q=urlparse.unquote(q), search_type=search_type, mobile=g.user_request.mobile) if 'isch' not in search_type else '') diff --git a/app/static/css/search-dark.css b/app/static/css/search-dark.css new file mode 100644 index 0000000..2ac5b47 --- /dev/null +++ b/app/static/css/search-dark.css @@ -0,0 +1,35 @@ +.autocomplete { + position: relative; + display: inline-block; + width: 100%; +} + +.autocomplete-items { + position: absolute; + border: 1px solid #685e79; + border-bottom: none; + border-top: none; + z-index: 99; + + /*position the autocomplete items to be the same width as the container:*/ + top: 100%; + left: 0; + right: 0; +} + +.autocomplete-items div { + padding: 10px; + cursor: pointer; + color: #fff; + background-color: #000; + border-bottom: 1px solid #242424; +} + +.autocomplete-items div:hover { + background-color: #404040; +} + +.autocomplete-active { + background-color: #685e79 !important; + color: #ffffff; +} \ No newline at end of file diff --git a/app/templates/display.html b/app/templates/display.html index e66de6f..94ebed2 100644 --- a/app/templates/display.html +++ b/app/templates/display.html @@ -6,7 +6,7 @@ - +