aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webcals/request
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-27 11:31:51 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-27 11:31:51 +0200
commitc3db57754c540129bd004137ab88be69788217d2 (patch)
tree758acbd7c7fcb42f392838a55125d090697a336c /lib/webcals/request
parent95d50ef280c46ce6a29454285ccd7fc42cbcac61 (diff)
downloadjsCalDAV-c3db57754c540129bd004137ab88be69788217d2.tar.gz
Add calendar data / calendar query
Diffstat (limited to 'lib/webcals/request')
-rw-r--r--lib/webcals/request/calendar_query.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/webcals/request/calendar_query.js b/lib/webcals/request/calendar_query.js
new file mode 100644
index 0000000..b25a1c1
--- /dev/null
+++ b/lib/webcals/request/calendar_query.js
@@ -0,0 +1,31 @@
+(function(module, ns) {
+
+ var Propfind = ns.require('request/propfind');
+
+ /**
+ * Creates a calendar query request.
+ *
+ * Defaults to Depth of 1.
+ *
+ * @param {String} url location to make request.
+ * @param {Object} options options for calendar query.
+ */
+ function CalendarQuery(url, options) {
+ Propfind.apply(this, arguments);
+
+ this.xhr.headers['Depth'] = this.depth || 1;
+ this.xhr.method = 'REPORT';
+ }
+
+ CalendarQuery.prototype = {
+ __proto__: Propfind.prototype
+ };
+
+ module.exports = CalendarQuery;
+
+}.apply(
+ this,
+ (this.Webcals) ?
+ [Webcals('request/calendar_query'), Webcals] :
+ [module, require('../webcals')]
+));