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
var canvas = document.createElement('canvas'); | |
var gl; | |
var debugInfo; | |
var vendor; | |
var renderer; | |
try { | |
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); | |
} catch (e) { | |
} |
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
/** | |
* DOM动画方法扩展 | |
* 使用方法: | |
* document.getElementsByTagName('div')[0].hide(200); | |
* document.getElementsByTagName('div')[0].show(500); | |
* document.getElementsByTagName('div')[0].animate(300, 300, 500); | |
*/ | |
(function (d) { |
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
// preserve Twitter's style of JSON string encoding... | |
// escape higher value unicode (lowercase hex) | |
// escape < and > (uppercase hex) | |
// escape / in strings (\/) | |
// hugs! https://gist.github.com/1306986 | |
// http://stackoverflow.com/questions/4901133/json-and-escaping-characters | |
function escapedStringify(s, emit_unicode) { | |
var json = JSON.stringify(s); | |
return emit_unicode ? json : json.replace(/\//g, | |
function(c) { |
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
// See http://www.bytearray.org/?p=95 | |
// Insert into GIFPlayer.as | |
import flash.geom.Rectangle; | |
public function resize(w:Number, h:Number):void | |
{ | |
for (var i = 0; i < aFrames.length; i++) { | |
aFrames[i].resize(w, h); | |
} | |
} |