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", "name": "screentime",
"version": "1.0.0", "version": "0.2.0",
"description": "Screentime ==========", "description": "An analytics plugin to measure how much time elements spend on-screen.",
"main": "screentime.js", "main": "screentime.js",
"directories": { "directories": {
"example": "examples", "example": "examples",
Expand All @@ -12,20 +12,20 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/petemill/screentime.git" "url": "git+https://github.com/robflaherty/screentime.git"
}, },
"keywords": [ "keywords": [
"analytics", "analytics",
"elements", "google analytics",
"time" "time"
], ],
"author": "", "author": "Rob Flaherty",
"license": "ISC", "license": "MIT",
"bugs": { "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": { "dependencies": {
"jquery": "^2.2.3" "jquery": ">=1.8"
} }
} }
43 changes: 19 additions & 24 deletions screentime.js
@@ -1,31 +1,26 @@
/*! /*!
* @preserve * @preserve
* Screentime.js | v0.2 * Screentime.js | v0.2.0
* Copyright (c) 2015 Rob Flaherty (@robflaherty) * Copyright (c) 2016 Rob Flaherty (@robflaherty)
* Licensed under the MIT and GPL licenses. * Licensed under the MIT and GPL licenses.
*/ */
/* Universal module definition */

/* Universal module definition */
(function(factory) {

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


var defaults = { var defaults = {
fields: [], fields: [],
Expand Down

0 comments on commit 0c3868b

Please sign in to comment.