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 reapplyTimeoutId = null | |
$each(['insertBefore', 'replaceChild', 'removeChild', 'appendChild'], function(methodName) { | |
Node.prototype["_" + methodName] = Node.prototype[methodName] | |
Node.prototype[methodName] = function() { | |
var ret = this["_" + methodName](arguments[0], arguments[1]) | |
if (reapplyTimeoutId) { clearTimeout(reapplyTimeoutId) } | |
reapplyTimeoutId = setTimeout(Attitude.applyDefinitions.bind(Attitude), 100) | |
return ret | |
} |
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
Fx.Scroll.implement({ | |
scrollToCenter: function(el, axes, offset){ | |
axes = axes ? $splat(axes) : ['x', 'y']; | |
el = $(el); | |
var to = {}, | |
pos = el.getPosition(this.element), | |
size = el.getSize(), | |
scroll = this.element.getScroll(), | |
containerSize = this.element.getSize(), | |
edge = { |
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
/* | |
* Converted from: http://blog.narcvs.com/?p=43 | |
*/ | |
var MooPubSubBroker = new Class({ | |
Implements: [Options, Events], | |
options:{}, | |
initialize: function(args, options){ |
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
// -*- Mode: Javascript; tab-width: 4; -*- | |
/* | |
--- | |
privides: [String.bound, String.prototype.bind] | |
description: Lets you bind to a method that doesn't exist yet, and then swap out methods without re-wiring all your codez | |
author: Thomas Aylott <subtlegradient.com> | |
copyright: 2009 Thomas Aylott | |
license: MIT Style | |
... | |
*/ |
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){ | |
this.list = $splat(list || []); | |
this.length = this.list.length; | |
}; | |
new Native({name: 'Collection', initialize: Collection, generics: false}); | |
(function() { | |
// Some browsers don't iterate over natives, so brute force is required. |
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
/* | |
--- | |
source: http://gist.github.com/133677 | |
provides: document.write | |
description: MooTools based document.write replacement | |
requires: MooTools | |
author: Thomas Aylott -- SubtleGradient.com | |
thanks: Daniel Steigerwald -- daniel.steigerwald.cz |
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
// Lightbox Overlay | |
var LightBoxOverlay = new Class({ | |
Implements: [Options, Events], | |
options:{ | |
tag: 'div', | |
properties: { | |
id: 'lightbox_overlay', | |
'class': 'hide' | |
} | |
}, |
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
window.store('testCode', 'What is up?'); |
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(){ | |
this.Queue = new Class({ | |
Extends: Chain, | |
call: function(){ | |
if (this.busy) return this; | |
this.busy = true; |
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.instantiate = function(C){ | |
C.$prototyping = true; | |
var instance = new C; | |
delete C.$prototyping; | |
return instance; | |
}; |
OlderNewer