logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: a9b4f458e98ffcd5a2bce95fd95c28638a3a6b0f
parent 46dd502592f5ad09fab761c9311065b72ee3e55d
Author: Thomas Pointhuber <thomas.pointhuber@gmx.at>
Date:   Tue,  4 Nov 2014 14:32:53 +0100

Merge pull request #6 from pointhi/template_oscar

[enh] add no-js support

Diffstat:

Msearx/templates/oscar/base.html6++++++
Msearx/templates/oscar/preferences.html16++++++++++++----
Msearx/templates/oscar/result_templates/images.html2+-
3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html @@ -32,6 +32,12 @@ searx.method = "{{ method or 'POST' }}"; searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %}; </script> + <noscript> + <style type="text/css"> + .tab-content > .active_if_nojs {display: block;} + .hide_if_nojs {display: none !important;overflow:none !important;} + </style> + </noscript> </head> <body> <div class="container"> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html @@ -7,12 +7,15 @@ <form method="post" action="{{ url_for('preferences') }}" id="search_form"> <!-- Nav tabs --> - <ul class="nav nav-tabs" role="tablist" style="margin-bottom:20px;"> + <ul class="nav nav-tabs hide_if_nojs" role="tablist" style="margin-bottom:20px;"> <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li> <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li> </ul> <!-- Tab panes --> + <noscript> + <h3>{{ _('General') }}</h3> + </noscript> <div class="tab-content"> <div class="tab-pane active" id="tab_general"> <fieldset> @@ -83,20 +86,25 @@ </div> </fieldset> </div> - <div class="tab-pane" id="tab_engine"> + <div class="tab-pane active_if_nojs" id="tab_engine"> <!-- Nav tabs --> - <ul class="nav nav-tabs" role="tablist" style="margin-bottom:20px;"> + <ul class="nav nav-tabs hide_if_nojs" role="tablist" style="margin-bottom:20px;"> {% for (categ,search_engines) in categs %} <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li> {% endfor %} </ul> + <noscript> + <h3>{{ _('Engines') }}</h3> + </noscript> <!-- Tab panes --> <div class="tab-content"> {% for (categ,search_engines) in categs %} - <div class="tab-pane{% if loop.first %} active{% endif %}" id="tab_engine_{{ categ|replace(' ', '_') }}"> + <noscript><label>{{ _(categ) }}</label> + </noscript> + <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}"> <div class="container-fluid"> <fieldset> {% for search_engine in search_engines %} diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html @@ -1,4 +1,4 @@ -<a href="#" data-toggle="modal" data-target="#modal-{{ index }}"> +<a href="{{ result.img_src }}" data-toggle="modal" data-target="#modal-{{ index }}"> <img src="{{ result.img_src }}" alt="{{ result.title|e }}" class="img-thumbnail"> </a>