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
// EXAMPLE: a compound iterator with sequencing | |
// Python style | |
function cat() { | |
let is = arguments; | |
return { | |
next: { | |
let length; | |
while ((length = is.length) > 0) { | |
try { |
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
<html> | |
<head> | |
<script src="mootools.js"></script> | |
<script src="mootools-1.2.4.4-more.js"></script> | |
<script src="rx.js"></script> | |
<script src="rx.mootools.js"></script> | |
<script> | |
window.addEvent('domready', 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
// Array shuffle for MooTools | |
Array.implement({ | |
shuffle: function(){ | |
for (var i = this.length; i && --i;){ | |
var temp = this[i], r = Math.floor(Math.random() * ( i + 1 )); | |
this[i] = this[r]; | |
this[r] = temp; | |
} |
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
PRELOADING REQUIRED: | |
Sheer({ | |
original: 'urn:Sheer:Lang:Array', | |
require: { | |
'urn:Sheer:Lang': ['Type', 'Object', 'Function'] | |
} | |
}, function(Type, Object, 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
/*= | |
name: Animation | |
description: Simple animations implementation that work with standard-sized browsers (using Fx) and use webkit css animations where available. | |
license: MooTools MIT-Style License (http://mootools.net/license.txt) | |
copyright: Valerio Proietti (http://mad4milk.net) | |
authors: Valerio Proietti (http://mad4milk.net) | |
requires: MooTools 1.2.3+ (Core) (http://mootools.net/download) | |
=*/ | |
var Animation = 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
Element.implement({ | |
/** | |
truncates element text to fit in element width. | |
end (bool) defaults false. True = cuts string at end, False = cuts string in middle | |
str (string) truncation string default : '...' | |
**/ | |
truncate : function(end,str){ | |
str = str || '...'; | |
var style = this.style; | |
var originalStyles = { overflow: style.overflow, 'white-space': style.whiteSpace, padding: style.padding }; |