Skip to content
This repository
Browse code

rebuild

  • Loading branch information...
commit 9150f8ad83eb00ad5ac85a3f4e08a2c65a443725 1 parent 2652fb9
Rod Vagg rvagg authored

Showing 2 changed files with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  bean.js
  2. +1 1  bean.min.js
1  bean.js
@@ -608,6 +608,7 @@
608 608
609 609 , bean = {
610 610 add : add
  611 + , on : on
611 612 , one : one
612 613 , remove : remove
613 614 , clone : clone
2  bean.min.js
@@ -7,4 +7,4 @@
7 7 * dperini: https://github.com/dperini/nwevents
8 8 * the entire mootools team: github.com/mootools/mootools-core
9 9 */
10   -!function(e,t,n){typeof module!="undefined"?module.exports=n(e,t):typeof define=="function"&&typeof define.amd=="object"?define(n):t[e]=n(e,t)}("bean",this,function(e,t){var n=window,r=t[e],i=/[^\.]*(?=\..*)\.|.*/,s=/\..*/,o="addEventListener",u="attachEvent",a="removeEventListener",f="detachEvent",l="ownerDocument",c="target",h="querySelectorAll",p=document||{},d=p.documentElement||{},v=d[o],m=v?o:u,g=Array.prototype.slice,y={},b="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",w="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",E=function(e,t){return e.split(t||" ")},S=function(e){return typeof e=="string"},x=function(e){return Object.prototype.toString.call(e)==="[object Array]"},T=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},E(b+(v?w:""))),N=function(){var e="compareDocumentPosition",t=e in d?function(t,n){return n[e]&&(n[e](t)&16)===16}:"contains"in d?function(e,t){return t=t.nodeType===9||t===window?d:t,t!==e&&t.contains(e)}:function(e,t){while(e=e.parentNode)if(e===t)return 1;return 0},n=function(e){var n=e.relatedTarget;return n?n!==this&&n.prefix!=="xul"&&!/document/.test(this.toString())&&!t(n,this):n==null};return{mouseenter:{base:"mouseover",condition:n},mouseleave:{base:"mouseout",condition:n},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),C=function(){var e=E("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which"),t=e.concat(E("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),n=t.concat(E("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),r=e.concat(E("char charCode key keyCode keyIdentifier keyLocation location")),i=e.concat(E("data")),s=e.concat(E("touches targetTouches changedTouches scale rotation")),o=e.concat(E("data origin source")),u=e.concat(E("state")),a=/over|out/,f=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.which||e.keyCode,r}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){n.rightClick=e.which===3||e.button===2,n.pos={x:0,y:0};if(e.pageX||e.pageY)n.clientX=e.pageX,n.clientY=e.pageY;else if(e.clientX||e.clientY)n.clientX=e.clientX+p.body.scrollLeft+d.scrollLeft,n.clientY=e.clientY+p.body.scrollTop+d.scrollTop;return a.test(r)&&(n.relatedTarget=e.relatedTarget||e[(r=="mouseover"?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return n}},{reg:/^text/i,fix:function(){return i}},{reg:/^touch|^gesture/i,fix:function(){return s}},{reg:/^message$/i,fix:function(){return o}},{reg:/^popstate$/i,fix:function(){return u}},{reg:/.*/,fix:function(){return e}}],l={},h="preventDefault",v=function(e){return function(){e[h]?e[h]():e.returnValue=!1}},m="stopPropagation",g=function(e){return function(){e[m]?e[m]():e.cancelBubble=!0}},y="stopImmediatePropagation",b=function(e){return function(){e[y]&&e[y]()}},w=function(e){return function(){e[h](),e[m](),e.stopped=!0}},S=function(e,t,n){var r,i;for(r=n.length;r--;)!((i=n[r])in t)&&i in e&&(t[i]=e[i])};return function(e,t){var n={originalEvent:e,isNative:t,isBean:!0};if(!e)return n;var r,i,s,o=e.type,u=e[c]||e.srcElement;n[h]=v(e),n[m]=g(e),n[y]=b(e),n.stop=w(n),n[c]=u&&u.nodeType===3?u.parentNode:u;if(t){s=l[o];if(!s)for(r=0,i=f.length;r<i;r++)if(f[r].reg.test(o)){l[o]=s=f[r].fix;break}S(e,n,s(e,n,o))}return n}}(),k=function(e,t){return!v&&!t&&(e===p||e===n)?d:e},L=function(){function e(e,t,n,r,i,s){var o=N[t],u;t=="unload"&&(n=H(B,e,t,n,r)),o&&(o.condition&&(n=P(e,n,t,o.condition,s,!0)),t=o.base||t),this.isNative=u=T[t]&&!!e[m],this.customType=!v&&!u&&t,this.element=e,this.type=t,this.original=r,this.namespaces=i,this.eventType=v||u?t:"propertychange",this[c]=k(e,u),this[m]=!!this[c][m],this.handler=u?D(e,n,s):P(e,n,t,!1,s,!1)}return e.prototype={inNamespaces:function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},matches:function(e,t,n){return this.element===e&&(!t||this.original===t)&&(!n||this.handler===n)}},e}(),A=function(){var e={},t=function(n,r,i,s,o){if(!r||r=="*")for(var u in e)u.charAt(0)=="$"&&t(n,u.substr(1),i,s,o);else{var a=0,f,l=e["$"+r],c=n=="*";if(!l)return;for(f=l.length;a<f;a++)if((c||l[a].matches(n,i,s))&&!o(l[a],l,a,r))return}},n=function(t,n,r){var i,s=e["$"+n];if(s)for(i=s.length;i--;)if(s[i].matches(t,r,null))return!0;return!1},r=function(e,n,r){var i=[];return t(e,n,r,null,function(e){return i.push(e)}),i},i=function(t){return(e["$"+t.type]||(e["$"+t.type]=[])).push(t),t},s=function(n){t(n.element,n.type,null,n.handler,function(t,n,r){return n.splice(r,1),n.length===0&&delete e["$"+t.type],!1})},o=function(){var t,n=[];for(t in e)t.charAt(0)=="$"&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:s,entries:o}}(),O,M=function(e){arguments.length?O=e:O=p[h]?function(e,t){return t[h](e)}:function(){throw new Error("Bean: No selector engine installed")}},_=v?function(e,t,n,r){e[r?o:a](t,n,!1)}:function(e,t,n,r,i){i&&r&&e["_on"+i]==null&&(e["_on"+i]=0),e[r?u:f]("on"+t,n)},D=function(e,t,r){var i=t.__beanDel,s=function(s){return s=C(s||((this[l]||this.document||this).parentWindow||n).event,!0),i&&(s.currentTarget=i.ft(s[c],e)),t.apply(e,[s].concat(r))};return s.__beanDel=i,s},P=function(e,t,r,i,s,o){var u=t.__beanDel,a=function(a){var f=u?u.ft(a[c],e):this,h=i?i.apply(f,arguments):v?!0:a&&a.propertyName=="_on"+r||!a;h&&(a&&(a=C(a||((this[l]||this.document||this).parentWindow||n).event,o),a.currentTarget=f),t.apply(e,a&&(!s||s.length===0)?arguments:g.call(arguments,a?0:1).concat(s)))};return a.__beanDel=u,a},H=function(e,t,n,r,i){return function(){e(t,n,i),r.apply(this,arguments)}},B=function(e,t,n,r){var i=t&&t.replace(s,""),o=A.get(e,i,n),u,a,f;for(u=0,a=o.length;u<a;u++)o[u].inNamespaces(r)&&((f=o[u])[m]&&_(f[c],f.eventType,f.handler,!1,f.type),A.del(f))},j=function(e,t){var n=function(t,n){var r,i=S(e)?O(e,n):e;for(;t&&t!==n;t=t.parentNode)for(r=i.length;r--;)if(i[r]===t)return t},r=function(e){var r=n(e[c],this);r&&t.apply(r,arguments)};return r.__beanDel={ft:n,selector:e},r},F=function(e,t,n){var r=B,o=S(t),u,a,f,l;if(o&&t.indexOf(" ")>0){t=E(t);for(l=t.length;l--;)F(e,t[l],n);return e}a=o&&t.replace(s,""),a&&N[a]&&(a=N[a].type);if(!t||o){if(f=o&&t.replace(i,""))f=E(f,".");r(e,a,n,f)}else if(typeof t=="function")r(e,null,t);else for(u in t)t.hasOwnProperty(u)&&F(e,u,t[u]);return e},I=function(e,t,n,r){var o,u,a,f,l,h;if(n===undefined&&typeof t=="object"){for(u in t)t.hasOwnProperty(u)&&I.call(this,e,u,t[u]);return}S(n)||x(n)?(o=r,l=g.call(arguments,4),r=j(n,o,O)):(l=g.call(arguments,3),r=o=n),a=E(t),this===y&&(r=H(F,e,t,r,o));for(f=a.length;f--;)h=A.put(new L(e,a[f].replace(s,""),r,o,E(a[f].replace(i,""),"."),l)),h[m]&&_(h[c],h.eventType,h.handler,!0,h.customType);return e},q=function(e,t,n,r){return I.apply(this,S(n)?[e,n,t,r].concat(arguments.length>3?g.call(arguments,5):[]):g.call(arguments))},R=function(){return q.apply(y,arguments)},U=v?function(e,t,r){var i=p.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,n,1),r.dispatchEvent(i)}:function(e,t,n){n=k(n,e),e?n.fireEvent("on"+t,p.createEventObject()):n["_on"+t]++},z=function(e,t,n){var r=E(t),o,u,a,f,l;for(o=r.length;o--;){t=r[o].replace(s,"");if(f=r[o].replace(i,""))f=E(f,".");if(!f&&!n&&e[m])U(T[t],t,e);else{l=A.get(e,t),n=[!1].concat(n);for(u=0,a=l.length;u<a;u++)l[u].inNamespaces(f)&&l[u].handler.apply(e,n)}}return e},W=function(e,t,n){var r=A.get(t,n),i,s,o,u;for(i=0,s=r.length;i<s;i++)r[i].original&&(u=r[i].handler.__beanDel,u?o=[e,u.selector,r[i].type,r[i].original]:o=[e,r[i].type,r[i].original],q.apply(null,o));return e},X={add:q,one:R,remove:F,clone:W,fire:z,setSelectorEngine:M,noConflict:function(){return t[e]=r,this}};if(n[u]){var V=function(){var e,t=A.entries();for(e in t)t[e].type&&t[e].type!=="unload"&&F(t[e].element,t[e].type);n[f]("onunload",V),n.CollectGarbage&&n.CollectGarbage()};n[u]("onunload",V)}return M(),X})
  10 +!function(e,t,n){typeof module!="undefined"?module.exports=n(e,t):typeof define=="function"&&typeof define.amd=="object"?define(n):t[e]=n(e,t)}("bean",this,function(e,t){var n=window,r=t[e],i=/[^\.]*(?=\..*)\.|.*/,s=/\..*/,o="addEventListener",u="attachEvent",a="removeEventListener",f="detachEvent",l="ownerDocument",c="target",h="querySelectorAll",p=document||{},d=p.documentElement||{},v=d[o],m=v?o:u,g=Array.prototype.slice,y={},b="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",w="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",E=function(e,t){return e.split(t||" ")},S=function(e){return typeof e=="string"},x=function(e){return Object.prototype.toString.call(e)==="[object Array]"},T=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},E(b+(v?w:""))),N=function(){var e="compareDocumentPosition",t=e in d?function(t,n){return n[e]&&(n[e](t)&16)===16}:"contains"in d?function(e,t){return t=t.nodeType===9||t===window?d:t,t!==e&&t.contains(e)}:function(e,t){while(e=e.parentNode)if(e===t)return 1;return 0},n=function(e){var n=e.relatedTarget;return n?n!==this&&n.prefix!=="xul"&&!/document/.test(this.toString())&&!t(n,this):n==null};return{mouseenter:{base:"mouseover",condition:n},mouseleave:{base:"mouseout",condition:n},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),C=function(){var e=E("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which"),t=e.concat(E("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),n=t.concat(E("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),r=e.concat(E("char charCode key keyCode keyIdentifier keyLocation location")),i=e.concat(E("data")),s=e.concat(E("touches targetTouches changedTouches scale rotation")),o=e.concat(E("data origin source")),u=e.concat(E("state")),a=/over|out/,f=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.which||e.keyCode,r}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){n.rightClick=e.which===3||e.button===2,n.pos={x:0,y:0};if(e.pageX||e.pageY)n.clientX=e.pageX,n.clientY=e.pageY;else if(e.clientX||e.clientY)n.clientX=e.clientX+p.body.scrollLeft+d.scrollLeft,n.clientY=e.clientY+p.body.scrollTop+d.scrollTop;return a.test(r)&&(n.relatedTarget=e.relatedTarget||e[(r=="mouseover"?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return n}},{reg:/^text/i,fix:function(){return i}},{reg:/^touch|^gesture/i,fix:function(){return s}},{reg:/^message$/i,fix:function(){return o}},{reg:/^popstate$/i,fix:function(){return u}},{reg:/.*/,fix:function(){return e}}],l={},h="preventDefault",v=function(e){return function(){e[h]?e[h]():e.returnValue=!1}},m="stopPropagation",g=function(e){return function(){e[m]?e[m]():e.cancelBubble=!0}},y="stopImmediatePropagation",b=function(e){return function(){e[y]&&e[y]()}},w=function(e){return function(){e[h](),e[m](),e.stopped=!0}},S=function(e,t,n){var r,i;for(r=n.length;r--;)!((i=n[r])in t)&&i in e&&(t[i]=e[i])};return function(e,t){var n={originalEvent:e,isNative:t,isBean:!0};if(!e)return n;var r,i,s,o=e.type,u=e[c]||e.srcElement;n[h]=v(e),n[m]=g(e),n[y]=b(e),n.stop=w(n),n[c]=u&&u.nodeType===3?u.parentNode:u;if(t){s=l[o];if(!s)for(r=0,i=f.length;r<i;r++)if(f[r].reg.test(o)){l[o]=s=f[r].fix;break}S(e,n,s(e,n,o))}return n}}(),k=function(e,t){return!v&&!t&&(e===p||e===n)?d:e},L=function(){function e(e,t,n,r,i,s){var o=N[t],u;t=="unload"&&(n=H(B,e,t,n,r)),o&&(o.condition&&(n=P(e,n,t,o.condition,s,!0)),t=o.base||t),this.isNative=u=T[t]&&!!e[m],this.customType=!v&&!u&&t,this.element=e,this.type=t,this.original=r,this.namespaces=i,this.eventType=v||u?t:"propertychange",this[c]=k(e,u),this[m]=!!this[c][m],this.handler=u?D(e,n,s):P(e,n,t,!1,s,!1)}return e.prototype={inNamespaces:function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},matches:function(e,t,n){return this.element===e&&(!t||this.original===t)&&(!n||this.handler===n)}},e}(),A=function(){var e={},t=function(n,r,i,s,o){if(!r||r=="*")for(var u in e)u.charAt(0)=="$"&&t(n,u.substr(1),i,s,o);else{var a=0,f,l=e["$"+r],c=n=="*";if(!l)return;for(f=l.length;a<f;a++)if((c||l[a].matches(n,i,s))&&!o(l[a],l,a,r))return}},n=function(t,n,r){var i,s=e["$"+n];if(s)for(i=s.length;i--;)if(s[i].matches(t,r,null))return!0;return!1},r=function(e,n,r){var i=[];return t(e,n,r,null,function(e){return i.push(e)}),i},i=function(t){return(e["$"+t.type]||(e["$"+t.type]=[])).push(t),t},s=function(n){t(n.element,n.type,null,n.handler,function(t,n,r){return n.splice(r,1),n.length===0&&delete e["$"+t.type],!1})},o=function(){var t,n=[];for(t in e)t.charAt(0)=="$"&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:s,entries:o}}(),O,M=function(e){arguments.length?O=e:O=p[h]?function(e,t){return t[h](e)}:function(){throw new Error("Bean: No selector engine installed")}},_=v?function(e,t,n,r){e[r?o:a](t,n,!1)}:function(e,t,n,r,i){i&&r&&e["_on"+i]==null&&(e["_on"+i]=0),e[r?u:f]("on"+t,n)},D=function(e,t,r){var i=t.__beanDel,s=function(s){return s=C(s||((this[l]||this.document||this).parentWindow||n).event,!0),i&&(s.currentTarget=i.ft(s[c],e)),t.apply(e,[s].concat(r))};return s.__beanDel=i,s},P=function(e,t,r,i,s,o){var u=t.__beanDel,a=function(a){var f=u?u.ft(a[c],e):this,h=i?i.apply(f,arguments):v?!0:a&&a.propertyName=="_on"+r||!a;h&&(a&&(a=C(a||((this[l]||this.document||this).parentWindow||n).event,o),a.currentTarget=f),t.apply(e,a&&(!s||s.length===0)?arguments:g.call(arguments,a?0:1).concat(s)))};return a.__beanDel=u,a},H=function(e,t,n,r,i){return function(){e(t,n,i),r.apply(this,arguments)}},B=function(e,t,n,r){var i=t&&t.replace(s,""),o=A.get(e,i,n),u,a,f;for(u=0,a=o.length;u<a;u++)o[u].inNamespaces(r)&&((f=o[u])[m]&&_(f[c],f.eventType,f.handler,!1,f.type),A.del(f))},j=function(e,t){var n=function(t,n){var r,i=S(e)?O(e,n):e;for(;t&&t!==n;t=t.parentNode)for(r=i.length;r--;)if(i[r]===t)return t},r=function(e){var r=n(e[c],this);r&&t.apply(r,arguments)};return r.__beanDel={ft:n,selector:e},r},F=function(e,t,n){var r=B,o=S(t),u,a,f,l;if(o&&t.indexOf(" ")>0){t=E(t);for(l=t.length;l--;)F(e,t[l],n);return e}a=o&&t.replace(s,""),a&&N[a]&&(a=N[a].type);if(!t||o){if(f=o&&t.replace(i,""))f=E(f,".");r(e,a,n,f)}else if(typeof t=="function")r(e,null,t);else for(u in t)t.hasOwnProperty(u)&&F(e,u,t[u]);return e},I=function(e,t,n,r){var o,u,a,f,l,h;if(n===undefined&&typeof t=="object"){for(u in t)t.hasOwnProperty(u)&&I.call(this,e,u,t[u]);return}S(n)||x(n)?(o=r,l=g.call(arguments,4),r=j(n,o,O)):(l=g.call(arguments,3),r=o=n),a=E(t),this===y&&(r=H(F,e,t,r,o));for(f=a.length;f--;)h=A.put(new L(e,a[f].replace(s,""),r,o,E(a[f].replace(i,""),"."),l)),h[m]&&_(h[c],h.eventType,h.handler,!0,h.customType);return e},q=function(e,t,n,r){return I.apply(this,S(n)?[e,n,t,r].concat(arguments.length>3?g.call(arguments,5):[]):g.call(arguments))},R=function(){return q.apply(y,arguments)},U=v?function(e,t,r){var i=p.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,n,1),r.dispatchEvent(i)}:function(e,t,n){n=k(n,e),e?n.fireEvent("on"+t,p.createEventObject()):n["_on"+t]++},z=function(e,t,n){var r=E(t),o,u,a,f,l;for(o=r.length;o--;){t=r[o].replace(s,"");if(f=r[o].replace(i,""))f=E(f,".");if(!f&&!n&&e[m])U(T[t],t,e);else{l=A.get(e,t),n=[!1].concat(n);for(u=0,a=l.length;u<a;u++)l[u].inNamespaces(f)&&l[u].handler.apply(e,n)}}return e},W=function(e,t,n){var r=A.get(t,n),i,s,o,u;for(i=0,s=r.length;i<s;i++)r[i].original&&(u=r[i].handler.__beanDel,u?o=[e,u.selector,r[i].type,r[i].original]:o=[e,r[i].type,r[i].original],q.apply(null,o));return e},X={add:q,on:I,one:R,remove:F,clone:W,fire:z,setSelectorEngine:M,noConflict:function(){return t[e]=r,this}};if(n[u]){var V=function(){var e,t=A.entries();for(e in t)t[e].type&&t[e].type!=="unload"&&F(t[e].element,t[e].type);n[f]("onunload",V),n.CollectGarbage&&n.CollectGarbage()};n[u]("onunload",V)}return M(),X})

0 comments on commit 9150f8a

Please sign in to comment.
Something went wrong with that request. Please try again.