Skip to content

Instantly share code, notes, and snippets.

@dpobel
Last active December 19, 2015 14:39
Show Gist options
  • Select an option

  • Save dpobel/5970446 to your computer and use it in GitHub Desktop.

Select an option

Save dpobel/5970446 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://yui.yahooapis.com/3.10.3/build/yui/yui.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<pre></pre>
<script>
YUI({
groups: {
'cdnjs': {
base : '//cdnjs.cloudflare.com/ajax/libs',
modules: {
'moment' : {
path: '/moment.js/2.0.0/moment.min.js'
},
'three': {
path: '/three.js/r58/three.min.js'
}
}
}
},
onSuccess: function (e) {
for (var i = 0, len = e.data.length; i < len; ++i) {
if ( e.data[i] === 'moment' ) {
YUI.add('moment', function (Y){
Y.moment = moment;
});
} else if ( e.data[i] === 'three' ) {
YUI.add('three', function (Y) {
Y.THREE = THREE;
});
}
}
}
}).use('moment', 'three', 'node', function (Y) {
// Check to see if each library is available
Y.one('pre').append('Date/Time is ' + Y.moment().format('LLL'));
Y.one('pre').append("<br/>" + 'THREE version: ' + Y.THREE.REVISION);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment