~bjornt/lazr-js/prefetch-yui-3.5

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-01-14 23:32:29 UTC
  • mfrom: (197.1.7 yui-3.3.0)
  • Revision ID: launchpad@pqm.canonical.com-20110114233229-r6i4cazdiiw18o7p
Upgrade to YUI 3.3.0 [r=mars]

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.2.0
6
 
build: 2676
 
5
version: 3.3.0
 
6
build: 3167
7
7
*/
8
 
YUI.add("event-valuechange",function(C){var B=C.Array,A={POLL_INTERVAL:50,TIMEOUT:10000,_history:{},_intervals:{},_notifiers:{},_timeouts:{},_poll:function(G,E,H){var D=G._node.value,I=A._history[E],F;if(D!==I){A._history[E]=D;F={_event:H,newVal:D,prevVal:I};B.each(A._notifiers[E],function(J){J.fire(F);});A._refreshTimeout(G,E);}},_refreshTimeout:function(E,D){A._stopTimeout(E,D);A._timeouts[D]=setTimeout(function(){A._stopPolling(E,D);},A.TIMEOUT);},_startPolling:function(E,D,G,F){if(!D){D=C.stamp(E);}if(!F&&A._intervals[D]){return;}A._stopPolling(E,D);A._intervals[D]=setInterval(function(){A._poll(E,D,G);},A.POLL_INTERVAL);A._refreshTimeout(E,D,G);},_stopPolling:function(E,D){if(!D){D=C.stamp(E);}A._intervals[D]=clearInterval(A._intervals[D]);A._stopTimeout(E,D);},_stopTimeout:function(E,D){if(!D){D=C.stamp(E);}A._timeouts[D]=clearTimeout(A._timeouts[D]);},_onBlur:function(D){A._stopPolling(D.currentTarget);},_onKeyDown:function(D){A._startPolling(D.currentTarget,null,D);},_onKeyUp:function(D){if(D.charCode===229||D.charCode===197){A._startPolling(D.currentTarget,null,D,true);}},_onMouseDown:function(D){A._startPolling(D.currentTarget,null,D);},_onSubscribe:function(H,G,F){var E=C.stamp(H),D=A._notifiers[E];A._history[E]=H.get("value");F._handles=H.on({blur:A._onBlur,keydown:A._onKeyDown,keyup:A._onKeyUp,mousedown:A._onMouseDown});if(!D){D=A._notifiers[E]=[];}D.push(F);},_onUnsubscribe:function(I,H,G){var F=C.stamp(I),D=A._notifiers[F],E=B.indexOf(D,G);G._handles.detach();if(E!==-1){D.splice(E,1);if(!D.length){A._stopPolling(I,F);delete A._notifiers[F];delete A._history[F];}}}};C.Event.define("valueChange",{detach:A._onUnsubscribe,on:A._onSubscribe,publishConfig:{emitFacade:true}});C.ValueChange=A;},"3.2.0",{requires:["event-focus","event-synthetic"]});
 
 
b'\\ No newline at end of file'
 
8
YUI.add("event-valuechange",function(D){var B=D.Array,C="value",A={POLL_INTERVAL:50,TIMEOUT:10000,_history:{},_intervals:{},_notifiers:{},_timeouts:{},_poll:function(I,F,J){var H=I._node,E=H&&H.value,K=A._history[F],G;if(!H){A._stopPolling(I,F);return;}if(E!==K){A._history[F]=E;G={_event:J,newVal:E,prevVal:K};B.each(A._notifiers[F],function(L){L.fire(G);});A._refreshTimeout(I,F);}},_refreshTimeout:function(F,E){A._stopTimeout(F,E);A._timeouts[E]=setTimeout(function(){A._stopPolling(F,E);},A.TIMEOUT);},_startPolling:function(F,E,H,G){if(!E){E=D.stamp(F);}if(!G&&A._intervals[E]){return;}A._stopPolling(F,E);A._intervals[E]=setInterval(function(){A._poll(F,E,H);},A.POLL_INTERVAL);A._refreshTimeout(F,E,H);},_stopPolling:function(F,E){if(!E){E=D.stamp(F);}A._intervals[E]=clearInterval(A._intervals[E]);A._stopTimeout(F,E);},_stopTimeout:function(F,E){if(!E){E=D.stamp(F);}A._timeouts[E]=clearTimeout(A._timeouts[E]);},_onBlur:function(E){A._stopPolling(E.currentTarget);},_onFocus:function(F){var E=F.currentTarget;A._history[D.stamp(E)]=E.get(C);A._startPolling(E,null,F);},_onKeyDown:function(E){A._startPolling(E.currentTarget,null,E);},_onKeyUp:function(E){if(E.charCode===229||E.charCode===197){A._startPolling(E.currentTarget,null,E,true);}},_onMouseDown:function(E){A._startPolling(E.currentTarget,null,E);},_onSubscribe:function(I,H,G){var F=D.stamp(I),E=A._notifiers[F];A._history[F]=I.get(C);G._handles=I.on({blur:A._onBlur,focus:A._onFocus,keydown:A._onKeyDown,keyup:A._onKeyUp,mousedown:A._onMouseDown});if(!E){E=A._notifiers[F]=[];}E.push(G);},_onUnsubscribe:function(J,I,H){var G=D.stamp(J),E=A._notifiers[G],F=B.indexOf(E,H);H._handles.detach();if(F!==-1){E.splice(F,1);if(!E.length){A._stopPolling(J,G);delete A._notifiers[G];delete A._history[G];}}}};D.Event.define("valueChange",{detach:A._onUnsubscribe,on:A._onSubscribe,publishConfig:{emitFacade:true}});D.ValueChange=A;},"3.3.0",{requires:["event-focus","event-synthetic"]});
 
 
b'\\ No newline at end of file'