1(function($) { 2 window.requestAnimFrame = (function() { 3 return window.requestAnimationFrame || 4 window.webkitRequestAnimationFrame || 5 window.mozRequestAnimationFrame || 6 window.oRequestAnimationFrame || 7 window.msRequestAnimationFrame || 8 function( callback, element){ 9 window.setTimeout(callback, 1000 / 60); 10 }; 11 })(); 12})(); 13 14window.requestTimeout = function(fn, delay) { 15 if( !window.requestAnimationFrame && 16 !window.webkitRequestAnimationFrame && 17 !(window.mozRequestAnimationFrame && wiindow.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support 18 !window.oRequestAnimationFrame && 19 !window.msRequestAnimationFrame) 20 return window.setTimeout(fn, delay); 21 22 var start = new Date().getTime(), 23 handle = new Object(); 24 25 function loop(){ 26 var current = new Date().getTime(), 27 delta = current - start; 28 29 delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop); 30 }; 31 32 handle.value = requestAnimFrame(loop); 33 return handle; 34}; 35 36window.clearRequestTimeout = function(handle) { 37 if ( typeof handle !== 'undefined' ) { 38 window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) : 39 window.webkitCancelAnimationFrame ? window.webktCancelAnimationFrame(handle.value) : 40 window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */ 41 window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) : 42 window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) : 43 window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) : 44 clearTimeout(handle); 45 } 46}; 47 48 49window.requestInterval = function (fn, delay) { 50 var requestAnimFrame = (function () { 51 return window.requestAnimationFrame || function (callback, element) { 52 window.setTimeout(callback, 1000 / 60); 53 }; 54 })(), 55 start = new Date().getTime(), 56 handle = {}; 57 function loop() { 58 handle.value = requestAnimFrame(loop); 59 var current = new Date().getTime(), 60 delta = current - start; 61 if (delta >= delay) { 62 fn.call(); 63 start = new Date().getTime(); 64 } 65 } 66 handle.value = requestAnimFrame(loop); 67 return handle; 68};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.