From e9c46c77346017d0443dc3c5874730f0599edf63 Mon Sep 17 00:00:00 2001 From: eastandwestwind Date: Mon, 11 Jul 2016 12:19:35 -0400 Subject: [PATCH 1/3] adding max time option --- .DS_Store | Bin 0 -> 6148 bytes riveted.js | 4 +++- test/test.html | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..10d75a495ab37dec4832c10d671cb4fabf018106 GIT binary patch literal 6148 zcmeHKOHRWu5PdFPv;{$zEVE<-5;usdg2Was0BNdHNI#+}Y;%kriUV+)@@8yR`LRU^ z%}C?tIP)@@XDf~YxY0Jf28IB7biq!aO^eBW@rHH6i13^~;|*7M!3HZV8__oK7Zs4X z8zA9~ePD{x{M}`%Ns_G+-j~I3OTXBwu_p^6!4`95NIB;lJlEnsYw>58=&Hz>W3Jqs zxWtU?1=1?p-PhPBSmTLLcx5}|dmdI&goJc z*K;)sq_!R1?e}bf(*|duwY6}yvU0wz=Gh>x=5SI;Ij+z7S>uwPQTLfVzsitGT(4A# zzM3_rfGJ=Kv?{Vwb~e?91<>aH4>5 zz``T%(440dJ=KLHhVyieMPta=ktG+WLKtuDe$ipaNY64c*K&z-r6Wm_S%U4NEeg1!sCI$j&8+_m96-kuEz05 WI>b0&;gKUW`w>tXtT6?CRe^8ASBJv@ literal 0 HcmV?d00001 diff --git a/riveted.js b/riveted.js index 6398507..8bd3eac 100644 --- a/riveted.js +++ b/riveted.js @@ -35,6 +35,7 @@ var riveted = (function() { sendUserTiming, reportInterval, idleTimeout, + maxTime, nonInteraction, universalGA, classicGA, @@ -48,6 +49,7 @@ var riveted = (function() { options = options || {}; reportInterval = parseInt(options.reportInterval, 10) || 5; idleTimeout = parseInt(options.idleTimeout, 10) || 30; + maxTime = parseInt(options.maxTime, 10) || null; gaGlobal = options.gaGlobal || 'ga'; /* @@ -211,7 +213,7 @@ var riveted = (function() { function clock() { clockTime += 1; - if (clockTime > 0 && (clockTime % reportInterval === 0)) { + if (clockTime > 0 && clockTime < maxTime && (clockTime % reportInterval === 0)) { sendEvent(clockTime); } diff --git a/test/test.html b/test/test.html index 6f8fc43..3fd05b1 100644 --- a/test/test.html +++ b/test/test.html @@ -33,10 +33,11 @@ riveted.init({ reportInterval: 2, idleTimeout: 5, + maxTime: 10, nonInteraction: false, //gaGlobal: '__gaTracker', gaTracker: 'fooo' - + /*eventHandler: function(event) { console.log(event); }, @@ -50,4 +51,4 @@

Test

- \ No newline at end of file + From 225573e66064137048c2cecea4714368626fee70 Mon Sep 17 00:00:00 2001 From: eastandwestwind Date: Mon, 11 Jul 2016 13:02:37 -0400 Subject: [PATCH 2/3] default max time 1e3 --- riveted.js | 2 +- test/test.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/riveted.js b/riveted.js index 8bd3eac..319586d 100644 --- a/riveted.js +++ b/riveted.js @@ -49,7 +49,7 @@ var riveted = (function() { options = options || {}; reportInterval = parseInt(options.reportInterval, 10) || 5; idleTimeout = parseInt(options.idleTimeout, 10) || 30; - maxTime = parseInt(options.maxTime, 10) || null; + maxTime = parseInt(options.maxTime, 10) || 1e3; gaGlobal = options.gaGlobal || 'ga'; /* diff --git a/test/test.html b/test/test.html index 3fd05b1..f958007 100644 --- a/test/test.html +++ b/test/test.html @@ -33,7 +33,7 @@ riveted.init({ reportInterval: 2, idleTimeout: 5, - maxTime: 10, + maxTime: 1e3, nonInteraction: false, //gaGlobal: '__gaTracker', gaTracker: 'fooo' From 64007204c41cde5ad5753debdbd75a4956be577f Mon Sep 17 00:00:00 2001 From: eastandwestwind Date: Mon, 11 Jul 2016 13:11:39 -0400 Subject: [PATCH 3/3] 1e10 max --- riveted.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riveted.js b/riveted.js index 319586d..78e5edc 100644 --- a/riveted.js +++ b/riveted.js @@ -49,7 +49,7 @@ var riveted = (function() { options = options || {}; reportInterval = parseInt(options.reportInterval, 10) || 5; idleTimeout = parseInt(options.idleTimeout, 10) || 30; - maxTime = parseInt(options.maxTime, 10) || 1e3; + maxTime = parseInt(options.maxTime, 10) || 1e10; gaGlobal = options.gaGlobal || 'ga'; /*