if (!this.loading) {
$('kronolithLoading').hide();
}
- this._closeRedBox();
+ this.closeRedBox();
this.showNotifications([ { type: 'horde.error', message: Kronolith.text.ajax_error } ]);
this.debug('onException', e);
}.bind(this),
this.updateView(date, loc);
var dates = this.viewDates(date, loc);
- this._loadEvents(dates[0], dates[1], loc);
+ this.loadEvents(dates[0], dates[1], loc);
if ($('kronolithView' + locCap)) {
this.viewLoading = true;
$('kronolithView' + locCap).appear({
queue: 'end',
afterFinish: function() {
if (loc == 'week' || loc == 'day') {
- this._calculateRowSizes(loc + 'Sizes', 'kronolithView' + locCap);
+ this.calculateRowSizes(loc + 'Sizes', 'kronolithView' + locCap);
}
this.viewLoading = false; }.bind(this)
});
$($('kronolithTasks' + tasktype).parentNode).removeClassName('activeTab');
});
$('kronolithTasks' + this.tasktype.capitalize()).parentNode.addClassName('activeTab');
- this._loadTasks(this.tasktype);
+ this.loadTasks(this.tasktype);
if ($('kronolithView' + locCap)) {
this.viewLoading = true;
$('kronolithView' + locCap).appear({ queue: 'end', afterFinish: function() { this.viewLoading = false; }.bind(this) });
break;
}
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
this.view = loc;
break;
event.value.calendar = calendars.key;
event.value.start = Date.parse(event.value.s);
event.value.end = Date.parse(event.value.e);
- this._insertEvent(event, events.key, 'agenda');
+ this.insertEvent(event, events.key, 'agenda');
}, this);
}, this);
}, this);
$('kronolithViewAgenda').appear({ queue: 'end', afterFinish: function() { this.viewLoading = false; }.bind(this) });
$('kronolithLoadingagenda').insert($('kronolithLoading').remove());
this.updateMinical(this.date);
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
this.view = 'agenda';
break;
default:
return;
}
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
break;
case 'task':
this.editTask(locParts[0], locParts[1]);
break;
}
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
break;
case 'calendar':
return;
}
this.editCalendar(locParts.join(':'));
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
break;
case 'options':
this.iframeContent(loc, Kronolith.conf.prefs_url);
this.setTitle(Kronolith.text.prefs);
this.updateMinical(this.date);
- this._addHistory(loc);
+ this.addHistory(loc);
this.view = 'iframe';
break;
this.iframeContent(loc, Kronolith.conf.app_urls[app]);
}
this.updateMinical(this.date);
- this._addHistory(fullloc);
+ this.addHistory(fullloc);
this.view = 'iframe';
break;
}
tbody.insert(this.createWeekRow(day, date.getMonth(), dates).show());
day.next().week();
}
- this._equalRowHeights(tbody);
+ this.equalRowHeights(tbody);
break;
return table;
},
- _equalRowHeights: function(tbody)
+ equalRowHeights: function(tbody)
{
var children = tbody.childElements();
children.invoke('setStyle', { height: (100 / (children.size() - 1)) + '%' });
* @param string storage Property name where the dimensions are stored.
* @param string view DOM node ID of the view.
*/
- _calculateRowSizes: function(storage, view)
+ calculateRowSizes: function(storage, view)
{
if (!Object.isUndefined(this[storage])) {
return;
*
* @param Element The A element of a tab.
*/
- _openTab: function(elt)
+ openTab: function(elt)
{
var dialog = elt.up('form');
dialog.select('.kronolithTabsOption').invoke('hide');
/**
*/
- _loadEvents: function(firstDay, lastDay, view, calendars)
+ loadEvents: function(firstDay, lastDay, view, calendars)
{
if (typeof calendars == 'undefined') {
calendars = [];
cals = cals.get(cal[1]);
while (!Object.isUndefined(cals.get(startDay.dateString())) &&
startDay.isBefore(endDay)) {
- this._insertEvents([startDay, startDay], view, cal.join('|'));
+ this.insertEvents([startDay, startDay], view, cal.join('|'));
startDay.add(1).day();
}
while (!Object.isUndefined(cals.get(endDay.dateString())) &&
(!startDay.isAfter(endDay))) {
- this._insertEvents([endDay, endDay], view, cal.join('|'));
+ this.insertEvents([endDay, endDay], view, cal.join('|'));
endDay.add(-1).day();
}
if (startDay.compareTo(endDay) > 0) {
var start = startDay.dateString(), end = endDay.dateString(),
calendar = cal.join('|');
this.startLoading(calendar, start + end);
- this._storeCache($H(), calendar);
+ this.storeCache($H(), calendar);
this.doAction('ListEvents',
{ start: start,
end: end,
cal: calendar,
view: view },
- this._loadEventsCallback.bind(this));
+ this.loadEventsCallback.bind(this));
}, this);
},
*
* @param object r The ajax response object.
*/
- _loadEventsCallback: function(r)
+ loadEventsCallback: function(r)
{
// Hide spinner.
this.loading--;
end = this.parseDate(r.response.sig.substr(8, 8)),
dates = [start, end];
- this._storeCache(r.response.events || {}, r.response.cal, dates);
+ this.storeCache(r.response.events || {}, r.response.cal, dates);
// Check if this is the still the result of the most current request.
if (r.response.view != this.view ||
}
delete this.eventsLoading[r.response.cal];
- this._insertEvents(dates, this.view, r.response.cal);
+ this.insertEvents(dates, this.view, r.response.cal);
},
/**
* @param string view The view to update.
* @param string calendar The calendar to update.
*/
- _insertEvents: function(dates, view, calendar)
+ insertEvents: function(dates, view, calendar)
{
switch (view) {
case 'day':
// The day and week views require the view to be completely
// loaded, to correctly calculate the dimensions.
if (this.viewLoading || this.view != view) {
- this._insertEvents.bind(this, [dates[0].clone(), dates[1].clone()], view, calendar).defer();
+ this.insertEvents.bind(this, [dates[0].clone(), dates[1].clone()], view, calendar).defer();
return;
}
break;
busy = false;
}
- this._getCacheForDate(date).sortBy(this._sortEvents).each(function(event) {
+ this.getCacheForDate(date).sortBy(this.sortEvents).each(function(event) {
switch (view) {
case 'month':
case 'agenda':
title += '<br />';
return;
}
- this._insertEvent(event, date, view);
+ this.insertEvent(event, date, view);
}, this);
switch (view) {
* @param string date The day to update.
* @param string view The view to update.
*/
- _insertEvent: function(event, date, view)
+ insertEvent: function(event, date, view)
{
var calendar = event.value.calendar.split('|');
event.value.nodeId = 'kronolithEvent' + view + event.value.calendar + date + event.key;
break;
}
- this._setEventText(div, event.value)
+ this.setEventText(div, event.value)
.observe('mouseover', div.addClassName.curry('kronolithSelected'))
.observe('mouseout', div.removeClassName.curry('kronolithSelected'));
},
- _setEventText: function(div, event)
+ setEventText: function(div, event)
{
var calendar = event.calendar.split('|');
div.update();
* @param string event An event id.
* @param string calendar A calendar name.
*/
- _removeEvent: function(event, calendar)
+ removeEvent: function(event, calendar)
{
- this._deleteCache(event, calendar);
+ this.deleteCache(event, calendar);
$('kronolithBody').select('div').findAll(function(el) {
return el.retrieve('calendar') == calendar &&
el.retrieve('eventid') == event;
* Calculates the event's start and end dates based on some drag and drop
* information.
*/
- _calculateEventDates: function(event, storage, step, offset, height, start, end)
+ calculateEventDates: function(event, storage, step, offset, height, start, end)
{
if (!Object.isUndefined(start)) {
event.start = start;
*
* @return array The list of task cache storage names.
*/
- _getTaskStorage: function(tasktype)
+ getTaskStorage: function(tasktype)
{
var tasktypes;
if (tasktype == 'all' || tasktype == 'future') {
* future).
* @param Array tasksLists The lists from where to obtain the tasks.
*/
- _loadTasks: function(tasktype, tasklists)
+ loadTasks: function(tasktype, tasklists)
{
- var tasktypes = this._getTaskStorage(tasktype), loading = false;
+ var tasktypes = this.getTaskStorage(tasktype), loading = false;
if (Object.isUndefined(tasklists)) {
tasklists = [];
{ type: type,
list: list },
function(r) {
- this._loadTasksCallback(r, true);
+ this.loadTasksCallback(r, true);
}.bind(this));
}
}, this);
if (!loading) {
tasklists.each(function(list) {
- this._insertTasks(tasktype, list);
+ this.insertTasks(tasktype, list);
}, this);
}
},
* adding individual tasks to the cache without
* assuming to have all tasks of the list.
*/
- _loadTasksCallback: function(r, createCache)
+ loadTasksCallback: function(r, createCache)
{
// Hide spinner.
this.loading--;
$('kronolithLoading').hide();
}
- this._storeTasksCache(r.response.tasks || {}, r.response.type, r.response.list, createCache);
+ this.storeTasksCache(r.response.tasks || {}, r.response.type, r.response.list, createCache);
if (Object.isUndefined(r.response.tasks)) {
return;
}
// There could be a rare race condition where two responses for the
// same task(s) arrive in the wrong order. Checking this too, like we
// do for events seems not worth it.
- var tasktypes = this._getTaskStorage(this.tasktype),
+ var tasktypes = this.getTaskStorage(this.tasktype),
tasklist = Kronolith.conf.calendars.tasklists['tasks/' + r.response.list];
if (this.view != 'tasks' ||
!tasklist || !tasklist.show ||
!tasktypes.include(r.response.type)) {
return;
}
- this._insertTasks(this.tasktype, r.response.list);
+ this.insertTasks(this.tasktype, r.response.list);
},
/**
* future).
* @param string tasksList The task list to be drawn.
*/
- _insertTasks: function(tasktype, tasklist)
+ insertTasks: function(tasktype, tasklist)
{
- var tasktypes = this._getTaskStorage(tasktype), now = new Date();
+ var tasktypes = this.getTaskStorage(tasktype), now = new Date();
$('kronolithViewTasksBody').select('tr').findAll(function(el) {
return el.retrieve('tasklist') == tasklist;
}
break;
}
- this._insertTask(task);
+ this.insertTask(task);
}, this);
}, this);
*
* @param object task A Hash with the task to insert
*/
- _insertTask: function(task)
+ insertTask: function(task)
{
var body = $('kronolithViewTasksBody'),
row = $('kronolithTasksTemplate').cloneNode(true),
}
row.insert(col.show());
- this._insertTaskPosition(row, task);
+ this.insertTaskPosition(row, task);
},
/**
* @param Element newRow The new row to be inserted.
* @param object newTask A Hash with the task being added.
*/
- _insertTaskPosition: function(newRow, newTask)
+ insertTaskPosition: function(newRow, newTask)
{
var rows = $('kronolithViewTasksBody').select('tr');
// The first row is the add task row, the second a template, ignoring.
// TODO: Throw error
return;
}
- if (!this._isTaskAfter(newTask.value, rowTask)) {
+ if (!this.isTaskAfter(newTask.value, rowTask)) {
break;
}
}
*
* TODO: Very incomplete, only a dummy version
*/
- _isTaskAfter: function(taskA, taskB)
+ isTaskAfter: function(taskA, taskB)
{
// TODO: Make all ordering system
return (taskA.pr >= taskB.pr);
* @param string tasklist The task list to which the tasks belongs
* @param string taskid The id of the task
*/
- _toggleCompletion: function(tasklist, taskid)
+ toggleCompletion: function(tasklist, taskid)
{
// Update the cache.
var task = this.tcache.inject(null, function(acc, list) {
});
if (Object.isUndefined(task)) {
// This shouldn't happen.
- this._toggleCompletionClass(taskid);
+ this.toggleCompletionClass(taskid);
return;
}
task.cp = !task.cp;
this.tcache.get(task.cp ? 'incomplete' : 'complete').get(tasklist).unset(taskid);
// Remove row if necessary.
- var row = this._getTaskRow(taskid);
+ var row = this.getTaskRow(taskid);
if (!row) {
return;
}
*
* @param string taskid The id of the task.
*/
- _toggleCompletionClass: function(taskid)
+ toggleCompletionClass: function(taskid)
{
- var row = this._getTaskRow(taskid);
+ var row = this.getTaskRow(taskid);
if (!row) {
return;
}
*
* @return Element The table row of the task list, if found.
*/
- _getTaskRow: function(taskid)
+ getTaskRow: function(taskid)
{
return $('kronolithViewTasksBody').select('tr').find(function(el) {
return el.retrieve('taskid') == taskid;
RedBox.onDisplay = null;
};
- this._openTab($('kronolithTaskForm').down('.tabset a.kronolithTabLink'));
+ this.openTab($('kronolithTaskForm').down('.tabset a.kronolithTabLink'));
$('kronolithTaskForm').enable();
$('kronolithTaskForm').reset();
$('kronolithTaskSave').show();
this.updateTasklistDropDown();
if (id) {
RedBox.loading();
- this.doAction('GetTask', { list: tasklist, id: id }, this._editTask.bind(this));
+ this.doAction('GetTask', { list: tasklist, id: id }, this.editTask.bind(this));
} else {
$('kronolithTaskId').clear();
$('kronolithTaskOldList').clear();
*
* @param object r The ajax response object.
*/
- _editTask: function(r)
+ editTask: function(r)
{
if (!r.response.task) {
RedBox.close();
* @param string task A task id.
* @param string list A task list name.
*/
- _removeTask: function(task, list)
+ removeTask: function(task, list)
{
- this._deleteTasksCache(task, list);
+ this.deleteTasksCache(task, list);
$('kronolithViewTasksBody').select('tr').find(function(el) {
return el.retrieve('tasklist') == list &&
el.retrieve('taskid') == task;
.merge({ sig: this.tasktype }),
function(r) {
if (r.response.tasks && taskid) {
- this._removeTask(taskid, tasklist);
+ this.removeTask(taskid, tasklist);
}
- this._loadTasksCallback(r, false);
- this._closeRedBox();
+ this.loadTasksCallback(r, false);
+ this.closeRedBox();
window.history.back();
}.bind(this));
},
{
if ($('kronolithCalendarDialog')) {
RedBox.showHtml($('kronolithCalendarDialog').show());
- this._editCalendar(calendar);
+ this.editCalendar(calendar);
} else {
RedBox.loading();
this.doAction('ChunkContent', { chunk: 'calendar' }, function(r) {
if (r.response.chunk) {
RedBox.showHtml(r.response.chunk);
- this._editCalendar(calendar);
+ this.editCalendar(calendar);
} else {
- this._closeRedBox();
+ this.closeRedBox();
}
}.bind(this));
}
*
* @param string calendar Calendar type and calendar id, separated by '|'.
*/
- _editCalendar: function(calendar)
+ editCalendar: function(calendar)
{
calendar = calendar.split('|');
var type = calendar[0];
if (type == 'remote') {
newCalendar = true;
} else {
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
return;
}
*
* @param string type The calendar type.
*/
- _calendarNext: function(type)
+ calendarNext: function(type)
{
var i = 1;
while (!$('kronolithCalendar' + type + i).visible()) {
}
}
form.down('.kronolithCalendarSave').enable();
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
}.bind(this));
},
* @param string dates A date range in the format yyyymmddyyyymmdd as
* used in the ajax response signature.
*/
- _storeCache: function(events, calendar, dates)
+ storeCache: function(events, calendar, dates)
{
if (Object.isString(calendar)) {
calendar = calendar.split('|');
* @param boolean createCache Whether to create a cache list entry for the
* response, if none exists yet.
*/
- _storeTasksCache: function(tasks, tasktypes, tasklist, createCache)
+ storeTasksCache: function(tasks, tasktypes, tasklist, createCache)
{
var taskHashes = {}, cacheExists = {};
* @param string event An event ID or empty if deleting the calendar.
* @param string calendar A calendar string or array.
*/
- _deleteCache: function(event, calendar)
+ deleteCache: function(event, calendar)
{
if (Object.isString(calendar)) {
calendar = calendar.split('|');
* @param string task A task ID.
* @param string list A task list string.
*/
- _deleteTasksCache: function(task, list)
+ deleteTasksCache: function(task, list)
{
- this._deleteCache(task, [ 'external', 'tasks/' + list ]);
+ this.deleteCache(task, [ 'external', 'tasks/' + list ]);
[ 'complete', 'incomplete' ].each(function(type) {
if (!Object.isUndefined(this.tcache.get(type)) &&
!Object.isUndefined(this.tcache.get(type).get(list))) {
* @return Hash An event hash which event ids as keys and event objects as
* values.
*/
- _getCacheForDate: function(date)
+ getCacheForDate: function(date)
{
var events = $H();
this.ecache.each(function(type) {
*
* @return string A comparable string.
*/
- _sortEvents: function(event)
+ sortEvents: function(event)
{
return event.value.sort;
},
- _addHistory: function(loc, data)
+ addHistory: function(loc, data)
{
if (Horde.dhtmlHistory.getCurrentLocation() != loc) {
Horde.dhtmlHistory.add(loc, data);
$('kronolithIframe' + name).src = loc;
} else {
var iframe = new Element('iframe', { id: 'kronolithIframe' + name, className: 'kronolithIframe', frameBorder: 0, src: loc });
- //this._resizeIE6Iframe(iframe);
+ //this.resizeIE6Iframe(iframe);
$('kronolithViewIframe').insert(iframe);
}
$('kronolithQuickinsert').fade();
break;
case 'kronolithEventForm':
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
break;
}
switch (kc) {
case Event.KEY_ESC:
- this._closeRedBox();
+ this.closeRedBox();
break;
}
},
{ cal: cal, id: eventid },
function(r) {
if (r.response.deleted) {
- this._removeEvent(eventid, cal);
+ this.removeEvent(eventid, cal);
} else {
$('kronolithBody').select('div').findAll(function(el) {
return el.retrieve('calendar') == cal &&
return el.retrieve('calendar') == cal &&
el.retrieve('eventid') == eventid;
}).invoke('hide');
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
e.stop();
return;
{ list: tasklist, id: taskid },
function(r) {
if (r.response.deleted) {
- this._removeTask(taskid, tasklist);
+ this.removeTask(taskid, tasklist);
} else {
$('kronolithViewTasksBody').select('tr').find(function(el) {
return el.retrieve('tasklist') == tasklist &&
if (taskrow) {
taskrow.hide();
}
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
e.stop();
return;
return;
case 'kronolithTabLink':
- this._openTab(elt);
+ this.openTab(elt);
e.stop();
return;
if (this.colorPicker) {
this.colorPicker.hide();
}
- this._closeRedBox();
+ this.closeRedBox();
this.resetMap();
window.history.back();
e.stop();
} else if (elt.hasClassName('kronolithTaskCheckbox')) {
var taskid = elt.up('tr.kronolithTaskRow', 0).retrieve('taskid'),
tasklist = elt.up('tr.kronolithTaskRow', 0).retrieve('tasklist');
- this._toggleCompletionClass(taskid);
+ this.toggleCompletionClass(taskid);
this.doAction('ToggleCompletion',
{ list: tasklist, id: taskid },
function(r) {
if (r.response.toggled) {
- this._toggleCompletion(tasklist, taskid);
+ this.toggleCompletion(tasklist, taskid);
} else {
- this._toggleCompletionClass(taskid);
+ this.toggleCompletionClass(taskid);
}
}.bind(this));
e.stop();
if (r.response.desc) {
$('kronolithCalendarremoteDescription').setValue(r.response.desc);
}
- this._calendarNext(type);
- this._calendarNext(type);
+ this.calendarNext(type);
+ this.calendarNext(type);
} else if (r.response.auth) {
- this._calendarNext(type);
+ this.calendarNext(type);
} else {
elt.enable();
}
!$F('kronolithCalendarremoteDescription')) {
$('kronolithCalendarremoteDescription').setValue(r.response.desc);
}
- this._calendarNext(type);
+ this.calendarNext(type);
} else if (r.response.auth) {
this.showNotifications([{ type: 'horde.warning', message: Kronolith.text.wrong_auth }]);
elt.enable();
e.stop();
return;
}
- this._calendarNext(type);
+ this.calendarNext(type);
elt.disable();
e.stop();
return;
});
div.previous('span').remove();
div.remove();
- this._deleteCache(null, calendar);
+ this.deleteCache(null, calendar);
$('kronolithBody').select('div').findAll(function(el) {
return el.retrieve('calendar') == calendar;
}).invoke('remove');
delete Kronolith.conf.calendars[type][calendar];
}
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
}.bind(this));
elt.disable();
Object.isUndefined(this.ecache.get(calClass)) ||
Object.isUndefined(this.ecache.get(calClass).get(calendar))) {
var dates = this.viewDates(this.date, this.view);
- this._loadEvents(dates[0], dates[1], this.view, [[calClass, calendar]]);
+ this.loadEvents(dates[0], dates[1], this.view, [[calClass, calendar]]);
} else {
$('kronolithBody').select('div').findAll(function(el) {
return el.retrieve('calendar') == calClass + '|' + calendar;
return el.retrieve('tasklist') == tasklist;
}).invoke('remove');
} else {
- this._loadTasks(this.tasktype, [ tasklist ]);
+ this.loadTasks(this.tasktype, [ tasklist ]);
}
}
// Fall through.
switch (type) {
case 'over':
if (DragDrop.Drags.drag && elt.hasClassName('exp')) {
- this._toggleSubFolder(elt.up(), 'exp');
+ this.toggleSubFolder(elt.up(), 'exp');
}
break;
}
att: $H({ start_date: drop.retrieve('date') }).toJSON() },
function(r) {
if (r.response.events) {
- this._removeEvent(eventid, cal);
+ this.removeEvent(eventid, cal);
}
- this._loadEventsCallback(r);
+ this.loadEventsCallback(r);
}.bind(this));
},
height: height + 'px'
});
- this._calculateEventDates(event, storage, step, offset, height);
+ this.calculateEventDates(event, storage, step, offset, height);
drag.innerDiv.update('(' + event.start.toString(Kronolith.conf.time_format) + ' - ' + event.end.toString(Kronolith.conf.time_format) + ') ' + event.t.escapeHTML());
} else if (elt.hasClassName('kronolithEditable')) {
if (Object.isUndefined(drag.innerDiv)) {
if (this.view == 'week') {
var offsetX = Math.round(drag.ghost.offsetLeft / drag.stepX);
event.offsetDays = offsetX;
- this._calculateEventDates(event, storage, step, drag.ghost.offsetTop, drag.divHeight, event.start.clone().addDays(offsetX), event.end.clone().addDays(offsetX));
+ this.calculateEventDates(event, storage, step, drag.ghost.offsetTop, drag.divHeight, event.start.clone().addDays(offsetX), event.end.clone().addDays(offsetX));
} else {
event.offsetDays = 0;
- this._calculateEventDates(event, storage, step, drag.ghost.offsetTop, drag.divHeight);
+ this.calculateEventDates(event, storage, step, drag.ghost.offsetTop, drag.divHeight);
}
event.offsetTop = drag.ghost.offsetTop - drag.startTop;
drag.innerDiv.update('(' + event.start.toString(Kronolith.conf.time_format) + ' - ' + event.end.toString(Kronolith.conf.time_format) + ') ' + event.t.escapeHTML());
div.removeClassName('kronolithSelected');
if (!Object.isUndefined(drag.innerDiv)) {
- this._setEventText(drag.innerDiv, event.value);
+ this.setEventText(drag.innerDiv, event.value);
}
drag.destroy();
this.startLoading(event.value.calendar, start + end);
},
function(r) {
if (r.response.events) {
- this._removeEvent(event.key, event.value.calendar);
+ this.removeEvent(event.key, event.value.calendar);
}
- this._loadEventsCallback(r);
+ this.loadEventsCallback(r);
}.bind(this));
},
this.updateCalendarDropDown('kronolithEventTarget');
this.toggleAllDay(false);
- this._openTab($('kronolithEventForm').down('.tabset a.kronolithTabLink'));
+ this.openTab($('kronolithEventForm').down('.tabset a.kronolithTabLink'));
$('kronolithEventForm').enable();
$('kronolithEventForm').reset();
if (Kronolith.conf.maps.driver) {
$('kronolithEventSave').show();
$('kronolithEventDelete').show();
$('kronolithEventForm').down('.kronolithFormActions .kronolithSep').show();
- this.doAction('ListTopTags', {}, this._topTags);
+ this.doAction('ListTopTags', {}, this.topTags);
if (id) {
RedBox.loading();
- this.doAction('GetEvent', { cal: calendar, id: id, date: date }, this._editEvent.bind(this));
+ this.doAction('GetEvent', { cal: calendar, id: id, date: date }, this.editEventCallback.bind(this));
} else {
$('kronolithEventTags').autocompleter.init();
var d;
}),
function(r) {
if (r.response.events && eventid) {
- this._removeEvent(eventid, cal);
+ this.removeEvent(eventid, cal);
}
- this._loadEventsCallback(r);
+ this.loadEventsCallback(r);
this.resetMap();
- this._closeRedBox();
+ this.closeRedBox();
window.history.back();
}.bind(this));
},
view_end: end
}),
function(r) {
- this._loadEventsCallback(r);
+ this.loadEventsCallback(r);
if (Object.isUndefined(r.msgs)) {
$('kronolithQuickinsertQ').value = '';
}
}.bind(this));
},
- _topTags: function(r)
+ topTags: function(r)
{
if (!r.response.tags) {
$('kronolithEventTopTags').update();
*
* @param object r The ajax response object.
*/
- _editEvent: function(r)
+ editEventCallback: function(r)
{
if (!r.response.event) {
RedBox.close();
if (!Object.isUndefined(ev.ln)) {
this.iframeContent('event', ev.ln);
- this._closeRedBox();
+ this.closeRedBox();
return;
}
return;
}
this.freeBusy.set(attendee.e, [ tr, r.response.fb ]);
- this._insertFreeBusy(attendee.e);
+ this.insertFreeBusy(attendee.e);
}.bind(this));
tr.insert(new Element('td').writeAttribute('title', attendee.l).insert(attendee.e.escapeHTML()));
for (i = 0; i < 24; i++) {
}
$('kronolithEventStartDate').observe('change', function() {
ev.at.each(function(attendee) {
- this._insertFreeBusy(attendee.e);
+ this.insertFreeBusy(attendee.e);
}, this);
}.bind(this));
}
*
* @param string email An email address as the free/busy identifier.
*/
- _insertFreeBusy: function(email)
+ insertFreeBusy: function(email)
{
if (!$('kronolithEventDialog').visible() ||
!this.freeBusy.get(email)) {
td = tr.select('td')[1],
div = td.down('div');
if (!td.getWidth()) {
- this._insertFreeBusy.bind(this, email).defer();
+ this.insertFreeBusy.bind(this, email).defer();
return;
}
tr.select('td').each(function(td, i) {
}
},
- _closeRedBox: function()
+ closeRedBox: function()
{
var content = RedBox.getWindowContents();
if (content) {