e.stop();
break;
} else if (elt.hasClassName('kronolithCalendarDelete')) {
- elt.disable();
var form = elt.up('form'),
type = form.id.replace(/kronolithCalendarForm/, ''),
calendar = $F('kronolithCalendar' + type + 'Id');
+
+ if ((type == 'tasklists' &&
+ !window.confirm(Kronolith.text.delete_tasklist)) ||
+ (type != 'tasklists' &&
+ !window.confirm(Kronolith.text.delete_calendar))) {
+ e.stop();
+ break;
+ }
+
+ elt.disable();
this.doAction('deleteCalendar',
{ type: type, calendar: calendar },
function(r) {
'no_url' => _("You must specify a URL."),
'no_calendar_title' => _("The calendar title must not be empty."),
'no_tasklist_title' => _("The task list title must not be empty."),
+ 'delete_calendar' => _("Are you sure you want to delete this calendar and all the events in it?"),
+ 'delete_tasklist' => _("Are you sure you want to delete this task list and all the tasks in it?"),
'wrong_auth' => _("The authentication information you specified wasn't accepted."),
'geocode_error' => _("Unable to locate requested address"),
'wrong_date_format' => sprintf(_("You used an unknown date format \"%s\". Please try something like \"%s\"."), '#{wrong}', '#{right}'),