This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () | |
{ | |
if (!Function.prototype.inherit) | |
{ | |
Function.prototype.inherit = function (p_parent) | |
{ | |
if (p_parent.constructor == Function) | |
{ | |
// Normal Inheritance | |
this.prototype = new p_parent(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// feature detection | |
isTouch = "ontouchstart" in window; | |
InputHandler = { | |
startEventType : isTouch ? "touchstart" : "mousedown", | |
moveEventType : isTouch ? "touchmove" : "mousemove", | |
endEventType : isTouch ? "touchend" : "mouseup", | |
isTouchDevice : isTouch, | |
// normalize an event object generated by a select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a simple utility function for pretty printing | |
function pad(number, length) { | |
var str = '' + number; | |
while (str.length < length) { | |
str = '0' + str; | |
} | |
return str; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |