diff options
-rw-r--r-- | caldav.js | 9 | ||||
-rw-r--r-- | lib/caldav/connection.js | 9 |
2 files changed, 14 insertions, 4 deletions
@@ -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 |