if ($conf['maps']['driver']) {
Kronolith::initEventMap($conf['maps']);
}
-$tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'kronolithEventTags', 'box' => 'kronolithEventACBox', 'pretty' => true));
-$tac->attach();
+Horde_Ajax_Imple::factory(
+ array('kronolith', 'TagAutoCompleter'),
+ array('triggerId' => 'kronolithEventTags',
+ 'box' => 'kronolithEventACBox',
+ 'pretty' => true,
+ 'var' => 'kronolithETagAc'))
+ ->attach();
+
+Horde_Ajax_Imple::factory(
+ array('kronolith', 'TagAutoCompleter'),
+ array('triggerId' => 'kronolithCalendarinternalTags',
+ 'triggerContainer' => 'kronolithACCalendarTriggerContainer',
+ 'box' => 'kronolithCalendarinternalACBox',
+ 'pretty' => true,
+ 'var' => 'kronolithCTagAc'))
+ ->attach();
echo "</body>\n</html>";
RedBox.loading();
this.doAction('chunkContent', { chunk: 'calendar' }, function(r) {
if (r.response.chunk) {
- RedBox.onDisplay = function() { this.editCalendarCallback(calendar); RedBox.onDisplay = null; }.bind(this);
RedBox.showHtml(r.response.chunk);
+ this.editCalendarCallback(calendar);
} else {
this.closeRedBox();
}
return;
}
}
-
+ if (!kronolithCTagAc.initialized) {
+ kronolithCTagAc.init()
+ }
if (newCalendar) {
switch (type) {
case 'internal':
$('kronolithCalendar' + type + 'Id').clear();
$('kronolithCalendar' + type + 'Color').setValue('#dddddd').setStyle({ backgroundColor: '#dddddd', color: '#000' });
form.down('.kronolithCalendarDelete').hide();
+ if (calendar && type == 'remote') {
+ $('kronolithCalendarremoteUrl').setValue(calendar);
+ }
+ kronolithCTagAc.reset();
} else {
info = Kronolith.conf.calendars[type][calendar];
switch (type) {
case 'internal':
- $('kronolithCalendarinternalTags').autocompleter.init(Kronolith.conf.calendars.internal[calendar].tg);
- // Fall through
+ $('kronolithCalendarinternalDescription').setValue(info.desc);
+ $('kronolithCalendarinternalLinkImportExport').up('span').show();
+ $('kronolithCalendarinternalExport').href = Kronolith.conf.URI_CALENDAR_EXPORT + '=' + calendar;
+ kronolithCTagAc.reset(Kronolith.conf.calendars.internal[calendar].tg);
+ break;
case 'tasklists':
$('kronolithCalendar' + type + 'Description').setValue(info.desc);
$('kronolithCalendar' + type + 'LinkImportExport').up('span').show();
form.down('.kronolithFormActions .kronolithSeparator').show();
} else {
form.disable();
+ kronolithCTagAc.disable();
form.down('.kronolithColorPicker').hide();
form.down('.kronolithCalendarDelete').hide();
form.down('.kronolithCalendarSave').hide();
return;
case 'kronolithEventTag':
- $('kronolithEventTags').autocompleter.addNewItemNode(elt.getText());
+ kronolithETagAc.addNewItemNode(elt.getText());
e.stop();
return;
case 'kronolithCalendarTag':
- $('kronolithCalendarinternalTags').autocompleter.addNewItemNode(elt.getText());
+ kronolithCTagAc.addNewItemNode(elt.getText());
e.stop();
return;
{
this.closeRedBox();
- if (Object.isUndefined($('kronolithEventTags').autocompleter)) {
+ if (Object.isUndefined(kronolithETagAc)) {
this.editEvent.bind(this, calendar, id, date).defer();
return;
}
+ if (!kronolithETagAc.initialized) {
+ kronolithETagAc.init();
+ }
RedBox.onDisplay = function() {
try {
RedBox.loading();
this.doAction('getEvent', { cal: calendar, id: id, date: date }, this.editEventCallback.bind(this));
} else {
- $('kronolithEventTags').autocompleter.init();
+ kronolithETagAc.reset();
var d;
if (date) {
if (date.endsWith('all')) {
viewDates = this.viewDates(this.date, this.view),
start = viewDates[0].dateString(),
end = viewDates[1].dateString();
- $('kronolithEventTags').autocompleter.shutdown();
+ kronolithETagAc.shutdown();
this.startLoading(cal, start + end);
this.doAction('saveEvent',
$H($('kronolithEventForm').serialize({ hash: true }))
}
/* Tags */
- $('kronolithEventTags').autocompleter.init(ev.tg);
+ kronolithETagAc.reset(ev.tg);
/* Geo */
if (ev.gl) {