|
2 | 2 | <html>
|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8">
|
5 |
| - <title>JS Bin</title> |
6 |
| - <script src="../../dist/raven.js"></script> |
| 5 | + <title></title> |
7 | 6 | <script>
|
| 7 | + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ |
| 8 | + // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating |
| 9 | + |
| 10 | + // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel |
| 11 | + |
| 12 | + // MIT license |
| 13 | + |
| 14 | + (function() { |
| 15 | + var lastTime = 0; |
| 16 | + var vendors = ['ms', 'moz', 'webkit', 'o']; |
| 17 | + for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
| 18 | + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; |
| 19 | + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] |
| 20 | + || window[vendors[x]+'CancelRequestAnimationFrame']; |
| 21 | + } |
| 22 | + |
| 23 | + if (!window.requestAnimationFrame) |
| 24 | + window.requestAnimationFrame = function(callback, element) { |
| 25 | + var currTime = new Date().getTime(); |
| 26 | + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); |
| 27 | + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, |
| 28 | + timeToCall); |
| 29 | + lastTime = currTime + timeToCall; |
| 30 | + return id; |
| 31 | + }; |
| 32 | + |
| 33 | + if (!window.cancelAnimationFrame) |
| 34 | + window.cancelAnimationFrame = function(id) { |
| 35 | + clearTimeout(id); |
| 36 | + }; |
| 37 | + }()); |
| 38 | + </script> |
| 39 | + <script src="../../build/raven.js"></script> |
| 40 | + <script> |
| 41 | + // stub _makeRequest so we don't actually transmit any data |
8 | 42 | Raven._makeRequest = function () {};
|
9 | 43 |
|
| 44 | + // get a reference to the original, unwrapped setTimeout (used for |
| 45 | + // making "clean" stack traces that don't originate from mocha) |
10 | 46 | window.origSetTimeout = setTimeout;
|
| 47 | + |
11 | 48 | Raven.config('https://[email protected]/1', {
|
12 | 49 | dataCallback: function (data) {
|
13 | 50 | window.ravenData = data;
|
|
0 commit comments