Skip to content

Instantly share code, notes, and snippets.

var _missing= function(data){ return React.DOM.pre(null, "Route not found: "+ data.route) },
_router= null,
_started= false,
_nextId= 1;
function handleRouteChange(container, component) {
var routeParams= Array.prototype.slice.call( arguments, 1 )
React.renderComponent(
component({ routeParams:routeParams }, null),
container
/**
* Delegation based mixins for JavaScript.
*
* Non-specific extensions are used:
* __proto__
* __noSuchMethod__
*
* Tested in SpiderMonkey.
*
* Opened issues:
var _restoreSymbol = (function($G)
{
var iframe = document.createElement('iframe');
(document.body || document.documentElement).appendChild(iframe);
iframe.style.display = 'none';
var win = iframe.contentWindow, doc = win.document;
doc.open();
/*
* classList.js
*
* Implements a cross-browser element.classList getter.
*
*/
"use strict";
if (typeof Element !== "undefined") {
if (!window.localStorage || !window.sessionStorage) (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
/**
* Aliases and additional "sugar"
* 2010-04-15
* @author Dmitry A. Soshnikov
*/
(function () {
["defineProperty", "defineProperties", "keys", "getOwnPropertyNames",
"getOwnPropertyDescriptor", "getPrototypeOf", "seal", "freeze",
"preventExtensions", "isFrozen", "isSealed", "isExtensible"]
/* by Dmitry A. Soshnikov */
var object = (function () {
// private
var _x = 10;
// also private
function _privateFunc() {
return _x;
[] == false; // true
"" == false; // true
null == false; // false, that's more like it
var a = [];
if (a) {
alert(1); // alert this; in condition need check a.length
} else {
alert(2);
}
// original (http://html5shiv.googlecode.com/svn/trunk/html5.js)
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,figure,figcaption,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
// kangax version (29 characters less, yay!)
/*@cc_on(function(e,i){i=e.length;while(i--)document.createElement(e[i])})("abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','))@*/
// jdalton version (was 5, now 41 characters less than kangax, yay!)