mirror of https://github.com/searx/searx
Merge pull request #1763 from return42/dos2unix
themes: remove CR from newlines
This commit is contained in:
commit
b0177847f8
|
@ -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;
|
||||
}*/
|
||||
|
|
|
@ -24,7 +24,7 @@ module.exports = function(grunt) {
|
|||
jshint: {
|
||||
files: ['gruntfile.js', 'js/searx_src/*.js'],
|
||||
options: {
|
||||
reporterOutput: "",
|
||||
reporterOutput: "",
|
||||
// options here to override JSHint defaults
|
||||
globals: {
|
||||
jQuery: true,
|
||||
|
@ -55,7 +55,7 @@ module.exports = function(grunt) {
|
|||
"css/logicodev-dark.min.css": "less/logicodev-dark/oscar.less"}
|
||||
},
|
||||
/*
|
||||
// built with ./manage.sh styles
|
||||
// built with ./manage.sh styles
|
||||
bootstrap: {
|
||||
options: {
|
||||
paths: ["less/bootstrap"],
|
||||
|
@ -90,7 +90,7 @@ module.exports = function(grunt) {
|
|||
grunt.registerTask('test', ['jshint']);
|
||||
|
||||
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less']);
|
||||
|
||||
|
||||
grunt.registerTask('styles', ['less']);
|
||||
|
||||
};
|
||||
|
|
|
@ -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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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 += "<tr><td>" + row + "</td><td>";
|
||||
switch(row) {
|
||||
case "phone":
|
||||
case "fax":
|
||||
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "email":
|
||||
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "website":
|
||||
case "url":
|
||||
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikidata":
|
||||
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikipedia":
|
||||
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>";
|
||||
break;
|
||||
}
|
||||
/* jshint ignore:start */
|
||||
default:
|
||||
/* jshint ignore:end */
|
||||
newHtml += element.tags[row];
|
||||
break;
|
||||
}
|
||||
newHtml += "</td></tr>";
|
||||
}
|
||||
}
|
||||
$(result_table).html(newHtml);
|
||||
$(result_table).removeClass('hidden');
|
||||
$(result_table_loadicon).addClass('hidden');
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(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 ).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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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 += "<tr><td>" + row + "</td><td>";
|
||||
switch(row) {
|
||||
case "phone":
|
||||
case "fax":
|
||||
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "email":
|
||||
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "website":
|
||||
case "url":
|
||||
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikidata":
|
||||
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikipedia":
|
||||
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>";
|
||||
break;
|
||||
}
|
||||
/* jshint ignore:start */
|
||||
default:
|
||||
/* jshint ignore:end */
|
||||
newHtml += element.tags[row];
|
||||
break;
|
||||
}
|
||||
newHtml += "</td></tr>";
|
||||
}
|
||||
}
|
||||
$(result_table).html(newHtml);
|
||||
$(result_table).removeClass('hidden');
|
||||
$(result_table_loadicon).addClass('hidden');
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(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 ).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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 );
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
requirejs.config({
|
||||
baseUrl: './static/themes/oscar/js',
|
||||
paths: {
|
||||
app: '../app'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
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()
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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 += "<tr><td>" + row + "</td><td>";
|
||||
switch(row) {
|
||||
case "phone":
|
||||
case "fax":
|
||||
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "email":
|
||||
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "website":
|
||||
case "url":
|
||||
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikidata":
|
||||
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikipedia":
|
||||
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>";
|
||||
break;
|
||||
}
|
||||
/* jshint ignore:start */
|
||||
default:
|
||||
/* jshint ignore:end */
|
||||
newHtml += element.tags[row];
|
||||
break;
|
||||
}
|
||||
newHtml += "</td></tr>";
|
||||
}
|
||||
}
|
||||
$(result_table).html(newHtml);
|
||||
$(result_table).removeClass('hidden');
|
||||
$(result_table_loadicon).addClass('hidden');
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(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 ).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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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, <thomas.pointhuber@gmx.at>
|
||||
*/
|
||||
|
||||
$(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 += "<tr><td>" + row + "</td><td>";
|
||||
switch(row) {
|
||||
case "phone":
|
||||
case "fax":
|
||||
newHtml += "<a href=\"tel:" + element.tags[row].replace(/ /g,'') + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "email":
|
||||
newHtml += "<a href=\"mailto:" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "website":
|
||||
case "url":
|
||||
newHtml += "<a href=\"" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikidata":
|
||||
newHtml += "<a href=\"https://www.wikidata.org/wiki/" + element.tags[row] + "\">" + element.tags[row] + "</a>";
|
||||
break;
|
||||
case "wikipedia":
|
||||
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>";
|
||||
break;
|
||||
}
|
||||
/* jshint ignore:start */
|
||||
default:
|
||||
/* jshint ignore:end */
|
||||
newHtml += element.tags[row];
|
||||
break;
|
||||
}
|
||||
newHtml += "</td></tr>";
|
||||
}
|
||||
}
|
||||
$(result_table).html(newHtml);
|
||||
$(result_table).removeClass('hidden');
|
||||
$(result_table_loadicon).addClass('hidden');
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(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 ).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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 © <a href="https://openstreetmap.org">OpenStreetMap</a> 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 );
|
||||
});
|
||||
});
|
||||
|
|
|
@ -109,7 +109,7 @@ ul.nav li a {
|
|||
|
||||
.btn:hover {
|
||||
color:#444 !important;
|
||||
background-color: #BBB !important;
|
||||
background-color: #BBB !important;
|
||||
}
|
||||
|
||||
.btn-primary.active {
|
||||
|
@ -221,7 +221,7 @@ p.btn.btn-default{
|
|||
}
|
||||
|
||||
.table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th {
|
||||
background: rgb(102, 105, 110) !important;
|
||||
background: rgb(102, 105, 110) !important;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
|
|
|
@ -78,7 +78,7 @@ pre, code{
|
|||
user-select: none;
|
||||
cursor: default;
|
||||
color: #556366;
|
||||
|
||||
|
||||
&::selection {
|
||||
background: transparent; /* WebKit/Blink Browsers */
|
||||
}
|
||||
|
@ -99,5 +99,3 @@ pre, code{
|
|||
.highlight {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
table-layout: fixed;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.infobox_part:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
@ -28,4 +28,3 @@
|
|||
width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor: default;
|
||||
|
||||
|
||||
&::selection {
|
||||
background: transparent; /* WebKit/Blink Browsers */
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
word-wrap: break-word;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
|
||||
.infobox_part:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,8 @@
|
|||
{% if preferences -%}
|
||||
<select class="custom-select form-control" name='language'>
|
||||
{%- else -%}
|
||||
<select class="time_range custom-select form-control" id='language' name='language'>
|
||||
{%- endif -%}
|
||||
<option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
|
||||
{%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
|
||||
<option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>
|
||||
{{- lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id -}}
|
||||
</option>
|
||||
{%- endfor -%}
|
||||
</select>
|
||||
<select class="language custom-select form-control" id="language" name="language" accesskey="l">
|
||||
<option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
|
||||
{%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
|
||||
<option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>
|
||||
{{- lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id -}}
|
||||
</option>
|
||||
{%- endfor -%}
|
||||
</select>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
{% set language_label = _('Search language') %}
|
||||
{% set language_info = _('What language do you prefer for search?') %}
|
||||
{{ preferences_item_header(language_info, language_label, rtl) }}
|
||||
{% include 'oscar/languages.html' %}
|
||||
{% include 'oscar/languages.html' %}
|
||||
{{ preferences_item_footer(language_info, language_label, rtl) }}
|
||||
|
||||
{% set locale_label = _('Interface language') %}
|
||||
|
@ -156,26 +156,26 @@
|
|||
<div class="container-fluid">
|
||||
<fieldset>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-condensed table-striped">
|
||||
<tr>
|
||||
<table class="table table-hover table-condensed table-striped">
|
||||
<tr>
|
||||
{% if not rtl %}
|
||||
<th>{{ _("Allow") }}</th>
|
||||
<th>{{ _("Engine name") }}</th>
|
||||
<th>{{ _("Shortcut") }}</th>
|
||||
<th>{{ _("Selected language") }}</th>
|
||||
<th>{{ _("SafeSearch") }}</th>
|
||||
<th>{{ _("Time range") }}</th>
|
||||
<th>{{ _("Avg. time") }}</th>
|
||||
<th>{{ _("Max time") }}</th>
|
||||
<th>{{ _("Allow") }}</th>
|
||||
<th>{{ _("Engine name") }}</th>
|
||||
<th>{{ _("Shortcut") }}</th>
|
||||
<th>{{ _("Selected language") }}</th>
|
||||
<th>{{ _("SafeSearch") }}</th>
|
||||
<th>{{ _("Time range") }}</th>
|
||||
<th>{{ _("Avg. time") }}</th>
|
||||
<th>{{ _("Max time") }}</th>
|
||||
{% else %}
|
||||
<th>{{ _("Max time") }}</th>
|
||||
<th>{{ _("Avg. time") }}</th>
|
||||
<th>{{ _("Time range") }}</th>
|
||||
<th>{{ _("SafeSearch") }}</th>
|
||||
<th>{{ _("Selected language") }}</th>
|
||||
<th>{{ _("Shortcut") }}</th>
|
||||
<th>{{ _("Engine name") }}</th>
|
||||
<th>{{ _("Allow") }}</th>
|
||||
<th>{{ _("Max time") }}</th>
|
||||
<th>{{ _("Avg. time") }}</th>
|
||||
<th>{{ _("Time range") }}</th>
|
||||
<th>{{ _("SafeSearch") }}</th>
|
||||
<th>{{ _("Selected language") }}</th>
|
||||
<th>{{ _("Shortcut") }}</th>
|
||||
<th>{{ _("Engine name") }}</th>
|
||||
<th>{{ _("Allow") }}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for search_engine in engines_by_category[categ] %}
|
||||
|
@ -186,19 +186,19 @@
|
|||
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
|
||||
</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<td class="name">{{ shortcuts[search_engine.name] }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
{% else %}
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ shortcuts[search_engine.name] }}</td>
|
||||
<td class="name">{{ shortcuts[search_engine.name] }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
{% else %}
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ shortcuts[search_engine.name] }}</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<td class="onoff-checkbox">
|
||||
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
|
||||
|
@ -207,7 +207,7 @@
|
|||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
|
@ -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 %}<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 %}
|
||||
|
||||
<div dir="ltr">
|
||||
{{ result.codelines|code_highlighter(result.code_language)|safe }}
|
||||
</div>
|
||||
|
||||
{% 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 %}<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 %}
|
||||
|
||||
<div dir="ltr">
|
||||
{{ result.codelines|code_highlighter(result.code_language)|safe }}
|
||||
</div>
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<span class="label label-default pull-right">{{ result.engine }}</span>{{- "" -}}
|
||||
<p class="text-muted pull-left">{{ result.pretty_url }}</p>{{- "" -}}
|
||||
<div class="clearfix"></div>{{- "" -}}
|
||||
<div class="row">{{- "" -}}
|
||||
<div class="row">{{- "" -}}
|
||||
<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>{{- "" -}}
|
||||
</div>{{- "" -}}
|
||||
|
|
|
@ -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 %}
|
||||
<small> • <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 %}
|
||||
|
||||
{% if result.osm and (result.osm.type and result.osm.id) %}
|
||||
<small> • <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 %}
|
||||
|
||||
{# {% if (result.latitude and result.longitude) %}
|
||||
<small> • <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 %} #}
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
{% 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">
|
||||
{% if result.address.name %}
|
||||
<strong itemprop="name">{{ result.address.name }}</strong><br/>
|
||||
{% endif %}
|
||||
{% if result.address.road %}
|
||||
<span itemprop="streetAddress">
|
||||
{% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
|
||||
{{ result.address.road }}
|
||||
</span><br/>
|
||||
{% endif %}
|
||||
{% if result.address.locality %}
|
||||
<span itemprop="addressLocality">{{ result.address.locality }}</span>
|
||||
{% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if result.address.country %}
|
||||
<span itemprop="addressCountry">{{ result.address.country }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% 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="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 }}">
|
||||
<tr><th>key</th><th>value</th></tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# {% if (result.latitude and result.longitude) %}
|
||||
<div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
|
||||
<strong>Longitude:</strong> {{ result.longitude }} <br/>
|
||||
<strong>Latitude:</strong> {{ result.latitude }}
|
||||
</div>
|
||||
{% endif %} #}
|
||||
|
||||
{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% if (result.latitude and result.longitude) or result.boundingbox %}
|
||||
<div class="collapse" id="result-map-{{ index }}">
|
||||
<div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
|
||||
</div>
|
||||
{% 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 %}
|
||||
<small> • <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 %}
|
||||
|
||||
{% if result.osm and (result.osm.type and result.osm.id) %}
|
||||
<small> • <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 %}
|
||||
|
||||
{# {% if (result.latitude and result.longitude) %}
|
||||
<small> • <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 %} #}
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
{% 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">
|
||||
{% if result.address.name %}
|
||||
<strong itemprop="name">{{ result.address.name }}</strong><br/>
|
||||
{% endif %}
|
||||
{% if result.address.road %}
|
||||
<span itemprop="streetAddress">
|
||||
{% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
|
||||
{{ result.address.road }}
|
||||
</span><br/>
|
||||
{% endif %}
|
||||
{% if result.address.locality %}
|
||||
<span itemprop="addressLocality">{{ result.address.locality }}</span>
|
||||
{% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if result.address.country %}
|
||||
<span itemprop="addressCountry">{{ result.address.country }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% 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="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 }}">
|
||||
<tr><th>key</th><th>value</th></tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# {% if (result.latitude and result.longitude) %}
|
||||
<div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
|
||||
<strong>Longitude:</strong> {{ result.longitude }} <br/>
|
||||
<strong>Latitude:</strong> {{ result.latitude }}
|
||||
</div>
|
||||
{% endif %} #}
|
||||
|
||||
{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% if (result.latitude and result.longitude) or result.boundingbox %}
|
||||
<div class="collapse" id="result-map-{{ index }}">
|
||||
<div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
|
|
|
@ -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 %}
|
||||
<small> • <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 %}
|
||||
|
||||
{% if result.embedded %}
|
||||
<div id="result-video-{{ index }}" class="collapse">
|
||||
{{ result.embedded|safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="container-fluid">
|
||||
<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>
|
||||
{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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 %}
|
||||
<small> • <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 %}
|
||||
|
||||
{% if result.embedded %}
|
||||
<div id="result-video-{{ index }}" class="collapse">
|
||||
{{ result.embedded|safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="container-fluid">
|
||||
<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>
|
||||
{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if rtl %}
|
||||
{{ result_footer_rtl(result) }}
|
||||
{% else %}
|
||||
{{ result_footer(result) }}
|
||||
{% endif %}
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
{% if unresponsive_engines and results|length >= 1 -%}
|
||||
<div class="alert alert-danger fade in" role="alert">
|
||||
<p>{{ _('Engines cannot retrieve results') }}:</p>
|
||||
{%- for engine_name, error_type in unresponsive_engines -%}AAAA
|
||||
{%- for engine_name, error_type in unresponsive_engines -%}
|
||||
{{- engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}{{- "" -}}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8">
|
||||
<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 }}" accesskey="s">
|
||||
<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>
|
||||
</span>
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
{% from 'oscar/macros.html' import icon %}
|
||||
|
||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
|
||||
{% if rtl %}
|
||||
<div class="input-group">
|
||||
{% else %}
|
||||
<div class="input-group col-md-8 col-md-offset-2">
|
||||
{% 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 }}">
|
||||
<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>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-8 col-md-offset-2 advanced">
|
||||
{% include 'oscar/advanced.html' %}
|
||||
</div>
|
||||
|
||||
</form><!-- / #search_form_full -->
|
||||
{% from 'oscar/macros.html' import icon %}
|
||||
|
||||
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
|
||||
{% if rtl %}
|
||||
<div class="input-group">
|
||||
{% else %}
|
||||
<div class="input-group col-md-8 col-md-offset-2">
|
||||
{% 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 }}" accesskey="s">
|
||||
<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>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-8 col-md-offset-2 advanced">
|
||||
{% include 'oscar/advanced.html' %}
|
||||
</div>
|
||||
|
||||
</form><!-- / #search_form_full -->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<select name="time_range" id="time-range" class="custom-select form-control">{{- "" -}}
|
||||
<select name="time_range" id="time-range" class="custom-select form-control" accesskey="t">{{- "" -}}
|
||||
<option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}>
|
||||
{{- _('Anytime') -}}
|
||||
</option>{{- "" -}}
|
||||
|
|
Loading…
Reference in New Issue