From ee8dac6ecd2927d6ea1930ae478ff65766b446d9 Mon Sep 17 00:00:00 2001 From: James Lal Date: Sat, 7 Jul 2012 16:33:27 -0700 Subject: resources request --- scripts/connect | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts/connect') diff --git a/scripts/connect b/scripts/connect index 050df1b..b5d12cb 100755 --- a/scripts/connect +++ b/scripts/connect @@ -35,6 +35,7 @@ var con = new CalDav.Connection({ var Propfind = CalDav.Request.Propfind; var CalendarHome = CalDav.Request.CalendarHome; +var Calendar = CalDav.Resources.Calendar; function getCalendarDetails(caluri) { @@ -52,16 +53,18 @@ function getCalendarDetails(caluri) { // found calendar home find calendars. calFind.send(function(err, data) { - var url, name; + var url, name, calendars = {}; for (url in data) { if (data[url].resourcetype.value.indexOf('calendar') !== -1) { - name = data[url].displayname.value.value; - console.log('CAL RESOURCE:', name, '-', url); + calendars[url] = new Calendar(con, { url: url }); + calendars[url].updateFromServer(data[url]); + + console.log('CAL RESOURCE:', calendars[url]); } } - console.log('DATA:'); - console.log(JSON.stringify(data)); + //console.log('DATA:'); + //console.log(JSON.stringify(data)); //console.log('RAW:'); //console.log(calFind.xhr.xhr.responseText); }); -- cgit