~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/event/event-synthetic-min.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
 
YUI.add("event-synthetic",function(H){var E=H.Env.evt,D=E.dom_wrappers,B=E.dom_map,G=E.plugins,A=H.Node.DOM_EVENTS,F=H.Lang.isFunction;H.CustomEvent.prototype.getSubscriber=function(N,J){var L=this.getSubs(),K,I,O,M;for(K=0,I=L.length;K<I;++K){for(O in L[K]){if(L[K].hasOwnProperty(O)){M=L[K][O];if((!N||M.fn===N)&&(!J||M.context===J)){return M;}}}}return null;};function C(I){this._init(I);}C.prototype={_init:function(I){this.type=I.type;this.impl=I;this._publishConfig=I.publishConfig||{emitFacade:true};},on:function(N,O,J){var M=H.Array(arguments,0,true),T=A[N],I,K,R,S,P,Q,L;if(H.Lang.isString(J)){M[2]=H.Selector.query(J);if(M[2].length){J=M[2];}else{L=H.onAvailable(J,function(){H.mix(L,H.on.apply(H,M),true);});}}if(H.Lang.isArray(J)){Q=[];H.Array.each(J,function(U){M[2]=U;Q.push(H.on.apply(H,M));});L=new H.EventHandle(Q);}if(!L){R=F(T.impl.processArgs)?T.impl.processArgs(M):T._processArgs(M);M.shift();K=M[1]=H.one(J);I=K._yuievt?K._yuievt.events[T.type]:null;if(!I){I=K.publish(T.type,T._publishConfig);I.detach=function(V,U){return T.detach.call(H,N,V,U);};P=H.stamp(J);S="event:"+H.stamp(J)+T.type;H.mix(I,{el:J,key:S,domkey:P,fn:function(){},capture:false});B[P]=B[P]||{};D[S]=B[P][S]=I;}if(!I.getSubscriber(O,J)){L=I.on.apply(I,M);L.sub._extra=R;L.detach=function(){T.detach.call(H,N,this.sub.fn,this.sub.context);};if(F(T.impl.on)){T.impl.on.call(T.impl,K,L.sub,I);}}}return L;},detach:function(O,N,M){var K=H.Array(arguments,0,true),I=A[O],J=1,P,L;if(M instanceof H.Node){M=M._node;}else{if(M instanceof H.NodeList){M=M._nodes;}else{if(H.Lang.isString(M)){M=H.Selector.query(M);}else{if(M&&!H.Array.test(M)&&!M.tagName){M=null;}}}}if(M){if(H.Array.test(M)){H.Array.each(M,function(R,Q){K[2]=R;J+=H.detach.apply(H,K);});return J;}M=H.one(M);P=(M._yuievt||{events:{}}).events[I.type];L=P?P.getSubscriber(N,M):null;if(L){if(!N){while(L){K[1]=L.fn;J+=H.detach.apply(H,K);L=P.getSubscriber(N,M);}return J;}if(F(I.impl.detach)){I.impl.detach.call(I.impl,M,L,P);}P._delete(L);J=1;}}return J;},_processArgs:function(I){return null;}};H.SyntheticEvent=C;H.Event.define=function(J,I){var K=H.Lang.isObject(J)?J:H.mix(H.Object(I||{}),{type:J});if(!A[K.type]){G[K.type]=A[K.type]=new H.SyntheticEvent(K);}};},"3.1.2",{requires:["node-base","event-custom"]});
 
 
b'\\ No newline at end of file'
 
8
YUI.add("event-synthetic",function(b){var h=b.Env.evt.dom_map,d=b.Array,g=b.Lang,j=g.isObject,c=g.isString,e=b.Selector.query,i=function(){};function f(l,k){this.handle=l;this.emitFacade=k;}f.prototype.fire=function(q){var k=d(arguments,0,true),o=this.handle,p=o.evt,m=o.sub,r=m.context,l=m.filter,n=q||{};if(this.emitFacade){if(!q||!q.preventDefault){n=p._getFacade();if(j(q)&&!q.preventDefault){b.mix(n,q,true);k[0]=n;}else{k.unshift(n);}}n.type=p.type;n.details=k.slice();if(l){n.container=p.host;}}else{if(l&&j(q)&&q.currentTarget){k.shift();}}m.context=r||n.currentTarget||p.host;p.fire.apply(p,k);m.context=r;};function a(){this._init.apply(this,arguments);}b.mix(a,{Notifier:f,getRegistry:function(q,p,n){var o=q._node,m=b.stamp(o),l="event:"+m+p+"_synth",k=h[m]||(h[m]={});if(!k[l]&&n){k[l]={type:"_synth",fn:i,capture:false,el:o,key:l,domkey:m,notifiers:[],detachAll:function(){var r=this.notifiers,s=r.length;while(--s>=0){r[s].detach();}}};}return(k[l])?k[l].notifiers:null;},_deleteSub:function(l){if(l&&l.fn){var k=this.eventDef,m=(l.filter)?"detachDelegate":"detach";this.subscribers={};this.subCount=0;k[m](l.node,l,this.notifier,l.filter);k._unregisterSub(l);delete l.fn;delete l.node;delete l.context;}},prototype:{constructor:a,_init:function(){var k=this.publishConfig||(this.publishConfig={});this.emitFacade=("emitFacade" in k)?k.emitFacade:true;k.emitFacade=false;},processArgs:i,on:i,detach:i,delegate:i,detachDelegate:i,_on:function(m,o){var n=[],k=m[2],q=o?"delegate":"on",l,p;l=(c(k))?e(k):d(k);if(!l.length&&c(k)){p=b.on("available",function(){b.mix(p,b[q].apply(b,m),true);},k);return p;}b.each(l,function(t){var u=m.slice(),r,s;t=b.one(t);if(t){r=this.processArgs(u,o);if(o){s=u.splice(3,1)[0];}u.splice(0,4,u[1],u[3]);if(!this.preventDups||!this.getSubs(t,m,null,true)){p=this._getNotifier(t,u,r,s);this[q](t,p.sub,p.notifier,s);n.push(p);}}},this);return(n.length===1)?n[0]:new b.EventHandle(n);},_getNotifier:function(n,q,o,m){var s=new b.CustomEvent(this.type,this.publishConfig),p=s.on.apply(s,q),r=new f(p,this.emitFacade),l=a.getRegistry(n,this.type,true),k=p.sub;p.notifier=r;k.node=n;k.filter=m;k._extra=o;b.mix(s,{eventDef:this,notifier:r,host:n,currentTarget:n,target:n,el:n._node,_delete:a._deleteSub},true);l.push(p);return p;},_unregisterSub:function(m){var k=a.getRegistry(m.node,this.type),l;if(k){for(l=k.length-1;l>=0;--l){if(k[l].sub===m){k.splice(l,1);break;}}}},_detach:function(m){var r=m[2],p=(c(r))?e(r):d(r),q,o,k,n,l;m.splice(2,1);for(o=0,k=p.length;o<k;++o){q=b.one(p[o]);if(q){n=this.getSubs(q,m);if(n){for(l=n.length-1;l>=0;--l){n[l].detach();}}}}},getSubs:function(l,q,k,n){var r=a.getRegistry(l,this.type),s=[],m,p,o;if(r){if(!k){k=this.subMatch;}for(m=0,p=r.length;m<p;++m){o=r[m];if(k.call(this,o.sub,q)){if(n){return o;}else{s.push(r[m]);}}}}return s.length&&s;},subMatch:function(l,k){return !k[1]||l.fn===k[1];}}},true);b.SyntheticEvent=a;b.Event.define=function(m,l,o){if(!l){l={};}var n=(j(m))?m:b.merge({type:m},l),p,k;if(o||!b.Node.DOM_EVENTS[n.type]){p=function(){a.apply(this,arguments);};b.extend(p,a,n);k=new p();m=k.type;b.Node.DOM_EVENTS[m]=b.Env.evt.plugins[m]={eventDef:k,on:function(){return k._on(d(arguments));},delegate:function(){return k._on(d(arguments),true);},detach:function(){return k._detach(d(arguments));}};}return k;};},"3.2.0",{requires:["node-base","event-custom"]});
 
 
b'\\ No newline at end of file'