2011-08-31 22:20:46 +04:00
|
|
|
$(document).ready(function(){
|
2012-01-02 14:39:23 +04:00
|
|
|
$('#timezone').change( function(){
|
2011-09-11 19:20:23 +04:00
|
|
|
OC.msg.startSaving('#calendar .msg')
|
2011-08-31 22:20:46 +04:00
|
|
|
// Serialize the data
|
2012-01-02 14:39:23 +04:00
|
|
|
var post = $( '#timezone' ).serialize();
|
2011-09-29 01:16:32 +04:00
|
|
|
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
|
2011-10-02 17:51:24 +04:00
|
|
|
//OC.msg.finishedSaving('#calendar .msg', data);
|
2011-08-31 22:20:46 +04:00
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
2012-01-02 14:39:23 +04:00
|
|
|
$('#timezone').chosen();
|
|
|
|
$('#timeformat').change( function(){
|
|
|
|
var data = $('#timeformat').serialize();
|
|
|
|
$.post( OC.filePath('calendar', 'ajax', 'settimeformat.php'), data, function(data){
|
|
|
|
if(data == 'error'){
|
|
|
|
console.log('saving timeformat failed');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2012-01-02 14:35:50 +04:00
|
|
|
$('#timezonedetection').change( function(){
|
|
|
|
var post = $('#timezonedetection').serialize();
|
|
|
|
$.post( OC.filePath('calendar', 'ajax', 'timezonedetection.php'), post, function(data){
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2011-10-01 12:39:07 +04:00
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax', 'timeformat.php'), function(jsondata, status) {
|
2012-01-02 14:39:23 +04:00
|
|
|
$('#' + jsondata.timeformat).attr('selected',true);
|
|
|
|
$('#timeformat').chosen();
|
2011-10-02 00:53:18 +04:00
|
|
|
});
|
2012-01-02 14:35:50 +04:00
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax', 'gettimezonedetection.php'), function(jsondata, status){
|
|
|
|
if(jsondata.detection == 'true'){
|
|
|
|
$('#timezonedetection').attr('checked', 'checked');
|
|
|
|
}
|
|
|
|
});
|
2011-08-31 22:20:46 +04:00
|
|
|
});
|