themes: remove CR from newlines

Adding a CR in  some files and in others not,  is  a good starting point for a
DOS+Unix mess we all have already seen in many projects.

Patch fixes all files matching (even those comming from grunt's build)::

   find ./searx -exec file {} \; | grep CR

BTW: Same with mixing TAB and SPACE indent styles in one and the same file.  So
if sources are tuched here in this patch, its also fixed.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2019-12-08 14:14:18 +01:00
parent 1bb46e5e37
commit 56b7e05721
15 changed files with 1744 additions and 1744 deletions

View File

@ -1,61 +1,61 @@
/* /*
* searx, A privacy-respecting, hackable metasearch engine * searx, A privacy-respecting, hackable metasearch engine
*/ */
ul { ul {
&.autocompleter-choices { &.autocompleter-choices {
position: absolute; position: absolute;
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
border: 1px solid @color-autocompleter-choices-border; border: 1px solid @color-autocompleter-choices-border;
border-left-color: @color-autocompleter-choices-border-left-right; border-left-color: @color-autocompleter-choices-border-left-right;
border-right-color: @color-autocompleter-choices-border-left-right; border-right-color: @color-autocompleter-choices-border-left-right;
border-bottom-color: @color-autocompleter-choices-border-bottom; border-bottom-color: @color-autocompleter-choices-border-bottom;
text-align: left; text-align: left;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
z-index: 50; z-index: 50;
background-color: @color-autocompleter-choices-background; background-color: @color-autocompleter-choices-background;
color: @color-autocompleter-choices-font; color: @color-autocompleter-choices-font;
li { li {
position: relative; position: relative;
margin: -2px 0 0 0; margin: -2px 0 0 0;
padding: 0.2em 1.5em 0.2em 1em; padding: 0.2em 1.5em 0.2em 1em;
display: block; display: block;
float: none !important; float: none !important;
cursor: pointer; cursor: pointer;
font-weight: normal; font-weight: normal;
white-space: nowrap; white-space: nowrap;
font-size: 1em; font-size: 1em;
line-height: 1.5em; line-height: 1.5em;
&.autocompleter-selected { &.autocompleter-selected {
background-color: @color-autocompleter-selected-background; background-color: @color-autocompleter-selected-background;
color: @color-autocompleter-selected-font; color: @color-autocompleter-selected-font;
span.autocompleter-queried { span.autocompleter-queried {
color: @color-autocompleter-selected-queried-font; color: @color-autocompleter-selected-queried-font;
} }
} }
} }
span.autocompleter-queried { span.autocompleter-queried {
display: inline; display: inline;
float: none; float: none;
font-weight: bold; font-weight: bold;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
} }
} }
/*.autocompleter-loading { /*.autocompleter-loading {
//background-image: url(images/spinner.gif); //background-image: url(images/spinner.gif);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right 50%; background-position: right 50%;
}*/ }*/
/*textarea.autocompleter-loading { /*textarea.autocompleter-loading {
background-position: right bottom; background-position: right bottom;
}*/ }*/

View File

@ -1,26 +1,26 @@
/** /**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
requirejs.config({ requirejs.config({
baseUrl: './static/themes/oscar/js', baseUrl: './static/themes/oscar/js',
paths: { paths: {
app: '../app' app: '../app'
} }
}); });
;/** ;/**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
@ -51,306 +51,306 @@ window.searx = (function(d) {
method: script.getAttribute('data-method') method: script.getAttribute('data-method')
}; };
})(document); })(document);
;/** ;/**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
if(searx.autocompleter) { if(searx.autocompleter) {
searx.searchResults = new Bloodhound({ searx.searchResults = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: './autocompleter?q=%QUERY' remote: './autocompleter?q=%QUERY'
}); });
searx.searchResults.initialize(); searx.searchResults.initialize();
} }
$(document).ready(function(){ $(document).ready(function(){
if(searx.autocompleter) { if(searx.autocompleter) {
$('#q').typeahead(null, { $('#q').typeahead(null, {
name: 'search-results', name: 'search-results',
displayKey: function(result) { displayKey: function(result) {
return result; return result;
}, },
source: searx.searchResults.ttAdapter() source: searx.searchResults.ttAdapter()
}); });
} }
}); });
;/** ;/**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
$(document).ready(function(){ $(document).ready(function(){
/** /**
* focus element if class="autofocus" and id="q" * focus element if class="autofocus" and id="q"
*/ */
$('#q.autofocus').focus(); $('#q.autofocus').focus();
/** /**
* select full content on click if class="select-all-on-click" * select full content on click if class="select-all-on-click"
*/ */
$(".select-all-on-click").click(function () { $(".select-all-on-click").click(function () {
$(this).select(); $(this).select();
}); });
/** /**
* change text during btn-collapse click if possible * change text during btn-collapse click if possible
*/ */
$('.btn-collapse').click(function() { $('.btn-collapse').click(function() {
var btnTextCollapsed = $(this).data('btn-text-collapsed'); var btnTextCollapsed = $(this).data('btn-text-collapsed');
var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed'); var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed');
if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') { if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') {
if($(this).hasClass('collapsed')) { if($(this).hasClass('collapsed')) {
new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed); new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed);
} else { } else {
new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed); new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed);
} }
$(this).html(new_html); $(this).html(new_html);
} }
}); });
/** /**
* change text during btn-toggle click if possible * change text during btn-toggle click if possible
*/ */
$('.btn-toggle .btn').click(function() { $('.btn-toggle .btn').click(function() {
var btnClass = 'btn-' + $(this).data('btn-class'); var btnClass = 'btn-' + $(this).data('btn-class');
var btnLabelDefault = $(this).data('btn-label-default'); var btnLabelDefault = $(this).data('btn-label-default');
var btnLabelToggled = $(this).data('btn-label-toggled'); var btnLabelToggled = $(this).data('btn-label-toggled');
if(btnLabelToggled !== '') { if(btnLabelToggled !== '') {
if($(this).hasClass('btn-default')) { if($(this).hasClass('btn-default')) {
new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled); new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled);
} else { } else {
new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault); new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault);
} }
$(this).html(new_html); $(this).html(new_html);
} }
$(this).toggleClass(btnClass); $(this).toggleClass(btnClass);
$(this).toggleClass('btn-default'); $(this).toggleClass('btn-default');
}); });
/** /**
* change text during btn-toggle click if possible * change text during btn-toggle click if possible
*/ */
$('.media-loader').click(function() { $('.media-loader').click(function() {
var target = $(this).data('target'); var target = $(this).data('target');
var iframe_load = $(target + ' > iframe'); var iframe_load = $(target + ' > iframe');
var srctest = iframe_load.attr('src'); var srctest = iframe_load.attr('src');
if(srctest === undefined || srctest === false){ if(srctest === undefined || srctest === false){
iframe_load.attr('src', iframe_load.data('src')); iframe_load.attr('src', iframe_load.data('src'));
} }
}); });
/** /**
* Select or deselect every categories on double clic * Select or deselect every categories on double clic
*/ */
$(".btn-sm").dblclick(function() { $(".btn-sm").dblclick(function() {
var btnClass = 'btn-' + $(this).data('btn-class'); // primary var btnClass = 'btn-' + $(this).data('btn-class'); // primary
if($(this).hasClass('btn-default')) { if($(this).hasClass('btn-default')) {
$(".btn-sm > input").attr('checked', 'checked'); $(".btn-sm > input").attr('checked', 'checked');
$(".btn-sm > input").prop("checked", true); $(".btn-sm > input").prop("checked", true);
$(".btn-sm").addClass(btnClass); $(".btn-sm").addClass(btnClass);
$(".btn-sm").addClass('active'); $(".btn-sm").addClass('active');
$(".btn-sm").removeClass('btn-default'); $(".btn-sm").removeClass('btn-default');
} else { } else {
$(".btn-sm > input").attr('checked', ''); $(".btn-sm > input").attr('checked', '');
$(".btn-sm > input").removeAttr('checked'); $(".btn-sm > input").removeAttr('checked');
$(".btn-sm > input").checked = false; $(".btn-sm > input").checked = false;
$(".btn-sm").removeClass(btnClass); $(".btn-sm").removeClass(btnClass);
$(".btn-sm").removeClass('active'); $(".btn-sm").removeClass('active');
$(".btn-sm").addClass('btn-default'); $(".btn-sm").addClass('btn-default');
} }
}); });
}); });
;/** ;/**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
$(document).ready(function(){ $(document).ready(function(){
$(".searx_overpass_request").on( "click", function( event ) { $(".searx_overpass_request").on( "click", function( event ) {
var overpass_url = "https://overpass-api.de/api/interpreter?data="; var overpass_url = "https://overpass-api.de/api/interpreter?data=";
var query_start = overpass_url + "[out:json][timeout:25];("; var query_start = overpass_url + "[out:json][timeout:25];(";
var query_end = ");out meta;"; var query_end = ");out meta;";
var osm_id = $(this).data('osm-id'); var osm_id = $(this).data('osm-id');
var osm_type = $(this).data('osm-type'); var osm_type = $(this).data('osm-type');
var result_table = $(this).data('result-table'); var result_table = $(this).data('result-table');
var result_table_loadicon = "#" + $(this).data('result-table-loadicon'); var result_table_loadicon = "#" + $(this).data('result-table-loadicon');
// tags which can be ignored // tags which can be ignored
var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ]; var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ];
if(osm_id && osm_type && result_table) { if(osm_id && osm_type && result_table) {
result_table = "#" + result_table; result_table = "#" + result_table;
var query = null; var query = null;
switch(osm_type) { switch(osm_type) {
case 'node': case 'node':
query = query_start + "node(" + osm_id + ");" + query_end; query = query_start + "node(" + osm_id + ");" + query_end;
break; break;
case 'way': case 'way':
query = query_start + "way(" + osm_id + ");" + query_end; query = query_start + "way(" + osm_id + ");" + query_end;
break; break;
case 'relation': case 'relation':
query = query_start + "relation(" + osm_id + ");" + query_end; query = query_start + "relation(" + osm_id + ");" + query_end;
break; break;
default: default:
break; break;
} }
if(query) { if(query) {
//alert(query); //alert(query);
var ajaxRequest = $.ajax( query ) var ajaxRequest = $.ajax( query )
.done(function( html) { .done(function( html) {
if(html && html.elements && html.elements[0]) { if(html && html.elements && html.elements[0]) {
var element = html.elements[0]; var element = html.elements[0];
var newHtml = $(result_table).html(); var newHtml = $(result_table).html();
for (var row in element.tags) { for (var row in element.tags) {
if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) { if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
newHtml += "<tr><td>" + row + "</td><td>"; newHtml += "<tr><td>" + row + "</td><td>";
switch(row) { switch(row) {
case "phone": case "phone":
case "fax": case "fax":
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
break; break;
case "email": case "email":
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "website": case "website":
case "url": case "url":
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "wikidata": case "wikidata":
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "wikipedia": case "wikipedia":
if(element.tags[row].indexOf(":") != -1) { if(element.tags[row].indexOf(":") != -1) {
newHtml += "<a href=\"https://" + element.tags[row].substring(0,element.tags[row].indexOf(":")) + ".wikipedia.org/wiki/" + element.tags[row].substring(element.tags[row].indexOf(":")+1) + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"https://" + element.tags[row].substring(0,element.tags[row].indexOf(":")) + ".wikipedia.org/wiki/" + element.tags[row].substring(element.tags[row].indexOf(":")+1) + "\">" + element.tags[row] + "</a>";
break; break;
} }
/* jshint ignore:start */ /* jshint ignore:start */
default: default:
/* jshint ignore:end */ /* jshint ignore:end */
newHtml += element.tags[row]; newHtml += element.tags[row];
break; break;
} }
newHtml += "</td></tr>"; newHtml += "</td></tr>";
} }
} }
$(result_table).html(newHtml); $(result_table).html(newHtml);
$(result_table).removeClass('hidden'); $(result_table).removeClass('hidden');
$(result_table_loadicon).addClass('hidden'); $(result_table_loadicon).addClass('hidden');
} }
}) })
.fail(function() { .fail(function() {
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>"); $(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>");
}); });
} }
} }
// this event occour only once per element // this event occour only once per element
$( this ).off( event ); $( this ).off( event );
}); });
$(".searx_init_map").on( "click", function( event ) { $(".searx_init_map").on( "click", function( event ) {
var leaflet_target = $(this).data('leaflet-target'); var leaflet_target = $(this).data('leaflet-target');
var map_lon = $(this).data('map-lon'); var map_lon = $(this).data('map-lon');
var map_lat = $(this).data('map-lat'); var map_lat = $(this).data('map-lat');
var map_zoom = $(this).data('map-zoom'); var map_zoom = $(this).data('map-zoom');
var map_boundingbox = $(this).data('map-boundingbox'); var map_boundingbox = $(this).data('map-boundingbox');
var map_geojson = $(this).data('map-geojson'); var map_geojson = $(this).data('map-geojson');
require(['leaflet-0.7.3.min'], function(leaflet) { require(['leaflet-0.7.3.min'], function(leaflet) {
if(map_boundingbox) { if(map_boundingbox) {
southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]); southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]); northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
map_bounds = L.latLngBounds(southWest, northEast); map_bounds = L.latLngBounds(southWest, northEast);
} }
// TODO hack // TODO hack
// change default imagePath // change default imagePath
L.Icon.Default.imagePath = "./static/themes/oscar/img/map"; L.Icon.Default.imagePath = "./static/themes/oscar/img/map";
// init map // init map
var map = L.map(leaflet_target); var map = L.map(leaflet_target);
// create the tile layer with correct attribution // create the tile layer with correct attribution
var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmMapnikAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'; var osmMapnikAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib}); var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib});
var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'; var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'; var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib}); var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
// init map view // init map view
if(map_bounds) { if(map_bounds) {
// TODO hack: https://github.com/Leaflet/Leaflet/issues/2021 // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
setTimeout(function () { setTimeout(function () {
map.fitBounds(map_bounds, { map.fitBounds(map_bounds, {
maxZoom:17 maxZoom:17
}); });
}, 0); }, 0);
} else if (map_lon && map_lat) { } else if (map_lon && map_lat) {
if(map_zoom) if(map_zoom)
map.setView(new L.LatLng(map_lat, map_lon),map_zoom); map.setView(new L.LatLng(map_lat, map_lon),map_zoom);
else else
map.setView(new L.LatLng(map_lat, map_lon),8); map.setView(new L.LatLng(map_lat, map_lon),8);
} }
map.addLayer(osmMapnik); map.addLayer(osmMapnik);
var baseLayers = { var baseLayers = {
"OSM Mapnik": osmMapnik/*, "OSM Mapnik": osmMapnik/*,
"OSM Wikimedia": osmWikimedia*/ "OSM Wikimedia": osmWikimedia*/
}; };
L.control.layers(baseLayers).addTo(map); L.control.layers(baseLayers).addTo(map);
if(map_geojson) if(map_geojson)
L.geoJson(map_geojson).addTo(map); L.geoJson(map_geojson).addTo(map);
/*else if(map_bounds) /*else if(map_bounds)
L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/ L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/
}); });
// this event occour only once per element // this event occour only once per element
$( this ).off( event ); $( this ).off( event );
}); });
}); });

View File

@ -1,23 +1,23 @@
/** /**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
requirejs.config({ requirejs.config({
baseUrl: './static/themes/oscar/js', baseUrl: './static/themes/oscar/js',
paths: { paths: {
app: '../app' app: '../app'
} }
}); });

View File

@ -1,37 +1,37 @@
/** /**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
if(searx.autocompleter) { if(searx.autocompleter) {
searx.searchResults = new Bloodhound({ searx.searchResults = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: './autocompleter?q=%QUERY' remote: './autocompleter?q=%QUERY'
}); });
searx.searchResults.initialize(); searx.searchResults.initialize();
} }
$(document).ready(function(){ $(document).ready(function(){
if(searx.autocompleter) { if(searx.autocompleter) {
$('#q').typeahead(null, { $('#q').typeahead(null, {
name: 'search-results', name: 'search-results',
displayKey: function(result) { displayKey: function(result) {
return result; return result;
}, },
source: searx.searchResults.ttAdapter() source: searx.searchResults.ttAdapter()
}); });
} }
}); });

View File

@ -1,99 +1,99 @@
/** /**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
$(document).ready(function(){ $(document).ready(function(){
/** /**
* focus element if class="autofocus" and id="q" * focus element if class="autofocus" and id="q"
*/ */
$('#q.autofocus').focus(); $('#q.autofocus').focus();
/** /**
* select full content on click if class="select-all-on-click" * select full content on click if class="select-all-on-click"
*/ */
$(".select-all-on-click").click(function () { $(".select-all-on-click").click(function () {
$(this).select(); $(this).select();
}); });
/** /**
* change text during btn-collapse click if possible * change text during btn-collapse click if possible
*/ */
$('.btn-collapse').click(function() { $('.btn-collapse').click(function() {
var btnTextCollapsed = $(this).data('btn-text-collapsed'); var btnTextCollapsed = $(this).data('btn-text-collapsed');
var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed'); var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed');
if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') { if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') {
if($(this).hasClass('collapsed')) { if($(this).hasClass('collapsed')) {
new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed); new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed);
} else { } else {
new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed); new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed);
} }
$(this).html(new_html); $(this).html(new_html);
} }
}); });
/** /**
* change text during btn-toggle click if possible * change text during btn-toggle click if possible
*/ */
$('.btn-toggle .btn').click(function() { $('.btn-toggle .btn').click(function() {
var btnClass = 'btn-' + $(this).data('btn-class'); var btnClass = 'btn-' + $(this).data('btn-class');
var btnLabelDefault = $(this).data('btn-label-default'); var btnLabelDefault = $(this).data('btn-label-default');
var btnLabelToggled = $(this).data('btn-label-toggled'); var btnLabelToggled = $(this).data('btn-label-toggled');
if(btnLabelToggled !== '') { if(btnLabelToggled !== '') {
if($(this).hasClass('btn-default')) { if($(this).hasClass('btn-default')) {
new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled); new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled);
} else { } else {
new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault); new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault);
} }
$(this).html(new_html); $(this).html(new_html);
} }
$(this).toggleClass(btnClass); $(this).toggleClass(btnClass);
$(this).toggleClass('btn-default'); $(this).toggleClass('btn-default');
}); });
/** /**
* change text during btn-toggle click if possible * change text during btn-toggle click if possible
*/ */
$('.media-loader').click(function() { $('.media-loader').click(function() {
var target = $(this).data('target'); var target = $(this).data('target');
var iframe_load = $(target + ' > iframe'); var iframe_load = $(target + ' > iframe');
var srctest = iframe_load.attr('src'); var srctest = iframe_load.attr('src');
if(srctest === undefined || srctest === false){ if(srctest === undefined || srctest === false){
iframe_load.attr('src', iframe_load.data('src')); iframe_load.attr('src', iframe_load.data('src'));
} }
}); });
/** /**
* Select or deselect every categories on double clic * Select or deselect every categories on double clic
*/ */
$(".btn-sm").dblclick(function() { $(".btn-sm").dblclick(function() {
var btnClass = 'btn-' + $(this).data('btn-class'); // primary var btnClass = 'btn-' + $(this).data('btn-class'); // primary
if($(this).hasClass('btn-default')) { if($(this).hasClass('btn-default')) {
$(".btn-sm > input").attr('checked', 'checked'); $(".btn-sm > input").attr('checked', 'checked');
$(".btn-sm > input").prop("checked", true); $(".btn-sm > input").prop("checked", true);
$(".btn-sm").addClass(btnClass); $(".btn-sm").addClass(btnClass);
$(".btn-sm").addClass('active'); $(".btn-sm").addClass('active');
$(".btn-sm").removeClass('btn-default'); $(".btn-sm").removeClass('btn-default');
} else { } else {
$(".btn-sm > input").attr('checked', ''); $(".btn-sm > input").attr('checked', '');
$(".btn-sm > input").removeAttr('checked'); $(".btn-sm > input").removeAttr('checked');
$(".btn-sm > input").checked = false; $(".btn-sm > input").checked = false;
$(".btn-sm").removeClass(btnClass); $(".btn-sm").removeClass(btnClass);
$(".btn-sm").removeClass('active'); $(".btn-sm").removeClass('active');
$(".btn-sm").addClass('btn-default'); $(".btn-sm").addClass('btn-default');
} }
}); });
}); });

View File

@ -1,167 +1,167 @@
/** /**
* searx is free software: you can redistribute it and/or modify * searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* searx is distributed in the hope that it will be useful, * searx is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with searx. If not, see < http://www.gnu.org/licenses/ >. * along with searx. If not, see < http://www.gnu.org/licenses/ >.
* *
* (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at> * (C) 2014 by Thomas Pointhuber, <thomas.pointhuber@gmx.at>
*/ */
$(document).ready(function(){ $(document).ready(function(){
$(".searx_overpass_request").on( "click", function( event ) { $(".searx_overpass_request").on( "click", function( event ) {
var overpass_url = "https://overpass-api.de/api/interpreter?data="; var overpass_url = "https://overpass-api.de/api/interpreter?data=";
var query_start = overpass_url + "[out:json][timeout:25];("; var query_start = overpass_url + "[out:json][timeout:25];(";
var query_end = ");out meta;"; var query_end = ");out meta;";
var osm_id = $(this).data('osm-id'); var osm_id = $(this).data('osm-id');
var osm_type = $(this).data('osm-type'); var osm_type = $(this).data('osm-type');
var result_table = $(this).data('result-table'); var result_table = $(this).data('result-table');
var result_table_loadicon = "#" + $(this).data('result-table-loadicon'); var result_table_loadicon = "#" + $(this).data('result-table-loadicon');
// tags which can be ignored // tags which can be ignored
var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ]; var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ];
if(osm_id && osm_type && result_table) { if(osm_id && osm_type && result_table) {
result_table = "#" + result_table; result_table = "#" + result_table;
var query = null; var query = null;
switch(osm_type) { switch(osm_type) {
case 'node': case 'node':
query = query_start + "node(" + osm_id + ");" + query_end; query = query_start + "node(" + osm_id + ");" + query_end;
break; break;
case 'way': case 'way':
query = query_start + "way(" + osm_id + ");" + query_end; query = query_start + "way(" + osm_id + ");" + query_end;
break; break;
case 'relation': case 'relation':
query = query_start + "relation(" + osm_id + ");" + query_end; query = query_start + "relation(" + osm_id + ");" + query_end;
break; break;
default: default:
break; break;
} }
if(query) { if(query) {
//alert(query); //alert(query);
var ajaxRequest = $.ajax( query ) var ajaxRequest = $.ajax( query )
.done(function( html) { .done(function( html) {
if(html && html.elements && html.elements[0]) { if(html && html.elements && html.elements[0]) {
var element = html.elements[0]; var element = html.elements[0];
var newHtml = $(result_table).html(); var newHtml = $(result_table).html();
for (var row in element.tags) { for (var row in element.tags) {
if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) { if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
newHtml += "<tr><td>" + row + "</td><td>"; newHtml += "<tr><td>" + row + "</td><td>";
switch(row) { switch(row) {
case "phone": case "phone":
case "fax": case "fax":
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
break; break;
case "email": case "email":
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "website": case "website":
case "url": case "url":
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "wikidata": case "wikidata":
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
break; break;
case "wikipedia": case "wikipedia":
if(element.tags[row].indexOf(":") != -1) { if(element.tags[row].indexOf(":") != -1) {
newHtml += "<a href=\"https://" + element.tags[row].substring(0,element.tags[row].indexOf(":")) + ".wikipedia.org/wiki/" + element.tags[row].substring(element.tags[row].indexOf(":")+1) + "\">" + element.tags[row] + "</a>"; newHtml += "<a href=\"https://" + element.tags[row].substring(0,element.tags[row].indexOf(":")) + ".wikipedia.org/wiki/" + element.tags[row].substring(element.tags[row].indexOf(":")+1) + "\">" + element.tags[row] + "</a>";
break; break;
} }
/* jshint ignore:start */ /* jshint ignore:start */
default: default:
/* jshint ignore:end */ /* jshint ignore:end */
newHtml += element.tags[row]; newHtml += element.tags[row];
break; break;
} }
newHtml += "</td></tr>"; newHtml += "</td></tr>";
} }
} }
$(result_table).html(newHtml); $(result_table).html(newHtml);
$(result_table).removeClass('hidden'); $(result_table).removeClass('hidden');
$(result_table_loadicon).addClass('hidden'); $(result_table_loadicon).addClass('hidden');
} }
}) })
.fail(function() { .fail(function() {
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>"); $(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>");
}); });
} }
} }
// this event occour only once per element // this event occour only once per element
$( this ).off( event ); $( this ).off( event );
}); });
$(".searx_init_map").on( "click", function( event ) { $(".searx_init_map").on( "click", function( event ) {
var leaflet_target = $(this).data('leaflet-target'); var leaflet_target = $(this).data('leaflet-target');
var map_lon = $(this).data('map-lon'); var map_lon = $(this).data('map-lon');
var map_lat = $(this).data('map-lat'); var map_lat = $(this).data('map-lat');
var map_zoom = $(this).data('map-zoom'); var map_zoom = $(this).data('map-zoom');
var map_boundingbox = $(this).data('map-boundingbox'); var map_boundingbox = $(this).data('map-boundingbox');
var map_geojson = $(this).data('map-geojson'); var map_geojson = $(this).data('map-geojson');
require(['leaflet-0.7.3.min'], function(leaflet) { require(['leaflet-0.7.3.min'], function(leaflet) {
if(map_boundingbox) { if(map_boundingbox) {
southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]); southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]); northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
map_bounds = L.latLngBounds(southWest, northEast); map_bounds = L.latLngBounds(southWest, northEast);
} }
// TODO hack // TODO hack
// change default imagePath // change default imagePath
L.Icon.Default.imagePath = "./static/themes/oscar/img/map"; L.Icon.Default.imagePath = "./static/themes/oscar/img/map";
// init map // init map
var map = L.map(leaflet_target); var map = L.map(leaflet_target);
// create the tile layer with correct attribution // create the tile layer with correct attribution
var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmMapnikAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'; var osmMapnikAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib}); var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib});
var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'; var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'; var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib}); var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
// init map view // init map view
if(map_bounds) { if(map_bounds) {
// TODO hack: https://github.com/Leaflet/Leaflet/issues/2021 // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
setTimeout(function () { setTimeout(function () {
map.fitBounds(map_bounds, { map.fitBounds(map_bounds, {
maxZoom:17 maxZoom:17
}); });
}, 0); }, 0);
} else if (map_lon && map_lat) { } else if (map_lon && map_lat) {
if(map_zoom) if(map_zoom)
map.setView(new L.LatLng(map_lat, map_lon),map_zoom); map.setView(new L.LatLng(map_lat, map_lon),map_zoom);
else else
map.setView(new L.LatLng(map_lat, map_lon),8); map.setView(new L.LatLng(map_lat, map_lon),8);
} }
map.addLayer(osmMapnik); map.addLayer(osmMapnik);
var baseLayers = { var baseLayers = {
"OSM Mapnik": osmMapnik/*, "OSM Mapnik": osmMapnik/*,
"OSM Wikimedia": osmWikimedia*/ "OSM Wikimedia": osmWikimedia*/
}; };
L.control.layers(baseLayers).addTo(map); L.control.layers(baseLayers).addTo(map);
if(map_geojson) if(map_geojson)
L.geoJson(map_geojson).addTo(map); L.geoJson(map_geojson).addTo(map);
/*else if(map_bounds) /*else if(map_bounds)
L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/ L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/
}); });
// this event occour only once per element // this event occour only once per element
$( this ).off( event ); $( this ).off( event );
}); });
}); });

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,18 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
{{ result_header(result, favicons) }} {{ result_header(result, favicons) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %} {% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %} {% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %}
<div dir="ltr"> <div dir="ltr">
{{ result.codelines|code_highlighter(result.code_language)|safe }} {{ result.codelines|code_highlighter(result.code_language)|safe }}
</div> </div>
{% if rtl %} {% if rtl %}
{{ result_footer_rtl(result) }} {{ result_footer_rtl(result) }}
{% else %} {% else %}
{{ result_footer(result) }} {{ result_footer(result) }}
{% endif %} {% endif %}

View File

@ -1,31 +1,31 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %} {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
{{ result_header(result, favicons) }} {{ result_header(result, favicons) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if result.embedded %} {% if result.embedded %}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small> <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>
{% endif %} {% endif %}
{% if result.embedded %} {% if result.embedded %}
<div id="result-media-{{ index }}" class="collapse"> <div id="result-media-{{ index }}" class="collapse">
{{ result.embedded|safe }} {{ result.embedded|safe }}
</div> </div>
{% endif %} {% endif %}
{% if result.img_src %} {% if result.img_src %}
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content"> <img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
{% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %} {% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %}
</div> </div>
</div> </div>
{% else %} {% else %}
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %} {% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
{% endif %} {% endif %}
{% if rtl %} {% if rtl %}
{{ result_footer_rtl(result) }} {{ result_footer_rtl(result) }}
{% else %} {% else %}
{{ result_footer(result) }} {{ result_footer(result) }}
{% endif %} {% endif %}

View File

@ -1,49 +1,49 @@
{% from 'oscar/macros.html' import draw_favicon %} {% from 'oscar/macros.html' import draw_favicon %}
<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}"> <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}">
<img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail"> <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">
</a> </a>
<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-wrapper"> <div class="modal-wrapper">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4> <h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}"> <img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}">
{% if result.author %}<span class="photo-author">{{ result.author }}</span><br />{% endif %} {% if result.author %}<span class="photo-author">{{ result.author }}</span><br />{% endif %}
{% if result.content %} {% if result.content %}
<p class="result-content"> <p class="result-content">
{{ result.content|striptags }} {{ result.content|striptags }}
</p> </p>
{% endif %} {% endif %}
{% if result.img_format %} {% if result.img_format %}
<p class="result-format"> <p class="result-format">
{{ result.img_format }} {{ result.img_format }}
</p> </p>
{% endif %} {% endif %}
{% if result.source %} {% if result.source %}
<p class="result-source"> <p class="result-source">
{{ result.source }} {{ result.source }}
</p> </p>
{% endif %} {% endif %}
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="clearfix"></div> <div class="clearfix"></div>
<span class="label label-default pull-right">{{ result.engine }}</span> <span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted pull-left">{{ result.pretty_url }}</p> <p class="text-muted pull-left">{{ result.pretty_url }}</p>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('Get image') }}</a> <a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('Get image') }}</a>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('View source') }}</a> <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} class="btn btn-default">{{ _('View source') }}</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,72 +1,72 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
{{ result_header(result, favicons) }} {{ result_header(result, favicons) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if (result.latitude and result.longitude) or result.boundingbox %} {% if (result.latitude and result.longitude) or result.boundingbox %}
<small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small> <small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
{% endif %} {% endif %}
{% if result.osm and (result.osm.type and result.osm.id) %} {% if result.osm and (result.osm.type and result.osm.id) %}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request disabled_if_nojs" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small> <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request disabled_if_nojs" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small>
{% endif %} {% endif %}
{# {% if (result.latitude and result.longitude) %} {# {% if (result.latitude and result.longitude) %}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small> <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small>
{% endif %} #} {% endif %} #}
<div class="container-fluid"> <div class="container-fluid">
{% if result.address %} {% if result.address %}
<p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress"> <p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress">
{% if result.address.name %} {% if result.address.name %}
<strong itemprop="name">{{ result.address.name }}</strong><br/> <strong itemprop="name">{{ result.address.name }}</strong><br/>
{% endif %} {% endif %}
{% if result.address.road %} {% if result.address.road %}
<span itemprop="streetAddress"> <span itemprop="streetAddress">
{% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
{{ result.address.road }} {{ result.address.road }}
</span><br/> </span><br/>
{% endif %} {% endif %}
{% if result.address.locality %} {% if result.address.locality %}
<span itemprop="addressLocality">{{ result.address.locality }}</span> <span itemprop="addressLocality">{{ result.address.locality }}</span>
{% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %} {% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
<br/> <br/>
{% endif %} {% endif %}
{% if result.address.country %} {% if result.address.country %}
<span itemprop="addressCountry">{{ result.address.country }}</span> <span itemprop="addressCountry">{{ result.address.country }}</span>
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}
{% if result.osm and (result.osm.type and result.osm.id) %} {% if result.osm and (result.osm.type and result.osm.id) %}
<div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}> <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}>
<div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div> <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
<table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}"> <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
<tr><th>key</th><th>value</th></tr> <tr><th>key</th><th>value</th></tr>
</table> </table>
</div> </div>
{% endif %} {% endif %}
{# {% if (result.latitude and result.longitude) %} {# {% if (result.latitude and result.longitude) %}
<div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}"> <div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
<strong>Longitude:</strong> {{ result.longitude }} <br/> <strong>Longitude:</strong> {{ result.longitude }} <br/>
<strong>Latitude:</strong> {{ result.latitude }} <strong>Latitude:</strong> {{ result.latitude }}
</div> </div>
{% endif %} #} {% endif %} #}
{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %} {% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
</div> </div>
{% if (result.latitude and result.longitude) or result.boundingbox %} {% if (result.latitude and result.longitude) or result.boundingbox %}
<div class="collapse" id="result-map-{{ index }}"> <div class="collapse" id="result-map-{{ index }}">
<div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div> <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
</div> </div>
{% endif %} {% endif %}
{% if rtl %} {% if rtl %}
{{ result_footer_rtl(result) }} {{ result_footer_rtl(result) }}
{% else %} {% else %}
{{ result_footer(result) }} {{ result_footer(result) }}
{% endif %} {% endif %}

View File

@ -1,27 +1,27 @@
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} {% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
{{ result_header(result, favicons) }} {{ result_header(result, favicons) }}
{{ result_sub_header(result) }} {{ result_sub_header(result) }}
{% if result.embedded %} {% if result.embedded %}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small> <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>
{% endif %} {% endif %}
{% if result.embedded %} {% if result.embedded %}
<div id="result-video-{{ index }}" class="collapse"> <div id="result-video-{{ index }}" class="collapse">
{{ result.embedded|safe }} {{ result.embedded|safe }}
</div> </div>
{% endif %} {% endif %}
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a> <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %} {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
</div> </div>
</div> </div>
{% if rtl %} {% if rtl %}
{{ result_footer_rtl(result) }} {{ result_footer_rtl(result) }}
{% else %} {% else %}
{{ result_footer(result) }} {{ result_footer(result) }}
{% endif %} {% endif %}

View File

@ -1,156 +1,156 @@
{% extends "oscar/base.html" %} {% extends "oscar/base.html" %}
{% macro search_form_attrs(pageno) -%} {% macro search_form_attrs(pageno) -%}
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %} {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="q" value="{{ q|e }}" /> <input type="hidden" name="q" value="{{ q|e }}" />
<input type="hidden" name="pageno" value="{{ pageno }}" /> <input type="hidden" name="pageno" value="{{ pageno }}" />
<input type="hidden" name="time_range" value="{{ time_range }}" /> <input type="hidden" name="time_range" value="{{ time_range }}" />
<input type="hidden" name="language" value="{{ current_language }}" /> <input type="hidden" name="language" value="{{ current_language }}" />
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif %} {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" />{% endif %}
{%- endmacro %} {%- endmacro %}
{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&amp;language={{ current_language }}{% endif %}{% endmacro -%} {%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&amp;language={{ current_language }}{% endif %}{% endmacro -%}
{% block title %}{{ q|e }} - {% endblock %} {% block title %}{{ q|e }} - {% endblock %}
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&amp;format=rss">{% endblock %} {% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&amp;format=rss">{% endblock %}
{% block content %} {% block content %}
{% include 'oscar/search.html' %} {% include 'oscar/search.html' %}
<div class="row"> <div class="row">
<div class="col-sm-8" id="main_results"> <div class="col-sm-8" id="main_results">
<h1 class="sr-only">{{ _('Search results') }}</h1> <h1 class="sr-only">{{ _('Search results') }}</h1>
{% if corrections %} {% if corrections %}
<div class="result"> <div class="result">
<span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span> <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
{% for correction in corrections %} {% for correction in corrections %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
<input type="hidden" name="q" value="{{ correction.url }}"> <input type="hidden" name="q" value="{{ correction.url }}">
<button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button> <button type="submit" class="btn btn-default btn-xs">{{ correction.title }}</button>
</form> </form>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if answers %} {% if answers %}
{% for answer in answers %} {% for answer in answers %}
<div class="result well"> <div class="result well">
<span>{{ answer }}</span> <span>{{ answer }}</span>
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% for result in results %} {% for result in results %}
<div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}"> <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
{% set index = loop.index %} {% set index = loop.index %}
{% if result.template %} {% if result.template %}
{% include get_result_template('oscar', result['template']) %} {% include get_result_template('oscar', result['template']) %}
{% else %} {% else %}
{% include 'oscar/result_templates/default.html' %} {% include 'oscar/result_templates/default.html' %}
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
{% if not results and not answers %} {% if not results and not answers %}
{% include 'oscar/messages/no_results.html' %} {% include 'oscar/messages/no_results.html' %}
{% endif %} {% endif %}
<div class="clearfix"></div> <div class="clearfix"></div>
{% if paging %} {% if paging %}
{% if rtl %} {% if rtl %}
<div id="pagination"> <div id="pagination">
<div class="pull-left"> <div class="pull-left">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{{ search_form_attrs(pageno+1) }} {{ search_form_attrs(pageno+1) }}
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button> <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
</form> </form>
</div> </div>
<div class="pull-right"> <div class="pull-right">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{{ search_form_attrs(pageno-1) }} {{ search_form_attrs(pageno-1) }}
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button> <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
</form> </form>
</div> </div>
</div><!-- /#pagination --> </div><!-- /#pagination -->
<div class="clearfix"></div> <div class="clearfix"></div>
{% else %} {% else %}
<div id="pagination"> <div id="pagination">
<div class="pull-left"> <div class="pull-left">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{{ search_form_attrs(pageno-1) }} {{ search_form_attrs(pageno-1) }}
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button> <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
</form> </form>
</div> </div>
<div class="pull-right"> <div class="pull-right">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{{ search_form_attrs(pageno+1) }} {{ search_form_attrs(pageno+1) }}
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button> <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
</form> </form>
</div> </div>
</div><!-- /#pagination --> </div><!-- /#pagination -->
<div class="clearfix"></div> <div class="clearfix"></div>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div><!-- /#main_results --> </div><!-- /#main_results -->
<div class="col-sm-4" id="sidebar_results"> <div class="col-sm-4" id="sidebar_results">
{% if number_of_results != '0' %} {% if number_of_results != '0' %}
<p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p> <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
{% endif %} {% endif %}
{% if unresponsive_engines and results|length >= 1 %} {% if unresponsive_engines and results|length >= 1 %}
<div class="alert alert-danger fade in" role="alert"> <div class="alert alert-danger fade in" role="alert">
<p>{{ _('Engines cannot retrieve results') }}:</p> <p>{{ _('Engines cannot retrieve results') }}:</p>
{% for engine_name, error_type in unresponsive_engines %} {% for engine_name, error_type in unresponsive_engines %}
{{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %} {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if infoboxes %} {% if infoboxes %}
{% for infobox in infoboxes %} {% for infobox in infoboxes %}
{% include 'oscar/infobox.html' %} {% include 'oscar/infobox.html' %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if suggestions %} {% if suggestions %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title">{{ _('Suggestions') }}</h4> <h4 class="panel-title">{{ _('Suggestions') }}</h4>
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% for suggestion in suggestions %} {% for suggestion in suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
<input type="hidden" name="q" value="{{ suggestion.url }}"> <input type="hidden" name="q" value="{{ suggestion.url }}">
<button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button> <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
</form> </form>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title">{{ _('Links') }}</h4> <h4 class="panel-title">{{ _('Links') }}</h4>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<form role="form"> <form role="form">
<div class="form-group"> <div class="form-group">
<label for="search_url">{{ _('Search URL') }}</label> <label for="search_url">{{ _('Search URL') }}</label>
<input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly> <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>
</div> </div>
</form> </form>
<label>{{ _('Download results') }}</label> <label>{{ _('Download results') }}</label>
<div class="clearfix"></div> <div class="clearfix"></div>
{% for output_type in ('csv', 'json', 'rss') %} {% for output_type in ('csv', 'json', 'rss') %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
{{ search_form_attrs(pageno) }} {{ search_form_attrs(pageno) }}
<input type="hidden" name="format" value="{{ output_type }}"> <input type="hidden" name="format" value="{{ output_type }}">
<button type="submit" class="btn btn-default">{{ output_type }}</button> <button type="submit" class="btn btn-default">{{ output_type }}</button>
</form> </form>
{% endfor %} {% endfor %}
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
</div><!-- /#sidebar_results --> </div><!-- /#sidebar_results -->
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,24 +1,24 @@
{% from 'oscar/macros.html' import icon %} {% from 'oscar/macros.html' import icon %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-8"> <div class="col-xs-12 col-md-8">
<div class="input-group search-margin"> <div class="input-group search-margin">
<input type="search" name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}"> <input type="search" name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="btn btn-default" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> <button type="submit" class="btn btn-default" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
</span> </span>
</div> </div>
</div> </div>
<div class="col-xs-6 col-md-2 search-margin"> <div class="col-xs-6 col-md-2 search-margin">
{% include 'oscar/time-range.html' %} {% include 'oscar/time-range.html' %}
</div> </div>
<div class="col-xs-6 col-md-2 search-margin"> <div class="col-xs-6 col-md-2 search-margin">
{% include 'oscar/languages.html' %} {% include 'oscar/languages.html' %}
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
{% include 'oscar/categories.html' %} {% include 'oscar/categories.html' %}
</div> </div>
</div> </div>
</form><!-- / #search_form_full --> </form><!-- / #search_form_full -->

View File

@ -1,18 +1,18 @@
{% from 'oscar/macros.html' import icon %} {% from 'oscar/macros.html' import icon %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
{% if rtl %} {% if rtl %}
<div class="input-group"> <div class="input-group">
{% else %} {% else %}
<div class="input-group col-md-8 col-md-offset-2"> <div class="input-group col-md-8 col-md-offset-2">
{% endif %} {% endif %}
<input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}"> <input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="btn btn-default input-lg" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> <button type="submit" class="btn btn-default input-lg" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
</span> </span>
</div> </div>
<div class="col-md-8 col-md-offset-2 advanced"> <div class="col-md-8 col-md-offset-2 advanced">
{% include 'oscar/advanced.html' %} {% include 'oscar/advanced.html' %}
</div> </div>
</form><!-- / #search_form_full --> </form><!-- / #search_form_full -->