<commit_before>/*
 * Italian petrol pumps comparator - Project born (and winner) at hackaton Facile.it 2015
 * Copyright (C) 2015 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
 * Copyright (C) 2022 <NAME>
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */

var map;
var EUROS = 40;
var errorTooStations = true;
var pleaseZoomIn = true;
var noStations = true;
var Stations = {
	all: [],
	exists: function(id) {
		var i = 0;
		while(i < this.all.length && this.all[i++] !== id);
		return this.all[i-1] === id;
	},
	alreadyAdded: function(id) {
		if( this.exists(id) ) {
			return true;
		}
		this.all.push(id);
		return false;
	}

};
var Overworld = {
	$el: undefined,
	$action: undefined,
	visible: true,
	running: false,
	hide: function() {
		if(Overworld.running) {
			return;
		}
		Overworld.running = true;

		Overworld.$el.hide( "slow", function() {
			Overworld.$action.show( "fast", function() {
				Overworld.running = false;
			});
		});
	},
	show: function() {
		if(Overworld.running) {
			return;
		}
		Overworld.running = true;

		map.closePopup();

		Overworld.$el.find("input").val("");

		Overworld.$action.hide( "slow", function() {
			Overworld.$el.show( "fast", function() {
				Overworld.$el.find("input").focus();
				Overworld.running = false;
			});
		});
	}
};

$( function() {

	Overworld.$action = $("#overworld-buttons");
	Overworld.$el	  = $("#overworld");
	Overworld.$action.hide().click( Overworld.show );

	$(".close-overworld").click( Overworld.hide );

	$("form").submit(function(event) {
		suggest_nominatim_addresses(
			$("input[name=search_address]").val()
		);
		event.preventDefault();
	});

	map = L.map('map');

	// create the tile layer with correct attribution
	var osmUrl='http://{s}.tile.osm.org/{z}/{x}/{y}.png';
	var osmAttrib='© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
	var osm = new L.TileLayer(osmUrl, {maxZoom: 17, attribution: osmAttrib});
	map.addLayer(osm);

	map.setView([41.49, 13.11], 6);

	map.on("moveend", function() {
		getMarkersInBounds();<commit_msg>use https:// OpenStreetMap tiles<commit_after>/*
 * Italian petrol pumps comparator - Project born (and winner) at hackaton Facile.it 2015
 * Copyright (C) 2015 <NAME>, <NAME>, <NAME>, <NAME>, Cesare de Cal, Edoardo de Cal
 * Copyright (C) 2022 <NAME>
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */

var map;
var EUROS = 40;
var errorTooStations = true;
var pleaseZoomIn = true;
var noStations = true;
var Stations = {
	all: [],
	exists: function(id) {
		var i = 0;
		while(i < this.all.length && this.all[i++] !== id);
		return this.all[i-1] === id;
	},
	alreadyAdded: function(id) {
		if( this.exists(id) ) {
			return true;
		}
		this.all.push(id);
		return false;
	}

};
var Overworld = {
	$el: undefined,
	$action: undefined,
	visible: true,
	running: false,
	hide: function() {
		if(Overworld.running) {
			return;
		}
		Overworld.running = true;

		Overworld.$el.hide( "slow", function() {
			Overworld.$action.show( "fast", function() {
				Overworld.running = false;
			});
		});
	},
	show: function() {
		if(Overworld.running) {
			return;
		}
		Overworld.running = true;

		map.closePopup();

		Overworld.$el.find("input").val("");

		Overworld.$action.hide( "slow", function() {
			Overworld.$el.show( "fast", function() {
				Overworld.$el.find("input").focus();
				Overworld.running = false;
			});
		});
	}
};

$( function() {

	Overworld.$action = $("#overworld-buttons");
	Overworld.$el	  = $("#overworld");
	Overworld.$action.hide().click( Overworld.show );

	$(".close-overworld").click( Overworld.hide );

	$("form").submit(function(event) {
		suggest_nominatim_addresses(
			$("input[name=search_address]").val()
		);
		event.preventDefault();
	});

	map = L.map('map');

	// create the tile layer with correct attribution
	var osmUrl='https://{s}.tile.osm.org/{z}/{x}/{y}.png';
	var osmAttrib='© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
	var osm = new L.TileLayer(osmUrl, {maxZoom: 17, attribution: osmAttrib});
	map.addLayer(osm);

	map.setView([41.49, 13.11], 6);

	map.on("moveend", function() {
		getMarkersInBounds();
{'fraction_non_alphanumeric': 0.16123019571295433, 'fraction_numerical': 0.01043802423112768, 'mean_word_length': 3.8429602888086642, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5141493', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1766, 'n_words': 508}