Revert "Avoid key collisions when a listTimeObjects provider can export the same...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 17:09:26 +0000 (12:09 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 7 Nov 2009 17:38:19 +0000 (12:38 -0500)
This reverts commit 202eb693c2a77b366c59528044707adefde92564.

kronolith/js/kronolith.js

index d9a988f..d3e093e 100644 (file)
@@ -761,10 +761,7 @@ KronolithCore = {
             if (typeof ext[api[0]] == 'undefined') {
                 ext[api[0]] = {};
             }
-            if (typeof ext[api[0]][api[1]] == 'undefined') {
-                ext[api[0]][api[1]] = [];
-            }
-            ext[api[0]][api[1]].push(cal.value);
+            ext[api[0]][api[1]] = cal.value;
             extNames[api[0]] = cal.value.api;
         });
         $H(ext).each(function(api) {
@@ -774,16 +771,13 @@ KronolithCore = {
                                 .update('+'))
                         .insert({ bottom: extNames[api.key].escapeHTML() }))
                 .insert(new Element('DIV', { 'id': 'kronolithExternalCalendar' + api.key, 'class': 'kronolithCalendars' }));
-            $H(api.value).each(function(cals) {
-                for (var i = 0; i < cals.value.length; i++) {
-                    var cal = cals.value[i];
-                    $('kronolithExternalCalendar' + api.key)
-                        .insert(new Element('DIV', { 'class': cal.show ? 'kronolithCalOn' : 'kronolithCalOff' })
-                                .store('calendar', api.key + '/' + cal.key)
-                                .store('calendarclass', 'external')
-                                .setStyle({ backgroundColor: cal.bg, color: cal.fg })
-                                .update(cal.name.escapeHTML()));
-                }
+            $H(api.value).each(function(cal) {
+                $('kronolithExternalCalendar' + api.key)
+                    .insert(new Element('DIV', { 'class': cal.value.show ? 'kronolithCalOn' : 'kronolithCalOff' })
+                            .store('calendar', api.key + '/' + cal.key)
+                            .store('calendarclass', 'external')
+                            .setStyle({ backgroundColor: cal.value.bg, color: cal.value.fg })
+                            .update(cal.value.name.escapeHTML()));
             });
         });