<commit_before>$(document).ready(function(){

	changeBackground();
	updateClock();
	updateGreetings();

	$('#weather, #miniweather').on('click', function(e){
		$('#weather, #miniweather').toggle();
	});

	getWeather();
});

function changeBackground() {
	$('#background').css('background-image', 'url("https://source.unsplash.com/category/nature/1920x1080")').waitForImages(function() {
		$('#background').addClass('show');
	}, $.noop, true);
}

function updateClock() {
    var now = new Date(); // current date
	time = ("0" + now.getHours()).slice(-2) + ':' + ("0" + now.getMinutes()).slice(-2) + ':' + ("0" + now.getSeconds()).slice(-2);

    // set the content of the element with the ID time to the formatted string
    $('#clock h1').html(time);

    // call this function again in 1000ms
    setTimeout(updateClock, 1000);
}

function updateGreetings() {
	var now = new Date();
	var hour = now.getHours();
	var message = '';
	if(hour >= 5 && hour < 12) {
		message = chrome.i18n.getMessage("greetingsMorning");
	} else if(hour >= 12 && hour < 21) {
		message = chrome.i18n.getMessage("greetingsAfternoon");
	} else if(hour >= 21 || hour < 5) {
		message = chrome.i18n.getMessage("greetingsEvening");
	}
	chrome.storage.local.get('username').then(function(data){
		console.log(data);
		if(!data || data.length > 0 || data.length === 0 || typeof data.username === 'undefined') {
			var input = $('<input />');
			input.on('keydown', function(e){
				if (e.keyCode == 13) {
					saveName(this.value);
				}
			});
			$('#greetings').html(message+', ');
			$('#greetings').append(input);
		} else {
			$('#greetings').html(message+', '+data.username);
		}
	});
}

function getLocation(callback) {
	if (navigator.geolocation) {
		navigator.geolocation.getCurrentPosition(function(position){
			callback(position.coords);
		});
	} else {
		console.info( "Geolocation is not supported by this chrome.");
	}
}<commit_msg>browser compatibility<commit_after>$(document).ready(function(){

	changeBackground();
	updateClock();
	updateGreetings();

	$('#weather, #miniweather').on('click', function(e){
		$('#weather, #miniweather').toggle();
	});

	getWeather();
});

function changeBackground() {
	$('#background').css('background-image', 'url("https://source.unsplash.com/category/nature/1920x1080")').waitForImages(function() {
		$('#background').addClass('show');
	}, $.noop, true);
}

function updateClock() {
    var now = new Date(); // current date
	time = ("0" + now.getHours()).slice(-2) + ':' + ("0" + now.getMinutes()).slice(-2) + ':' + ("0" + now.getSeconds()).slice(-2);

    // set the content of the element with the ID time to the formatted string
    $('#clock h1').html(time);

    // call this function again in 1000ms
    setTimeout(updateClock, 1000);
}

function updateGreetings() {
	var now = new Date();
	var hour = now.getHours();
	var message = '';
	if(hour >= 5 && hour < 12) {
		message = chrome.i18n.getMessage("greetingsMorning");
	} else if(hour >= 12 && hour < 21) {
		message = chrome.i18n.getMessage("greetingsAfternoon");
	} else if(hour >= 21 || hour < 5) {
		message = chrome.i18n.getMessage("greetingsEvening");
	}
	chrome.storage.local.get('username',function(data){
		console.log(data);
		if(!data || data.length > 0 || data.length === 0 || typeof data.username === 'undefined') {
			var input = $('<input />');
			input.on('keydown', function(e){
				if (e.keyCode == 13) {
					saveName(this.value);
				}
			});
			$('#greetings').html(message+', ');
			$('#greetings').append(input);
		} else {
			$('#greetings').html(message+', '+data.username);
		}
	});
}

function getLocation(callback) {
	if (navigator.geolocation) {
		navigator.geolocation.getCurrentPosition(function(position){
			callback(position.coords);
		});
	} else {
		console.info( "Geolocation is not supported by this chrome.");
	}
}
{'fraction_non_alphanumeric': 0.2092660072878709, 'fraction_numerical': 0.022384174908901613, 'mean_word_length': 4.271604938271605, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '705882', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1274, 'n_words': 253}