Merge remote-tracking branch 'origin/master' into heroku-app
This commit is contained in:
commit
8091150f26
|
@ -183,7 +183,9 @@ class Filter:
|
||||||
result_link = urlparse.urlparse(href)
|
result_link = urlparse.urlparse(href)
|
||||||
query_link = parse_qs(result_link.query)['q'][0] if '?q=' in href else ''
|
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())
|
enc_result = Fernet(self.secret_key).encrypt(query_link.encode())
|
||||||
new_search = '/search?q=' + enc_result.decode()
|
new_search = '/search?q=' + enc_result.decode()
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ class Config:
|
||||||
self.url = ''
|
self.url = ''
|
||||||
self.lang = 'lang_en'
|
self.lang = 'lang_en'
|
||||||
self.ctry = ''
|
self.ctry = ''
|
||||||
self.safe = True
|
self.safe = False
|
||||||
self.dark = False
|
self.dark = False
|
||||||
self.nojs = False
|
self.nojs = False
|
||||||
self.near = ''
|
self.near = ''
|
||||||
|
|
|
@ -144,9 +144,11 @@ def search():
|
||||||
'display.html',
|
'display.html',
|
||||||
query=urlparse.unquote(q),
|
query=urlparse.unquote(q),
|
||||||
search_type=search_type,
|
search_type=search_type,
|
||||||
|
dark_mode=g.user_config.dark,
|
||||||
response=formatted_results,
|
response=formatted_results,
|
||||||
search_header=render_template(
|
search_header=render_template(
|
||||||
'header.html',
|
'header.html',
|
||||||
|
dark_mode=g.user_config.dark,
|
||||||
q=urlparse.unquote(q),
|
q=urlparse.unquote(q),
|
||||||
search_type=search_type,
|
search_type=search_type,
|
||||||
mobile=g.user_request.mobile) if 'isch' not in search_type else '')
|
mobile=g.user_request.mobile) if 'isch' not in search_type else '')
|
||||||
|
|
35
app/static/css/search-dark.css
Normal file
35
app/static/css/search-dark.css
Normal file
|
@ -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;
|
||||||
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="referrer" content="no-referrer">
|
<meta name="referrer" content="no-referrer">
|
||||||
<script type="text/javascript" src="/static/js/autocomplete.js"></script>
|
<script type="text/javascript" src="/static/js/autocomplete.js"></script>
|
||||||
<link rel="stylesheet" href="/static/css/search.css">
|
<link rel="stylesheet" href="/static/css/{{ 'search-dark' if dark_mode else 'search' }}.css">
|
||||||
<link rel="stylesheet" href="/static/css/header.css">
|
<link rel="stylesheet" href="/static/css/header.css">
|
||||||
<title>{{ query }} - Whoogle Search</title>
|
<title>{{ query }} - Whoogle Search</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
<div class="H0PQec" style="width: 100%;">
|
<div class="H0PQec" style="width: 100%;">
|
||||||
<div class="sbc esbc autocomplete">
|
<div class="sbc esbc autocomplete">
|
||||||
<input id="search-bar" autocapitalize="none" autocomplete="off" class="noHIxc" name="q"
|
<input id="search-bar" autocapitalize="none" autocomplete="off" class="noHIxc" name="q"
|
||||||
|
style="background-color: {{ '#000' if dark_mode else '#fff' }};
|
||||||
|
color: {{ '#685e79' if dark_mode else '#000' }};
|
||||||
|
border: {{ '1px solid #685e79' if dark_mode else '' }}"
|
||||||
spellcheck="false" type="text" value="{{ q }}">
|
spellcheck="false" type="text" value="{{ q }}">
|
||||||
<input name="tbm" value="{{ search_type }}" style="display: none">
|
<input name="tbm" value="{{ search_type }}" style="display: none">
|
||||||
<div class="sc"></div>
|
<div class="sc"></div>
|
||||||
|
@ -34,7 +37,10 @@
|
||||||
<div class="autocomplete" style="width: 100%; flex: 1">
|
<div class="autocomplete" style="width: 100%; flex: 1">
|
||||||
<div style="width: 100%; display: flex">
|
<div style="width: 100%; display: flex">
|
||||||
<input id="search-bar" autocapitalize="none" autocomplete="off" class="noHIxc" name="q"
|
<input id="search-bar" autocapitalize="none" autocomplete="off" class="noHIxc" name="q"
|
||||||
spellcheck="false" type="text" value="{{ q }}">
|
spellcheck="false" type="text" value="{{ q }}"
|
||||||
|
style="background-color: {{ '#000' if dark_mode else '#fff' }};
|
||||||
|
color: {{ '#685e79' if dark_mode else '#000' }};
|
||||||
|
border: {{ '1px solid #685e79' if dark_mode else '' }}">
|
||||||
<input name="tbm" value="{{ search_type }}" style="display: none">
|
<input name="tbm" value="{{ search_type }}" style="display: none">
|
||||||
<div class="sc"></div>
|
<div class="sc"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<script type="text/javascript" src="/static/js/controller.js"></script>
|
<script type="text/javascript" src="/static/js/controller.js"></script>
|
||||||
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Whoogle Search">
|
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Whoogle Search">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="/static/css/search.css">
|
<link rel="stylesheet" href="/static/css/{{ 'search-dark' if dark_mode else 'search' }}.css">
|
||||||
<link rel="stylesheet" href="/static/css/main.css">
|
<link rel="stylesheet" href="/static/css/main.css">
|
||||||
<title>Whoogle Search</title>
|
<title>Whoogle Search</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user