Return-Path:
Selector string filters will trigger the callback if the event originated + * from a node that matches it or is contained in a node that matches it. + * Function filters are called for each Node up the parent axis to the + * subscribing container node, and receive at each level the Node and the event + * object. The function should return true (or a truthy value) if that Node + * should trigger the subscription callback. Note, it is possible for filters + * to match multiple Nodes for a single event. In this case, the delegate + * callback will be executed for each matching Node.
+ * + *For each matching Node, the callback will be executed with its 'this'
+ * object set to the Node matched by the filter (unless a specific context was
+ * provided during subscription), and the provided event's
+ * Documentation for events added by this module can be found in the event document for the YUI global. Documentation for the flick event can be found on the YUI global,
+ * along with the other supported events. It is recommended that you use Y.bind to set up context and additional arguments for your event handler,
+ * however if you want to pass the context and arguments as additional signature arguments to "on",
+ * you need to provide a null value for the configuration object, e.g: Add a key listener. The listener will only be notified if the
+ * keystroke detected meets the supplied specification. The
+ * specification is a string that is defined as: Examples:currentTarget
will also be set to the matching Node. The
+ * containing Node from which the subscription was originally made can be
+ * referenced as e.container
.
+ *
+ * @method delegate
+ * @param type {String} the event type to delegate
+ * @param fn {Function} the callback function to execute. This function
+ * will be provided the event object for the delegated event.
+ * @param el {String|node} the element that is the delegation container
+ * @param filter {string|Function} a selector that must match the target of the
+ * event or a function to test target and its parents for a match
+ * @param context optional argument that specifies what 'this' refers to.
+ * @param args* 0..n additional arguments to pass on to the callback function.
+ * These arguments will be added after the event object.
+ * @return {EventHandle} the detach handle
+ * @static
+ * @for Event
+ */
+function delegate(type, fn, el, filter) {
+ var args = toArray(arguments, 0, true),
+ query = isString(el) ? el : null,
+ typeBits, synth, container, categories, cat, i, len, handles, handle;
+
+ // Support Y.delegate({ click: fnA, key: fnB }, el, filter, ...);
+ // and Y.delegate(['click', 'key'], fn, el, filter, ...);
+ if (isObject(type)) {
+ handles = [];
+
+ if (isArray(type)) {
+ for (i = 0, len = type.length; i < len; ++i) {
+ args[0] = type[i];
+ handles.push(Y.delegate.apply(Y, args));
+ }
+ } else {
+ // Y.delegate({'click', fn}, el, filter) =>
+ // Y.delegate('click', fn, el, filter)
+ args.unshift(null); // one arg becomes two; need to make space
+
+ for (i in type) {
+ if (type.hasOwnProperty(i)) {
+ args[0] = i;
+ args[1] = type[i];
+ handles.push(Y.delegate.apply(Y, args));
+ }
+ }
+ }
+
+ return new Y.EventHandle(handles);
+ }
+
+ typeBits = type.split(/\|/);
+
+ if (typeBits.length > 1) {
+ cat = typeBits.shift();
+ args[0] = type = typeBits.shift();
+ }
+
+ synth = Y.Node.DOM_EVENTS[type];
+
+ if (isObject(synth) && synth.delegate) {
+ handle = synth.delegate.apply(synth, arguments);
+ }
+
+ if (!handle) {
+ if (!type || !fn || !el || !filter) {
+ return;
+ }
+
+ container = (query) ? Y.Selector.query(query, null, true) : el;
+
+ if (!container && isString(el)) {
+ handle = Y.on('available', function () {
+ Y.mix(handle, Y.delegate.apply(Y, args), true);
+ }, el);
+ }
+
+ if (!handle && container) {
+ args.splice(2, 2, container); // remove the filter
+
+ handle = Y.Event._attach(args, { facade: false });
+ handle.sub.filter = filter;
+ handle.sub._notify = delegate.notifySub;
+ }
+ }
+
+ if (handle && cat) {
+ categories = detachCategories[cat] || (detachCategories[cat] = {});
+ categories = categories[type] || (categories[type] = []);
+ categories.push(handle);
+ }
+
+ return handle;
+}
+
+/**
+Overrides the _notify
method on the normal DOM subscription to
+inject the filtering logic and only proceed in the case of a match.
+
+This method is hosted as a private property of the `delegate` method
+(e.g. `Y.delegate.notifySub`)
+
+@method notifySub
+@param thisObj {Object} default 'this' object for the callback
+@param args {Array} arguments passed to the event's fire()
+@param ce {CustomEvent} the custom event managing the DOM subscriptions for
+ the subscribed event on the subscribing node.
+@return {Boolean} false if the event was stopped
+@private
+@static
+@since 3.2.0
+**/
+delegate.notifySub = function (thisObj, args, ce) {
+ // Preserve args for other subscribers
+ args = args.slice();
+ if (this.args) {
+ args.push.apply(args, this.args);
+ }
+
+ // Only notify subs if the event occurred on a targeted element
+ var currentTarget = delegate._applyFilter(this.filter, args, ce),
+ //container = e.currentTarget,
+ e, i, len, ret;
+
+ if (currentTarget) {
+ // Support multiple matches up the the container subtree
+ currentTarget = toArray(currentTarget);
+
+ // The second arg is the currentTarget, but we'll be reusing this
+ // facade, replacing the currentTarget for each use, so it doesn't
+ // matter what element we seed it with.
+ e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce);
+
+ e.container = Y.one(ce.el);
+
+ for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) {
+ e.currentTarget = Y.one(currentTarget[i]);
+
+ ret = this.fn.apply(this.context || e.currentTarget, args);
+
+ if (ret === false) { // stop further notifications
+ break;
+ }
+ }
+
+ return ret;
+ }
+};
+
+/**
+Compiles a selector string into a filter function to identify whether
+Nodes along the parent axis of an event's target should trigger event
+notification.
+
+This function is memoized, so previously compiled filter functions are
+returned if the same selector string is provided.
+
+This function may be useful when defining synthetic events for delegate
+handling.
+
+Hosted as a property of the `delegate` method (e.g. `Y.delegate.compileFilter`).
+
+@method compileFilter
+@param selector {String} the selector string to base the filtration on
+@return {Function}
+@since 3.2.0
+@static
+**/
+delegate.compileFilter = Y.cached(function (selector) {
+ return function (target, e) {
+ return selectorTest(target._node, selector,
+ (e.currentTarget === e.target) ? null : e.currentTarget._node);
+ };
+});
+
+/**
+Regex to test for disabled elements during filtering. This is only relevant to
+IE to normalize behavior with other browsers, which swallow events that occur
+to disabled elements. IE fires the event from the parent element instead of the
+original target, though it does preserve `event.srcElement` as the disabled
+element. IE also supports disabled on ``, but the event still bubbles, so it
+acts more like `e.preventDefault()` plus styling. That issue is not handled here
+because other browsers fire the event on the ``, so delegate is supported in
+both cases.
+
+@property _disabledRE
+@type {RegExp}
+@protected
+@since 3.8.1
+**/
+delegate._disabledRE = /^(?:button|input|select|textarea)$/i;
+
+/**
+Walks up the parent axis of an event's target, and tests each element
+against a supplied filter function. If any Nodes, including the container,
+satisfy the filter, the delegated callback will be triggered for each.
+
+Hosted as a protected property of the `delegate` method (e.g.
+`Y.delegate._applyFilter`).
+
+@method _applyFilter
+@param filter {Function} boolean function to test for inclusion in event
+ notification
+@param args {Array} the arguments that would be passed to subscribers
+@param ce {CustomEvent} the DOM event wrapper
+@return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter
+@protected
+**/
+delegate._applyFilter = function (filter, args, ce) {
+ var e = args[0],
+ container = ce.el, // facadeless events in IE, have no e.currentTarget
+ target = e.target || e.srcElement,
+ match = [],
+ isContainer = false;
+
+ // Resolve text nodes to their containing element
+ if (target.nodeType === 3) {
+ target = target.parentNode;
+ }
+
+ // For IE. IE propagates events from the parent element of disabled
+ // elements, where other browsers swallow the event entirely. To normalize
+ // this in IE, filtering for matching elements should abort if the target
+ // is a disabled form control.
+ if (target.disabled && delegate._disabledRE.test(target.nodeName)) {
+ return match;
+ }
+
+ // passing target as the first arg rather than leaving well enough alone
+ // making 'this' in the filter function refer to the target. This is to
+ // support bound filter functions.
+ args.unshift(target);
+
+ if (isString(filter)) {
+ while (target) {
+ isContainer = (target === container);
+ if (selectorTest(target, filter, (isContainer ? null: container))) {
+ match.push(target);
+ }
+
+ if (isContainer) {
+ break;
+ }
+
+ target = target.parentNode;
+ }
+ } else {
+ // filter functions are implementer code and should receive wrappers
+ args[0] = Y.one(target);
+ args[1] = new Y.DOMEventFacade(e, container, ce);
+
+ while (target) {
+ // filter(target, e, extra args...) - this === target
+ if (filter.apply(args[0], args)) {
+ match.push(target);
+ }
+
+ if (target === container) {
+ break;
+ }
+
+ target = target.parentNode;
+ args[0] = Y.one(target);
+ }
+ args[1] = e; // restore the raw DOM event
+ }
+
+ if (match.length <= 1) {
+ match = match[0]; // single match or undefined
+ }
+
+ // remove the target
+ args.shift();
+
+ return match;
+};
+
+/**
+ * Sets up event delegation on a container element. The delegated event
+ * will use a supplied filter to test if the callback should be executed.
+ * This filter can be either a selector string or a function that returns
+ * a Node to use as the currentTarget for the event.
+ *
+ * The event object for the delegated event is supplied to the callback
+ * function. It is modified slightly in order to support all properties
+ * that may be needed for event delegation. 'currentTarget' is set to
+ * the element that matched the selector string filter or the Node returned
+ * from the filter function. 'container' is set to the element that the
+ * listener is delegated from (this normally would be the 'currentTarget').
+ *
+ * Filter functions will be called with the arguments that would be passed to
+ * the callback function, including the event object as the first parameter.
+ * The function should return false (or a falsey value) if the success criteria
+ * aren't met, and the Node to use as the event's currentTarget and 'this'
+ * object if they are.
+ *
+ * @method delegate
+ * @param type {string} the event type to delegate
+ * @param fn {function} the callback function to execute. This function
+ * will be provided the event object for the delegated event.
+ * @param el {string|node} the element that is the delegation container
+ * @param filter {string|function} a selector that must match the target of the
+ * event or a function that returns a Node or false.
+ * @param context optional argument that specifies what 'this' refers to.
+ * @param args* 0..n additional arguments to pass on to the callback function.
+ * These arguments will be added after the event object.
+ * @return {EventHandle} the detach handle
+ * @for YUI
+ */
+Y.delegate = Y.Event.delegate = delegate;
+
+
+}, '3.17.2', {"requires": ["node-base"]});
Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-flick",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="end",o="move",u="ownerDocument",a="minVelocity",f="minDistance",l="preventDefault",c="_fs",h="_fsh",p="_feh",d="_fmh",v="nodeType";e.Event.define("flick",{on:function(e,t,n){var s=e.on(r[i],this._onStart,this,e,t,n);t[h]=s},detach:function(e,t,n){var r=t[h],i=t[p];r&&(r.detach(),t[h]=null),i&&(i.detach(),t[p]=null)},processArgs:function(t){var n=t.length>3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,
n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"3.17.2",{requires:["node-base","event-touch","event-synthetic"]});
Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/event-flick/event-flick.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,278 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('event-flick', function (Y, NAME) {
+
+/**
+ * The gestures module provides gesture events such as "flick", which normalize user interactions
+ * across touch and mouse or pointer based input devices. This layer can be used by application developers
+ * to build input device agnostic components which behave the same in response to either touch or mouse based
+ * interaction.
+ *
+ * node.on("flick", fn, null, context, arg1, arg2, arg3)
+ *
+ * @return {EventHandle} the detach handle
+ */
+
+Y.Event.define('flick', {
+
+ on: function (node, subscriber, ce) {
+
+ var startHandle = node.on(EVENT[START],
+ this._onStart,
+ this,
+ node,
+ subscriber,
+ ce);
+
+ subscriber[_FLICK_START_HANDLE] = startHandle;
+ },
+
+ detach: function (node, subscriber, ce) {
+
+ var startHandle = subscriber[_FLICK_START_HANDLE],
+ endHandle = subscriber[_FLICK_END_HANDLE];
+
+ if (startHandle) {
+ startHandle.detach();
+ subscriber[_FLICK_START_HANDLE] = null;
+ }
+
+ if (endHandle) {
+ endHandle.detach();
+ subscriber[_FLICK_END_HANDLE] = null;
+ }
+ },
+
+ processArgs: function(args) {
+ var params = (args.length > 3) ? Y.merge(args.splice(3, 1)[0]) : {};
+
+ if (!(MIN_VELOCITY in params)) {
+ params[MIN_VELOCITY] = this.MIN_VELOCITY;
+ }
+
+ if (!(MIN_DISTANCE in params)) {
+ params[MIN_DISTANCE] = this.MIN_DISTANCE;
+ }
+
+ if (!(PREVENT_DEFAULT in params)) {
+ params[PREVENT_DEFAULT] = this.PREVENT_DEFAULT;
+ }
+
+ return params;
+ },
+
+ _onStart: function(e, node, subscriber, ce) {
+
+ var start = true, // always true for mouse
+ endHandle,
+ moveHandle,
+ doc,
+ preventDefault = subscriber._extra.preventDefault,
+ origE = e;
+
+ if (e.touches) {
+ start = (e.touches.length === 1);
+ e = e.touches[0];
+ }
+
+ if (start) {
+
+ if (preventDefault) {
+ // preventDefault is a boolean or function
+ if (!preventDefault.call || preventDefault(e)) {
+ origE.preventDefault();
+ }
+ }
+
+ e.flick = {
+ time : new Date().getTime()
+ };
+
+ subscriber[_FLICK_START] = e;
+
+ endHandle = subscriber[_FLICK_END_HANDLE];
+
+ doc = (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);
+ if (!endHandle) {
+ endHandle = doc.on(EVENT[END], Y.bind(this._onEnd, this), null, node, subscriber, ce);
+ subscriber[_FLICK_END_HANDLE] = endHandle;
+ }
+
+ subscriber[_FLICK_MOVE_HANDLE] = doc.once(EVENT[MOVE], Y.bind(this._onMove, this), null, node, subscriber, ce);
+ }
+ },
+
+ _onMove: function(e, node, subscriber, ce) {
+ var start = subscriber[_FLICK_START];
+
+ // Start timing from first move.
+ if (start && start.flick) {
+ start.flick.time = new Date().getTime();
+ }
+ },
+
+ _onEnd: function(e, node, subscriber, ce) {
+
+ var endTime = new Date().getTime(),
+ start = subscriber[_FLICK_START],
+ valid = !!start,
+ endEvent = e,
+ startTime,
+ time,
+ preventDefault,
+ params,
+ xyDistance,
+ distance,
+ velocity,
+ axis,
+ moveHandle = subscriber[_FLICK_MOVE_HANDLE];
+
+ if (moveHandle) {
+ moveHandle.detach();
+ delete subscriber[_FLICK_MOVE_HANDLE];
+ }
+
+ if (valid) {
+
+ if (e.changedTouches) {
+ if (e.changedTouches.length === 1 && e.touches.length === 0) {
+ endEvent = e.changedTouches[0];
+ } else {
+ valid = false;
+ }
+ }
+
+ if (valid) {
+
+ params = subscriber._extra;
+ preventDefault = params[PREVENT_DEFAULT];
+
+ if (preventDefault) {
+ // preventDefault is a boolean or function
+ if (!preventDefault.call || preventDefault(e)) {
+ e.preventDefault();
+ }
+ }
+
+ startTime = start.flick.time;
+ endTime = new Date().getTime();
+ time = endTime - startTime;
+
+ xyDistance = [
+ endEvent.pageX - start.pageX,
+ endEvent.pageY - start.pageY
+ ];
+
+ if (params.axis) {
+ axis = params.axis;
+ } else {
+ axis = (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y';
+ }
+
+ distance = xyDistance[(axis === 'x') ? 0 : 1];
+ velocity = (time !== 0) ? distance/time : 0;
+
+ if (isFinite(velocity) && (Math.abs(distance) >= params[MIN_DISTANCE]) && (Math.abs(velocity) >= params[MIN_VELOCITY])) {
+
+ e.type = "flick";
+ e.flick = {
+ time:time,
+ distance: distance,
+ velocity:velocity,
+ axis: axis,
+ start : start
+ };
+
+ ce.fire(e);
+
+ }
+
+ subscriber[_FLICK_START] = null;
+ }
+ }
+ },
+
+ MIN_VELOCITY : 0,
+ MIN_DISTANCE : 0,
+ PREVENT_DEFAULT : false
+});
+
+
+}, '3.17.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});
Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/event-focus/event-focus-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/event-focus/event-focus-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/event-focus/event-focus-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/event-focus/event-focus-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_useActivate:o,_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s
+ *
+ *
+ * [{type}:]{code}[,{code}]*
"down", "up", or "press"
{keyCode|character|keyName}[+{modifier}]*
"shift", "ctrl", "alt", or "meta"
"enter", "space", "backspace", "esc", "tab", "pageup", or "pagedown"
+ *
+ *
+ * @event key
+ * @for YUI
+ * @param type {string} 'key'
+ * @param fn {function} the function to execute
+ * @param id {string|HTMLElement|collection} the element(s) to bind
+ * @param spec {string} the keyCode and modifier specification
+ * @param o optional context object
+ * @param args 0..n additional arguments to provide to the listener.
+ * @return {Event.Handle} the detach handle
+ */
+Y.Event.define('key', eventDef, true);
+
+
+}, '3.17.2', {"requires": ["event-synthetic"]});
Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/event-simulate/event-simulate-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/event-simulate/event-simulate-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/event-simulate/event-simulate-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/event-simulate/event-simulate-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,9 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-simulate",function(e,t){(function(){function v(t,n,a,f,l,c,h,p,d,v,m){t||e.error("simulateKeyEvent(): Invalid target.");if(i(n)){n=n.toLowerCase();switch(n){case"textevent":n="keypress";break;case"keyup":case"keydown":case"keypress":break;default:e.error("simulateKeyEvent(): Event type '"+n+"' not supported.")}}else e.error("simulateKeyEvent(): Event type must be a string.");s(a)||(a=!0),s(f)||(f=!0),o(l)||(l=e.config.win),s(c)||(c=!1),s(h)||(h=!1),s(p)||(p=!1),s(d)||(d=!1),u(v)||(v=0),u(m)||(m=0);var g=null;if(r(e.config.doc.createEvent)){try{g=e.config.doc.createEvent("KeyEvents"),g.initKeyEvent(n,a,f,l,c,h,p,d,v,m)}catch(y){try{g=e.config.doc.createEvent("Events")}catch(b){g=e.config.doc.createEvent("UIEvents")}finally{g.initEvent(n,a,f),g.view=l,g.altKey=h,g.ctrlKey=c,g.shiftKey=p,g.metaKey=d,g.keyCode=v,g.charCode=m}}t.dispatchEvent(g)}else o(e.config.doc.createEventObject)?(g=e.config.doc.createEventObject(),g.bubbles=a,g.cancelable=f,g.view=l,g.ctrlKey=c,g.altK
ey=h,g.shiftKey=p,g.metaKey=d,g.keyCode=m>0?m:v,t.fireEvent("on"+n,g)):e.error("simulateKeyEvent(): No event simulation framework present.")}function m(t,n,l,c,h,p,d,v,m,g,y,b,w,E,S,x){t||e.error("simulateMouseEvent(): Invalid target."),i(n)?!a[n.toLowerCase()]&&!f[n]&&e.error("simulateMouseEvent(): Event type '"+n+"' not supported."):e.error("simulateMouseEvent(): Event type must be a string."),s(l)||(l=!0),s(c)||(c=n!=="mousemove"),o(h)||(h=e.config.win),u(p)||(p=1),u(d)||(d=0),u(v)||(v=0),u(m)||(m=0),u(g)||(g=0),s(y)||(y=!1),s(b)||(b=!1),s(w)||(w=!1),s(E)||(E=!1),u(S)||(S=0),x=x||null;var T=null;if(r(e.config.doc.createEvent))T=e.config.doc.createEvent("MouseEvents"),T.initMouseEvent?T.initMouseEvent(n,l,c,h,p,d,v,m,g,y,b,w,E,S,x):(T=e.config.doc.createEvent("UIEvents"),T.initEvent(n,l,c),T.view=h,T.detail=p,T.screenX=d,T.screenY=v,T.clientX=m,T.clientY=g,T.ctrlKey=y,T.altKey=b,T.metaKey=E,T.shiftKey=w,T.button=S,T.relatedTarget=x),x&&!T.relatedTarget&&(n==="mouseout"?T.toElement
=x:n==="mouseover"&&(T.fromElement=x)),t.dispatchEvent(T);else if(o(e.config.doc.createEventObject)){T=e.config.doc.createEventObject(),T.bubbles=l,T.cancelable=c,T.view=h,T.detail=p,T.screenX=d,T.screenY=v,T.clientX=m,T.clientY=g,T.ctrlKey=y,T.altKey=b,T.metaKey=E,T.shiftKey=w;switch(S){case 0:T.button=1;break;case 1:T.button=4;break;case 2:break;default:T.button=0}T.relatedTarget=x,t.fireEvent("on"+n,T)}else e.error("simulateMouseEvent(): No event simulation framework present.")}function g(t,n,a,f,l,p){t||e.error("simulateUIEvent(): Invalid target."),i(n)?(n=n.toLowerCase(),c[n]||e.error("simulateUIEvent(): Event type '"+n+"' not supported.")):e.error("simulateUIEvent(): Event type must be a string.");var d=null;s(a)||(a=n in h),s(f)||(f=n==="submit"),o(l)||(l=e.config.win),u(p)||(p=1),r(e.config.doc.createEvent)?(d=e.config.doc.createEvent("UIEvents"),d.initUIEvent(n,a,f,l,p),t.dispatchEvent(d)):o(e.config.doc.createEventObject)?(d=e.config.doc.createEventObject(),d.bubbles=a,d.c
ancelable=f,d.view=l,d.detail=p,t.fireEvent("on"+n,d)):e.error("simulateUIEvent(): No event simulation framework present.")}function y(t,n,r,i,s,o,u,a,f,l,c,h,p,v,m,g){var y;(!e.UA.ios||e.UA.ios<2)&&e.error("simulateGestureEvent(): Native gesture DOM eventframe is not available in this platform."),t||e.error("simulateGestureEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),d[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateGestureEvent(): Event type must be a string."),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=!0),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=2),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(c)||(c=!1),e.Lang.isBoolean(h)||(h=!1),e.Lang.isBoolean(p)||(p=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(m)||(m=1),e.Lang.isNumber(g)||(g=0),y=e.config.doc.createEvent("GestureEvent"),y.initGestureEvent(n,r,i,s,o,u,a,f,l,c
,h,p,v,t,m,g),t.dispatchEvent(y)}function b(t,n,r,i,s,o,u,a,f,l,c,h,d,v,m,g,y,b,w){var E;t||e.error("simulateTouchEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),p[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateTouchEvent(): Event type must be a string."),n==="touchstart"||n==="touchmove"?m.length===0&&e.error("simulateTouchEvent(): No touch object in touches"):n==="touchend"&&y.length===0&&e.error("simulateTouchEvent(): No touch object in changedTouches"),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=n!=="touchcancel"),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=1),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(c)||(c=!1),e.Lang.isBoolean(h)||(h=!1),e.Lang.isBoolean(d)||(d=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(b)||(b=1),e.Lang.isNumber(w)||(w=0),e.Lang.isFunction(e.config.doc.createEvent)?(e.UA.android?e.UA.android<4?(E
=e.config.doc.createEvent("MouseEvents"),E.initMouseEvent(n,r,i,s,o,u,a,f,l,c,h,d,v,0,t),E.touches=m,E.targetTouches=g,E.changedTouches=y):(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(m,g,y,n,s,u,a,f,l,c,h,d,v)):e.UA.ios?e.UA.ios>=2?(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(n,r,i,s,o,u,a,f,l,c,h,d,v,m,g,y,b,w)):e.error("simulateTouchEvent(): No touch event simulation framework present for iOS, "+e.UA.ios+"."):e.error("simulateTouchEvent(): Not supported agent yet, "+e.UA.userAgent),t.dispatchEvent(E)):e.error("simulateTouchEvent(): No event simulation framework present.")}var t=e.Lang,n=e.config.win,r=t.isFunction,i=t.isString,s=t.isBoolean,o=t.isObject,u=t.isNumber,a={click:1,dblclick:1,mouseover:1,mouseout:1,mousedown:1,mouseup:1,mousemove:1,contextmenu:1},f=n&&n.PointerEvent?{pointerover:1,pointerout:1,pointerdown:1,pointerup:1,pointermove:1}:{MSPointerOver:1,MSPointerOut:1,MSPointerDown:1,MSPointerUp:1,MSPointerMove:1},l={keydown:1,keyup:1,keypress
:1},c={submit:1,blur
+:1,change:1,focus:1,resize:1,scroll:1,select:1},h={scroll:1,resize:1,reset:1,submit:1,change:1,select:1,error:1,abort:1},p={touchstart:1,touchmove:1,touchend:1,touchcancel:1},d={gesturestart:1,gesturechange:1,gestureend:1};e.mix(h,a),e.mix(h,l),e.mix(h,p),e.Event.simulate=function(t,n,r){r=r||{},a[n]||f[n]?m(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget):l[n]?v(t,n,r.bubbles,r.cancelable,r.view,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode):c[n]?g(t,n,r.bubbles,r.cancelable,r.view,r.detail):p[n]?e.config.win&&"ontouchstart"in e.config.win&&!e.UA.phantomjs&&!(e.UA.chrome&&e.UA.chrome<6)?b(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.touches,r.targetTouches,r.changedTouches,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated. Use gesture-simulate module instead."):e.UA.
ios&&e.UA.ios>=2&&d[n]?y(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated.")}})()},"3.17.2",{requires:["event-base"]});
Y.on("key", callback, "press:12,65+shift+ctrl", "#my-input");
Y.delegate("key", preventSubmit, "#forms", "enter", "input[type=text]");
Y.one("doc").on("key", viNav, "j,k,l,;");