Permalink
Browse files

adding UMD support

  • Loading branch information...
Rob Flaherty
Rob Flaherty committed Apr 28, 2016
1 parent d20cd8f commit 95cd8a1f8d588933cb651ecab7c32689a7909b43
Showing with 40 additions and 19 deletions.
  1. +40 −19 riveted.js
View
@@ -1,29 +1,46 @@
/*!
* @preserve
* riveted.js | v0.6.0
* Copyright (c) 2015 Rob Flaherty (@robflaherty)
* riveted.js | v0.6.1
* Copyright (c) 2016 Rob Flaherty (@robflaherty)
* Licensed under the MIT license
*/
/* Universal module definition */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define([], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS
module.exports = factory();
} else {
// Browser global
root.riveted = factory();
}
}(this, function () {
/* Riveted */
var riveted = (function() {
var started = false,
stopped = false,
turnedOff = false,
clockTime = 0,
startTime = new Date(),
clockTimer = null,
idleTimer = null,
sendEvent,
sendUserTiming,
reportInterval,
idleTimeout,
nonInteraction,
universalGA,
classicGA,
universalSendCommand,
googleTagManager,
gaGlobal;
var started = false,
stopped = false,
turnedOff = false,
clockTime = 0,
startTime = new Date(),
clockTimer = null,
idleTimer = null,
sendEvent,
sendUserTiming,
reportInterval,
idleTimeout,
nonInteraction,
universalGA,
classicGA,
universalSendCommand,
googleTagManager,
gaGlobal;
function init(options) {
@@ -274,3 +291,7 @@ var riveted = (function() {
};
})();
return riveted;
}));

0 comments on commit 95cd8a1

Please sign in to comment.