Permalink
Browse files

Merge branch 'petemill-master'

  • Loading branch information...
2 parents 73dffa7 + 0c3868b commit d57bc2d2f0d524418094054413875715d7dbee5e Rob Flaherty committed May 8, 2016
Showing with 51 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +31 −0 package.json
  3. +19 −4 screentime.js
View
@@ -0,0 +1 @@
+node_modules
View
@@ -0,0 +1,31 @@
+{
+ "name": "screentime",
+ "version": "0.2.0",
+ "description": "An analytics plugin to measure how much time elements spend on-screen.",
+ "main": "screentime.js",
+ "directories": {
+ "example": "examples",
+ "test": "test"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/robflaherty/screentime.git"
+ },
+ "keywords": [
+ "analytics",
+ "google analytics",
+ "time"
+ ],
+ "author": "Rob Flaherty",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/robflaherty/screentime/issues"
+ },
+ "homepage": "http://screentime.parsnip.io/",
+ "dependencies": {
+ "jquery": ">=1.8"
+ }
+}
View
@@ -1,11 +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.
*/
-(function($, window, document) {
+/* 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: [],
@@ -230,4 +245,4 @@
};
-})(jQuery, window, document);
+}));

0 comments on commit d57bc2d

Please sign in to comment.