Changeset View
Changeset View
Standalone View
Standalone View
plugins/calendar/calendar_ui.js
Show First 20 Lines • Show All 2,955 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (confirm(rcmail.gettext(calendar.children ? 'deletecalendarconfirmrecursive' : 'deletecalendarconfirm', 'calendar'))) { | if (confirm(rcmail.gettext(calendar.children ? 'deletecalendarconfirmrecursive' : 'deletecalendarconfirm', 'calendar'))) { | ||||
rcmail.http_post('calendar', { action:'delete', c:{ id:calendar.id } }); | rcmail.http_post('calendar', { action:'delete', c:{ id:calendar.id } }); | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
}; | }; | ||||
this.calendar_refresh_source = function(id) | |||||
{ | |||||
// got race-conditions fc.currentFetchID when using refetchEvents, | |||||
// so we remove and add the source instead | |||||
// fc.fullCalendar('refetchEvents', me.calendars[id]); | |||||
fc.fullCalendar('removeEventSource', me.calendars[id]); | |||||
fc.fullCalendar('addEventSource', me.calendars[id]); | |||||
bruederli: This is really an ugly hack. I wasn't aware that `refetchEvents` has issues. Should maybe be… | |||||
}; | |||||
this.calendar_destroy_source = function(id) | this.calendar_destroy_source = function(id) | ||||
{ | { | ||||
var delete_ids = []; | var delete_ids = []; | ||||
if (this.calendars[id]) { | if (this.calendars[id]) { | ||||
// find sub-calendars | // find sub-calendars | ||||
if (this.calendars[id].children) { | if (this.calendars[id].children) { | ||||
for (var child_id in this.calendars) { | for (var child_id in this.calendars) { | ||||
▲ Show 20 Lines • Show All 1,261 Lines • ▼ Show 20 Lines | window.rcmail && rcmail.addEventListener('init', function(evt) { | ||||
rcmail.register_command('reset-search', function(){ cal.reset_quicksearch(); }, true); | rcmail.register_command('reset-search', function(){ cal.reset_quicksearch(); }, true); | ||||
// resource invitation dialog | // resource invitation dialog | ||||
rcmail.register_command('search-resource', function(){ cal.resource_search(); }, true); | rcmail.register_command('search-resource', function(){ cal.resource_search(); }, true); | ||||
rcmail.register_command('reset-resource-search', function(){ cal.reset_resource_search(); }, true); | rcmail.register_command('reset-resource-search', function(){ cal.reset_resource_search(); }, true); | ||||
rcmail.register_command('add-resource', function(){ cal.add_resource2event(); }, false); | rcmail.register_command('add-resource', function(){ cal.add_resource2event(); }, false); | ||||
// register callback commands | // register callback commands | ||||
rcmail.addEventListener('plugin.refresh_source', function(data) { cal.calendar_refresh_source(data); }); | |||||
rcmail.addEventListener('plugin.destroy_source', function(p){ cal.calendar_destroy_source(p.id); }); | rcmail.addEventListener('plugin.destroy_source', function(p){ cal.calendar_destroy_source(p.id); }); | ||||
rcmail.addEventListener('plugin.unlock_saving', function(p){ cal.unlock_saving(); }); | rcmail.addEventListener('plugin.unlock_saving', function(p){ cal.unlock_saving(); }); | ||||
rcmail.addEventListener('plugin.refresh_calendar', function(p){ cal.refresh(p); }); | rcmail.addEventListener('plugin.refresh_calendar', function(p){ cal.refresh(p); }); | ||||
rcmail.addEventListener('plugin.import_success', function(p){ cal.import_success(p); }); | rcmail.addEventListener('plugin.import_success', function(p){ cal.import_success(p); }); | ||||
rcmail.addEventListener('plugin.import_error', function(p){ cal.import_error(p); }); | rcmail.addEventListener('plugin.import_error', function(p){ cal.import_error(p); }); | ||||
rcmail.addEventListener('plugin.update_counts', function(p){ cal.update_counts(p); }); | rcmail.addEventListener('plugin.update_counts', function(p){ cal.update_counts(p); }); | ||||
rcmail.addEventListener('plugin.reload_view', function(p){ cal.reload_view(p); }); | rcmail.addEventListener('plugin.reload_view', function(p){ cal.reload_view(p); }); | ||||
rcmail.addEventListener('plugin.resource_data', function(p){ cal.resource_data_load(p); }); | rcmail.addEventListener('plugin.resource_data', function(p){ cal.resource_data_load(p); }); | ||||
Show All 27 Lines |
This is really an ugly hack. I wasn't aware that refetchEvents has issues. Should maybe be fixed independent to this.