Merge remote-tracking branch 'origin/master' into heroku-app
This commit is contained in:
commit
22f9911e56
|
@ -31,9 +31,6 @@ class Filter:
|
||||||
|
|
||||||
def reskin(self, page):
|
def reskin(self, page):
|
||||||
# Aesthetic only re-skinning
|
# Aesthetic only re-skinning
|
||||||
page = page.replace('>G<', '>Wh<')
|
|
||||||
pattern = re.compile('4285f4|ea4335|fbcc05|34a853|fbbc05', re.IGNORECASE)
|
|
||||||
page = pattern.sub('685e79', page)
|
|
||||||
if self.dark:
|
if self.dark:
|
||||||
page = page.replace('fff', '000').replace('202124', 'ddd').replace('1967D2', '3b85ea')
|
page = page.replace('fff', '000').replace('202124', 'ddd').replace('1967D2', '3b85ea')
|
||||||
|
|
||||||
|
@ -56,6 +53,7 @@ class Filter:
|
||||||
self.fix_question_section()
|
self.fix_question_section()
|
||||||
self.update_styling(soup)
|
self.update_styling(soup)
|
||||||
|
|
||||||
|
|
||||||
for img in [_ for _ in soup.find_all('img') if 'src' in _.attrs]:
|
for img in [_ for _ in soup.find_all('img') if 'src' in _.attrs]:
|
||||||
self.update_element_src(img, 'image/png')
|
self.update_element_src(img, 'image/png')
|
||||||
|
|
||||||
|
@ -147,7 +145,9 @@ class Filter:
|
||||||
def update_link(self, link):
|
def update_link(self, link):
|
||||||
# Replace href with only the intended destination (no "utm" type tags)
|
# Replace href with only the intended destination (no "utm" type tags)
|
||||||
href = link['href'].replace('https://www.google.com', '')
|
href = link['href'].replace('https://www.google.com', '')
|
||||||
if '/advanced_search' in href:
|
if '/advanced_search' in href or 'tbm=shop' in href:
|
||||||
|
# TODO: The "Shopping" tab requires further filtering (see #136)
|
||||||
|
# Temporarily removing all links to that tab for now.
|
||||||
link.decompose()
|
link.decompose()
|
||||||
return
|
return
|
||||||
elif self.new_tab:
|
elif self.new_tab:
|
||||||
|
|
|
@ -2,7 +2,7 @@ class Config:
|
||||||
# Derived from here:
|
# Derived from here:
|
||||||
# https://sites.google.com/site/tomihasa/google-language-codes#searchlanguage
|
# https://sites.google.com/site/tomihasa/google-language-codes#searchlanguage
|
||||||
LANGUAGES = [
|
LANGUAGES = [
|
||||||
{'name': 'Default (use server location)', 'value': ''},
|
{'name': 'Default (none specified)', 'value': ''},
|
||||||
{'name': 'English', 'value': 'lang_en'},
|
{'name': 'English', 'value': 'lang_en'},
|
||||||
{'name': 'Afrikaans', 'value': 'lang_af'},
|
{'name': 'Afrikaans', 'value': 'lang_af'},
|
||||||
{'name': 'Arabic', 'value': 'lang_ar'},
|
{'name': 'Arabic', 'value': 'lang_ar'},
|
||||||
|
|
|
@ -59,7 +59,7 @@ def before_request_func():
|
||||||
|
|
||||||
if https_only and request.url.startswith('http://'):
|
if https_only and request.url.startswith('http://'):
|
||||||
return redirect(request.url.replace('http://', 'https://', 1), code=308)
|
return redirect(request.url.replace('http://', 'https://', 1), code=308)
|
||||||
|
|
||||||
g.user_config = Config(**session['config'])
|
g.user_config = Config(**session['config'])
|
||||||
|
|
||||||
if not g.user_config.url:
|
if not g.user_config.url:
|
||||||
|
|
|
@ -5,9 +5,7 @@
|
||||||
<a class="logo-link mobile-logo"
|
<a class="logo-link mobile-logo"
|
||||||
href="/"
|
href="/"
|
||||||
style="display:flex; justify-content:center; align-items:center; color:#685e79; font-size:18px; ">
|
style="display:flex; justify-content:center; align-items:center; color:#685e79; font-size:18px; ">
|
||||||
<span class="V6gwVd">Wh</span><span class="iWkuvd">o</span><span class="cDrQ7">o</span><span
|
<span style="color: #685e79">Whoogle</span>
|
||||||
class="V6gwVd">g</span><span class="ntlR9">l</span><span
|
|
||||||
class="iWkuvd tJ3Myc">e</span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="H0PQec" style="width: 100%;">
|
<div class="H0PQec" style="width: 100%;">
|
||||||
<div class="sbc esbc autocomplete">
|
<div class="sbc esbc autocomplete">
|
||||||
|
@ -27,9 +25,7 @@
|
||||||
<header>
|
<header>
|
||||||
<div class="logo-div">
|
<div class="logo-div">
|
||||||
<a class="logo-link" href="/">
|
<a class="logo-link" href="/">
|
||||||
<span class="V6gwVd logo-letter">Wh</span><span class="iWkuvd logo-letter">o</span><span
|
<span style="color: #685e79">Whoogle</span>
|
||||||
class="cDrQ7 logo-letter">o</span><span class="V6gwVd logo-letter">g</span><span
|
|
||||||
class="ntlR9 logo-letter">l</span><span class="iWkuvd tJ3Myc logo-letter">e</span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-div">
|
<div class="search-div">
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<form id="search-form" action="/search" method="{{ 'get' if config.get_only else 'post' }}">
|
<form id="search-form" action="/search" method="{{ 'get' if config.get_only else 'post' }}">
|
||||||
<div class="search-fields">
|
<div class="search-fields">
|
||||||
<div class="autocomplete">
|
<div class="autocomplete">
|
||||||
<input type="text" name="q" id="search-bar" autofocus="autofocus">
|
<input type="text" name="q" id="search-bar" autofocus="autofocus" autocomplete="off">
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" id="search-submit" value="Search">
|
<input type="submit" id="search-submit" value="Search">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user