diff options
author | James Lal <james@lightsofapollo.com> | 2012-06-27 16:58:05 +0200 |
---|---|---|
committer | James Lal <james@lightsofapollo.com> | 2012-06-27 16:58:05 +0200 |
commit | 5e731c14d9fca4e99ac73f020d69008431ef4f81 (patch) | |
tree | 297270d9a71a242ae368f2e4303fbcb63a50ed23 /lib/webcals/request/calendar_query.js | |
parent | 24932d09294ab7a80b9c00ff505bc2823f1a65d1 (diff) | |
download | jsCalDAV-5e731c14d9fca4e99ac73f020d69008431ef4f81.tar.gz |
working calendar queries
Diffstat (limited to 'lib/webcals/request/calendar_query.js')
-rw-r--r-- | lib/webcals/request/calendar_query.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/webcals/request/calendar_query.js b/lib/webcals/request/calendar_query.js index b39853f..b9a350d 100644 --- a/lib/webcals/request/calendar_query.js +++ b/lib/webcals/request/calendar_query.js @@ -2,6 +2,7 @@ var Propfind = ns.require('request/propfind'); var CalendarData = ns.require('templates/calendar_data'); + var CalendarFilter = ns.require('templates/calendar_filter'); /** * Creates a calendar query request. @@ -17,16 +18,30 @@ this.xhr.headers['Depth'] = this.depth || 1; this.xhr.method = 'REPORT'; this.fields = new CalendarData(); - this.template.rootTag = 'calendar-query'; + this.filters = new CalendarFilter(); + + this.template.rootTag = ['caldav', 'calendar-query']; } CalendarQuery.prototype = { __proto__: Propfind.prototype, _createPayload: function() { - var props = this._props.join(''); - props += this.fields.render(this.template); - var content = this.template.tag('prop', props); + var content; + var props; + + props = this._props.join(''); + + if (this.fields) { + props += this.fields.render(this.template); + } + + content = this.template.tag('prop', props); + + if (this.filters) { + content += this.filters.render(this.template); + } + return this.template.render(content); } |