Skip to content

Instantly share code, notes, and snippets.

View anutron's full-sized avatar

Aaron Newton anutron

View GitHub Profile
/*
Script: Element.Delegate.js
Extends the Element native object to include the delegate method for more efficient event management.
License:
http://www.clientcide.com/wiki/cnet-libraries#license
*/
(function(){
var getType = function(type) {
/*
Script: Element.Delegate.js
Extends the Element native object to include the delegate method for more efficient event management.
Based on the work of Daniel Steigerwald.
"Element.Delegate": {
"deps":["Element.Event"],
"desc":"Delegates events for child elements to their parents for greater efficiency."
},
Chain = new Class({
$chains: {},
getChain: function(key) {
this.$chains[key] = this.$chains[key] || {
$chain: [],
/*
* AUTOGROW TEXTAREA
* Version 1.0
* A mooTools plugin
* by Gary Glass (www.bookballoon.com)
* mailto:bookballoon -at- bookballoon.com
*
* Based on a jQuery plugin by Chrys Bader (www.chrysbader.com).
*
* Copyright (c) 2009 Gary Glass (www.bookballoon.com)
/*
Script: Element.Measure.js
Extends the Element native object to include methods useful in measuring dimensions.
Element.measure / .expose methods by Daniel Steigerwald
License: MIT-style license.
Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz
License:
MIT-style license.
Class.events = new Events();
Class.Mutators.initialize = function(initialize){
return function(){
Class.events.fireEvent('initialize', this);
var inited = initialize.apply(this, arguments);
Class.events.fireEvent('afterInitialize', this);
return inited;
}
};
Class.Initializers = {};
Class.Mutators.initialize = function(initialize){
return function(){
for (var modifier in Class.Initializers) {
if (!this[modifier]) continue;
this[modifier] = Class.Initializers[modifier].call(this, this[modifier]);
}
dispose: (Browser.Engine.trident && window.location.href.test(/^https/i)) ?
function(){
if (this.parentNode) {
var bg = this.style.background;
this.style.background = '';
this.parentNode.removeChild(this);
this.style.background = bg;
}
return this;
} : function(){
Number.implement({
parsePermissions: function() {
var perms = {};
$H({
user_read: 0004,
user_write: 0002,
user_execute: 0001,
group_read: 0040,
group_write: 0020,
group_execute: 0010,
//positions an input over an object to edit it inline
var EditInline = new Class({
Implements: [Options, Class.Occlude, Events],
Binds: ['edit', 'mouseenter', 'mouseleave', 'esc'],
options: {
//onEnter: $empty,
tag: 'input',
hoverClass: 'edit_highlight',
activeClass: 'edit_activated',