diff --git a/build/gallery-dispatcher/gallery-dispatcher-min.js b/build/gallery-dispatcher/gallery-dispatcher-min.js index 879c2e6b5c..cdf8e43e11 100644 --- a/build/gallery-dispatcher/gallery-dispatcher-min.js +++ b/build/gallery-dispatcher/gallery-dispatcher-min.js @@ -1 +1 @@ -YUI.add("gallery-dispatcher",function(B){var P=B.UA,I=B.ClassNameManager.getClassName,K="dispatcher",E=".",V="script",Q="start",U="purge",Z="change",W="load",H="uri",F="content",G="autopurge",T="loading",D=[G,T,F,H],S=I(K),C=I(K,"loading"),A=E+S,J=B.Lang,M=J.isBoolean,O=J.isString,N=J.isObject,R=function(){R.superclass.constructor.apply(this,arguments);};function X(Y){var L=B.Node.create("
"),a={};L.setContent(Y);a.js=L.all(V).each(function(b){L.removeChild(b);});a.content=L.get("innerHTML");return a;}B.mix(R,{NAME:K,_hashtable:[],ATTRS:{autopurge:{value:true,writeOnce:true,validator:M},uri:{value:null,setter:function(L){this.stop();this._io=this._fetch(L);return L;},validator:function(L){return(L&&O(L)&&(L!==""));}},content:{value:"",setter:function(L){this.stop();this._dispatch(L);return L;},validator:O},loading:{value:false,validator:M,setter:function(L){if(L){this._node.addClass(C);}else{this._node.removeClass(C);}return L;}}}});B.extend(R,B.Base,{_history:[],_node:null,_queue:null,_io:null,initializer:function(L){var Y=this;L=L||{};this._queue=new B.AsyncQueue();if(!N(L)||!L.node||!(this._node=B.one(L.node))){return;}B.Array.each(D,function(a){if(L[a]){Y.set(a,L[a]);}});this.publish(Q);this.publish(U);this.publish(Z);this.publish(W);},destructor:function(){this.stop();this._node=null;this._queue=null;this._io=null;},stop:function(){this._queue.stop();if(this._io){this._io.abort();}return this;},_dispatch:function(L){var a=X(L),Y=this._queue,b=this._node;if(this.get("autopurge")){Y.add({fn:function(){b.get("children").each(function(d){d.purge(true);});}});}Y.add({fn:function(){b.setContent(a.content);}});a.js.each(function(c){if(c&&c.get("src")){Y.add({fn:function(){B.Get.script(c.get("src"),{onFailure:function(d){},onEnd:function(d){d.purge();Y.run();}});},autoContinue:false});}else{Y.add({fn:function(){var g=c.get("ownerDocument"),f=g.one("head")||g.get("documentElement"),e=B.Node.create("<"+V+">");f.replaceChild(c,f.appendChild(e));if(c._node.text){e._node.text=c._node.text;}c.remove();}});}});this._queue.run();},_fetch:function(Y,L){if(!Y){return false;}L=L||{method:"GET"};L.on={start:function(){},success:function(a,b){this.set(F,b.responseText);},failure:function(a,b){},end:function(){}};L.context=this;return B.io(Y,L);},_destroy:function(L,Y){}});B.Dispatcher=R;},"gallery-2010.03.23-17-54",{requires:["base-base","node-base","io-base","get","async-queue","classnamemanager"]}); \ No newline at end of file +YUI.add("gallery-dispatcher",function(A){var G=A.ClassNameManager.getClassName,I="dispatcher",R="script",T="fetch",Q="purge",C="beforeExecute",S="load",O="ready",F="uri",D="content",E="autopurge",N="loading",P="node",B=G(I,"loading"),H=A.Lang,J=H.isBoolean,K=H.isString,M=function(){M.superclass.constructor.apply(this,arguments);};function U(V){var L=A.Node.create("
"),W={};L.setContent(V);W.js=L.all(R).each(function(X){X.get("parentNode").removeChild(X);});W.content=L.get("innerHTML");return W;}A.mix(M,{EVENT_PREFIX:I,ATTRS:{node:{value:null,setter:function(L){this.stop();return A.one(L);}},autopurge:{value:true,validator:J},uri:{value:null,validator:function(L){return(L&&K(L)&&(L!==""));}},content:{value:"",validator:K},loading:{value:false,validator:J,readOnly:true,setter:function(L){if(L){this.fire(T);this.get(P).addClass(B);}else{this.fire(S);this.get(P).removeClass(B);}return L;}}}});A.extend(M,A.Base,{_queue:null,_io:null,initializer:function(L){L=L||{};this._queue=new A.AsyncQueue();this._initEvents();this.after(D+"Change",function(V){this._dispatch(V.newVal);},this);this.after(F+"Change",function(V){this._fetch(V.newVal);},this);if(L[D]){this._dispatch(this.get(D));}if(L[F]){this._fetch(this.get(F));}},destructor:function(){this.stop();this._queue=null;this._io=null;},stop:function(){this._queue.stop();if(this._io){this._io.abort();}return this;},_initEvents:function(){this.publish(T);this.publish(O);this.publish(Q);this.publish(C);this.publish(S);},_dispatch:function(V){var L=this,X=U(V),W=this._queue,Y=this.get(P);this.stop();if(!Y){return;}if(this.get(E)){W.add({fn:function(){Y.get("children").each(function(Z){Z.purge(true);});L.fire(Q,Y);}});}W.add({fn:function(){Y.setContent(X.content);L.fire(C,Y);}});X.js.each(function(Z){if(Z&&Z.get("src")){W.add({fn:function(){A.Get.script(Z.get("src"),{onFailure:function(a){},onEnd:function(a){a.purge();W.run();}});},autoContinue:false});}else{W.add({fn:function(){var c=Z.get("ownerDocument"),b=c.one("head")||c.get("documentElement"),a=A.Node.create("<"+R+">");b.replaceChild(Z,b.appendChild(a));if(Z._node.text){a._node.text=Z._node.text;}Z.remove();}});}});W.add({fn:function(){L.fire(O);}});this._queue.run();},_fetch:function(V,L){this.stop();if(!V){return false;}L=L||{method:"GET"};L.on={start:function(){this._set(N,true);},success:function(W,X){this.set(D,X.responseText);},failure:function(W,X){},end:function(){this._set(N,false);}};L.context=this;return(this._io=A.io(V,L));}});A.Dispatcher=M;},"gallery-2010.04.28-20-33",{requires:["base-base","node-base","io-base","get","async-queue","classnamemanager"]}); \ No newline at end of file