2011-11-11 14:51:44 +00:00
|
|
|
/**
|
|
|
|
* 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) {
|
2012-04-30 19:18:34 +00:00
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php') + '?lat=' + position.coords.latitude + '&long=' + position.coords.longitude,
|
2011-11-11 14:51:44 +00:00
|
|
|
function(data){
|
2012-01-02 10:35:50 +00:00
|
|
|
if (data.status == 'success' && typeof(data.message) != 'undefined'){
|
2011-11-11 14:51:44 +00:00
|
|
|
$('#notification').html(data.message);
|
|
|
|
$('#notification').slideDown();
|
|
|
|
window.setTimeout(function(){$('#notification').slideUp();}, 5000);
|
|
|
|
}else{
|
|
|
|
console.log('Can\'t set new timezone.');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|