<commit_before>var map;
var coords = {};

function initMap() {
	map = new google.maps.Map(document.getElementById('map'), {
		center: coords,
		zoom: 13,
		disableDefaultUI: true
	});

	$('#submit-city').attr("id", "submit-newCity");

	var geocoder = new google.maps.Geocoder();

	document.getElementById('submit-newCity').addEventListener('click', function() {
	  geocodeNewCity(geocoder, map);
	});
}

function geocodeNewCity(geocoder, resultsMap) {
	var city = $('#city').val();
	geocoder.geocode({'address': city}, function(results, status) {
		if (status === google.maps.GeocoderStatus.OK) {
			resultsMap.setCenter(results[0].geometry.location);
		} else {
			alert('Geocode was not successful for the following reason: ' + status);
		}
	});
}

function getGeoLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
			coords.lat = position.coords.latitude;
			coords.lng = position.coords.longitude;

			initMap();
		})
	}
}

function getLocationManually() {
	var geocodeApiUrl = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyAZKV6_aryLoI5q40ikKRJ_Qy-32Hg-3ng&address=";
	var city = $('#city').val();
	var geocodeUrl = geocodeApiUrl + city;

	console.log(city);
	console.log(geocodeUrl);

	$.getJSON(geocodeUrl, function( data ) {
		pos = data.results[0].geometry.location;
		coords.lat = pos.lat;
		coords.lng = pos.lng;
		
		initMap();
	});
}

getGeoLocation();
$('#getCity').submit(getLocationManually);
<commit_msg>fix: Manual City Submission button<commit_after>var map;
var coords = {};

function initMap() {
	map = new google.maps.Map(document.getElementById('map'), {
		center: coords,
		zoom: 13,
		disableDefaultUI: true
	});

	$('#submit-city').attr("id", "submit-newCity");

	var geocoder = new google.maps.Geocoder();

	document.getElementById('submit-newCity').addEventListener('click', function() {
	  geocodeNewCity(geocoder, map);
	});
}

function geocodeNewCity(geocoder, resultsMap) {
	var city = $('#city').val();
	geocoder.geocode({'address': city}, function(results, status) {
		if (status === google.maps.GeocoderStatus.OK) {
			resultsMap.setCenter(results[0].geometry.location);
		} else {
			alert('Geocode was not successful for the following reason: ' + status);
		}
	});
}

function getGeoLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
			coords.lat = position.coords.latitude;
			coords.lng = position.coords.longitude;

			initMap();
			getEvents();
		})
	}
}

function getLocationManually() {
	var geocodeApi = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyAZKV6_aryLoI5q40ikKRJ_Qy-32Hg-3ng&address=";
	var city = $('#city').val();
	var geocodeUrl = geocodeApi + city;

	console.log(city);
	console.log(geocodeUrl);

	$.getJSON(geocodeUrl, function( data ) {
		pos = data.results[0].geometry.location;
		coords.lat = pos.lat;
		coords.lng = pos.lng;
		
		initMap();
		getEvents();
	});
}

function getEvents() {
	// API for events is coming from eventful.com
	var efApi = "http://api.eventful.com/json/events/search?app_key=";
	var efKey = "VN3TDSXzQdSQK2rD";
	var efSort = "&date=Today&sort_order=popularity&within=25";
	var efInclude = "&include=categories,subcategories,popularity";
	var efLocation = "&location=" + coords.lat + "," + coords.lng;

	var efUrl = efApi + efKey + efSort + efInclude + efLocation;
	
	console.log(coords.lat);
	console.log(efUrl);
	// $.getJSON(efUrl, function( data ) {
	// 	console.log(data);
	// });
	$.ajax({
		url: efUrl,
		dataType: "jsonp",
		success: function( data ) {
			console.log(data);
		}
	});
}

getGeoLocation();
// $('#getCity').submit(getLocationManually);
document.getElementById('submit-city').addEventListener('click', function() {
	getLocationManually();
});

{'fraction_non_alphanumeric': 0.16819732353712935, 'fraction_numerical': 0.006822356336919444, 'mean_word_length': 4.655786350148368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '6221920', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1356, 'n_words': 227}