diff --git a/dom/1.1.x/dom-event-debug.js b/dom/1.1.x/dom-event-debug.js index 0bebef3..279bb24 100644 --- a/dom/1.1.x/dom-event-debug.js +++ b/dom/1.1.x/dom-event-debug.js @@ -1,6 +1,6 @@ /*! * JRaiser 2 Javascript Library - * dom-event - v1.1.1 (2015-04-29T10:20:17+0800) + * dom-event - v1.1.1 (2015-08-05T09:57:13+0800) * http://jraiser.org/ | Released under MIT license */ define(function(require, exports, module) { 'use strict'; @@ -342,6 +342,10 @@ var listenerManager = (function() { function on(node, types, handler, options) { if ( !supportEvent(node) ) { return; } + if (typeof handler !== 'function') { + throw new Error('handler must be a function'); + } + types.forEach(function(type) { type = type.split('.'); diff --git a/dom/1.1.x/dom-event.js b/dom/1.1.x/dom-event.js index 9dda647..5196147 100644 --- a/dom/1.1.x/dom-event.js +++ b/dom/1.1.x/dom-event.js @@ -1,6 +1,6 @@ /*! * JRaiser 2 Javascript Library - * dom-event - v1.1.1 (2015-04-29T10:20:17+0800) + * dom-event - v1.1.1 (2015-08-05T09:57:13+0800) * http://jraiser.org/ | Released under MIT license */ -define("dom/1.1.x/dom-event",["base/1.1.x/","dom/1.1.x/dom-base","dom/1.1.x/dom-data","dom/1.1.x/sizzle","dom/1.1.x/dom-event-arg"],function(e,t,n){"use strict";function r(e){return h.isWindow(e)||h.isHTMLElement(e,!0)}function o(e){e=v.fix(e);var t=this,n=e.type,r=e.target;if(!(b.get(t,n)||r&&b.get(r,n))){var o=y[n]?y[n].bindType:n,a=E.get(t,o);a&&a.forEach(function(o){if(!e.isTrigger||o.trueType===n){var a;if(o.delegator){for(var i=r;i&&i!==t;){if(p.matchesSelector(i,o.delegator)){a=i,e.delegateTarget=t;break}i=i.parentNode}if(!a)return}else a=t;"data"in e||(e.data=o.data);var c=o.handle?o.handle.call(a,o,e):o.handler.call(a,e);c===!1&&e.preventDefault(),e.cancelBubble===!0&&e.stopPropagation()}})}}function a(e,t,n,o){r(e)&&t.forEach(function(t){t=t.split(".");var r=y[t[0]];E.add(e,r?r.bindType:t[0],f.customExtend({handler:n,trueType:t[0],handle:r?r.handle:null,namespace:t[1]},o,{overwrite:!1}))})}function i(e,t,n){r(e)&&(t?t.forEach(function(t){t=t.split(".");var r=y[t[0]];E.remove(e,t[0],r?r.bindType:t[0],t[1],n)}):E.remove(e))}function c(e,t,n){if(r(e)&&t){n=n||{};var a=v.fix(f.extend({type:t,target:e},w[g[t]])),i=e,c=null!=n.bubbles?n.bubbles:T[t];a.isTrigger=!0,null!=n.data&&(a.data=n.data);do o.call(e,a),e=e.parentNode;while(c&&e&&!a.isPropagationStopped());k[t]&&!a.isDefaultPrevented()&&t in i&&(b.set(i,t,!0),i[t](),b.remove(i,t))}}var l,s,u,f=e("base/1.1.x/"),h=e("./dom-base"),d=e("./dom-data"),p=e("./sizzle"),m=e("./dom-event-arg");document.addEventListener?(l=function(e,t,n){e.addEventListener(t,n,!1)},s=function(e,t,n){e.removeEventListener(t,n,!1)}):document.attachEvent&&(l=function(e,t,n){e.attachEvent("on"+t,n)},s=function(e,t,n){e.detachEvent("on"+t,n)},u=!0);var g={},v={props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),keyHook:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHook:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement touches".split(" "),filter:function(e,t){var n,r,o,a=t.button,i=t.fromElement,c=t.touches;return c&&1===c.length&&(e.pageX=c[0].pageX,e.pageY=c[0].pageY),null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||document,r=n.documentElement,o=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&i&&(e.relatedTarget=i===e.target?t.toElement:i),e.which||f.isUndefined(a)||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e instanceof m)return e;var t=e,n=this[g[e.type]+"Hook"],r=n&&n.props?this.props.concat(n.props):this.props;return e=f.customExtend(new m(e),t,{whiteList:r}),e.target||(e.target=t.srcElement||document),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,n&&n.filter?n.filter(e,t):e}},y={};"onmouseenter"in document||f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){y[t]={bindType:e,handle:function(e,n){var r,o=n.relatedTarget;if(!n||!o||o!==this&&!p.contains(this,o)){var a=n.type;n.type=t,r=e.handler.call(this,n),n.type=a}return r}}});var b=d.createDataSpace({cloneable:!1}),E=function(){function e(e,n,r){var a;if(u){var a=function(){return o.apply(e,arguments)};r.set(e,t,a)}else a=o;l(e,n,a)}var t="__dispatch__",n=d.createDataSpace({onClone:function(n,r){var o;u&&(o=this.get(r,t)),this.keys(n).forEach(function(r){r!==t&&(o&&s(n,r,o),e(n,r,this))})}});return{add:function(r,o,a){if(o!==t){var i=n.get(r,o);i||(i=[],n.set(r,o,i),e(r,o,n)),i.push(a)}},get:function(e,t){return n.get(e,t)},remove:function(e,r,a,i,c){var l;if(c||i){var u=n.get(e,a);if(u){for(var f=u.length-1;f>=0;f--)u[f].trueType!==r||c&&u[f].handler!==c||i&&u[f].namespace!==i||u.splice(f,1);u.length||(l=1)}}else l=r?1:2;var h=n.get(e,t)||o;1===l&&(n.remove(e,a),s(e,a,h));var d=n.keys(e);d&&(2===l?(d.forEach(function(n){n!==t&&s(e,n,h)}),d=null):1===d.length&&d[0]===t&&(d=null)),d||n.clear(e)}}}(),w={key:{view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},mouse:{view:window,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0},ui:{view:window}},k={focus:!0,blur:!0,click:!0,reset:!0,submit:!0},T={scroll:!0,resize:!0,select:!0,error:!0,reset:!0,submit:!0,change:!0,abort:!0},K={on:function(e,t,n){return e=h.splitBySpace(e),e&&this.forEach(function(r){a(r,e,t,n)}),this},off:function(e,t){return e&&(e=h.splitBySpace(e)),this.forEach(function(n){i(n,e,t)}),this},trigger:function(e,t){return this.forEach(function(n){c(n,e,t)}),this}},X=/^key/,Y=/^(?:mouse|contextmenu|touch)|click/;return"blur focus load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave touchstart touchmove touchend change select submit keydown keypress keyup error contextmenu".split(" ").forEach(function(e){X.test(e)?(T[e]=!0,g[e]="key"):Y.test(e)&&(T[e]=!0,g[e]="mouse"),K[e]=function(t,n){return arguments.length?this.on(e,t,n):this.trigger(e)}}),{shortcuts:K}}); \ No newline at end of file +define("dom/1.1.x/dom-event",["base/1.1.x/","dom/1.1.x/dom-base","dom/1.1.x/dom-data","dom/1.1.x/sizzle","dom/1.1.x/dom-event-arg"],function(e,t,n){"use strict";function r(e){return h.isWindow(e)||h.isHTMLElement(e,!0)}function o(e){e=v.fix(e);var t=this,n=e.type,r=e.target;if(!(b.get(t,n)||r&&b.get(r,n))){var o=y[n]?y[n].bindType:n,a=w.get(t,o);a&&a.forEach(function(o){if(!e.isTrigger||o.trueType===n){var a;if(o.delegator){for(var i=r;i&&i!==t;){if(p.matchesSelector(i,o.delegator)){a=i,e.delegateTarget=t;break}i=i.parentNode}if(!a)return}else a=t;"data"in e||(e.data=o.data);var c=o.handle?o.handle.call(a,o,e):o.handler.call(a,e);c===!1&&e.preventDefault(),e.cancelBubble===!0&&e.stopPropagation()}})}}function a(e,t,n,o){if(r(e)){if("function"!=typeof n)throw new Error("handler must be a function");t.forEach(function(t){t=t.split(".");var r=y[t[0]];w.add(e,r?r.bindType:t[0],f.customExtend({handler:n,trueType:t[0],handle:r?r.handle:null,namespace:t[1]},o,{overwrite:!1}))})}}function i(e,t,n){r(e)&&(t?t.forEach(function(t){t=t.split(".");var r=y[t[0]];w.remove(e,t[0],r?r.bindType:t[0],t[1],n)}):w.remove(e))}function c(e,t,n){if(r(e)&&t){n=n||{};var a=v.fix(f.extend({type:t,target:e},E[g[t]])),i=e,c=null!=n.bubbles?n.bubbles:T[t];a.isTrigger=!0,null!=n.data&&(a.data=n.data);do o.call(e,a),e=e.parentNode;while(c&&e&&!a.isPropagationStopped());k[t]&&!a.isDefaultPrevented()&&t in i&&(b.set(i,t,!0),i[t](),b.remove(i,t))}}var l,s,u,f=e("base/1.1.x/"),h=e("./dom-base"),d=e("./dom-data"),p=e("./sizzle"),m=e("./dom-event-arg");document.addEventListener?(l=function(e,t,n){e.addEventListener(t,n,!1)},s=function(e,t,n){e.removeEventListener(t,n,!1)}):document.attachEvent&&(l=function(e,t,n){e.attachEvent("on"+t,n)},s=function(e,t,n){e.detachEvent("on"+t,n)},u=!0);var g={},v={props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),keyHook:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHook:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement touches".split(" "),filter:function(e,t){var n,r,o,a=t.button,i=t.fromElement,c=t.touches;return c&&1===c.length&&(e.pageX=c[0].pageX,e.pageY=c[0].pageY),null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||document,r=n.documentElement,o=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&i&&(e.relatedTarget=i===e.target?t.toElement:i),e.which||f.isUndefined(a)||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e instanceof m)return e;var t=e,n=this[g[e.type]+"Hook"],r=n&&n.props?this.props.concat(n.props):this.props;return e=f.customExtend(new m(e),t,{whiteList:r}),e.target||(e.target=t.srcElement||document),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,n&&n.filter?n.filter(e,t):e}},y={};"onmouseenter"in document||f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){y[t]={bindType:e,handle:function(e,n){var r,o=n.relatedTarget;if(!n||!o||o!==this&&!p.contains(this,o)){var a=n.type;n.type=t,r=e.handler.call(this,n),n.type=a}return r}}});var b=d.createDataSpace({cloneable:!1}),w=function(){function e(e,n,r){var a;if(u){var a=function(){return o.apply(e,arguments)};r.set(e,t,a)}else a=o;l(e,n,a)}var t="__dispatch__",n=d.createDataSpace({onClone:function(n,r){var o;u&&(o=this.get(r,t)),this.keys(n).forEach(function(r){r!==t&&(o&&s(n,r,o),e(n,r,this))})}});return{add:function(r,o,a){if(o!==t){var i=n.get(r,o);i||(i=[],n.set(r,o,i),e(r,o,n)),i.push(a)}},get:function(e,t){return n.get(e,t)},remove:function(e,r,a,i,c){var l;if(c||i){var u=n.get(e,a);if(u){for(var f=u.length-1;f>=0;f--)u[f].trueType!==r||c&&u[f].handler!==c||i&&u[f].namespace!==i||u.splice(f,1);u.length||(l=1)}}else l=r?1:2;var h=n.get(e,t)||o;1===l&&(n.remove(e,a),s(e,a,h));var d=n.keys(e);d&&(2===l?(d.forEach(function(n){n!==t&&s(e,n,h)}),d=null):1===d.length&&d[0]===t&&(d=null)),d||n.clear(e)}}}(),E={key:{view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},mouse:{view:window,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0},ui:{view:window}},k={focus:!0,blur:!0,click:!0,reset:!0,submit:!0},T={scroll:!0,resize:!0,select:!0,error:!0,reset:!0,submit:!0,change:!0,abort:!0},K={on:function(e,t,n){return e=h.splitBySpace(e),e&&this.forEach(function(r){a(r,e,t,n)}),this},off:function(e,t){return e&&(e=h.splitBySpace(e)),this.forEach(function(n){i(n,e,t)}),this},trigger:function(e,t){return this.forEach(function(n){c(n,e,t)}),this}},X=/^key/,Y=/^(?:mouse|contextmenu|touch)|click/;return"blur focus load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave touchstart touchmove touchend change select submit keydown keypress keyup error contextmenu".split(" ").forEach(function(e){X.test(e)?(T[e]=!0,g[e]="key"):Y.test(e)&&(T[e]=!0,g[e]="mouse"),K[e]=function(t,n){return arguments.length?this.on(e,t,n):this.trigger(e)}}),{shortcuts:K}}); \ No newline at end of file diff --git a/dom/1.1.x/index.js b/dom/1.1.x/index.js index 245b943..e6823f0 100644 --- a/dom/1.1.x/index.js +++ b/dom/1.1.x/index.js @@ -68,10 +68,10 @@ define("dom/1.1.x/dom-ready",null,function(t,n,e){"use strict";return function(t define("dom/1.1.x/dom-event-arg",null,function(t,e,n){"use strict";function a(){return!1}function i(){return!0}var r,o=t("base/1.1.x/");return o.createClass(function(t,e){var n=this;if(t&&t.type?(n.originalEvent=t,n.type=t.type,n.isDefaultPrevented=t.defaultPrevented||t.defaultPrevented===r&&t.returnValue===!1?i:a,n.timeStamp=t.timeStamp):n.type=t,e)for(var o in e)"function"!=typeof e[o]&&(n[o]=e[o]);n.timeStamp=n.timeStamp||+new Date},{preventDefault:function(){this.isDefaultPrevented=i;var t=this.originalEvent;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=i;var t=this.originalEvent;t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},isDefaultPrevented:a,isPropagationStopped:a})}); /*! * JRaiser 2 Javascript Library - * dom-event - v1.1.1 (2015-04-29T10:20:17+0800) + * dom-event - v1.1.1 (2015-08-05T09:57:13+0800) * http://jraiser.org/ | Released under MIT license */ -define("dom/1.1.x/dom-event",null,function(e,t,n){"use strict";function r(e){return h.isWindow(e)||h.isHTMLElement(e,!0)}function o(e){e=v.fix(e);var t=this,n=e.type,r=e.target;if(!(b.get(t,n)||r&&b.get(r,n))){var o=y[n]?y[n].bindType:n,a=E.get(t,o);a&&a.forEach(function(o){if(!e.isTrigger||o.trueType===n){var a;if(o.delegator){for(var i=r;i&&i!==t;){if(p.matchesSelector(i,o.delegator)){a=i,e.delegateTarget=t;break}i=i.parentNode}if(!a)return}else a=t;"data"in e||(e.data=o.data);var c=o.handle?o.handle.call(a,o,e):o.handler.call(a,e);c===!1&&e.preventDefault(),e.cancelBubble===!0&&e.stopPropagation()}})}}function a(e,t,n,o){r(e)&&t.forEach(function(t){t=t.split(".");var r=y[t[0]];E.add(e,r?r.bindType:t[0],f.customExtend({handler:n,trueType:t[0],handle:r?r.handle:null,namespace:t[1]},o,{overwrite:!1}))})}function i(e,t,n){r(e)&&(t?t.forEach(function(t){t=t.split(".");var r=y[t[0]];E.remove(e,t[0],r?r.bindType:t[0],t[1],n)}):E.remove(e))}function c(e,t,n){if(r(e)&&t){n=n||{};var a=v.fix(f.extend({type:t,target:e},w[g[t]])),i=e,c=null!=n.bubbles?n.bubbles:T[t];a.isTrigger=!0,null!=n.data&&(a.data=n.data);do o.call(e,a),e=e.parentNode;while(c&&e&&!a.isPropagationStopped());k[t]&&!a.isDefaultPrevented()&&t in i&&(b.set(i,t,!0),i[t](),b.remove(i,t))}}var l,s,u,f=e("base/1.1.x/"),h=e("./dom-base"),d=e("./dom-data"),p=e("./sizzle"),m=e("./dom-event-arg");document.addEventListener?(l=function(e,t,n){e.addEventListener(t,n,!1)},s=function(e,t,n){e.removeEventListener(t,n,!1)}):document.attachEvent&&(l=function(e,t,n){e.attachEvent("on"+t,n)},s=function(e,t,n){e.detachEvent("on"+t,n)},u=!0);var g={},v={props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),keyHook:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHook:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement touches".split(" "),filter:function(e,t){var n,r,o,a=t.button,i=t.fromElement,c=t.touches;return c&&1===c.length&&(e.pageX=c[0].pageX,e.pageY=c[0].pageY),null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||document,r=n.documentElement,o=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&i&&(e.relatedTarget=i===e.target?t.toElement:i),e.which||f.isUndefined(a)||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e instanceof m)return e;var t=e,n=this[g[e.type]+"Hook"],r=n&&n.props?this.props.concat(n.props):this.props;return e=f.customExtend(new m(e),t,{whiteList:r}),e.target||(e.target=t.srcElement||document),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,n&&n.filter?n.filter(e,t):e}},y={};"onmouseenter"in document||f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){y[t]={bindType:e,handle:function(e,n){var r,o=n.relatedTarget;if(!n||!o||o!==this&&!p.contains(this,o)){var a=n.type;n.type=t,r=e.handler.call(this,n),n.type=a}return r}}});var b=d.createDataSpace({cloneable:!1}),E=function(){function e(e,n,r){var a;if(u){var a=function(){return o.apply(e,arguments)};r.set(e,t,a)}else a=o;l(e,n,a)}var t="__dispatch__",n=d.createDataSpace({onClone:function(n,r){var o;u&&(o=this.get(r,t)),this.keys(n).forEach(function(r){r!==t&&(o&&s(n,r,o),e(n,r,this))})}});return{add:function(r,o,a){if(o!==t){var i=n.get(r,o);i||(i=[],n.set(r,o,i),e(r,o,n)),i.push(a)}},get:function(e,t){return n.get(e,t)},remove:function(e,r,a,i,c){var l;if(c||i){var u=n.get(e,a);if(u){for(var f=u.length-1;f>=0;f--)u[f].trueType!==r||c&&u[f].handler!==c||i&&u[f].namespace!==i||u.splice(f,1);u.length||(l=1)}}else l=r?1:2;var h=n.get(e,t)||o;1===l&&(n.remove(e,a),s(e,a,h));var d=n.keys(e);d&&(2===l?(d.forEach(function(n){n!==t&&s(e,n,h)}),d=null):1===d.length&&d[0]===t&&(d=null)),d||n.clear(e)}}}(),w={key:{view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},mouse:{view:window,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0},ui:{view:window}},k={focus:!0,blur:!0,click:!0,reset:!0,submit:!0},T={scroll:!0,resize:!0,select:!0,error:!0,reset:!0,submit:!0,change:!0,abort:!0},K={on:function(e,t,n){return e=h.splitBySpace(e),e&&this.forEach(function(r){a(r,e,t,n)}),this},off:function(e,t){return e&&(e=h.splitBySpace(e)),this.forEach(function(n){i(n,e,t)}),this},trigger:function(e,t){return this.forEach(function(n){c(n,e,t)}),this}},X=/^key/,Y=/^(?:mouse|contextmenu|touch)|click/;return"blur focus load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave touchstart touchmove touchend change select submit keydown keypress keyup error contextmenu".split(" ").forEach(function(e){X.test(e)?(T[e]=!0,g[e]="key"):Y.test(e)&&(T[e]=!0,g[e]="mouse"),K[e]=function(t,n){return arguments.length?this.on(e,t,n):this.trigger(e)}}),{shortcuts:K}}); +define("dom/1.1.x/dom-event",null,function(e,t,n){"use strict";function r(e){return h.isWindow(e)||h.isHTMLElement(e,!0)}function o(e){e=v.fix(e);var t=this,n=e.type,r=e.target;if(!(b.get(t,n)||r&&b.get(r,n))){var o=y[n]?y[n].bindType:n,a=w.get(t,o);a&&a.forEach(function(o){if(!e.isTrigger||o.trueType===n){var a;if(o.delegator){for(var i=r;i&&i!==t;){if(p.matchesSelector(i,o.delegator)){a=i,e.delegateTarget=t;break}i=i.parentNode}if(!a)return}else a=t;"data"in e||(e.data=o.data);var c=o.handle?o.handle.call(a,o,e):o.handler.call(a,e);c===!1&&e.preventDefault(),e.cancelBubble===!0&&e.stopPropagation()}})}}function a(e,t,n,o){if(r(e)){if("function"!=typeof n)throw new Error("handler must be a function");t.forEach(function(t){t=t.split(".");var r=y[t[0]];w.add(e,r?r.bindType:t[0],f.customExtend({handler:n,trueType:t[0],handle:r?r.handle:null,namespace:t[1]},o,{overwrite:!1}))})}}function i(e,t,n){r(e)&&(t?t.forEach(function(t){t=t.split(".");var r=y[t[0]];w.remove(e,t[0],r?r.bindType:t[0],t[1],n)}):w.remove(e))}function c(e,t,n){if(r(e)&&t){n=n||{};var a=v.fix(f.extend({type:t,target:e},E[g[t]])),i=e,c=null!=n.bubbles?n.bubbles:T[t];a.isTrigger=!0,null!=n.data&&(a.data=n.data);do o.call(e,a),e=e.parentNode;while(c&&e&&!a.isPropagationStopped());k[t]&&!a.isDefaultPrevented()&&t in i&&(b.set(i,t,!0),i[t](),b.remove(i,t))}}var l,s,u,f=e("base/1.1.x/"),h=e("./dom-base"),d=e("./dom-data"),p=e("./sizzle"),m=e("./dom-event-arg");document.addEventListener?(l=function(e,t,n){e.addEventListener(t,n,!1)},s=function(e,t,n){e.removeEventListener(t,n,!1)}):document.attachEvent&&(l=function(e,t,n){e.attachEvent("on"+t,n)},s=function(e,t,n){e.detachEvent("on"+t,n)},u=!0);var g={},v={props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),keyHook:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHook:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement touches".split(" "),filter:function(e,t){var n,r,o,a=t.button,i=t.fromElement,c=t.touches;return c&&1===c.length&&(e.pageX=c[0].pageX,e.pageY=c[0].pageY),null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||document,r=n.documentElement,o=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&i&&(e.relatedTarget=i===e.target?t.toElement:i),e.which||f.isUndefined(a)||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e instanceof m)return e;var t=e,n=this[g[e.type]+"Hook"],r=n&&n.props?this.props.concat(n.props):this.props;return e=f.customExtend(new m(e),t,{whiteList:r}),e.target||(e.target=t.srcElement||document),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,n&&n.filter?n.filter(e,t):e}},y={};"onmouseenter"in document||f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){y[t]={bindType:e,handle:function(e,n){var r,o=n.relatedTarget;if(!n||!o||o!==this&&!p.contains(this,o)){var a=n.type;n.type=t,r=e.handler.call(this,n),n.type=a}return r}}});var b=d.createDataSpace({cloneable:!1}),w=function(){function e(e,n,r){var a;if(u){var a=function(){return o.apply(e,arguments)};r.set(e,t,a)}else a=o;l(e,n,a)}var t="__dispatch__",n=d.createDataSpace({onClone:function(n,r){var o;u&&(o=this.get(r,t)),this.keys(n).forEach(function(r){r!==t&&(o&&s(n,r,o),e(n,r,this))})}});return{add:function(r,o,a){if(o!==t){var i=n.get(r,o);i||(i=[],n.set(r,o,i),e(r,o,n)),i.push(a)}},get:function(e,t){return n.get(e,t)},remove:function(e,r,a,i,c){var l;if(c||i){var u=n.get(e,a);if(u){for(var f=u.length-1;f>=0;f--)u[f].trueType!==r||c&&u[f].handler!==c||i&&u[f].namespace!==i||u.splice(f,1);u.length||(l=1)}}else l=r?1:2;var h=n.get(e,t)||o;1===l&&(n.remove(e,a),s(e,a,h));var d=n.keys(e);d&&(2===l?(d.forEach(function(n){n!==t&&s(e,n,h)}),d=null):1===d.length&&d[0]===t&&(d=null)),d||n.clear(e)}}}(),E={key:{view:window,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:0,charCode:0},mouse:{view:window,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0},ui:{view:window}},k={focus:!0,blur:!0,click:!0,reset:!0,submit:!0},T={scroll:!0,resize:!0,select:!0,error:!0,reset:!0,submit:!0,change:!0,abort:!0},K={on:function(e,t,n){return e=h.splitBySpace(e),e&&this.forEach(function(r){a(r,e,t,n)}),this},off:function(e,t){return e&&(e=h.splitBySpace(e)),this.forEach(function(n){i(n,e,t)}),this},trigger:function(e,t){return this.forEach(function(n){c(n,e,t)}),this}},X=/^key/,Y=/^(?:mouse|contextmenu|touch)|click/;return"blur focus load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave touchstart touchmove touchend change select submit keydown keypress keyup error contextmenu".split(" ").forEach(function(e){X.test(e)?(T[e]=!0,g[e]="key"):Y.test(e)&&(T[e]=!0,g[e]="mouse"),K[e]=function(t,n){return arguments.length?this.on(e,t,n):this.trigger(e)}}),{shortcuts:K}}); /*! * JRaiser 2 Javascript Library * animation - v1.0.1 (2015-08-04T17:44:55+0800)