Revert "Correctly fix listTimeObjects handling in the ajax interface."
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 17:08:26 +0000 (12:08 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 17:38:19 +0000 (12:38 -0500)
This reverts commit 2f91b86615afbf53897abd9e62c640335262952d.

kronolith/js/kronolith.js

index 21fe231..05f9618 100644 (file)
@@ -762,12 +762,9 @@ KronolithCore = {
                 ext[api[0]] = {};
             }
             if (typeof ext[api[0]][api[1]] == 'undefined') {
-                ext[api[0]][api[1]] = {};
+                ext[api[0]][api[1]] = [];
             }
-            if (typeof api[2] == 'undefined') {
-                api[2] = 0;
-            }
-            ext[api[0]][api[1]][api[2]] = cal.value;
+            ext[api[0]][api[1]].push(cal.value);
             extNames[api[0]] = cal.value.api;
         });
         $H(ext).each(function(api) {
@@ -778,14 +775,15 @@ KronolithCore = {
                         .insert({ bottom: extNames[api.key].escapeHTML() }))
                 .insert(new Element('DIV', { 'id': 'kronolithExternalCalendar' + api.key, 'class': 'kronolithCalendars' }));
             $H(api.value).each(function(cals) {
-                $H(cals.value).each(function(cal) {
+                for (var i = 0; i < cals.value.length; i++) {
+                    var cal = cals.value[i];
                     $('kronolithExternalCalendar' + api.key)
-                        .insert(new Element('DIV', { 'class': cal.value.show ? 'kronolithCalOn' : 'kronolithCalOff' })
-                                .store('calendar', api.key + '/' + cals.key + ((cal.key != 0) ? '/' + cal.key : ''))
+                        .insert(new Element('DIV', { 'class': cal.show ? 'kronolithCalOn' : 'kronolithCalOff' })
+                                .store('calendar', api.key + '/' + cals.key)
                                 .store('calendarclass', 'external')
-                                .setStyle({ backgroundColor: cal.value.bg, color: cal.value.fg })
-                                .update(cal.value.name.escapeHTML()));
-                });
+                                .setStyle({ backgroundColor: cal.bg, color: cal.fg })
+                                .update(cal.name.escapeHTML()));
+                }
             });
         });
 
@@ -2247,6 +2245,7 @@ KronolithCore = {
             calClass = elt.retrieve('calendarclass');
             if (calClass) {
                 var calendar = elt.retrieve('calendar');
+                console.log(calendar);
                 Kronolith.conf.calendars[calClass][calendar].show = !Kronolith.conf.calendars[calClass][calendar].show;
                 if (this.view == 'year' ||
                     typeof this.ecache.get(calClass) == 'undefined' ||