diff options
Diffstat (limited to 'apps/calendar/js/geo.js')
-rwxr-xr-x | apps/calendar/js/geo.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/calendar/js/geo.js b/apps/calendar/js/geo.js new file mode 100755 index 00000000000..acea17c0269 --- /dev/null +++ b/apps/calendar/js/geo.js @@ -0,0 +1,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', 'guesstimezone.php?lat=' + position.coords.latitude + '&long=' + position.coords.longitude + ''), + function(data){ + if (data.status == 'success'){ + $('#notification').html(data.message); + $('#notification').slideDown(); + window.setTimeout(function(){$('#notification').slideUp();}, 5000); + }else{ + console.log('Can\'t set new timezone.'); + } + }); + }); +}
\ No newline at end of file |