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
<component lightWeight="true"> | |
<attach event="onpropertychange" onevent="checkPropertyChange()" /> | |
<attach event="ondetach" onevent="restore()" /> | |
<attach event="onresize" for="window" onevent="restore();init()" /> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
var viewportwidth = (typeof window.innerWidth != 'undefined' ? window.innerWidth : element.document.documentElement.clientWidth); | |
// Shortcut for the document object | |
var doc = element.document; |
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.prototype.curry = function(){ | |
if(arguments.length < 1) return this; | |
var args = Array.prototype.slice.call(arguments), | |
method = this; | |
return function(){ | |
return method.apply(this, args.concat(Array.prototype.slice.call(arguments))); | |
} | |
} |
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
/* Source: http://nicolasgallagher.com/micro-clearfix-hack/ */ | |
/* For modern browsers */ | |
.cf:before, | |
.cf:after { | |
content:""; | |
display:table; | |
} | |
.cf:after { |
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
// Init boilerplate | |
function CanvasQuery(c){ | |
"use strict"; | |
if(!(this instanceof CanvasQuery)) return new CanvasQuery(c); | |
if(typeof c == "string"){ | |
var canvas = document.getElementById(c); | |
if(!canvas) throw new Error("Canvas element #" + c + " doesn't exist"); | |
} | |
if(typeof canvas == "undefined"){ | |
if(c.getContext) canvas = c; |
NewerOlder