From 94f0478300b6c95630c4d98c6554aa25371cf7bf Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 22 Dec 2009 23:39:25 +0100 Subject: [PATCH] Don't show user/password fields when editing calendars that don't require authentication. --- kronolith/js/kronolith.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 861189c3c..b11f63204 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2931,8 +2931,9 @@ KronolithCore = { while (!$('kronolithCalendar' + type + i).visible()) { i++; } - if (type == 'remote' && !$F('kronolithCalendarremoteId')) { + if (type == 'remote') { elt.disable(); + var params = { url: $F('kronolithCalendarremoteUrl') }; if (i == 1) { if (!$F('kronolithCalendarremoteUrl')) { this.showNotifications([ { type: 'horde.warning', message: Kronolith.text.no_url }]); @@ -2940,7 +2941,7 @@ KronolithCore = { return; } this.doAction('GetRemoteInfo', - { url: $F('kronolithCalendarremoteUrl') }, + params, function(r) { if (r.response.success) { if (r.response.name) { @@ -2960,7 +2961,6 @@ KronolithCore = { { asynchronous: false }); } if (i == 2) { - var params = { url: $F('kronolithCalendarremoteUrl') }; if ($F('kronolithCalendarremoteUsername')) { params.username = $F('kronolithCalendarremoteUsername'); params.password = $F('kronolithCalendarremotePassword'); @@ -2969,10 +2969,12 @@ KronolithCore = { params, function(r) { if (r.response.success) { - if (r.response.name) { + if (r.response.name && + !$F('kronolithCalendarremoteName')) { $('kronolithCalendarremoteName').setValue(r.response.name); } - if (r.response.desc) { + if (r.response.desc && + !$F('kronolithCalendarremoteDescription')) { $('kronolithCalendarremoteDescription').setValue(r.response.desc); } this._calendarNext(type); -- 2.11.0