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
![alt text][1] | |
[MooTools][2] is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and [coherent API][3]. | |
**HELLO WORLD EXAMPLE** | |
window.addEvent("domready", function() { | |
document.getElements("a").addEvent("click", function(event) { | |
alert("hello world from link with href " + this.get("href")); | |
}); | |
}); |
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
// extend Asset.js | |
Asset.javascripts = function(sources, options) { | |
// multiple js load | |
options = $merge({ | |
onComplete: $empty, | |
onProgress: function() {} | |
}, options); | |
var sources = $splat(sources), counter = 0, todo = sources.length; | |
sources.each(function(source) { | |
Asset.javascript(source, { |
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() { | |
Browser.Features.base64 = null; | |
var callback = function() { | |
Browser.Features.base64 = this.width == 1 && this.height == 1; | |
// alert(Browser.Features.base64); // true || false | |
}; | |
var img = new Image(), img = document.id(img) || new Element("img"); | |
img.onload = img.onerror = img.onabort = callback; | |
// 1x1 px gif to test with |
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 initDOM() { | |
if (document.getElementById("howimg") != null) { | |
how_demoAuction("auto") | |
} | |
ie6_test(); | |
if (document.getElementById("tab_bar") != null) { | |
var d = window.location.pathname; | |
var b = document.getElementById("tab_bar").getElementsByTagName("a"); | |
switch (d) { | |
case "/future/": |
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
alias slaps { | |
echo $G Usage: /slapx [nick] | |
echo $G <slap > - slaps around a bit with a substantially large Brown | |
Cow... | |
echo $G <slap2> - slaps with a 1kg unix manual.... | |
echo $G <slap3> - slaps around a bit with a large mIRC user | |
echo $G i want more good slaps! email/msg them to me =) | |
} | |
alias slap { |
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
#!/usr/bin/perl | |
use Socket; | |
my %server; | |
$server{'port'} = "27960"; | |
$server{'host'} = (shift(@ARGV)); | |
@message = @ARGV; | |
print "trying: $server{'host'}:$server{'port'}\n"; |
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() { | |
var eliminateOrig = Element.prototype.eliminate; | |
var localStorage = {}; | |
var get = function(uid){ | |
return (localStorage[uid] || (localStorage[uid] = [])); // converted to an array to store keys stored | |
}; | |
Element.implement({ | |
lstore: function(property, value) { |
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 timer = new Class({ | |
options: { | |
pause: 0 | |
}, | |
Implements: [Options,Events], | |
initialize: function(options) { | |
this.setOptions(options); | |
this.counter = 0; | |
}, | |
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() { | |
document.getElements('img[src$=png]').each(function(img, i) { | |
var oldId = img.id; | |
img.setProperty("id", "old"+i); | |
var imgID = "id='clone" + i + "' "; | |
var imgClass = (img.className) ? "class='" + img.className + "' " : "" | |
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " | |
var imgStyle = "display:inline-block;" + img.style.cssText | |
if (img.align == "left") imgStyle = "float:left;" + imgStyle | |
if (img.align == "right") imgStyle = "float:right;" + imgStyle |
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(){ | |
var Class = this.Class = new Type('Class', function(params){ | |
if (instanceOf(params, Function)) params = {initialize: params}; | |
var newClass = function(){ | |
reset(this); | |
if (newClass.$prototyping) return this; | |
this.$caller = null; | |
if (this.initialise) | |
this.initialize = this.initialise; |
OlderNewer