mirror of
https://github.com/turuslan/HackTimer
synced 2024-11-21 23:19:11 +00:00
Updated minified version
This commit is contained in:
parent
253439eb85
commit
1177ef0328
2
HackTimer.min.js
vendored
2
HackTimer.min.js
vendored
@ -1 +1 @@
|
||||
(function(s){var w,f={},o=window,l=console,m=Math,z='postMessage',x='HackTimer.js by turuslan: ',v='Initialisation failed';if(typeof(Worker)!=='undefined'){function g(p){return p+m.floor(m.random()*Number.MAX_VALUE)}try{w=new Worker(s);o.setInterval=function(c,t){var i=g('i-');f[i]=c;w[z]({n:'a',i:i,t:t});return i};o.clearInterval=function(i){delete f[i];w[z]({n:'b',i:i})};o.setTimeout=function(c,t){var i=g('t-');f[i]=c;w[z]({n:'c',i:i,t:t});return i};o.clearTimeout=function(i){delete f[i];w[z]({n:'d',i:i})};w.onmessage=function(e){f[e.data].call(o)};w.onerror=function(e){l.log(e)};l.log(x+'Initialisation succeeded')}catch(e){l.log(x+v);l.error(e)}}else l.log(x+v+' - HTML5 Web Worker is not supported')})('HackTimerWorker.min.js');
|
||||
(function(s){var w,f={},o=window,l=console,m=Math,z='postMessage',x='HackTimer.js by turuslan: ',v='Initialisation failed',p=0,r='hasOwnProperty';if(typeof(Worker)!=='undefined'){try{w=new Worker(s);o.setInterval=function(c,t){var i=++p;f[i]=c;w[z]({n:'a',i:i,t:t});return i};o.clearInterval=function(i){if(f[r](i)){delete f[i];w[z]({n:'b',i:i})}};o.setTimeout=function(c,t){var i=++p;f[i]=c;w[z]({n:'c',i:i,t:t});return i};o.clearTimeout=function(i){if(f[r](i)){delete f[i];w[z]({n:'d',i:i})}};w.onmessage=function(e){var n=e.data;if(f[r](n))n=f[n];if(typeof(n)=='string')try{n=new Function(n)}catch(k){l.log(x+'Error parsing callback code string: ',k)}if(typeof(n)=='function')n.call(o)};w.onerror=function(e){l.log(e)};l.log(x+'Initialisation succeeded')}catch(e){l.log(x+v);l.error(e)}}else l.log(x+v+' - HTML5 Web Worker is not supported')})('HackTimerWorker.min.js');
|
Loading…
Reference in New Issue
Block a user