diff options
Diffstat (limited to 'lib/webcals/request')
-rw-r--r-- | lib/webcals/request/calendar_query.js | 31 |
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')] +)); |