mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
6bd01bf81f
Close https://github.com/searx/searx/issues/2670 Note: clean-css contains a bug: * a multiline comment or URL adds "$stdin" to the sourcemap (see src/less/logicodev/search.less) * in this case when the user opens the devtools, the browser fails to load this "https://.../$stdin" URL * it is not a problem and the error appears only when the user actively tries to debug the CSS. * seems related to https://github.com/jakubpawlowicz/clean-css/issues/593
4 lines
5.6 KiB
JavaScript
4 lines
5.6 KiB
JavaScript
/*! oscar/searx.min.js | 21-03-2021 | */
|
|
|
|
window.searx=function(t){"use strict";var a,a=t.currentScript||(a=t.getElementsByTagName("script"))[a.length-1];return{autocompleter:"true"===a.getAttribute("data-autocompleter"),method:a.getAttribute("data-method"),translations:JSON.parse(a.getAttribute("data-translations"))}}(document),$(document).ready(function(){var t,e="";searx.autocompleter&&((t=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"./autocompleter?q=%QUERY",wildcard:"%QUERY"}})).initialize(),$("#q").on("keydown",function(t){13==t.which&&(e=$("#q").val())}),$("#q").typeahead({name:"search-results",highlight:!1,hint:!0,displayKey:function(t){return t},classNames:{input:"tt-input",hint:"tt-hint",menu:"tt-dropdown-menu",dataset:"tt-dataset-search-results"}},{name:"autocomplete",source:t}),$("#q").bind("typeahead:select",function(t,a){e&&$("#q").val(e),$("#search_form").submit()}))}),$(document).ready(function(){$("#q.autofocus").focus(),$("#clear_search").click(function(){document.getElementById("q").value=""}),$(".select-all-on-click").click(function(){$(this).select()}),$(".btn-collapse").click(function(){var t=$(this).data("btn-text-collapsed"),a=$(this).data("btn-text-not-collapsed");""!==t&&""!==a&&(new_html=$(this).hasClass("collapsed")?$(this).html().replace(t,a):$(this).html().replace(a,t),$(this).html(new_html))}),$(".btn-toggle .btn").click(function(){var t="btn-"+$(this).data("btn-class"),a=$(this).data("btn-label-default"),e=$(this).data("btn-label-toggled");""!==e&&(new_html=$(this).hasClass("btn-default")?$(this).html().replace(a,e):$(this).html().replace(e,a),$(this).html(new_html)),$(this).toggleClass(t),$(this).toggleClass("btn-default")}),$(".media-loader").click(function(){var t=$(this).data("target"),a=$(t+" > iframe"),t=a.attr("src");void 0!==t&&!1!==t||a.attr("src",a.data("src"))}),$(".btn-sm").dblclick(function(){var t="btn-"+$(this).data("btn-class");$(this).hasClass("btn-default")?($(".btn-sm > input").attr("checked","checked"),$(".btn-sm > input").prop("checked",!0),$(".btn-sm").addClass(t),$(".btn-sm").addClass("active"),$(".btn-sm").removeClass("btn-default")):($(".btn-sm > input").attr("checked",""),$(".btn-sm > input").removeAttr("checked"),$(".btn-sm > input").checked=!1,$(".btn-sm").removeClass(t),$(".btn-sm").removeClass("active"),$(".btn-sm").addClass("btn-default"))}),$(".nav-tabs").click(function(t){$(t.target).parents("ul").children().attr("aria-selected","false"),$(t.target).parent().attr("aria-selected","true")})}),window.addEventListener("load",function(){$(".infobox").each(function(){var t=$(this).find(".infobox_body");t.prop("scrollHeight")+t.find("img.infobox_part").height()<=t.css("max-height").replace("px","")&&$(this).find(".infobox_toggle").hide()})}),$(document).ready(function(){$(".searx_overpass_request").on("click",function(t){var a="https://overpass-api.de/api/interpreter?data=[out:json][timeout:25];(",e=");out meta;",s=$(this).data("osm-id"),n=$(this).data("osm-type"),i=$(this).data("result-table"),o="#"+$(this).data("result-table-loadicon"),r=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(s&&n&&i){var i="#"+i,l=null;switch(n){case"node":l=a+"node("+s+");"+e;break;case"way":l=a+"way("+s+");"+e;break;case"relation":l=a+"relation("+s+");"+e}l&&$.ajax(l).done(function(t){if(t&&t.elements&&t.elements[0]){var a,e=t.elements[0],s=$(i).html();for(a in e.tags)if(null===e.tags.name||-1==r.indexOf(a)){switch(s+="<tr><td>"+a+"</td><td>",a){case"phone":case"fax":s+='<a href="tel:'+e.tags[a].replace(/ /g,"")+'">'+e.tags[a]+"</a>";break;case"email":s+='<a href="mailto:'+e.tags[a]+'">'+e.tags[a]+"</a>";break;case"website":case"url":s+='<a href="'+e.tags[a]+'">'+e.tags[a]+"</a>";break;case"wikidata":s+='<a href="https://www.wikidata.org/wiki/'+e.tags[a]+'">'+e.tags[a]+"</a>";break;case"wikipedia":if(-1!=e.tags[a].indexOf(":")){s+='<a href="https://'+e.tags[a].substring(0,e.tags[a].indexOf(":"))+".wikipedia.org/wiki/"+e.tags[a].substring(e.tags[a].indexOf(":")+1)+'">'+e.tags[a]+"</a>";break}default:s+=e.tags[a]}s+="</td></tr>"}$(i).html(s),$(i).removeClass("hidden"),$(o).addClass("hidden")}}).fail(function(){$(o).html($(o).html()+'<p class="text-muted">'+searx.translations.could_not_load+"</p>")})}$(this).off(t)}),$(".searx_init_map").on("click",function(t){var a=$(this).data("leaflet-target"),e=$(this).data("map-lon"),s=$(this).data("map-lat"),n=$(this).data("map-zoom"),i=$(this).data("map-boundingbox"),o=$(this).data("map-geojson");i&&(southWest=L.latLng(i[0],i[2]),northEast=L.latLng(i[1],i[3]),map_bounds=L.latLngBounds(southWest,northEast)),L.Icon.Default.imagePath="./static/themes/oscar/css/images/";var r=L.map(a),a=new L.TileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{minZoom:1,maxZoom:19,attribution:'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'});new L.TileLayer("https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",{minZoom:1,maxZoom:19,attribution:'Wikimedia maps beta | Maps data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'});setTimeout(function(){map_bounds?r.fitBounds(map_bounds,{maxZoom:17}):e&&s&&(n?r.setView(new L.LatLng(s,e),n):r.setView(new L.LatLng(s,e),8))},0),r.addLayer(a),L.control.layers({"OSM Mapnik":a}).addTo(r),o&&L.geoJson(o).addTo(r),$(this).off(t)})}),$(document).ready(function(){$("#allow-all-engines").click(function(){$(".onoffswitch-checkbox").each(function(){this.checked=!1})}),$("#disable-all-engines").click(function(){$(".onoffswitch-checkbox").each(function(){this.checked=!0})})});
|
|
//# sourceMappingURL=searx.min.js.map
|