aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--caldav.js9
-rw-r--r--lib/caldav/connection.js9
2 files changed, 14 insertions, 4 deletions
diff --git a/caldav.js b/caldav.js
index 0f21ea6..1882c88 100644
--- a/caldav.js
+++ b/caldav.js
@@ -2744,8 +2744,13 @@ function write (chunk) {
(function(module, ns) {
- var Caldav = ns.require('caldav'),
- XHR = ns.require('xhr');
+ var Caldav;
+ if (typeof(window) !== 'undefined') {
+ Caldav = window.Caldav;
+ } else {
+ Caldav = ns.require('caldav');
+ }
+ var XHR = ns.require('xhr');
/**
* Connection objects contain
diff --git a/lib/caldav/connection.js b/lib/caldav/connection.js
index 8869571..c3a2588 100644
--- a/lib/caldav/connection.js
+++ b/lib/caldav/connection.js
@@ -1,7 +1,12 @@
(function(module, ns) {
- var Caldav = ns.require('caldav'),
- XHR = ns.require('xhr');
+ var Caldav;
+ if (typeof(window) !== 'undefined') {
+ Caldav = window.Caldav;
+ } else {
+ Caldav = ns.require('caldav');
+ }
+ var XHR = ns.require('xhr');
/**
* Connection objects contain