Skip to content

Commit

Permalink
adding UMD support
Browse files Browse the repository at this point in the history
  • Loading branch information
robflaherty committed Apr 28, 2016
1 parent d20cd8f commit 95cd8a1
Showing 1 changed file with 40 additions and 19 deletions.
59 changes: 40 additions & 19 deletions riveted.js
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down Expand Up @@ -274,3 +291,7 @@ var riveted = (function() {
};

})();

return riveted;

}));

0 comments on commit 95cd8a1

Please sign in to comment.