aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/connect
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/connect')
-rwxr-xr-xscripts/connect13
1 files changed, 8 insertions, 5 deletions
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);
});