This file contains hidden or 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
| // For extending the default object with properties | |
| extend = function(obj, extObj){ | |
| for(var i in extObj){ | |
| if(obj.hasOwnProperty(i)){ | |
| obj[i] = extObj[i]; | |
| } | |
| } | |
| } |
This file contains hidden or 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
| // find all points between 2 pooints http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm | |
| var x1 = mouseX, | |
| x2 = lastX, | |
| y1 = mouseY, | |
| y2 = lastY; | |
| var steep = (Math.abs(y2 - y1) > Math.abs(x2 - x1)); | |
| if (steep){ | |
| var x = x1; |
This file contains hidden or 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 byClass(matchClass){ | |
| if (!document.getElementsByClassName){ | |
| var elements = document.getElementsByTagName('*'), | |
| i=0, | |
| nodeList = [], | |
| reg = new RegExp('(^|\\s)' + matchClass + '(\\s|$)') | |
| for (i=0; i < elements.length;i++) | |
| { | |
| if(elements[i].className.match(reg) !== null){ |
NewerOlder