From b77eaeecff4dd49da53c0af7bbfd1bff9b7a77ea Mon Sep 17 00:00:00 2001 From: Serkan Yersen <serkanyersen@gmail.com> Date: Mon, 23 Nov 2015 17:01:30 -0800 Subject: [PATCH] Add chaining --- docs/ifvisible.html | 55 ++++++++++++++++++++++-------------- src/ifvisible.coffee | 59 ++++++++++++++++++++++++--------------- src/ifvisible.js | 66 +++++++++++++++++++++++++------------------- src/ifvisible.js.map | 2 +- src/ifvisible.min.js | 2 +- 5 files changed, 112 insertions(+), 72 deletions(-) diff --git a/docs/ifvisible.html b/docs/ifvisible.html index c4434ed..1eadea9 100644 --- a/docs/ifvisible.html +++ b/docs/ifvisible.html @@ -920,7 +920,9 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-property">@on</span>(<span class="hljs-string">"focus"</span>, callback) <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span></pre></div></div> + <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span> + <span class="hljs-property">@on</span>(<span class="hljs-string">"focus"</span>, callback) + <span class="hljs-keyword">else</span></pre></div></div> </li> @@ -935,10 +937,11 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"active"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"focus"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"wakeup"</span> <span class="hljs-comment"># When focused page will woke up too.</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status }</pre></div></div> + <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"active"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"focus"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"wakeup"</span> <span class="hljs-comment"># When focused page will woke up too.</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status } + @</pre></div></div> </li> @@ -969,7 +972,9 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-property">@on</span>(<span class="hljs-string">"blur"</span>, callback) <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span></pre></div></div> + <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span> + <span class="hljs-property">@on</span>(<span class="hljs-string">"blur"</span>, callback) + <span class="hljs-keyword">else</span></pre></div></div> </li> @@ -984,10 +989,11 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"hidden"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"blur"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"idle"</span> <span class="hljs-comment"># When blurred page is idle too</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status }</pre></div></div> + <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"hidden"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"blur"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"idle"</span> <span class="hljs-comment"># When blurred page is idle too</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status } + @</pre></div></div> </li> @@ -1017,7 +1023,9 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-property">@on</span>(<span class="hljs-string">"idle"</span>, callback) <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span></pre></div></div> + <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span> + <span class="hljs-property">@on</span>(<span class="hljs-string">"idle"</span>, callback) + <span class="hljs-keyword">else</span></pre></div></div> </li> @@ -1032,9 +1040,10 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"idle"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"idle"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status }</pre></div></div> + <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"idle"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"idle"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status } + @</pre></div></div> </li> @@ -1066,7 +1075,9 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">return</span> <span class="hljs-property">@on</span>(<span class="hljs-string">"wakeup"</span>, callback) <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span></pre></div></div> + <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-keyword">typeof</span> callback <span class="hljs-keyword">is</span> <span class="hljs-string">"function"</span> + <span class="hljs-property">@on</span>(<span class="hljs-string">"wakeup"</span>, callback) + <span class="hljs-keyword">else</span></pre></div></div> </li> @@ -1081,9 +1092,10 @@ <h2 id="exports">Exports</h2> </div> - <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"active"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"wakeup"</span> - customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status }</pre></div></div> + <div class="content"><div class='highlight'><pre> status = <span class="hljs-string">"active"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"wakeup"</span> + customEvent.fire <span class="hljs-keyword">this</span>, <span class="hljs-string">"statusChanged"</span>, { <span class="hljs-attribute">status</span>: status } + @</pre></div></div> </li> @@ -1106,7 +1118,8 @@ <h2 id="exports">Exports</h2> <div class="content"><div class='highlight'><pre> <span class="hljs-attribute">on</span>: <span class="hljs-function"><span class="hljs-params">(name, callback)</span> -></span> init() <span class="hljs-comment"># Auto init on first call</span> - customEvent.add <span class="hljs-keyword">this</span>, name, callback</pre></div></div> + customEvent.add <span class="hljs-keyword">this</span>, name, callback + @</pre></div></div> </li> @@ -1130,7 +1143,8 @@ <h2 id="exports">Exports</h2> <div class="content"><div class='highlight'><pre> <span class="hljs-attribute">off</span>: <span class="hljs-function"><span class="hljs-params">(name, callback)</span> -></span> init() <span class="hljs-comment"># Auto init on first call</span> - customEvent.remove <span class="hljs-keyword">this</span>, name, callback</pre></div></div> + customEvent.remove <span class="hljs-keyword">this</span>, name, callback + @</pre></div></div> </li> @@ -1226,6 +1240,7 @@ <h2 id="exports">Exports</h2> <div class="content"><div class='highlight'><pre> init() status <span class="hljs-keyword">is</span> (check <span class="hljs-keyword">or</span> <span class="hljs-string">"active"</span>) + <span class="hljs-keyword">return</span> ifvisible )</pre></div></div> diff --git a/src/ifvisible.coffee b/src/ifvisible.coffee index cdedbff..a548332 100644 --- a/src/ifvisible.coffee +++ b/src/ifvisible.coffee @@ -322,12 +322,15 @@ focus: (callback) -> # if first argument is a callback then set an event - return @on("focus", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "focus" - customEvent.fire this, "wakeup" # When focused page will woke up too. - customEvent.fire this, "statusChanged", { status: status } + if typeof callback is "function" + @on("focus", callback) + else + # else trigger event + status = "active" + customEvent.fire this, "focus" + customEvent.fire this, "wakeup" # When focused page will woke up too. + customEvent.fire this, "statusChanged", { status: status } + @ # When User swicthes tabs or minimizes the window @@ -337,23 +340,29 @@ blur: (callback) -> # if first argument is a callback then set an event - return @on("blur", callback) if typeof callback is "function" - # else trigger event - status = "hidden" - customEvent.fire this, "blur" - customEvent.fire this, "idle" # When blurred page is idle too - customEvent.fire this, "statusChanged", { status: status } + if typeof callback is "function" + @on("blur", callback) + else + # else trigger event + status = "hidden" + customEvent.fire this, "blur" + customEvent.fire this, "idle" # When blurred page is idle too + customEvent.fire this, "statusChanged", { status: status } + @ # When page is focused but user is doing nothing on the page idle: (callback) -> # if first argument is a callback then set an event - return @on("idle", callback) if typeof callback is "function" - # else trigger event - status = "idle" - customEvent.fire this, "idle" - customEvent.fire this, "statusChanged", { status: status } + if typeof callback is "function" + @on("idle", callback) + else + # else trigger event + status = "idle" + customEvent.fire this, "idle" + customEvent.fire this, "statusChanged", { status: status } + @ # When user started to make interactions on the page such as: @@ -362,11 +371,14 @@ wakeup: (callback) -> # if first argument is a callback then set an event - return @on("wakeup", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "wakeup" - customEvent.fire this, "statusChanged", { status: status } + if typeof callback is "function" + @on("wakeup", callback) + else + # else trigger event + status = "active" + customEvent.fire this, "wakeup" + customEvent.fire this, "statusChanged", { status: status } + @ # Set an event to ifvisible object # ``` @@ -380,6 +392,7 @@ on: (name, callback) -> init() # Auto init on first call customEvent.add this, name, callback + @ # Remove an event from ifvisible object # ``` @@ -394,6 +407,7 @@ off: (name, callback) -> init() # Auto init on first call customEvent.remove this, name, callback + @ # if page is visible then run given code in given seconds of intervals # ``` @@ -432,5 +446,6 @@ # Auto init on first call init() status is (check or "active") + return ifvisible ) diff --git a/src/ifvisible.js b/src/ifvisible.js index ed396db..bcd610e 100644 --- a/src/ifvisible.js +++ b/src/ifvisible.js @@ -218,53 +218,63 @@ }, focus: function(callback) { if (typeof callback === "function") { - return this.on("focus", callback); + this.on("focus", callback); + } else { + status = "active"; + customEvent.fire(this, "focus"); + customEvent.fire(this, "wakeup"); + customEvent.fire(this, "statusChanged", { + status: status + }); } - status = "active"; - customEvent.fire(this, "focus"); - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); + return this; }, blur: function(callback) { if (typeof callback === "function") { - return this.on("blur", callback); + this.on("blur", callback); + } else { + status = "hidden"; + customEvent.fire(this, "blur"); + customEvent.fire(this, "idle"); + customEvent.fire(this, "statusChanged", { + status: status + }); } - status = "hidden"; - customEvent.fire(this, "blur"); - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); + return this; }, idle: function(callback) { if (typeof callback === "function") { - return this.on("idle", callback); + this.on("idle", callback); + } else { + status = "idle"; + customEvent.fire(this, "idle"); + customEvent.fire(this, "statusChanged", { + status: status + }); } - status = "idle"; - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); + return this; }, wakeup: function(callback) { if (typeof callback === "function") { - return this.on("wakeup", callback); + this.on("wakeup", callback); + } else { + status = "active"; + customEvent.fire(this, "wakeup"); + customEvent.fire(this, "statusChanged", { + status: status + }); } - status = "active"; - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); + return this; }, on: function(name, callback) { init(); - return customEvent.add(this, name, callback); + customEvent.add(this, name, callback); + return this; }, off: function(name, callback) { init(); - return customEvent.remove(this, name, callback); + customEvent.remove(this, name, callback); + return this; }, onEvery: function(seconds, callback) { var paused, t; diff --git a/src/ifvisible.js.map b/src/ifvisible.js.map index 56db804..98f1f82 100644 --- a/src/ifvisible.js.map +++ b/src/ifvisible.js.map @@ -6,5 +6,5 @@ "ifvisible.coffee" ], "names": [], - "mappings": "AAAA;AAAA,EAAA,CAAC,SAAC,IAAD,EAAO,OAAP,GAAA;AACC,IAAA,IAAG,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QAAA,IAAA,CAAA,CAAA,CAAA;AAAA,QACA,WAAW,CAAC,MAAZ,CAAmB,IAAnB,EAAyB,IAAzB,EAA+B,QAA/B,CADA,CAAA;eAEA,KAHG;MAAA,CAhIL;AAAA,MA0IA,OAAA,EAAS,SAAC,OAAD,EAAU,QAAV,GAAA;AAEP,YAAA,SAAA;AAAA,QAAA,IAAA,CAAA,CAAA,CAAA;AAAA,QAEA,MAAA,GAAS,KAFT,CAAA;AAIA,QAAA,IAEqB,QAFrB;AAAA,UAAA,CAAA,GAAI,WAAA,CAAY,SAAA,GAAA;AACd,YAAA,IAAe,MAAA,KAAU,QAAV,IAAsB,MAAA,KAAU,KAA/C;qBAAA,QAAA,CAAA,EAAA;aADc;UAAA,CAAZ,EAEF,OAAA,GAAU,IAFR,CAAJ,CAAA;SAJA;eASA;AAAA,UAAA,IAAA,EAAM,SAAA,GAAA;mBACJ,aAAA,CAAc,CAAd,EADI;UAAA,CAAN;AAAA,UAGA,KAAA,EAAO,SAAA,GAAA;mBACL,MAAA,GAAS,KADJ;UAAA,CAHP;AAAA,UAMA,MAAA,EAAQ,SAAA,GAAA;mBACN,MAAA,GAAS,MADH;UAAA,CANR;AAAA,UASA,IAAA,EAAM,CATN;AAAA,UAUA,QAAA,EAAU,QAVV;UAXO;MAAA,CA1IT;AAAA,MAsKA,GAAA,EAAK,SAAC,KAAD,GAAA;AAEH,QAAA,IAAA,CAAA,CAAA,CAAA;eACA,MAAA,KAAU,CAAC,KAAA,IAAS,QAAV,EAHP;MAAA,CAtKL;KApQF,CAAA;AA+aA,WAAO,SAAP,CApbM;EAAA,CAbR,CAAA,CAAA;AAAA" } \ No newline at end of file diff --git a/src/ifvisible.min.js b/src/ifvisible.min.js index 006981f..a31a279 100644 --- a/src/ifvisible.min.js +++ b/src/ifvisible.min.js @@ -1 +1 @@ -(function(){!function(a,b){return"function"==typeof define&&define.amd?define(function(){return b()}):"object"==typeof exports?module.exports=b():a.ifvisible=b()}(this,function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;return i={},c=document,k=!1,l="active",g=6e4,f=!1,b=function(){var a,b,c,d,e,f,g;return a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},e=function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},f={},c="__ceGUID",b=function(a,b,d){return a[c]=void 0,a[c]||(a[c]="ifvisible.object.event.identifier"),f[a[c]]||(f[a[c]]={}),f[a[c]][b]||(f[a[c]][b]=[]),f[a[c]][b].push(d)},d=function(a,b,d){var e,g,h,i,j;if(a[c]&&f[a[c]]&&f[a[c]][b]){for(i=f[a[c]][b],j=[],g=0,h=i.length;h>g;g++)e=i[g],j.push(e(d||{}));return j}},g=function(a,b,d){var e,g,h,i,j;if(d){if(a[c]&&f[a[c]]&&f[a[c]][b])for(j=f[a[c]][b],g=h=0,i=j.length;i>h;g=++h)if(e=j[g],e===d)return f[a[c]][b].splice(g,1),e}else if(a[c]&&f[a[c]]&&f[a[c]][b])return delete f[a[c]][b]},{add:b,remove:g,fire:d}}(),a=function(){var a;return a=!1,function(b,c,d){return a||(a=b.addEventListener?function(a,b,c){return a.addEventListener(b,c,!1)}:b.attachEvent?function(a,b,c){return a.attachEvent("on"+b,c,!1)}:function(a,b,c){return a["on"+b]=c}),a(b,c,d)}}(),d=function(a,b){var d;return c.createEventObject?a.fireEvent("on"+b,d):(d=c.createEvent("HTMLEvents"),d.initEvent(b,!0,!0),!a.dispatchEvent(d))},h=function(){var a,b,d,e,f;for(e=void 0,f=3,d=c.createElement("div"),a=d.getElementsByTagName("i"),b=function(){return d.innerHTML="<!--[if gt IE "+ ++f+"]><i></i><![endif]-->",a[0]};b(););return f>4?f:e}(),e=!1,n=void 0,"undefined"!=typeof c.hidden?(e="hidden",n="visibilitychange"):"undefined"!=typeof c.mozHidden?(e="mozHidden",n="mozvisibilitychange"):"undefined"!=typeof c.msHidden?(e="msHidden",n="msvisibilitychange"):"undefined"!=typeof c.webkitHidden&&(e="webkitHidden",n="webkitvisibilitychange"),m=function(){var b,d;return b=!1,d=function(){return clearTimeout(b),"active"!==l&&i.wakeup(),f=+new Date,b=setTimeout(function(){return"active"===l?i.idle():void 0},g)},d(),a(c,"mousemove",d),a(c,"keyup",d),a(window,"scroll",d),i.focus(d),i.wakeup(d)},j=function(){var b;return k?!0:(e===!1?(b="blur",9>h&&(b="focusout"),a(window,b,function(){return i.blur()}),a(window,"focus",function(){return i.focus()})):a(c,n,function(){return c[e]?i.blur():i.focus()},!1),k=!0,m())},i={setIdleDuration:function(a){return g=1e3*a},getIdleDuration:function(){return g},getIdleInfo:function(){var a,b;return a=+new Date,b={},"idle"===l?(b.isIdle=!0,b.idleFor=a-f,b.timeLeft=0,b.timeLeftPer=100):(b.isIdle=!1,b.idleFor=a-f,b.timeLeft=f+g-a,b.timeLeftPer=(100-100*b.timeLeft/g).toFixed(2)),b},focus:function(a){return"function"==typeof a?this.on("focus",a):(l="active",b.fire(this,"focus"),b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l}))},blur:function(a){return"function"==typeof a?this.on("blur",a):(l="hidden",b.fire(this,"blur"),b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l}))},idle:function(a){return"function"==typeof a?this.on("idle",a):(l="idle",b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l}))},wakeup:function(a){return"function"==typeof a?this.on("wakeup",a):(l="active",b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l}))},on:function(a,c){return j(),b.add(this,a,c)},off:function(a,c){return j(),b.remove(this,a,c)},onEvery:function(a,b){var c,d;return j(),c=!1,b&&(d=setInterval(function(){return"active"===l&&c===!1?b():void 0},1e3*a)),{stop:function(){return clearInterval(d)},pause:function(){return c=!0},resume:function(){return c=!1},code:d,callback:b}},now:function(a){return j(),l===(a||"active")}}})}).call(this); \ No newline at end of file +(function(){!function(a,b){return"function"==typeof define&&define.amd?define(function(){return b()}):"object"==typeof exports?module.exports=b():a.ifvisible=b()}(this,function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;return i={},c=document,k=!1,l="active",g=6e4,f=!1,b=function(){var a,b,c,d,e,f,g;return a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},e=function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},f={},c="__ceGUID",b=function(a,b,d){return a[c]=void 0,a[c]||(a[c]="ifvisible.object.event.identifier"),f[a[c]]||(f[a[c]]={}),f[a[c]][b]||(f[a[c]][b]=[]),f[a[c]][b].push(d)},d=function(a,b,d){var e,g,h,i,j;if(a[c]&&f[a[c]]&&f[a[c]][b]){for(i=f[a[c]][b],j=[],g=0,h=i.length;h>g;g++)e=i[g],j.push(e(d||{}));return j}},g=function(a,b,d){var e,g,h,i,j;if(d){if(a[c]&&f[a[c]]&&f[a[c]][b])for(j=f[a[c]][b],g=h=0,i=j.length;i>h;g=++h)if(e=j[g],e===d)return f[a[c]][b].splice(g,1),e}else if(a[c]&&f[a[c]]&&f[a[c]][b])return delete f[a[c]][b]},{add:b,remove:g,fire:d}}(),a=function(){var a;return a=!1,function(b,c,d){return a||(a=b.addEventListener?function(a,b,c){return a.addEventListener(b,c,!1)}:b.attachEvent?function(a,b,c){return a.attachEvent("on"+b,c,!1)}:function(a,b,c){return a["on"+b]=c}),a(b,c,d)}}(),d=function(a,b){var d;return c.createEventObject?a.fireEvent("on"+b,d):(d=c.createEvent("HTMLEvents"),d.initEvent(b,!0,!0),!a.dispatchEvent(d))},h=function(){var a,b,d,e,f;for(e=void 0,f=3,d=c.createElement("div"),a=d.getElementsByTagName("i"),b=function(){return d.innerHTML="<!--[if gt IE "+ ++f+"]><i></i><![endif]-->",a[0]};b(););return f>4?f:e}(),e=!1,n=void 0,"undefined"!=typeof c.hidden?(e="hidden",n="visibilitychange"):"undefined"!=typeof c.mozHidden?(e="mozHidden",n="mozvisibilitychange"):"undefined"!=typeof c.msHidden?(e="msHidden",n="msvisibilitychange"):"undefined"!=typeof c.webkitHidden&&(e="webkitHidden",n="webkitvisibilitychange"),m=function(){var b,d;return b=!1,d=function(){return clearTimeout(b),"active"!==l&&i.wakeup(),f=+new Date,b=setTimeout(function(){return"active"===l?i.idle():void 0},g)},d(),a(c,"mousemove",d),a(c,"keyup",d),a(window,"scroll",d),i.focus(d),i.wakeup(d)},j=function(){var b;return k?!0:(e===!1?(b="blur",9>h&&(b="focusout"),a(window,b,function(){return i.blur()}),a(window,"focus",function(){return i.focus()})):a(c,n,function(){return c[e]?i.blur():i.focus()},!1),k=!0,m())},i={setIdleDuration:function(a){return g=1e3*a},getIdleDuration:function(){return g},getIdleInfo:function(){var a,b;return a=+new Date,b={},"idle"===l?(b.isIdle=!0,b.idleFor=a-f,b.timeLeft=0,b.timeLeftPer=100):(b.isIdle=!1,b.idleFor=a-f,b.timeLeft=f+g-a,b.timeLeftPer=(100-100*b.timeLeft/g).toFixed(2)),b},focus:function(a){return"function"==typeof a?this.on("focus",a):(l="active",b.fire(this,"focus"),b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l})),this},blur:function(a){return"function"==typeof a?this.on("blur",a):(l="hidden",b.fire(this,"blur"),b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l})),this},idle:function(a){return"function"==typeof a?this.on("idle",a):(l="idle",b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l})),this},wakeup:function(a){return"function"==typeof a?this.on("wakeup",a):(l="active",b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l})),this},on:function(a,c){return j(),b.add(this,a,c),this},off:function(a,c){return j(),b.remove(this,a,c),this},onEvery:function(a,b){var c,d;return j(),c=!1,b&&(d=setInterval(function(){return"active"===l&&c===!1?b():void 0},1e3*a)),{stop:function(){return clearInterval(d)},pause:function(){return c=!0},resume:function(){return c=!1},code:d,callback:b}},now:function(a){return j(),l===(a||"active")}}})}).call(this); \ No newline at end of file