diff options
author | James Lal <james@lightsofapollo.com> | 2012-06-27 12:27:09 +0200 |
---|---|---|
committer | James Lal <james@lightsofapollo.com> | 2012-06-27 12:27:09 +0200 |
commit | d74007aca2c501ac2fe56f8c440f01f6f6ceaa1f (patch) | |
tree | 2daea94d4e4028d2e4b2cd5217faf18045153de6 /lib | |
parent | 20420489ef9ded9b16852bc84b4b36d5bf363680 (diff) | |
download | jsCalDAV-d74007aca2c501ac2fe56f8c440f01f6f6ceaa1f.tar.gz |
integrate calendar data
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webcals/request/calendar_query.js | 13 | ||||
-rw-r--r-- | lib/webcals/request/propfind.js | 5 |
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/webcals/request/calendar_query.js b/lib/webcals/request/calendar_query.js index b25a1c1..b39853f 100644 --- a/lib/webcals/request/calendar_query.js +++ b/lib/webcals/request/calendar_query.js @@ -1,6 +1,7 @@ (function(module, ns) { var Propfind = ns.require('request/propfind'); + var CalendarData = ns.require('templates/calendar_data'); /** * Creates a calendar query request. @@ -15,10 +16,20 @@ this.xhr.headers['Depth'] = this.depth || 1; this.xhr.method = 'REPORT'; + this.fields = new CalendarData(); + this.template.rootTag = 'calendar-query'; } CalendarQuery.prototype = { - __proto__: Propfind.prototype + __proto__: Propfind.prototype, + + _createPayload: function() { + var props = this._props.join(''); + props += this.fields.render(this.template); + var content = this.template.tag('prop', props); + return this.template.render(content); + } + }; module.exports = CalendarQuery; diff --git a/lib/webcals/request/propfind.js b/lib/webcals/request/propfind.js index d73530c..e5f6f26 100644 --- a/lib/webcals/request/propfind.js +++ b/lib/webcals/request/propfind.js @@ -34,9 +34,10 @@ * * @param {String|Array} tagDesc tag description. * @param {Object} [attr] optional tag attrs. + * @param {Obj} [content] optional content. */ - prop: function(tagDesc, attr) { - this._props.push(this.template.tag(tagDesc, attr)); + prop: function(tagDesc, attr, content) { + this._props.push(this.template.tag(tagDesc, attr, content)); }, _createPayload: function() { |