From 56b7e05721394c0490ff43960cb7fa5626e83e3d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 8 Dec 2019 14:14:18 +0100 Subject: [PATCH] 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 --- .../themes/legacy/less/autocompleter.less | 122 ++-- searx/static/themes/oscar/js/searx.js | 652 +++++++++--------- .../oscar/js/searx_src/00_requirejs_config.js | 46 +- .../oscar/js/searx_src/autocompleter.js | 74 +- .../oscar/js/searx_src/element_modifiers.js | 198 +++--- .../themes/oscar/js/searx_src/leaflet_map.js | 334 ++++----- .../static/themes/simple/leaflet/leaflet.css | Bin 14198 -> 13562 bytes .../oscar/result_templates/code.html | 36 +- .../oscar/result_templates/default.html | 62 +- .../oscar/result_templates/images.html | 98 +-- .../templates/oscar/result_templates/map.html | 144 ++-- .../oscar/result_templates/videos.html | 54 +- searx/templates/oscar/results.html | 312 ++++----- searx/templates/oscar/search.html | 48 +- searx/templates/oscar/search_full.html | 36 +- 15 files changed, 1108 insertions(+), 1108 deletions(-) diff --git a/searx/static/themes/legacy/less/autocompleter.less b/searx/static/themes/legacy/less/autocompleter.less index db9601aeb..4ab2508f8 100644 --- a/searx/static/themes/legacy/less/autocompleter.less +++ b/searx/static/themes/legacy/less/autocompleter.less @@ -1,61 +1,61 @@ -/* - * searx, A privacy-respecting, hackable metasearch engine - */ - -ul { - &.autocompleter-choices { - position: absolute; - margin: 0; - padding: 0; - list-style: none; - border: 1px solid @color-autocompleter-choices-border; - border-left-color: @color-autocompleter-choices-border-left-right; - border-right-color: @color-autocompleter-choices-border-left-right; - border-bottom-color: @color-autocompleter-choices-border-bottom; - text-align: left; - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - z-index: 50; - background-color: @color-autocompleter-choices-background; - color: @color-autocompleter-choices-font; - - li { - position: relative; - margin: -2px 0 0 0; - padding: 0.2em 1.5em 0.2em 1em; - display: block; - float: none !important; - cursor: pointer; - font-weight: normal; - white-space: nowrap; - font-size: 1em; - line-height: 1.5em; - - &.autocompleter-selected { - background-color: @color-autocompleter-selected-background; - color: @color-autocompleter-selected-font; - - span.autocompleter-queried { - color: @color-autocompleter-selected-queried-font; - } - } - } - - span.autocompleter-queried { - display: inline; - float: none; - font-weight: bold; - margin: 0; - padding: 0; - } - } -} - -/*.autocompleter-loading { - //background-image: url(images/spinner.gif); - background-repeat: no-repeat; - background-position: right 50%; -}*/ - -/*textarea.autocompleter-loading { - background-position: right bottom; -}*/ +/* + * searx, A privacy-respecting, hackable metasearch engine + */ + +ul { + &.autocompleter-choices { + position: absolute; + margin: 0; + padding: 0; + list-style: none; + border: 1px solid @color-autocompleter-choices-border; + border-left-color: @color-autocompleter-choices-border-left-right; + border-right-color: @color-autocompleter-choices-border-left-right; + border-bottom-color: @color-autocompleter-choices-border-bottom; + text-align: left; + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + z-index: 50; + background-color: @color-autocompleter-choices-background; + color: @color-autocompleter-choices-font; + + li { + position: relative; + margin: -2px 0 0 0; + padding: 0.2em 1.5em 0.2em 1em; + display: block; + float: none !important; + cursor: pointer; + font-weight: normal; + white-space: nowrap; + font-size: 1em; + line-height: 1.5em; + + &.autocompleter-selected { + background-color: @color-autocompleter-selected-background; + color: @color-autocompleter-selected-font; + + span.autocompleter-queried { + color: @color-autocompleter-selected-queried-font; + } + } + } + + span.autocompleter-queried { + display: inline; + float: none; + font-weight: bold; + margin: 0; + padding: 0; + } + } +} + +/*.autocompleter-loading { + //background-image: url(images/spinner.gif); + background-repeat: no-repeat; + background-position: right 50%; +}*/ + +/*textarea.autocompleter-loading { + background-position: right bottom; +}*/ diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index 58b38f019..927aeb422 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -1,26 +1,26 @@ -/** - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * searx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with searx. If not, see < http://www.gnu.org/licenses/ >. - * - * (C) 2014 by Thomas Pointhuber, - */ - -requirejs.config({ - baseUrl: './static/themes/oscar/js', - paths: { - app: '../app' - } -}); +/** + * 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * searx is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with searx. If not, see < http://www.gnu.org/licenses/ >. + * + * (C) 2014 by Thomas Pointhuber, + */ + +requirejs.config({ + baseUrl: './static/themes/oscar/js', + paths: { + app: '../app' + } +}); ;/** * 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 @@ -51,306 +51,306 @@ window.searx = (function(d) { method: script.getAttribute('data-method') }; })(document); -;/** - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * searx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with searx. If not, see < http://www.gnu.org/licenses/ >. - * - * (C) 2014 by Thomas Pointhuber, - */ - -if(searx.autocompleter) { - searx.searchResults = new Bloodhound({ - datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), - queryTokenizer: Bloodhound.tokenizers.whitespace, - remote: './autocompleter?q=%QUERY' - }); - searx.searchResults.initialize(); -} - -$(document).ready(function(){ - if(searx.autocompleter) { - $('#q').typeahead(null, { - name: 'search-results', - displayKey: function(result) { - return result; - }, - source: searx.searchResults.ttAdapter() - }); - } -}); -;/** - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * searx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with searx. If not, see < http://www.gnu.org/licenses/ >. - * - * (C) 2014 by Thomas Pointhuber, - */ - -$(document).ready(function(){ - /** - * focus element if class="autofocus" and id="q" - */ - $('#q.autofocus').focus(); - - /** - * select full content on click if class="select-all-on-click" - */ - $(".select-all-on-click").click(function () { - $(this).select(); - }); - - /** - * change text during btn-collapse click if possible - */ - $('.btn-collapse').click(function() { - var btnTextCollapsed = $(this).data('btn-text-collapsed'); - var btnTextNotCollapsed = $(this).data('btn-text-not-collapsed'); - - if(btnTextCollapsed !== '' && btnTextNotCollapsed !== '') { - if($(this).hasClass('collapsed')) { - new_html = $(this).html().replace(btnTextCollapsed, btnTextNotCollapsed); - } else { - new_html = $(this).html().replace(btnTextNotCollapsed, btnTextCollapsed); - } - $(this).html(new_html); - } - }); - - /** - * change text during btn-toggle click if possible - */ - $('.btn-toggle .btn').click(function() { - var btnClass = 'btn-' + $(this).data('btn-class'); - var btnLabelDefault = $(this).data('btn-label-default'); - var btnLabelToggled = $(this).data('btn-label-toggled'); - if(btnLabelToggled !== '') { - if($(this).hasClass('btn-default')) { - new_html = $(this).html().replace(btnLabelDefault, btnLabelToggled); - } else { - new_html = $(this).html().replace(btnLabelToggled, btnLabelDefault); - } - $(this).html(new_html); - } - $(this).toggleClass(btnClass); - $(this).toggleClass('btn-default'); - }); - - /** - * change text during btn-toggle click if possible - */ - $('.media-loader').click(function() { - var target = $(this).data('target'); - var iframe_load = $(target + ' > iframe'); - var srctest = iframe_load.attr('src'); - if(srctest === undefined || srctest === false){ - iframe_load.attr('src', iframe_load.data('src')); - } - }); - - /** - * Select or deselect every categories on double clic - */ - $(".btn-sm").dblclick(function() { - var btnClass = 'btn-' + $(this).data('btn-class'); // primary - if($(this).hasClass('btn-default')) { - $(".btn-sm > input").attr('checked', 'checked'); - $(".btn-sm > input").prop("checked", true); - $(".btn-sm").addClass(btnClass); - $(".btn-sm").addClass('active'); - $(".btn-sm").removeClass('btn-default'); - } else { - $(".btn-sm > input").attr('checked', ''); - $(".btn-sm > input").removeAttr('checked'); - $(".btn-sm > input").checked = false; - $(".btn-sm").removeClass(btnClass); - $(".btn-sm").removeClass('active'); - $(".btn-sm").addClass('btn-default'); - } - }); -}); -;/** - * 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * searx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with searx. If not, see < http://www.gnu.org/licenses/ >. - * - * (C) 2014 by Thomas Pointhuber, - */ - -$(document).ready(function(){ - $(".searx_overpass_request").on( "click", function( event ) { - var overpass_url = "https://overpass-api.de/api/interpreter?data="; - var query_start = overpass_url + "[out:json][timeout:25];("; - var query_end = ");out meta;"; - - var osm_id = $(this).data('osm-id'); - var osm_type = $(this).data('osm-type'); - var result_table = $(this).data('result-table'); - var result_table_loadicon = "#" + $(this).data('result-table-loadicon'); - - // tags which can be ignored - var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ]; - - if(osm_id && osm_type && result_table) { - result_table = "#" + result_table; - var query = null; - switch(osm_type) { - case 'node': - query = query_start + "node(" + osm_id + ");" + query_end; - break; - case 'way': - query = query_start + "way(" + osm_id + ");" + query_end; - break; - case 'relation': - query = query_start + "relation(" + osm_id + ");" + query_end; - break; - default: - break; - } - if(query) { - //alert(query); - var ajaxRequest = $.ajax( query ) - .done(function( html) { - if(html && html.elements && html.elements[0]) { - var element = html.elements[0]; - var newHtml = $(result_table).html(); - for (var row in element.tags) { - if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) { - newHtml += "" + row + ""; - switch(row) { - case "phone": - case "fax": - newHtml += "" + element.tags[row] + ""; - break; - case "email": - newHtml += "" + element.tags[row] + ""; - break; - case "website": - case "url": - newHtml += "" + element.tags[row] + ""; - break; - case "wikidata": - newHtml += "" + element.tags[row] + ""; - break; - case "wikipedia": - if(element.tags[row].indexOf(":") != -1) { - newHtml += "" + element.tags[row] + ""; - break; - } - /* jshint ignore:start */ - default: - /* jshint ignore:end */ - newHtml += element.tags[row]; - break; - } - newHtml += ""; - } - } - $(result_table).html(newHtml); - $(result_table).removeClass('hidden'); - $(result_table_loadicon).addClass('hidden'); - } - }) - .fail(function() { - $(result_table_loadicon).html($(result_table_loadicon).html() + "

could not load data!

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

could not load data!

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

could not load data!

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

could not load data!

"); + }); + } + } + + // this event occour only once per element + $( this ).off( event ); + }); + + $(".searx_init_map").on( "click", function( event ) { + var leaflet_target = $(this).data('leaflet-target'); + var map_lon = $(this).data('map-lon'); + var map_lat = $(this).data('map-lat'); + var map_zoom = $(this).data('map-zoom'); + var map_boundingbox = $(this).data('map-boundingbox'); + var map_geojson = $(this).data('map-geojson'); + + require(['leaflet-0.7.3.min'], function(leaflet) { + if(map_boundingbox) { + southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]); + northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]); + map_bounds = L.latLngBounds(southWest, northEast); + } + + // TODO hack + // change default imagePath + L.Icon.Default.imagePath = "./static/themes/oscar/img/map"; + + // init map + var map = L.map(leaflet_target); + + // create the tile layer with correct attribution + var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + var osmMapnikAttrib='Map data © OpenStreetMap contributors'; + 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 osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © OpenStreetMap contributors'; + var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib}); + + // init map view + if(map_bounds) { + // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021 + setTimeout(function () { + map.fitBounds(map_bounds, { + maxZoom:17 + }); + }, 0); + } else if (map_lon && map_lat) { + if(map_zoom) + map.setView(new L.LatLng(map_lat, map_lon),map_zoom); + else + map.setView(new L.LatLng(map_lat, map_lon),8); + } + + map.addLayer(osmMapnik); + + var baseLayers = { + "OSM Mapnik": osmMapnik/*, + "OSM Wikimedia": osmWikimedia*/ + }; + + L.control.layers(baseLayers).addTo(map); + + + if(map_geojson) + L.geoJson(map_geojson).addTo(map); + /*else if(map_bounds) + L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/ + }); + + // this event occour only once per element + $( this ).off( event ); + }); +}); diff --git a/searx/static/themes/simple/leaflet/leaflet.css b/searx/static/themes/simple/leaflet/leaflet.css index 230e5bad14f3494ce152dc69634b24c232f76462..d1b47a1251c18df4c08b0b8c0b2c64522c90eab9 100644 GIT binary patch literal 13562 zcmcgzTaVku6@HF?#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ldJ&8G7#T}6erIQ9Dm{T=iPcH z94o**UTgbTd=8O3IV*Yg&ZCLOPZ(boA9_{}P>q})f2<|R4+Y-kmuA@ryg(|9y$CiPv{5Cu3 zII=Nm6est4Bk-=zEU~wIS0AkPgKaGbB?3IBo^lin*WTRRI6*t$KiPNaXu1Y> zj=z)eGQ9h{3W)0P;<^&>TK^7e1^W_vAzK0O*t1h1ula}1U_R-v7y_Vcp!*<_zW<0w zPtWNfq$5K2uzuBr(CH0SB26#b%xBk+q{<<|KI?eT08??T z1(gxu73E_Y2%VQk*smy-Q9J>5$`s=m z6WNg})VWX!%K(Vag;aw$w*0fqSMYsW9J*o(L&OIOps#qi-~xE}(DLKwXAY+Y_7b#s zoQpdGm!gwwaC~A~p9JwEY?|11*On3EN7Tb`5NW(bbTHhbAU-E4Joyqija<(PiW`7^ LGDJWJ6BzyjRQa-Z diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html index ba74d0333..a1c18a6b7 100644 --- a/searx/templates/oscar/result_templates/code.html +++ b/searx/templates/oscar/result_templates/code.html @@ -1,18 +1,18 @@ -{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} - -{{ result_header(result, favicons) }} -{{ result_sub_header(result) }} - -{% if result.content %}

{{ result.content|safe }}

{% endif %} - -{% if result.repository %}

{{ icon('file') }} {{ result.repository }}

{% endif %} - -
-{{ result.codelines|code_highlighter(result.code_language)|safe }} -
- -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if result.content %}

{{ result.content|safe }}

{% endif %} + +{% if result.repository %}

{{ icon('file') }} {{ result.repository }}

{% endif %} + +
+{{ result.codelines|code_highlighter(result.code_language)|safe }} +
+ +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 3ed0f3122..62b4d572d 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -1,31 +1,31 @@ -{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %} - -{{ result_header(result, favicons) }} -{{ result_sub_header(result) }} - -{% if result.embedded %} - -{% endif %} - -{% if result.embedded %} -
- {{ result.embedded|safe }} -
-{% endif %} - -{% if result.img_src %} -
-
-{{ result.title|striptags }} -{% if result.content %}

{{ result.content|safe }}

{% endif %} -
-
-{% else %} -{% if result.content %}

{{ result.content|safe }}

{% endif %} -{% endif %} - -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if result.embedded %} + +{% endif %} + +{% if result.embedded %} +
+ {{ result.embedded|safe }} +
+{% endif %} + +{% if result.img_src %} +
+
+{{ result.title|striptags }} +{% if result.content %}

{{ result.content|safe }}

{% endif %} +
+
+{% else %} +{% if result.content %}

{{ result.content|safe }}

{% endif %} +{% endif %} + +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index b3292f448..55da5485f 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -1,49 +1,49 @@ -{% from 'oscar/macros.html' import draw_favicon %} - - - {{ result.title|striptags }} - - - +{% from 'oscar/macros.html' import draw_favicon %} + + + {{ result.title|striptags }} + + + diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 822c7cdea..712375d7f 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -1,72 +1,72 @@ -{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} - -{{ result_header(result, favicons) }} -{{ result_sub_header(result) }} - -{% if (result.latitude and result.longitude) or result.boundingbox %} - -{% endif %} - -{% if result.osm and (result.osm.type and result.osm.id) %} - -{% endif %} - -{# {% if (result.latitude and result.longitude) %} - -{% endif %} #} - -
- -{% if result.address %} -

- {% if result.address.name %} - {{ result.address.name }}
- {% endif %} - {% if result.address.road %} - - {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} - {{ result.address.road }} -
- {% endif %} - {% if result.address.locality %} - {{ result.address.locality }} - {% if result.address.postcode %}, {{ result.address.postcode }}{% endif %} -
- {% endif %} - {% if result.address.country %} - {{ result.address.country }} - {% endif %} -

-{% endif %} - -{% if result.osm and (result.osm.type and result.osm.id) %} -
-
Loading ...
- - - -
-{% endif %} - -{# {% if (result.latitude and result.longitude) %} -
- Longitude: {{ result.longitude }}
- Latitude: {{ result.latitude }} -
-{% endif %} #} - -{% if result.content %}

{{ result.content|safe }}

{% endif %} - -
- -{% if (result.latitude and result.longitude) or result.boundingbox %} -
-
-
-{% endif %} - -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if (result.latitude and result.longitude) or result.boundingbox %} + +{% endif %} + +{% if result.osm and (result.osm.type and result.osm.id) %} + +{% endif %} + +{# {% if (result.latitude and result.longitude) %} + +{% endif %} #} + +
+ +{% if result.address %} +

+ {% if result.address.name %} + {{ result.address.name }}
+ {% endif %} + {% if result.address.road %} + + {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} + {{ result.address.road }} +
+ {% endif %} + {% if result.address.locality %} + {{ result.address.locality }} + {% if result.address.postcode %}, {{ result.address.postcode }}{% endif %} +
+ {% endif %} + {% if result.address.country %} + {{ result.address.country }} + {% endif %} +

+{% endif %} + +{% if result.osm and (result.osm.type and result.osm.id) %} +
+
Loading ...
+ + + +
+{% endif %} + +{# {% if (result.latitude and result.longitude) %} +
+ Longitude: {{ result.longitude }}
+ Latitude: {{ result.latitude }} +
+{% endif %} #} + +{% if result.content %}

{{ result.content|safe }}

{% endif %} + +
+ +{% if (result.latitude and result.longitude) or result.boundingbox %} +
+
+
+{% endif %} + +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index 36fb26240..3c1913d9d 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -1,27 +1,27 @@ -{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} - -{{ result_header(result, favicons) }} -{{ result_sub_header(result) }} - -{% if result.embedded %} - -{% endif %} - -{% if result.embedded %} -
- {{ result.embedded|safe }} -
-{% endif %} - -
-
- {{ result.title|striptags }} {{ result.engine }} - {% if result.content %}

{{ result.content|safe }}

{% endif %} -
-
- -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if result.embedded %} + +{% endif %} + +{% if result.embedded %} +
+ {{ result.embedded|safe }} +
+{% endif %} + +
+
+ {{ result.title|striptags }} {{ result.engine }} + {% if result.content %}

{{ result.content|safe }}

{% endif %} +
+
+ +{% if rtl %} +{{ result_footer_rtl(result) }} +{% else %} +{{ result_footer(result) }} +{% endif %} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index fce7f97d6..b6bcdd949 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -1,156 +1,156 @@ -{% extends "oscar/base.html" %} -{% macro search_form_attrs(pageno) -%} - {% for category in selected_categories %}{% endfor %} - - - - - {% if timeout_limit %}{% endif %} -{%- endmacro %} -{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%} - -{% block title %}{{ q|e }} - {% endblock %} -{% block meta %}{% endblock %} -{% block content %} - {% include 'oscar/search.html' %} -
-
-

{{ _('Search results') }}

- - {% if corrections %} -
- {{ _('Try searching for:') }} - {% for correction in corrections %} - - {% endfor %} -
- {% endif %} - - {% if answers %} - {% for answer in answers %} -
- {{ answer }} -
- {% endfor %} - {% endif %} - - {% for result in results %} -
- {% set index = loop.index %} - {% if result.template %} - {% include get_result_template('oscar', result['template']) %} - {% else %} - {% include 'oscar/result_templates/default.html' %} - {% endif %} -
- {% endfor %} - - {% if not results and not answers %} - {% include 'oscar/messages/no_results.html' %} - {% endif %} - -
- - {% if paging %} - {% if rtl %} - -
- {% else %} - -
- {% endif %} - {% endif %} -
- - -
-{% endblock %} +{% extends "oscar/base.html" %} +{% macro search_form_attrs(pageno) -%} + {% for category in selected_categories %}{% endfor %} + + + + + {% if timeout_limit %}{% endif %} +{%- endmacro %} +{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%} + +{% block title %}{{ q|e }} - {% endblock %} +{% block meta %}{% endblock %} +{% block content %} + {% include 'oscar/search.html' %} +
+
+

{{ _('Search results') }}

+ + {% if corrections %} +
+ {{ _('Try searching for:') }} + {% for correction in corrections %} + + {% endfor %} +
+ {% endif %} + + {% if answers %} + {% for answer in answers %} +
+ {{ answer }} +
+ {% endfor %} + {% endif %} + + {% for result in results %} +
+ {% set index = loop.index %} + {% if result.template %} + {% include get_result_template('oscar', result['template']) %} + {% else %} + {% include 'oscar/result_templates/default.html' %} + {% endif %} +
+ {% endfor %} + + {% if not results and not answers %} + {% include 'oscar/messages/no_results.html' %} + {% endif %} + +
+ + {% if paging %} + {% if rtl %} + +
+ {% else %} + +
+ {% endif %} + {% endif %} +
+ + +
+{% endblock %} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index bf9a9af5f..7b3bcf9c1 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -1,24 +1,24 @@ -{% from 'oscar/macros.html' import icon %} - +{% from 'oscar/macros.html' import icon %} + diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index fd8a9a393..90b3c030b 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -1,18 +1,18 @@ -{% from 'oscar/macros.html' import icon %} - -