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
/* | |
Script: Array.Reduce.js | |
MooTools implementation for Array.reduce() and Array.reduceRight() | |
Acknowledgement: | |
- Implementation code ported and reworked from Mozilla's Array.reduce() and Array.reduceRight() algorithms. | |
cf: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce, | |
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight | |
*/ |
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
function Collection(list, build){ | |
this.list = $splat(list || []); | |
this.length = this.list.length; | |
this.build = build || true; | |
if (this.build) this.rebuild(); | |
} | |
new Native({name: 'Collection', initialize: Collection, generics: false}); | |
(function() { |
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
/* | |
Script: Class.AfterImplement.js | |
Adds an afterImplement feature to Class: a function | |
fired after every implemented item. | |
License & Copyright: | |
Copyright 2009, Mark Obcena <keetology.com> | |
MIT-Style License | |
*/ |
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
/* | |
Script: Accessors.js | |
An accessors mixin for getters and setters. | |
License & Copyright: | |
Copyright 2009, Mark Obcena <keetology.com> | |
MIT-Style License | |
*/ | |
var Accessors = new Class({ |
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
/* | |
Script: Signal.js | |
Makes chaining functions easy! | |
License & Copyright: | |
Copyright 2009, Mark Obcena <keetology.com> | |
MIT-Style License | |
*/ | |
(function(global){ |
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
// As a Function method.. | |
(function(){ | |
Function.prototype.docString = function(){ | |
var doc = this[this.toSource ? 'toSource' : 'toString']().match(/['"]\*(.*)\*['"]/); | |
return (doc) ? doc[1].replace(/^\s+|\s+$/g, '') : ''; | |
}; | |
})(); |
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
/* | |
Script: Template.jx | |
Basic templating system. | |
License: | |
MIT-style license. | |
Acknowledgements: | |
Original inspired by Charlie Savages' simple templating engine. |
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
Class.extend({ | |
mock: function(klass, options){ | |
options = options || {}; | |
klass = klass.prototype; | |
var proto = {}; | |
for (var i in klass) (function(key, value){ | |
proto[key] = options[key]; | |
if (proto[key]) return; | |
switch ($type(value)){ | |
case 'function': |
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
/* | |
Script: Mediator | |
Object grouping and brokering | |
Copyright and License: | |
Copyright 2010, Mark Obcena. MIT-Style License | |
*/ | |
(function(){ |
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
/* | |
Script: Function.Typed.js | |
Helper for multimethods. | |
Copyright and License: | |
Copyrighted 2010, Mark Obcena. MIT-Style License | |
Credits: | |
Inspired by "Multimethods in Python" | |
[http://alexgaynor.net/2010/jun/26/multimethods-python/] |
OlderNewer