scripts/utopia.js
function(target, event, callback, traditional) {
			if(_.type(target) === 'string' || _.type(target) === 'array') {
				var elements = _.type(target) === 'string'? $$(target) : target;
				
				elements.forEach(function(element) {
					_.event.bind(element, event, callback, traditional);
				});
			}
			else if(_.type(event) === 'string') {
				if(traditional) {
					target['on' + event] = callback;
				}
				else {
					target.addEventListener(event, callback, false);
				}
			}
			else if(_.type(event) === 'array') {
				for (var i=0; i<event.length; i++) {
					_.event.bind(target, event[i], callback, arguments[2]);
				}
			}
			else {
				for (var name in event) {
					_.event.bind(target, name, event[name], arguments[2]);
				}
			}
		}
function(target, event, callback, traditional) {
			if(_.type(target) === 'string' || _.type(target) === 'array') {
				var elements = _.type(target) === 'string'? $$(target) : target;
				
				elements.forEach(function(element) {
					_.event.bind(element, event, callback, traditional);
				});
			}
			else if(_.type(event) === 'string') {
				if(traditional) {
					target['on' + event] = callback;
				}
				else {
					target.addEventListener(event, callback, false);
				}
			}
			else if(_.type(event) === 'array') {
				for (var i=0; i<event.length; i++) {
					_.event.bind(target, event[i], callback, arguments[2]);
				}
			}
			else {
				for (var name in event) {
					_.event.bind(target, name, event[name], arguments[2]);
				}
			}
		}
function ( target , event , callback , traditional ) { if ( _ . type ( target ) === 'string' || _ . type ( target ) === 'array' ) { var elements = _ . type ( target ) === 'string' ? $$ ( target ) : target ; elements . forEach ( function ( element ) { _ . event . bind ( element , event , callback , traditional ) ; } ) ; } else if ( _ . type ( event ) === 'string' ) { if ( traditional ) { target [ 'on' + event ] = callback ; } else { target . addEventListener ( event , callback , false ) ; } } else if ( _ . type ( event ) === 'array' ) { for ( var i = 0 ; i < event . length ; i ++ ) { _ . event . bind ( target , event [ i ] , callback , arguments [ 2 ] ) ; } } else { for ( var name in event ) { _ . event . bind ( target , name , event [ name ] , arguments [ 2 ] ) ; } } }
Binds one or more events to one or more elements
Binds one or more events to one or more elements