From: Jan Schneider Date: Tue, 22 Dec 2009 22:50:19 +0000 (+0100) Subject: Allow to add remote calendars through a URL. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f4bab51c4355b7bb531911a2f833c14cca28a449;p=horde.git Allow to add remote calendars through a URL. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index b11f63204..352b35dbf 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2072,8 +2072,21 @@ KronolithCore = { $('kronolithCalendar' + type + '1').show(); $('kronolithCalendarForm' + type).select('.kronolithCalendarContinue').invoke('enable'); + var newCalendar = !calendar; + if (calendar && + (Object.isUndefined(Kronolith.conf.calendars[type]) || + Object.isUndefined(Kronolith.conf.calendars[type][calendar]))) { + if (type == 'remote') { + newCalendar = true; + } else { + this._closeRedBox(); + window.history.back(); + return; + } + } + /* Reset form to defaults if this is for adding calendars. */ - if (!calendar) { + if (newCalendar) { var fields = [ 'Id', 'Name' ]; switch (type) { case 'internal': @@ -2089,13 +2102,9 @@ KronolithCore = { }); $('kronolithCalendar' + type + 'Color').setValue('#dddddd').setStyle({ 'backgroundColor': '#dddddd', 'color': '#000' }); $('kronolithCalendarForm' + type).down('.kronolithCalendarDelete').hide(); - return; - } - - if (Object.isUndefined(Kronolith.conf.calendars[type]) || - Object.isUndefined(Kronolith.conf.calendars[type][calendar])) { - this._closeRedBox(); - window.history.back(); + if (calendar && type == 'remote') { + $('kronolithCalendarremoteUrl').setValue(calendar); + } return; }