Skip to content

Commit

Permalink
modifying module section to match UMD pattern. updating package.json …
Browse files Browse the repository at this point in the history
…info
  • Loading branch information
robflaherty committed May 8, 2016
1 parent 2f6e6df commit 0c3868b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 33 deletions.
18 changes: 9 additions & 9 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "screentime",
"version": "1.0.0",
"description": "Screentime ==========",
"version": "0.2.0",
"description": "An analytics plugin to measure how much time elements spend on-screen.",
"main": "screentime.js",
"directories": {
"example": "examples",
Expand All @@ -12,20 +12,20 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/petemill/screentime.git"
"url": "git+https://github.com/robflaherty/screentime.git"
},
"keywords": [
"analytics",
"elements",
"google analytics",
"time"
],
"author": "",
"license": "ISC",
"author": "Rob Flaherty",
"license": "MIT",
"bugs": {
"url": "https://github.com/petemill/screentime/issues"
"url": "https://github.com/robflaherty/screentime/issues"
},
"homepage": "https://github.com/petemill/screentime#readme",
"homepage": "http://screentime.parsnip.io/",
"dependencies": {
"jquery": "^2.2.3"
"jquery": ">=1.8"
}
}
43 changes: 19 additions & 24 deletions screentime.js
@@ -1,31 +1,26 @@
/*!
* @preserve
* Screentime.js | v0.2
* Copyright (c) 2015 Rob Flaherty (@robflaherty)
* Screentime.js | v0.2.0
* Copyright (c) 2016 Rob Flaherty (@robflaherty)
* Licensed under the MIT and GPL licenses.
*/
/* Universal module definition */

(function(factory) {

//attempt to get global reference to jQuery
//if it's available, we shouldn't ask for the reference from elsewhere
var jQueryRef;
if (window && window.jQuery) {
jQueryRef = window.jQuery;
}
//either call this module's factory or return the output
if (!jQueryRef && typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS, use global jQuery ref or load from module
module.exports = factory(jQueryRef || require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function($) {

/* Universal module definition */

(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function($) {

/* Screentime */

var defaults = {
fields: [],
Expand Down

0 comments on commit 0c3868b

Please sign in to comment.