[fix] eslint --fix

automatically fix some of the problems reported by eslint rules::

    $ ./manage nvm.bash
    nvm-env$ npm --prefix searx/static/themes/simple run eslint-fix

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2021-12-14 07:31:58 +01:00
parent 32cf24a272
commit 34f5e9c7a3
10 changed files with 201 additions and 201 deletions
@@ -4,7 +4,7 @@
'use strict';
searxng.ready(function () {
searxng.on('.searxng_init_map', 'click', function(event) {
searxng.on('.searxng_init_map', 'click', function (event) {
// no more request
this.classList.remove("searxng_init_map");
@@ -17,9 +17,9 @@
var map_geojson = JSON.parse(this.dataset.mapGeojson);
searxng.loadStyle('css/leaflet.css');
searxng.loadScript('js/leaflet.js', function() {
searxng.loadScript('js/leaflet.js', function () {
var map_bounds = null;
if(map_boundingbox) {
if (map_boundingbox) {
var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
var northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
map_bounds = L.latLngBounds(southWest, northEast);
@@ -28,26 +28,26 @@
// 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 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 osmWikimediaUrl = 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
var osmWikimediaAttrib = 'Wikimedia maps | Maps data © <a href="https://openstreetmap.org">OpenStreetMap contributors</a>';
var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
// init map view
if(map_bounds) {
if (map_bounds) {
// TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
// Still useful ?
setTimeout(function () {
map.fitBounds(map_bounds, {
maxZoom:17
maxZoom: 17
});
}, 0);
} else if (map_lon && map_lat) {
if(map_zoom) {
map.setView(new L.latLng(map_lat, map_lon),map_zoom);
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.setView(new L.latLng(map_lat, map_lon), 8);
}
}
@@ -60,11 +60,11 @@
L.control.layers(baseLayers).addTo(map);
if(map_geojson) {
if (map_geojson) {
L.geoJson(map_geojson).addTo(map);
} /*else if(map_bounds) {
} /* else if(map_bounds) {
L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);
}*/
} */
});
// this event occour only once per element