From a3c15b028e98ee1ecc33bacc88248a39c67a3465 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sun, 14 Nov 2010 18:42:44 -0500 Subject: [PATCH] First stab at including all selected calendars, still need to sort --- kronolith/js/kronolithmobile.js | 168 ++++++++++++++++++++++++---------------- 1 file changed, 100 insertions(+), 68 deletions(-) diff --git a/kronolith/js/kronolithmobile.js b/kronolith/js/kronolithmobile.js index 30a1ba3af..f6de9c5c0 100644 --- a/kronolith/js/kronolithmobile.js +++ b/kronolith/js/kronolithmobile.js @@ -10,6 +10,10 @@ */ KronolithMobile = { + calendars: [], + loadedCalendars: [], + events: [], + /** * Perform an Ajax action * @@ -22,6 +26,23 @@ $.post(Kronolith.conf.URI_AJAX + action, params, callback, 'json'); }, + loadEvents: function(start, end) + { + KronolithMobile.loadedCalendars = []; + KronolithMobile.events = []; + for (cal in KronolithMobile.calendars) { + cal = KronolithMobile.calendars[cal]; + KronolithMobile.doAction('listEvents', + { + 'start': start.toString('yyyyMMdd'), + 'end': end.toString("yyyyMMdd"), + 'cal': cal[0] + '|' + cal[1] + }, + KronolithMobile.listEventsCallback + ); + } + }, + /** * Callback for the listEvents AJAX request. */ @@ -30,21 +51,25 @@ var list; data = data.response; - $("#dayview [data-role=content] ul").detach(); - $(".kronolithDayDate").html(KronolithMobile.currentDate.toString(Kronolith.conf.date_format)); - - list = $('