site/examples/resources/funcunit.js
function( type, options, element ) {
			options || (options = {});

			var create = Syn.create,
				setup = create[type] && create[type].setup,
				kind = key.test(type) ? 'key' : (page.test(type) ? "page" : "mouse"),
				createType = create[type] || {},
				createKind = create[kind],
				event, ret, autoPrevent, dispatchEl = element;

			//any setup code?
			Syn.support.ready === 2 && setup && setup(type, options, element);

			autoPrevent = options._autoPrevent;
			//get kind
			delete options._autoPrevent;

			if ( createType.event ) {
				ret = createType.event(type, options, element);
			} else {
				//convert options
				options = createKind.options ? createKind.options(type, options, element) : options;

				if (!Syn.support.changeBubbles && /option/i.test(element.nodeName) ) {
					dispatchEl = element.parentNode; //jQuery expects clicks on select
				}

				//create the event
				event = createKind.event(type, options, dispatchEl);

				//send the event
				ret = Syn.dispatch(event, dispatchEl, type, autoPrevent);
			}
			
			ret && Syn.support.ready === 2 && Syn.defaults[type] && Syn.defaults[type].call(element, options, autoPrevent);
			return ret;
		}
function( type, options, element ) {
			options || (options = {});

			var create = Syn.create,
				setup = create[type] && create[type].setup,
				kind = key.test(type) ? 'key' : (page.test(type) ? "page" : "mouse"),
				createType = create[type] || {},
				createKind = create[kind],
				event, ret, autoPrevent, dispatchEl = element;

			//any setup code?
			Syn.support.ready === 2 && setup && setup(type, options, element);

			autoPrevent = options._autoPrevent;
			//get kind
			delete options._autoPrevent;

			if ( createType.event ) {
				ret = createType.event(type, options, element);
			} else {
				//convert options
				options = createKind.options ? createKind.options(type, options, element) : options;

				if (!Syn.support.changeBubbles && /option/i.test(element.nodeName) ) {
					dispatchEl = element.parentNode; //jQuery expects clicks on select
				}

				//create the event
				event = createKind.event(type, options, dispatchEl);

				//send the event
				ret = Syn.dispatch(event, dispatchEl, type, autoPrevent);
			}
			
			ret && Syn.support.ready === 2 && Syn.defaults[type] && Syn.defaults[type].call(element, options, autoPrevent);
			return ret;
		}
function ( type , options , element ) { options || ( options = { } ) ; var create = Syn . create , setup = create [ type ] && create [ type ] . setup , kind = key . test ( type ) ? 'key' : ( page . test ( type ) ? "page" : "mouse" ) , createType = create [ type ] || { } , createKind = create [ kind ] , event , ret , autoPrevent , dispatchEl = element ; //any setup code? Syn . support . ready === 2 && setup && setup ( type , options , element ) ; autoPrevent = options . _autoPrevent ; //get kind delete options . _autoPrevent ; if ( createType . event ) { ret = createType . event ( type , options , element ) ; } else { //convert options options = createKind . options ? createKind . options ( type , options , element ) : options ; if ( ! Syn . support . changeBubbles && / option / i . test ( element . nodeName ) ) { dispatchEl = element . parentNode ; //jQuery expects clicks on select } //create the event event = createKind . event ( type , options , dispatchEl ) ; //send the event ret = Syn . dispatch ( event , dispatchEl , type , autoPrevent ) ; } ret && Syn . support . ready === 2 && Syn . defaults [ type ] && Syn . defaults [ type ] . call ( element , options , autoPrevent ) ; return ret ; }
Creates a synthetic event and dispatches it on the element.
This will run any default actions for the element.
Typically you want to use Syn, but if you want the return value, use this.
@param {String} type
@param {Object} options
@param {HTMLElement} element
@return {Boolean} true if default events were run, false if otherwise.
Creates a synthetic event and dispatches it on the element . This will run any default actions for the element . Typically you want to use Syn but if you want the return value use this .