array : {
add : function ( arg ) {
return array.add( this, arg );
},
addClass : function ( arg ) {
return array.each( this, function ( i ) {
element.klass( i, arg );
});
},
after : function ( type, args ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.create( type, args, i, "after" ) );
});
return result;
},
append : function ( type, args ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.create( type, args, i, "last" ) );
});
return result;
},
attr : function ( key, value ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.attr( i, key, value ) );
});
return result;
},
before : function ( type, args ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.create( type, args, i, "before" ) );
});
return result;
},
binIndex : function ( arg ) {
return array.binIndex( this, arg );
},
chunk : function ( size ) {
return array.chunk( this, size );
},
clear : function () {
return !server && ( this[0] instanceof Element ) ? array.each( this, function ( i ) {
element.clear(i);
}) : array.clear( this );
},
clone : function () {
return utility.clone( this );
},
collect : function ( arg ) {
return array.collect( this, arg );
},
compact : function () {
return array.compact( this );
},
contains : function ( arg ) {
return array.contains( this, arg );
},
count : function ( arg ) {
return array.count( this, arg );
},
create : function ( type, args, position ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.create( type, args, i, position ) );
});
return result;
},
css : function ( key, value ) {
return array.each( this, function ( i ) {
element.css( i, key, value );
});
},
data : function ( key, value ) {
var result = [];
array.each( this, function (i) {
result.push( element.data( i, key, value ) );
});
return result;
},
diff : function ( arg ) {
return array.diff( this, arg );
},
disable : function () {
return array.each( this, function ( i ) {
element.disable( i );
});
},
dispatch : function ( event, data, bubbles, cancelable ) {
return array.each( this, function ( i ) {
element.dispatch( i, event, data, bubbles, cancelable );
});
},
destroy : function () {
array.each( this, function ( i ) {
element.destroy( i );
});
return [];
},
each : function ( arg, async, size ) {
return array.each( this, arg, async, size );
},
empty : function () {
return array.empty( this );
},
enable : function () {
return array.each( this, function ( i ) {
element.enable( i );
});
},
equal : function ( arg ) {
return array.equal( this, arg );
},
fib : function ( arg ) {
return array.fib( arg );
},
fill : function ( arg, start, offset ) {
return array.fill( this, arg, start, offset );
},
find : function ( arg ) {
var result = [];
array.each( this, function ( i ) {
i.find( arg ).each( function ( r ) {
result.add( r );
});
});
return result;
},
fire : function () {
var args = arguments;
return array.each( this, function ( i ) {
observer.fire.apply( observer, [i].concat( array.cast( args ) ) );
});
},
first : function () {
return array.first( this );
},
flat : function () {
return array.flat( this );
},
fromObject : function ( arg ) {
return array.fromObject( arg );
},
genId : function () {
return array.each( this, function ( i ) {
utility.genId( i );
});
},
get : function ( uri, headers ) {
var result = [];
array.each( this, function ( i, idx ) {
i.get( uri, headers, function ( arg ) {
result[idx] = arg;
}, function ( e ) {
result[idx] = e;
});
});
return result;
},
has : function ( arg ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.has( i, arg ) );
});
return result;
},
hasClass : function ( arg ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.hasClass( i, arg ) );
});
return result;
},
html : function ( arg ) {
var result;
if ( arg !== undefined ) {
return array.each( this, function ( i ) {
element.html( i, arg );
});
}
else {
result = [];
array.each( this, function ( i ) {
result.push( element.html( i ) );
});
return result;
}
},
index : function ( arg ) {
return array.index( this, arg );
},
indexed : function () {
return array.indexed( this );
},
intersect : function ( arg ) {
return array.intersect( this, arg );
},
is : function ( arg ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.is( i, arg ) );
});
return result;
},
isAlphaNum : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isAlphaNum() );
});
return result;
},
isBoolean : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isBoolean() );
});
return result;
},
isChecked : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isChecked() );
});
return result;
},
isDate : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isDate() );
});
return result;
},
isDisabled : function () {
var result = [];
array.each( this, function ( i ) {
result.push( element.isDisabled( i ) );
});
return result;
},
isDomain : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isDomain() );
});
return result;
},
isEmail : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isEmail() );
});
return result;
},
isEmpty : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isEmpty() );
});
return result;
},
isHidden : function () {
var result = [];
array.each( this, function ( i ) {
result.push( element.isHidden( i ) );
});
return result;
},
isIP : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isIP() );
});
return result;
},
isInt : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isInt() );
});
return result;
},
isNumber : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isNumber() );
});
return result;
},
isPhone : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isPhone() );
});
return result;
},
isUrl : function () {
var result = [];
array.each( this, function ( i ) {
result.push( i.isUrl() );
});
return result;
},
keepIf : function ( fn ) {
return array.keepIf( this, fn );
},
keySort : function ( query, sub ) {
return array.keySort( this, query, sub );
},
keys : function () {
return array.keys( this );
},
last : function ( arg ) {
return array.last( this, arg );
},
limit : function ( start, offset ) {
return array.limit( this, start, offset );
},
listeners: function ( event ) {
var result = [];
array.each( this, function ( i ) {
array.merge(result, observer.listeners( i, event ) );
});
return result;
},
loading : function () {
return array.each( this, function ( i ) {
utility.loading( i );
});
},
max : function () {
return array.max( this );
},
mean : function () {
return array.mean( this );
},
median : function () {
return array.median( this );
},
merge : function ( arg ) {
return array.merge( this, arg );
},
min : function () {
return array.min( this );
},
mingle : function ( arg ) {
return array.mingle( this, arg );
},
mode : function () {
return array.mode( this );
},
on : function ( event, listener, id, scope, state ) {
return array.each( this, function ( i ) {
observer.add( i, event, listener, id, scope || i, state );
});
},
once : function ( event, listener, id, scope, state ) {
return array.each( this, function ( i ) {
observer.once( i, event, listener, id, scope || i, state );
});
},
percents : function ( precision, total ) {
return array.percents( this, precision, total );
},
position : function () {
var result = [];
array.each( this, function ( i ) {
result.push( element.position( i ) );
});
return result;
},
prepend : function ( type, args ) {
var result = [];
array.each( this, function ( i ) {
result.push( element.create( type, args, i, "first" ) );
});
return result;
},
range : function () {
return array.range( this );
},
rassoc : function ( arg ) {
return array.rassoc( this, arg );
},
reject : function ( fn ) {
return array.reject( this, fn );
},
remove : function ( start, end ) {
return array.remove( this, start, end );
},
removeIf : function ( fn ) {
return array.removeIf( this, fn );
},
removeWhile: function ( fn ) {
return array.removeWhile( this, fn );
},
removeAttr : function ( key ) {
array.each( this, function ( i ) {
element.removeAttr( i, key );
});
return this;
},
removeClass: function ( arg ) {
return array.each( this, function ( i ) {
element.klass( i, arg, false );
});
},
replace : function ( arg ) {
return array.replace( this, arg );
},
rest : function ( arg ) {
return array.rest( this, arg );
},
rindex : function ( arg ) {
return array.rindex( this, arg );
},
rotate : function ( arg ) {
return array.rotate( this, arg );
},
serialize : function ( string, encode ) {
return element.serialize( this, string, encode );
},
series : function ( start, end, offset ) {
return array.series( start, end, offset );
},
size : function () {
var result = [];
array.each( this, function ( i ) {
result.push( element.size( i ) );
});
return result;
},
sorted : function () {
return array.sorted( this );
},
split : function ( size ) {
return array.split( this, size );
},
stddev : function () {
return array.stddev( this );
},
sum : function () {
return array.sum( this );
},
take : function ( arg ) {
return array.take( this, arg );
},
text : function ( arg ) {
return array.each( this, function ( node ) {
if ( typeof node !== "object") {
node = utility.object( node );
}
if ( typeof node.text === "function") {
node.text( arg );
}
});
},
tpl : function ( arg ) {
return array.each( this, function ( i ) {
utility.tpl ( arg, i );
});
},
toggleClass : function ( arg ) {
return array.each( this, function ( i ) {
element.toggleClass( i, arg );
});
},
total : function () {
return array.total( this );
},
toObject : function () {
return array.toObject( this );
},
un : function ( event, id, state ) {
return array.each( this, function ( i ) {
observer.remove( i, event, id, state );
});
},
unique : function () {
return array.unique( this );
},
update : function ( arg ) {
return array.each( this, function ( i ) {
element.update( i, arg );
});
},
val : function ( arg ) {
var a = [],
type = null,
same = true;
array.each( this, function ( i ) {
if ( type !== null ) {
same = ( type === i.type );
}
type = i.type;
if ( typeof i.val === "function" ) {
a.push( element.val( i, arg ) );
}
});
return same ? a[0] : a;
},
validate : function () {
var result = [];
array.each( this, function ( i ) {
result.push( element.validate( i ) );
});
return result;
},
variance : function () {
return array.variance( this );
},
zip : function () {
return array.zip( this, arguments );
}
},
Private
Prototype hooks