aboutsummaryrefslogtreecommitdiffstats
path: root/caldav.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-09-30 12:35:08 -0700
committerJames Lal <james@lightsofapollo.com>2012-09-30 12:35:08 -0700
commitadcd11c2570d2e11eb201ce7d216b5067521afe0 (patch)
treeb5b2ac5c19489720323a29470f13077b97ed2c54 /caldav.js
parente5aaf7365f2b0ea0160357e5e1a4ee47379d372a (diff)
downloadjsCalDAV-adcd11c2570d2e11eb201ce7d216b5067521afe0.tar.gz
use strict fix
Diffstat (limited to 'caldav.js')
-rw-r--r--caldav.js34
1 files changed, 31 insertions, 3 deletions
diff --git a/caldav.js b/caldav.js
index aee364c..e075a8b 100644
--- a/caldav.js
+++ b/caldav.js
@@ -1472,9 +1472,6 @@ function write (chunk) {
//add to stackData
stackData.tagSpec = data.tagSpec;
- // shortcut to the current tag object
- this.currentTag = stackData;
-
//determine if we need to switch to another
//handler object.
handle = this.getHandler(data.tagSpec);
@@ -2522,6 +2519,37 @@ function write (chunk) {
this._props.push(this.template.tag(tagDesc, attr, content));
},
+ /**
+ * Removes property from request.
+ * Must use same arguments as 'prop' to remove prop.
+ *
+ * @param {String|Array} tagDesc tag description.
+ * @param {Object} [attr] optional tag attrs.
+ * @param {Obj} [content] optional content.
+ */
+ removeProp: function(tagDesc, attr, content) {
+ var prop = this.template.tag(tagDesc, attr, content);
+ var idx = this._props.indexOf(prop);
+
+ if (idx !== -1) {
+ this._props.splice(idx, 1);
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * Checks if prop has been added to the request.
+ *
+ * @param {String|Array} tagDesc tag description.
+ * @param {Object} [attr] optional tag attrs.
+ * @param {Obj} [content] optional content.
+ */
+ hasProp: function(tagDesc, attr, content) {
+ var prop = this.template.tag(tagDesc, attr, content);
+ return this._props.indexOf(prop) !== -1;
+ },
+
_createPayload: function() {
var content = this.template.tag('prop', this._props.join(''));
return this.template.render(content);