Merge pull request #1954 from return42/csp-oscar-theme

[fix] oscar theme, remove inline style attributes (CSP compliants)
This commit is contained in:
Adam Tauber 2020-06-30 15:55:13 +02:00 committed by GitHub
commit 6163bd671b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 19 deletions

View File

@ -164,29 +164,29 @@ quiet_cmd_grunt = GRUNT $2
cmd_grunt = PATH="$$(npm bin):$$PATH" \ cmd_grunt = PATH="$$(npm bin):$$PATH" \
grunt --gruntfile "$2" grunt --gruntfile "$2"
themes.oscar: themes.oscar: node.env
$(Q)echo '[!] build oscar theme' $(Q)echo '[!] build oscar theme'
$(call cmd,grunt,searx/static/themes/oscar/gruntfile.js) $(call cmd,grunt,searx/static/themes/oscar/gruntfile.js)
themes.simple: themes.simple: node.env
$(Q)echo '[!] build simple theme' $(Q)echo '[!] build simple theme'
$(call cmd,grunt,searx/static/themes/simple/gruntfile.js) $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
themes.legacy: themes.legacy: node.env
$(Q)echo '[!] build legacy theme' $(Q)echo '[!] build legacy theme'
$(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css) $(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css)
$(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css) $(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css)
themes.courgette: themes.courgette: node.env
$(Q)echo '[!] build courgette theme' $(Q)echo '[!] build courgette theme'
$(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css) $(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css)
$(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css) $(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css)
themes.pixart: themes.pixart: node.env
$(Q)echo '[!] build pixart theme' $(Q)echo '[!] build pixart theme'
$(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css) $(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css)
themes.bootstrap: themes.bootstrap: node.env
$(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css) $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css)

View File

@ -763,3 +763,12 @@ code {
.table > tbody > tr > th { .table > tbody > tr > th {
vertical-align: middle !important; vertical-align: middle !important;
} }
.nav-tabs.nav-justified {
margin-bottom: 20px;
}
p {
margin: 10px 0;
}
input.cursor-text {
margin: 10px 0;
}

View File

@ -736,6 +736,15 @@ code {
.table > tbody > tr > th { .table > tbody > tr > th {
vertical-align: middle !important; vertical-align: middle !important;
} }
.nav-tabs.nav-justified {
margin-bottom: 20px;
}
p {
margin: 10px 0;
}
input.cursor-text {
margin: 10px 0;
}
/*Global*/ /*Global*/
body { body {
background: #1d1f21 none !important; background: #1d1f21 none !important;

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,15 @@
.table > tbody > tr > td, .table > tbody > tr > th { .table > tbody > tr > td, .table > tbody > tr > th {
vertical-align: middle !important; vertical-align: middle !important;
} }
.nav-tabs.nav-justified{
margin-bottom: 20px;
}
p {
margin: 10px 0;
}
input.cursor-text {
margin: 10px 0;
}

View File

@ -9,7 +9,7 @@
<form method="post" action="{{ url_for('preferences') }}" id="search_form"> <form method="post" action="{{ url_for('preferences') }}" id="search_form">
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;"> <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
<li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li> <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> <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
<li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li> <li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li>
@ -143,7 +143,7 @@
<div class="tab-pane active_if_nojs" id="tab_engine"> <div class="tab-pane active_if_nojs" id="tab_engine">
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;"> <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
{% for categ in all_categories %} {% for categ in all_categories %}
<li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li> <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
{% endfor %} {% endfor %}
@ -259,7 +259,7 @@
<noscript> <noscript>
<h3>{{ _('Answerers') }}</h3> <h3>{{ _('Answerers') }}</h3>
</noscript> </noscript>
<p class="text-muted" style="margin:20px 0;"> <p class="text-muted">
{{ _('This is the list of searx\'s instant answering modules.') }} {{ _('This is the list of searx\'s instant answering modules.') }}
</p> </p>
<table class="table table-striped"> <table class="table table-striped">
@ -286,20 +286,20 @@
<noscript> <noscript>
<h3>{{ _('Cookies') }}</h3> <h3>{{ _('Cookies') }}</h3>
</noscript> </noscript>
<p class="text-muted" style="margin:20px 0;"> <p class="text-muted">
{{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br /> {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
{{ _('With that list, you can assess searx transparency.') }}<br /> {{ _('With that list, you can assess searx transparency.') }}<br />
</p> </p>
{% if cookies %} {% if cookies %}
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th class="text-muted{% if rtl %} text-right{% endif %}" style="padding-right:40px;">{{ _('Cookie name') }}</th> <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Cookie name') }}</th>
<th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Value') }}</th> <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Value') }}</th>
</tr> </tr>
{% for cookie in cookies %} {% for cookie in cookies %}
<tr> <tr>
<td class="text-muted" style="padding-right:40px;">{{ cookie }}</td> <td class="text-muted">{{ cookie }}</td>
<td class="text-muted">{{ cookies[cookie] }}</td> <td class="text-muted">{{ cookies[cookie] }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -309,17 +309,23 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
<br /> <p class="text-muted">
{{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} {{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
</p> {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
<p style="margin:20px 0;">{{ _('Search URL of the currently saved preferences') }} <small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:<br/>
<input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}">
</p> </p>
<input type="submit" class="btn btn-primary" value="{{ _('save') }}" /> <p>
{{ _('Search URL of the currently saved preferences') }}
<small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:
</p>
<div class="tab-pane">
<input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}">
<input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
<a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a> <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
<a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a> <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
</div>
</form> </form>
</div> </div>
{% endblock %} {% endblock %}