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
head | |
meta(charset="utf-8") | |
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") | |
title= title | |
link(rel='stylesheet', href='/public/js/libs/nodeunit/nodeunit.css') | |
script(src="/public/js/libs/nodeunit/nodeunit.js") | |
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js") | |
<!-- nodeunit HTML --> |
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
// Original - @Gozola. This is a reimplemented version (with a few bug fixes). | |
window.WeakMap = window.WeakMap || (function () { | |
var privates = Name() | |
return { | |
get: function (key, fallback) { | |
var store = privates(key) | |
return store.hasOwnProperty("value") ? | |
store.value : fallback | |
}, |
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
//use this if you want support for browsers which don't have ES5 goodies | |
(function () { | |
"use strict"; | |
var lists = document.getElementsByTagName( 'ol' ), list; | |
for ( var i = 0, len = lists.length; i < len; i++ ) { | |
// bug 1 not local variable | |
list = lists[i]; |
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
// assumes an ES5 compliant browser for Array.prototype.forEach | |
// and Object.defineProperty | |
// and a sane browser for Element.prototype.addEventListener | |
(function () { | |
"use strict"; | |
//no need to shim if it's already there | |
if ( 'hidden' in document && 'onvisibilitychange' in document ) { | |
return; | |
} |
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://www.w3.org/TR/2011/WD-page-visibility-20110602/ | |
(function () { | |
"use strict"; | |
//no need to shim if it's already there | |
if ( 'hidden' in document && 'onvisibilitychange' in document ) { | |
return; | |
} | |
//fail silently if the browser sux |
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
// Roughly: a combination of Jeremy’s and Allen’s ideas, updated with the results of recent discussions | |
// Guidelines: | |
// - Don’t use the same syntax as for object literals, but stay close. | |
// - Rationale: Some object literal features are forbidden in class declarations => don’t confuse people | |
// - Rationale: Comma separation is a bit tricky. | |
// - Keep new features at a minimum | |
// - Don’t obscure the fact that private names are actually name objects. | |
// => They can also be imported from somewhere else – a use case that needs to be supported. | |
// - In order to minimize confusion, keep module syntax and class declaration syntax similar. |
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
/* | |
I herd u liek bloat and useless frameworks. | |
Just write JavaScript already | |
Uses [DelegateListener][1] and [fragment][2] | |
[1]: https://github.com/termi/DelegateListener | |
[2]: https://github.com/Raynos/fragment | |
*/ |
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 ncore = require( 'ncore' ); | |
ncore.constructor( { | |
"./other.js": { | |
"test": "./test.js" | |
} | |
}); | |
console.log( ncore ); |