-
-
Save subtleGradient/269820 to your computer and use it in GitHub Desktop.
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
<script src="mootools.js"></script> | |
<script> | |
Moo.apply(this); // For non-strict browsers | |
Moo.apply(window); // For strict browsers | |
</script> |
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
// CommonJS | |
var Moo = require('mootools'); | |
Moo.apply(this); // For most CommonJS implementations | |
// For strict CommonJS implementations | |
Moo.apply({ | |
String:String | |
}); | |
var Class = Moo.Class; |
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
var Moo = function(){ | |
var context = this; | |
var Class = this.Class = function(){}; | |
this.String.prototype.foo = function(){ return "foo'd"; }; | |
context.String.prototype.bar = function(){ return "bar'd"; }; | |
}; | |
exports.Array = Array; | |
exports.String = String; | |
// etc… | |
exports.apply = function(context, args){ | |
MooTools.apply(context); | |
return context | |
}; | |
exports.apply(MooTools); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment