Welcome to mirror list, hosted at ThFree Co, Russian Federation.

geo.js « js « calendar « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7018c6298a20c46cb8c21b2206537780341554d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
if (navigator.geolocation) { 
	navigator.geolocation.getCurrentPosition(function(position) {
		$.getJSON(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php?lat=' + position.coords.latitude + '&long=' + position.coords.longitude + ''),
		function(data){
			if (data.status == 'success' && typeof(data.message) != 'undefined'){
				$('#notification').html(data.message);
				$('#notification').slideDown();
				window.setTimeout(function(){$('#notification').slideUp();}, 5000);
			}else{
				console.log('Can\'t set new timezone.');
			}
		});
	});
}