aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-07-08 12:44:49 -0700
committerJames Lal <james@lightsofapollo.com>2012-07-08 12:44:49 -0700
commit055988cbf2d8609963369494304b6b2a70e16f6a (patch)
treea4842f77986cdafa81e50d80f51a936093a588da /lib
parentee8dac6ecd2927d6ea1930ae478ff65766b446d9 (diff)
downloadjsCalDAV-055988cbf2d8609963369494304b6b2a70e16f6a.tar.gz
Fixed bug in resourcetype logic in Request.Resources. Refactored scripts/connect to use Resources
Diffstat (limited to 'lib')
-rw-r--r--lib/caldav/request/resources.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/caldav/request/resources.js b/lib/caldav/request/resources.js
index 1df7cf1..f66a455 100644
--- a/lib/caldav/request/resources.js
+++ b/lib/caldav/request/resources.js
@@ -2,14 +2,14 @@
var Propfind = ns.require('request/propfind');
- function ResourceFinder(connection, options) {
+ function Resources(connection, options) {
Propfind.apply(this, arguments);
this._resources = {};
this.depth = 1;
}
- ResourceFinder.prototype = {
+ Resources.prototype = {
__proto__: Propfind.prototype,
addResource: function(name, handler) {
@@ -22,6 +22,7 @@
var root;
var collection;
var self = this;
+ var resources;
if ('multistatus' in this.sax.root) {
root = this.sax.root.multistatus;
@@ -29,8 +30,11 @@
for (url in root) {
collection = root[url];
- if ('resourcetype' in collection) {
- collection.resourcetype.forEach(function(type) {
+ resources = collection.resourcetype;
+
+ if (resources.value.forEach) {
+
+ resources.value.forEach(function(type) {
if (type in self._resources) {
if (!(type in results)) {
@@ -59,7 +63,7 @@
};
- module.exports = ResourceFinder;
+ module.exports = Resources;
}.apply(
this,