src/javascript/core/utils/Events.js
function(obj, name, callback, key) {
		var func, events;
					
		name = name.toLowerCase();

		// Add event listener
		if (obj.addEventListener) {
			func = callback;
			
			obj.addEventListener(name, func, false);
		} else if (obj.attachEvent) {
			func = function() {
				var evt = window.event;

				if (!evt.target) {
					evt.target = evt.srcElement;
				}

				evt.preventDefault = preventDefault;
				evt.stopPropagation = stopPropagation;

				callback(evt);
			};

			obj.attachEvent('on' + name, func);
		}
		
		// Log event handler to objects internal mOxie registry
		if (!obj[uid]) {
			obj[uid] = Basic.guid();
		}
		
		if (!eventhash.hasOwnProperty(obj[uid])) {
			eventhash[obj[uid]] = {};
		}
		
		events = eventhash[obj[uid]];
		
		if (!events.hasOwnProperty(name)) {
			events[name] = [];
		}
				
		events[name].push({
			func: func,
			orig: callback, // store original callback for IE
			key: key
		});
	}
function(obj, name, callback, key) {
		var func, events;
					
		name = name.toLowerCase();

		// Add event listener
		if (obj.addEventListener) {
			func = callback;
			
			obj.addEventListener(name, func, false);
		} else if (obj.attachEvent) {
			func = function() {
				var evt = window.event;

				if (!evt.target) {
					evt.target = evt.srcElement;
				}

				evt.preventDefault = preventDefault;
				evt.stopPropagation = stopPropagation;

				callback(evt);
			};

			obj.attachEvent('on' + name, func);
		}
		
		// Log event handler to objects internal mOxie registry
		if (!obj[uid]) {
			obj[uid] = Basic.guid();
		}
		
		if (!eventhash.hasOwnProperty(obj[uid])) {
			eventhash[obj[uid]] = {};
		}
		
		events = eventhash[obj[uid]];
		
		if (!events.hasOwnProperty(name)) {
			events[name] = [];
		}
				
		events[name].push({
			func: func,
			orig: callback, // store original callback for IE
			key: key
		});
	}
function ( obj , name , callback , key ) { var func , events ; name = name . toLowerCase ( ) ; // Add event listener if ( obj . addEventListener ) { func = callback ; obj . addEventListener ( name , func , false ) ; } else if ( obj . attachEvent ) { func = function ( ) { var evt = window . event ; if ( ! evt . target ) { evt . target = evt . srcElement ; } evt . preventDefault = preventDefault ; evt . stopPropagation = stopPropagation ; callback ( evt ) ; } ; obj . attachEvent ( 'on' + name , func ) ; } // Log event handler to objects internal mOxie registry if ( ! obj [ uid ] ) { obj [ uid ] = Basic . guid ( ) ; } if ( ! eventhash . hasOwnProperty ( obj [ uid ] ) ) { eventhash [ obj [ uid ] ] = { } ; } events = eventhash [ obj [ uid ] ] ; if ( ! events . hasOwnProperty ( name ) ) { events [ name ] = [ ] ; } events [ name ] . push ( { func : func , orig : callback , // store original callback for IE key : key } ) ; }
Adds an event handler to the specified object and store reference to the handler
in objects internal Plupload registry (@see removeEvent).

@method addEvent
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Name to add event listener to.
@param {Function} callback Function to call when event occurs.
@param {String} [key] that might be used to add specifity to the event record.
Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry ( @see removeEvent ) .