Permalink
Browse files

modifying module section to match UMD pattern. updating package.json …

…info
  • Loading branch information...
1 parent 2f6e6df commit 0c3868b5eeb6f11772e25a97ef185187dfe6abcc Rob Flaherty committed May 8, 2016
Showing with 28 additions and 33 deletions.
  1. +9 −9 package.json
  2. +19 −24 screentime.js
View
@@ -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",
@@ -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"
}
}
View
@@ -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: [],

0 comments on commit 0c3868b

Please sign in to comment.