xref: /plugin/davcal/script.js (revision 73b331a35330253d417e5267583e2bf7e7182e31)
1/* DOKUWIKI:include_once fullcalendar-2.4.0/moment.js */
2/* DOKUWIKI:include_once fullcalendar-2.4.0/fullcalendar.js */
3/* DOKUWIKI:include_once fullcalendar-2.4.0/lang/de.js */
4/* DOKUWIKI:include_once fullcalendar-2.4.0/lang/en.js */
5/* DOKUWIKI:include_once datetimepicker-2.4.5/jquery.datetimepicker.js */
6/* DOKUWIKI:include_once jstz.js */
7
8/**
9 * Initialize the DAVCal script, attaching some event handlers and triggering
10 * the initial load of the fullcalendar JS
11 */
12jQuery(function() {
13    // Redefine functions for using moment.js with datetimepicker
14
15    Date.parseDate = function( input, format ){
16      return moment(input,format).toDate();
17    };
18    Date.prototype.dateFormat = function( format ){
19      return moment(this).format(format);
20    };
21
22    // Attach to event links
23    var calendarid = jQuery('#fullCalendar').data('calendarid');
24    if(!calendarid) return;
25    dw_davcal__modals.calid = calendarid;
26
27    jQuery('div.fullCalendarSettings a').each(function() {
28        var $link = jQuery(this);
29        var href = $link.attr('href');
30        if (!href) return;
31
32        $link.click(
33            function(e) {
34                dw_davcal__modals.showSettingsDialog();
35                e.preventDefault();
36                return '';
37            }
38        );
39        }
40    );
41
42    // First, retrieve the current settings.
43    // Upon success, initialize fullcalendar.
44    var postArray = { };
45    jQuery.post(
46        DOKU_BASE + 'lib/exe/ajax.php',
47        {
48            call: 'plugin_davcal',
49            id: dw_davcal__modals.calid,
50            action: 'getSettings',
51            params: postArray
52        },
53        function(data)
54        {
55            var result = data['result'];
56            if(result === true)
57            {
58                dw_davcal__modals.settings = data['settings'];
59                var wknum = false;
60                var tz = false;
61                var we = true;
62                var ro = false;
63                var detectedTz = jstz.determine().name();
64                dw_davcal__modals.detectedTz = detectedTz;
65                if(data['settings']['weeknumbers'] == 1)
66                    wknum = true;
67                if(data['settings']['timezone'] !== '')
68                    tz = data['settings']['timezone'];
69                if(data['settings']['workweek'] == 1)
70                    we = false;
71                // Initialize the davcal popup
72                var res = jQuery('#fullCalendar').fullCalendar({
73                    dayClick: function(date, jsEvent, view) {
74                        dw_davcal__modals.showEditEventDialog(date, false);
75                    },
76                    eventClick: function(calEvent, jsEvent, view) {
77                        dw_davcal__modals.showEditEventDialog(calEvent, true);
78                    },
79                    events: {
80                        url: DOKU_BASE + 'lib/exe/ajax.php',
81                        type: 'POST',
82                        data: {
83                            call: 'plugin_davcal',
84                            action: 'getEvents',
85                            id: dw_davcal__modals.calid
86                        },
87                        error: function() {
88                            dw_davcal__modals.msg = LANG.plugins.davcal['error_retrieving_data'];
89                            dw_davcal__modals.showDialog(false);
90                        }
91                    },
92                    header: {
93                        left: 'title',
94                        center: 'today prev,next',
95                        right: 'month,agendaWeek,agendaDay'
96                    },
97                    lang: JSINFO.plugin.davcal['language'],
98                    weekNumbers: wknum,
99                    timezone: tz,
100                    weekends: we,
101                });
102            }
103        }
104    );
105});
106
107/**
108 * This holds all modal windows that DAVCal uses.
109 */
110var dw_davcal__modals = {
111    $editEventDialog: null,
112    $dialog: null,
113    $settingsDialog: null,
114    msg: null,
115    completeCb: null,
116    action: null,
117    uid: null,
118    settings: null,
119    calid: null,
120    detectedTz: null,
121
122    /**
123     * Show the settings dialog
124     */
125    showSettingsDialog : function() {
126        if(dw_davcal__modals.$settingsDialog)
127            return;
128
129        // Dialog buttons are language-dependent and defined here.
130        // Attach event handlers for save and cancel.
131        var dialogButtons = {};
132        dialogButtons[LANG.plugins.davcal['save']] = function() {
133            var postArray = { };
134            jQuery("input[class=dw_davcal__settings], select[class=dw_davcal__settings]").each(function() {
135              if(jQuery(this).attr('type') == 'checkbox')
136              {
137                  postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
138              }
139              else
140              {
141                  postArray[jQuery(this).prop('name')] = jQuery(this).val();
142              }
143            });
144            jQuery('#dw_davcal__ajaxsettings').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
145            jQuery.post(
146                DOKU_BASE + 'lib/exe/ajax.php',
147                {
148                    call: 'plugin_davcal',
149                    id: dw_davcal__modals.calid,
150                    action: 'saveSettings',
151                    params: postArray
152                },
153                function(data)
154                {
155                    var result = data['result'];
156                    var html = data['html'];
157                    jQuery('#dw_davcal__ajaxsettings').html(html);
158                    if(result === true)
159                    {
160                        location.reload();
161                    }
162                }
163            );
164        };
165        dialogButtons[LANG.plugins.davcal['cancel']] = function () {
166            dw_davcal__modals.hideSettingsDialog();
167        };
168
169        dw_davcal__modals.$settingsDialog = jQuery(document.createElement('div'))
170       .dialog({
171           autoOpen: false,
172           draggable: true,
173           title: LANG.plugins.davcal['settings'],
174           resizable: true,
175           buttons: dialogButtons,
176       })
177       .html(
178            '<div><table>' +
179            //'<tr><td>' + LANG.plugins.davcal['use_lang_tz'] + '</td><td><input type="checkbox" name="use_lang_tz" id="dw_davcal__settings_use_lang_tz" class="dw_davcal__settings"></td></tr>' +
180            '<tr><td>' + LANG.plugins.davcal['timezone'] + '</td><td><select name="timezone" id="dw_davcal__settings_timezone" class="dw_davcal__settings"></select></td></tr>' +
181            '<tr><td>' + LANG.plugins.davcal['weeknumbers'] + '</td><td><input type="checkbox" name="weeknumbers" id="dw_davcal__settings_weeknumbers" class="dw_davcal__settings"></td></tr>' +
182            '<tr><td>' + LANG.plugins.davcal['only_workweek'] + '</td><td><input type="checkbox" name="workweek" id="dw_davcal__settings_workweek" class="dw_davcal__settings"></td></tr>' +
183            '<tr><td>' + LANG.plugins.davcal['sync_url'] + '</td><td><input type="text" name="syncurl" readonly="readonly" id="dw_davcal__settings_syncurl" class="dw_davcal__text" value="' + dw_davcal__modals.settings['syncurl'] + '"></td></tr>' +
184            '<tr><td>' + LANG.plugins.davcal['private_url'] + '</td><td><input type="text" name="privateurl" readonly="readonly" id="dw_davcal__settings_privateurl" class="dw_davcal__text" value="' + dw_davcal__modals.settings['privateurl'] + '"></td></tr>' +
185            '</table>' +
186            '</div>' +
187            '<div id="dw_davcal__ajaxsettings"></div>'
188            )
189       .parent()
190       .attr('id','dw_davcal__settings')
191       .show()
192       .appendTo('.dokuwiki:first');
193
194       jQuery('#dw_davcal__settings').position({
195           my: "center",
196           at: "center",
197           of: window
198       });
199
200       // Initialize current settings
201       jQuery('#dw_davcal__settings_syncurl').on('click', function() {
202           jQuery(this).select();
203       });
204
205       jQuery('#dw_davcal__settings_privateurl').on('click', function() {
206           jQuery(this).select();
207       });
208
209        var $tzdropdown = jQuery('#dw_davcal__settings_timezone');
210        jQuery('#fullCalendarTimezoneList option').each(function() {
211            jQuery('<option />', {value: jQuery(this).val(),
212                    text: jQuery(this).text()}).appendTo($tzdropdown);
213        });
214
215        if(dw_davcal__modals.settings)
216        {
217            if(dw_davcal__modals.settings['timezone'] !== '')
218                jQuery('#dw_davcal__settings_timezone').val(dw_davcal__modals.settings['timezone']);
219            if(dw_davcal__modals.settings['weeknumbers'] == 1)
220                jQuery('#dw_davcal__settings_weeknumbers').prop('checked', true);
221            else
222                jQuery('#dw_davcal__settings_weeknumbers').prop('checked', false);
223
224            if(dw_davcal__modals.settings['workweek'] == 1)
225                jQuery('#dw_davcal__settings_workweek').prop('checked', true);
226            else
227                jQuery('#dw_davcal__settings_workweek').prop('checked', false);
228        }
229
230        // attach event handlers
231        jQuery('#dw_davcal__settings .ui-dialog-titlebar-close').click(function(){
232          dw_davcal__modals.hideSettingsDialog();
233        });
234    },
235
236    /**
237     * Sanity-check our events.
238     *
239     * @return boolean false on failure, otherwise true
240     */
241    checkEvents : function() {
242        // Retrieve dates
243        var allDay = jQuery('#dw_davcal__allday_edit').prop('checked');
244        var startDate = moment(jQuery('#dw_davcal__eventfrom_edit').val(), 'YYYY-MM-DD');
245        var endDate = moment(jQuery('#dw_davcal__eventto_edit').val(), 'YYYY-MM-DD');
246
247        // Do the checking
248        if(!allDay)
249        {
250            var startTime = moment.duration(jQuery('#dw_davcal__eventfromtime_edit').val());
251            var endTime = moment.duration(jQuery('#dw_davcal__eventtotime_edit').val());
252            startDate.add(startTime);
253            endDate.add(endTime);
254        }
255        if(!startDate.isValid())
256        {
257            dw_davcal__modals.msg = LANG.plugins.davcal['start_date_invalid'];
258            dw_davcal__modals.showDialog(false);
259            return false;
260        }
261        if(!endDate.isValid())
262        {
263            dw_davcal__modals.msg = LANG.plugins.davcal['end_date_invalid'];
264            dw_davcal__modals.showDialog(false);
265            return false;
266        }
267        if(endDate.isBefore(startDate))
268        {
269            dw_davcal__modals.msg = LANG.plugins.davcal['end_date_before_start_date'];
270            dw_davcal__modals.showDialog(false);
271            return false;
272        }
273        if(!allDay && endDate.isSame(startDate))
274        {
275            dw_davcal__modals.msg = LANG.plugins.davcal['end_date_is_same_as_start_date'];
276            dw_davcal__modals.showDialog(false);
277            return false;
278        }
279        return true;
280    },
281
282    /**
283     * Show the edit event dialog, which is also used to create new events
284     * @param {Object} event The event to create, that is the date or the calEvent
285     * @param {Object} edit  Whether we edit (true) or create a new event (false)
286     */
287    showEditEventDialog : function(event, edit) {
288        if(dw_davcal__modals.$editEventDialog)
289            return;
290
291        var readonly = dw_davcal__modals.settings['readonly'];
292        var title = '';
293        var dialogButtons = {};
294        var calEvent = [];
295        var recurringWarning = '';
296        // Buttons are dependent on edit or create
297        // Several possibilities:
298        //
299        // 1) Somebody tries to edit, it is not recurring and not readonly -> show
300        // 2) Somebody tries to edit, it is recurring and not readonly -> message
301        // 3) Somebody tries to edit, it is readonly -> message
302        // 4) Somebody tries to create and it is readonly -> message
303        // 5) Somebody tries to create -> show
304        if(edit && (event.recurring != true) && (readonly === false))
305        {
306            calEvent = event;
307            title = LANG.plugins.davcal['edit_event'];
308            dialogButtons[LANG.plugins.davcal['edit']] = function() {
309                if(!dw_davcal__modals.checkEvents())
310                  return;
311                var postArray = { };
312                jQuery("input.dw_davcal__editevent, textarea.dw_davcal__editevent").each(function() {
313                  if(jQuery(this).attr('type') == 'checkbox')
314                  {
315                      postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
316                  }
317                  else
318                  {
319                      postArray[jQuery(this).prop('name')] = jQuery(this).val();
320                  }
321                });
322                jQuery('#dw_davcal__ajaxedit').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
323                jQuery.post(
324                    DOKU_BASE + 'lib/exe/ajax.php',
325                    {
326                        call: 'plugin_davcal',
327                        id: dw_davcal__modals.calid,
328                        action: 'editEvent',
329                        params: postArray
330                    },
331                    function(data)
332                    {
333                        var result = data['result'];
334                        var html = data['html'];
335                        jQuery('#dw_davcal__ajaxedit').html(html);
336                        if(result === true)
337                        {
338                            jQuery('#fullCalendar').fullCalendar('refetchEvents');
339                            dw_davcal__modals.hideEditEventDialog();
340                        }
341                    }
342                );
343            };
344            dialogButtons[LANG.plugins.davcal['delete']] = function() {
345                dw_davcal__modals.action = 'deleteEvent';
346                dw_davcal__modals.msg = LANG.plugins.davcal['really_delete_this_event'];
347                dw_davcal__modals.completeCb = function(data) {
348                    var result = data['result'];
349                    var html = data['html'];
350                    jQuery('#dw_davcal__ajaxedit').html(html);
351                    if(result === true)
352                    {
353                        jQuery('#fullCalendar').fullCalendar('refetchEvents');
354                        dw_davcal__modals.hideEditEventDialog();
355                    }
356                };
357                dw_davcal__modals.showDialog(true);
358            };
359        }
360        else if(edit && (event.recurring == true) && (readonly === false))
361        {
362            calEvent = event;
363            title = LANG.plugins.davcal['edit_event'];
364            recurringWarning = LANG.plugins.davcal['recurring_cant_edit'];
365        }
366        else if(edit && (readonly === true))
367        {
368            calEvent = event;
369            title = LANG.plugins.davcal['edit_event'];
370            recurringWarning = LANG.plugins.davcal['no_permission'];
371        }
372        else if(readonly === true)
373        {
374            calEvent.start = event;
375            calEvent.end = moment(event);
376            calEvent.start.hour(12);
377            calEvent.start.minute(0);
378            calEvent.end.hour(13);
379            calEvent.end.minute(0);
380            calEvent.allDay = false;
381            calEvent.recurring = false;
382            calEvent.title = '';
383            calEvent.description = '';
384            calEvent.id = '0';
385            title = LANG.plugins.davcal['create_new_event'];
386            recurringWarning = LANG.plugins.davcal['no_permission'];
387        }
388        else
389        {
390            calEvent.start = event;
391            calEvent.end = moment(event);
392            calEvent.start.hour(12);
393            calEvent.start.minute(0);
394            calEvent.end.hour(13);
395            calEvent.end.minute(0);
396            calEvent.allDay = false;
397            calEvent.recurring = false;
398            calEvent.title = '';
399            calEvent.description = '';
400            calEvent.id = '0';
401            title = LANG.plugins.davcal['create_new_event'];
402            dialogButtons[LANG.plugins.davcal['create']] = function() {
403                if(!dw_davcal__modals.checkEvents())
404                  return;
405
406                var postArray = { };
407                jQuery("input.dw_davcal__editevent, textarea.dw_davcal__editevent").each(function() {
408                  if(jQuery(this).attr('type') == 'checkbox')
409                  {
410                      postArray[jQuery(this).prop('name')] = jQuery(this).prop('checked') ? 1 : 0;
411                  }
412                  else
413                  {
414                      postArray[jQuery(this).prop('name')] = jQuery(this).val();
415                  }
416                });
417                jQuery('#dw_davcal__ajaxedit').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />');
418                jQuery.post(
419                    DOKU_BASE + 'lib/exe/ajax.php',
420                    {
421                        call: 'plugin_davcal',
422                        id: dw_davcal__modals.calid,
423                        action: 'newEvent',
424                        params: postArray
425                    },
426                    function(data)
427                    {
428                        var result = data['result'];
429                        var html = data['html'];
430                        jQuery('#dw_davcal__ajaxedit').html(html);
431                        if(result === true)
432                        {
433                            jQuery('#fullCalendar').fullCalendar('refetchEvents');
434                            dw_davcal__modals.hideEditEventDialog();
435                        }
436                    }
437                );
438            };
439        }
440        dialogButtons[LANG.plugins.davcal['cancel']] = function() {
441            dw_davcal__modals.hideEditEventDialog();
442        };
443        dw_davcal__modals.uid = calEvent.id;
444        dw_davcal__modals.$editEventDialog = jQuery(document.createElement('div'))
445       .dialog({
446           autoOpen: false,
447           draggable: true,
448           title: title,
449           resizable: true,
450           buttons: dialogButtons,
451       })
452       .html(
453            '<div><table><tr><td>' + LANG.plugins.davcal['title'] + '</td><td><input type="text" id="dw_davcal__eventname_edit" name="eventname" class="dw_davcal__editevent"></td></tr>' +
454            '<tr><td>' + LANG.plugins.davcal['description'] + '</td><td><textarea name="eventdescription" id="dw_davcal__eventdescription_edit" class="dw_davcal__editevent dw_davcal__text"></textarea></td></tr>' +
455            '<tr><td>' + LANG.plugins.davcal['from'] + '</td><td><input type="text" name="eventfrom" id="dw_davcal__eventfrom_edit" class="dw_davcal__editevent dw_davcal__date"><input type="text" name="eventfromtime" id="dw_davcal__eventfromtime_edit" class="dw_davcal__editevent dw_davcal__time"></td></tr>' +
456            '<tr><td>' + LANG.plugins.davcal['to'] + '</td><td><input type="text" name="eventto" id="dw_davcal__eventto_edit" class="dw_davcal__editevent dw_davcal__date"><input type="text" name="eventtotime" id="dw_davcal__eventtotime_edit" class="dw_davcal__editevent dw_davcal__time"></td></tr>' +
457            '<tr><td colspan="2"><input type="checkbox" name="allday" id="dw_davcal__allday_edit" class="dw_davcal__editevent">' + LANG.plugins.davcal['allday'] + '</td></tr>' +
458            '</table>' +
459            recurringWarning +
460            '<input type="hidden" name="uid" id="dw_davcal__uid_edit" class="dw_davcal__editevent">' +
461            '<input type="hidden" name="detectedtz" id="dw_davcal__tz_edit" class="dw_davcal__editevent">' +
462            '</div>' +
463            '<div id="dw_davcal__ajaxedit"></div>'
464            )
465       .parent()
466       .attr('id','dw_davcal__edit')
467       .show()
468       .appendTo('.dokuwiki:first');
469
470       jQuery('#dw_davcal__edit').position({
471           my: "center",
472           at: "center",
473           of: window
474       });
475
476       // Set up existing/predefined values
477       jQuery('#dw_davcal__tz_edit').val(dw_davcal__modals.detectedTz);
478       jQuery('#dw_davcal__uid_edit').val(calEvent.id);
479       jQuery('#dw_davcal__eventname_edit').val(calEvent.title);
480       jQuery('#dw_davcal__eventfrom_edit').val(calEvent.start.format('YYYY-MM-DD'));
481       jQuery('#dw_davcal__eventfromtime_edit').val(calEvent.start.format('HH:mm'));
482       jQuery('#dw_davcal__eventdescription_edit').val(calEvent.description);
483       if(calEvent.allDay && (calEvent.end === null))
484       {
485           jQuery('#dw_davcal__eventto_edit').val(calEvent.start.format('YYYY-MM-DD'));
486           jQuery('#dw_davcal__eventtotime_edit').val(calEvent.start.format('HH:mm'));
487       }
488       else if(calEvent.allDay)
489       {
490           endEvent = moment(calEvent.end);
491           endEvent.subtract(1, 'days');
492           jQuery('#dw_davcal__eventto_edit').val(endEvent.format('YYYY-MM-DD'));
493           jQuery('#dw_davcal__eventotime_edit').val(endEvent.format('HH:mm'));
494       }
495       else
496       {
497           jQuery('#dw_davcal__eventto_edit').val(calEvent.end.format('YYYY-MM-DD'));
498           jQuery('#dw_davcal__eventtotime_edit').val(calEvent.end.format('HH:mm'));
499       }
500       jQuery('#dw_davcal__allday_edit').prop('checked', calEvent.allDay);
501
502        // attach event handlers
503        jQuery('#dw_davcal__edit .ui-dialog-titlebar-close').click(function(){
504          dw_davcal__modals.hideEditEventDialog();
505        });
506        jQuery('#dw_davcal__eventfrom_edit').datetimepicker({format:'YYYY-MM-DD',
507                                                      formatDate:'YYYY-MM-DD',
508                                                      datepicker: true,
509                                                      timepicker: false,
510                                                      });
511        jQuery('#dw_davcal__eventfromtime_edit').datetimepicker({format:'HH:mm',
512                                                      formatTime:'HH:mm',
513                                                      datepicker: false,
514                                                      timepicker: true,
515                                                      step: 15});
516        jQuery('#dw_davcal__eventto_edit').datetimepicker({format:'YYYY-MM-DD',
517                                                      formatDate:'YYYY-MM-DD',
518                                                      datepicker: true,
519                                                      timepicker: false,
520                                                      });
521        jQuery('#dw_davcal__eventtotime_edit').datetimepicker({format:'HH:mm',
522                                                      formatTime:'HH:mm',
523                                                      datepicker: false,
524                                                      timepicker: true,
525                                                      step:15});
526        jQuery('#dw_davcal__allday_edit').change(function() {
527            if(jQuery(this).is(":checked"))
528            {
529                jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', true);
530                jQuery('#dw_davcal__eventtotime_edit').prop('readonly', true);
531            }
532            else
533            {
534                jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', false);
535                jQuery('#dw_davcal__eventtotime_edit').prop('readonly', false);
536            }
537        });
538        jQuery('#dw_davcal__allday_edit').change();
539    },
540
541    /**
542     * Show an info/confirmation dialog
543     * @param {Object} confirm Whether a confirmation dialog (true) or an info dialog (false) is requested
544     */
545    showDialog : function(confirm)
546    {
547        if(dw_davcal__modals.$confirmDialog)
548            return;
549        var dialogButtons = {};
550        var title = '';
551        if(confirm)
552        {
553            title = LANG.plugins.davcal['confirmation'];
554            dialogButtons[LANG.plugins.davcal['yes']] =  function() {
555                            jQuery.post(
556                                DOKU_BASE + 'lib/exe/ajax.php',
557                                {
558                                    call: 'plugin_davcal',
559                                    id: dw_davcal__modals.calid,
560                                    action: dw_davcal__modals.action,
561                                    params: {
562                                        uid: dw_davcal__modals.uid
563                                    }
564                                },
565                                function(data)
566                                {
567                                    dw_davcal__modals.completeCb(data);
568                                }
569                            );
570                            dw_davcal__modals.hideDialog();
571                    };
572            dialogButtons[LANG.plugins.davcal['cancel']] = function() {
573                            dw_davcal__modals.hideDialog();
574                    };
575        }
576        else
577        {
578            title = LANG.plugins.davcal['info'];
579            dialogButtons[LANG.plugins.davcal['ok']] = function() {
580                 dw_davcal__modals.hideDialog();
581            };
582        }
583        dw_davcal__modals.$dialog = jQuery(document.createElement('div'))
584            .dialog({
585                autoOpen: false,
586                draggable: true,
587                title: title,
588                resizable: true,
589                buttons: dialogButtons,
590            })
591            .html(
592                '<div>' + dw_davcal__modals.msg + '</div>'
593            )
594            .parent()
595            .attr('id','dw_davcal__confirm')
596            .show()
597            .appendTo('.dokuwiki:first');
598
599            jQuery('#dw_davcal__confirm').position({
600                my: "center",
601                at: "center",
602                of: window
603            });
604                 // attach event handlers
605            jQuery('#dw_davcal__confirm .ui-dialog-titlebar-close').click(function(){
606                dw_davcal__modals.hideDialog();
607            });
608    },
609
610    /**
611     * Hide the edit event dialog
612     */
613    hideEditEventDialog : function() {
614        dw_davcal__modals.$editEventDialog.empty();
615        dw_davcal__modals.$editEventDialog.remove();
616        dw_davcal__modals.$editEventDialog = null;
617    },
618
619    /**
620     * Hide the confirm/info dialog
621     */
622    hideDialog: function() {
623        dw_davcal__modals.$dialog.empty();
624        dw_davcal__modals.$dialog.remove();
625        dw_davcal__modals.$dialog = null;
626    },
627
628    /**
629     * Hide the settings dialog
630     */
631    hideSettingsDialog: function() {
632        dw_davcal__modals.$settingsDialog.empty();
633        dw_davcal__modals.$settingsDialog.remove();
634        dw_davcal__modals.$settingsDialog = null;
635    }
636};
637