-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathjquery.hasEventListener-2.0.4.min.js
2 lines (2 loc) · 2.32 KB
/
jquery.hasEventListener-2.0.4.min.js
1
2
/*! v.2.0.4 - Aug. 20, 2012 - Copyright (c) 2012 Sebastien P. - https://github.com/sebastien-p/jquery.hasEventListener - MIT licensed */
;(function(e,t,n,r,i,s,o,u,a){"use strict";function f(e,t){var n=e&&typeof e===(t||"function");return!!(t?n&&o.trim(e):n)}function l(e){var t=(/Object|(Ele|Docu)ment|Window/.exec(Object.prototype.toString.call(e))||[""])[0].charAt(),n;return t==="O"?!e.jquery&&((n=e.nodeType)&&(e.documentElement||f(e.tagName,s)&&o(e).is(e.tagName))?n===1&&"E"||n===9&&"D":e.setInterval?"W":"O"):t}var c=o.fn,h=c.delegate?{delegate:u,namespace:"namespace"}:{namespace:"type",selector:i,type:"guid"};h.get_events_data=o.now&&!o.sub?function(e){var t=l(e),r=o[i](e,(t=t==="W"||t==="O")?"__"+n+"__":n);return r&&t?(r||{})[n]:r}:function(e){return o[i](e,n)},h[r]=!!c[r],c.has&&(h.selector="selector",h.type=r),o[t]=function(e,t){var n;return e&&l(e)&&(n=h.get_events_data(e))&&t!==a&&f(t,s)&&(n=n[t]),n},c[t]=function(e){var n={},r;this.each(function(){o.extend(u,n,o[t](this,e))});for(r in n)return n},o[e]=function(n,i,c){var p,d,v,m,g="push",y="replace",b,w,E,S,x=[],T,N=!u;if(n&&(S=l(n))){if(o.grep(arguments,function(e){return e!==a}).length>1){if(f(i,s)){if(!(i=/^(!(delegate|live) ?)?([a-z_]+)?(\.([^\s]+))?$/.exec(i)))return N;if(c!==a&&!f(c))return N;v=i[5],m=i[3];if(d=i[2]){if(!h[d]||S==="O"||d===r&&S==="W")return N;S==="E"&&(n.jquery||(n=o(n)))&&x[g](function(e){return n.is(e[h.selector])}),m&&x[g](function(e){return(e.preType||e[h.type][y](e[h.selector],"").split(".")[0][y](/^\d+/,""))===m}),v&&x[g](function(e){return(/\.(.+)$/.exec(e.origType||e[h.type])||[])[1]===v})}else v&&x[g](function(e){return e[h.namespace]===v})}else{if(!f(i))return N;c=i}E=function(e){return(""+e)[y](/\s+/g,"")},c&&(c=E(c))&&x[g](function(e){return f(e=e.handler||e)&&E(e)===c})}w=function(e){o.each(e,function(){if(!function(e,t){while((t-=1)>=0)if(!x[t](e))return u}(this,T))return!(N=u)})},d?(p=(S!=="D"&&S!=="W"?o(document).add(d!==r?((n=o(n)).is("html")?n:n.parents(":not(html)").andSelf()).add(window):a):o(n))[e](r)[t](r))&&(b=w):(p=o[t](n,m))&&m&&(b=w),p&&((T=x.length)?(b||function(e){o.each(e,function(){return w(this),!N})})(p):N=u)}return N},o.expr[":"][e]=function(t,n,r){return o[e](t,r[3])},c[e]=function(t,n){return this.filter(function(){return o[e](this,t,n)})}}("hasEventListener","getEventsData","events","live","data","string",jQuery,!0));