From d78bc687711bb343d2f34bfa53e89f04add6d4c7 Mon Sep 17 00:00:00 2001 From: YUI Builder Date: Tue, 30 Mar 2010 10:26:59 -0700 Subject: [PATCH] Gallery Build Tag: gallery-2010.03.30-17-26 --- build/gallery-effects/gallery-effects-min.js | 4 +- .../gallery-resource-debug.js | 2 +- .../gallery-resource/gallery-resource-min.js | 2 +- build/gallery-resource/gallery-resource.js | 2 +- build/gallery-yquery/gallery-yquery-debug.js | 120 ++++++++++++++++++ build/gallery-yquery/gallery-yquery-min.js | 1 + build/gallery-yquery/gallery-yquery.js | 120 ++++++++++++++++++ 7 files changed, 246 insertions(+), 5 deletions(-) create mode 100644 build/gallery-yquery/gallery-yquery-debug.js create mode 100644 build/gallery-yquery/gallery-yquery-min.js create mode 100644 build/gallery-yquery/gallery-yquery.js diff --git a/build/gallery-effects/gallery-effects-min.js b/build/gallery-effects/gallery-effects-min.js index a4952d1b3d..6364c9d62f 100644 --- a/build/gallery-effects/gallery-effects-min.js +++ b/build/gallery-effects/gallery-effects-min.js @@ -1,2 +1,2 @@ -YUI.add("gallery-effects",function(D){var I=D.Lang,N=D.DOM,K="global",G={};G.EffectQueues={instances:{},get:function(L){if(!I.isString(L)){return L;}if(!this.instances[L]){this.instances[L]=new D.AsyncQueue();}return this.instances[L];}};G.GlobalQueue=G.EffectQueues.get(K);D.mix(D.DOM,{show:function(L){D.DOM.setStyle(L,"display","");},hide:function(L){D.DOM.setStyle(L,"display","none");},displayed:function(L){return D.DOM.getStyle(L,"display")!=="none";},toggle:function(L){D.DOM[D.DOM.displayed(L)?"hide":"show"](L);},getPositionedOffset:function(O){var L=0,Q=0;do{L+=O.offsetTop||0;Q+=O.offsetLeft||0;O=O.offsetParent;if(O){if(O.tagName==="BODY"){break;}var P=N.getStyle(O,"position");if(P!=="static"){break;}}}while(O);return[Q,L];},positionAbsolutely:function(O){if(N.getStyle(O,"position")==="absolute"){return;}var L=N.getPositionedOffset(O);N.setStyles(O,{position:"absolute",top:L[1]+"px",left:L[0]+"px",width:O.clientWidth+"px",height:O.clientHeight+"px"});},getDimensions:function(O){var R;if(N.displayed(O)){R=N.region(O);return[R.width,R.height];}var P=N.getStyle(O,"visibility"),S=N.getStyle(O,"position"),L=N.getStyle(O,"display"),Q;N.setStyles(O,{visibility:"hidden",position:"absolute",display:"block"});R=N.region(O);Q=[R.width,R.height];N.setStyles(O,{visibility:P,position:S,display:L});return Q;},makePositioned:function(L){var O=N.getStyle(L,"position");if(O==="static"||!O){N.setStyle(L,"position","relative");}},undoPositioned:function(L){N.setStyles(L,{position:"",top:"",left:"",bottom:"",right:""});},_makeClipping:function(L){if(L._overflow){return L;}L._oveflow=N.getStyle(L,"overflow")||"auto";if(L._overflow!=="hidden"){N.setStyle(L,"overflow","hidden");}},_undoClipping:function(L){if(!L._overflow){return;}N.setStyle(L,"overflow",L._overflow==="auto"?"":L._overflow);L._overflow=undefined;}});D.Node.importMethod(D.DOM,["show","hide","displayed","toggle","getPositionedOffset","positionAbsolutely","getDimensions","makePositioned","undoPositioned","_makeClipping","_undoClipping"]);var M="beforeStart",B="beforeSetup",E="afterSetup",H="beforeFinish",A="afterFinish",F=[M,B,E,H,A];G.BaseEffect=function(L){G.BaseEffect.superclass.constructor.apply(this,arguments);};G.BaseEffect.NAME="baseEffect";G.BaseEffect.ATTRS={scope:{value:K,validator:I.isString},wait:{value:true,validator:I.isBoolean},managed:{value:false,validator:I.isBoolean},anim:{validator:function(L){return L instanceof D.Anim;}},node:{writeOnce:true,validator:function(L){return L instanceof D.Node;}},config:{validator:I.isObject}};D.extend(G.BaseEffect,D.Base,{initializer:function(L){this.set("config",L);this.set("node",D.one(L.node));D.Array.each(F,D.bind(function(O){this.publish(O);if(L[O]){this.on(O,L[O]);}},this));},setup:function(){},addToQueue:function(){if(!this.get("managed")){this.fire("beforeStart");var L=this._getQueue();L.add({fn:this.run,context:this,autoContinue:!this.get("wait")});if(!L.isRunning()){L.run();}}},run:function(){this.fire("beforeSetup");this.setup();this.fire("afterSetup");var L=this.get("anim");L.on("end",this.finish,this);L.run();},finish:function(){this.fire("beforeFinish");this._finish();if(!this.get("managed")&&!this._getQueue().isRunning()){this._getQueue().run();}this.fire("afterFinish");},_getQueue:function(){return G.EffectQueues.get(this.get("scope"));},_finish:function(){}});G.Parallel=function(L){G.Parallel.superclass.constructor.apply(this,arguments);};G.Parallel.NAME="parallel";G.Parallel.ATTRS={effects:{value:[],validator:I.isArray}};D.extend(G.Parallel,G.BaseEffect,{initializer:function(){this.addToQueue();},run:function(){var O=this.get("effects"),L=this.get("config");this.fire("beforeSetup");this.setup();this.fire("afterSetup");if(O.length){O[O.length-1].after("animChange",function(P){P.newVal.on("end",this.finish,this);},this);D.Array.each(O,function(P){P.set("config",D.merge(P.get("config"),L));P.fire("beforeStart");P.run();});}else{this.finish();}}});G.Opacity=function(L){G.Opacity.superclass.constructor.apply(this,arguments);};G.Opacity.NAME="opacity";D.extend(G.Opacity,G.BaseEffect,{_startOpacity:0,initializer:function(L){this._startOpacity=this.get("node").getStyle("opacity")||0;this.addToQueue();},setup:function(){var L=this.get("config");L.from={opacity:L.from!==undefined?L.from:this._startOpacity};L.to={opacity:L.to!==undefined?L.to:1};this.set("anim",new D.Anim(L));}});G.Move=function(L){G.Move.superclass.constructor.apply(this,arguments);};G.Move.NAME="move";D.extend(G.Move,G.BaseEffect,{initializer:function(){this.addToQueue();},setup:function(){var L=this.get("config"),P=this.get("node"),O=D.Node.getDOMNode(P);P.makePositioned();if(L.mode==="absolute"){L.to={xy:[L.x,L.y]};}else{L.to={left:((L.x||0)+parseFloat(O.style.left||"0"))+"px",top:((L.y||0)+parseFloat(O.style.top||"0"))+"px"};}this.set("anim",new D.Anim(L));}});G.Morph=function(L){G.Morph.superclass.constructor.apply(this,arguments);};G.Morph.NAME="morph";D.extend(G.Morph,G.BaseEffect,{initializer:function(){this.addToQueue();},setup:function(){this.set("anim",new D.Anim(this.get("config")));}});G.Scale=function(L){G.Scale.superclass.constructor.apply(this,arguments);};G.Scale.NAME="scale";G.Scale.ATTRS={scaleX:{value:true,validator:I.isBoolean},scaleY:{value:true,validator:I.isBoolean},scaleContent:{value:true,validator:I.isBoolean},scaleFromCenter:{value:false,validator:I.isBoolean},scaleMode:{value:"box",validator:function(L){return L==="box"||L==="contents"||I.isObject(L);}},scaleFrom:{value:100,validator:I.isNumber},scaleTo:{value:200,validator:I.isNumber,setter:function(L){return L;}},restoreAfterFinish:{value:false,validator:I.isBoolean}};D.extend(G.Scale,G.BaseEffect,{_originalStyle:{},initializer:function(L){this.addToQueue();},setup:function(){var k=this.get("config"),e=this.get("node"),j=this.get("scaleX"),i=this.get("scaleY"),d=this.get("scaleContent"),V=this.get("scaleFromCenter"),g=this.get("scaleMode"),m=this.get("scaleFrom"),T=this.get("scaleTo"),W=e.getStyle("position"),X=e.getPositionedOffset(),R=e.getStyle("fontSize")||"100%",b,c; -D.Array.each(["top","left","width","height","fontSize"],D.bind(function(n){this._originalStyle[n]=e.getStyle(n);},this));D.Array.each(["em","px","%","pt"],function(n){if(R.toString().indexOf(n)>0){R=parseFloat(R);b=n;}});if(g==="box"){c=[e.get("offsetHeight"),e.get("offsetWidth")];}else{if(/^content/.test(g)){c=[e.get("scrollHeight"),e.get("scrollWidth")];}else{c=[g.originalHeight,g.originalWidth];}}var Q={},f={},Z=T/100,O=m/100,a=c[1]*O,Y=c[0]*O,P=c[1]*Z,U=c[0]*Z;if(d&&R){f.fontSize=R*O+b;Q.fontSize=R*Z+b;}if(j){f.width=a+"px";Q.width=P+"px";}if(i){f.height=Y+"px";Q.height=U+"px";}if(V){var L=(Y-c[0])/2,h=(a-c[1])/2,l=(U-c[0])/2,S=(P-c[1])/2;if(W==="absolute"){if(i){f.top=(X[1]-L)+"px";Q.top=(X[1]-l)+"px";}if(j){f.left=(X[0]-h)+"px";Q.left=(X[0]-S)+"px";}}else{if(i){f.top=-L+"px";Q.top=-l+"px";}if(j){f.left=-h+"px";Q.left=-S+"px";}}}k.to=Q;k.from=f;this.set("anim",new D.Anim(k));},_finish:function(){if(this.get("restoreAfterFinish")){this.get("node").setStyles(this._originalStyle);}}});G.Highlight=function(L){if(!D.one(L.node).displayed()){return;}G.Highlight.superclass.constructor.apply(this,arguments);};G.Highlight.NAME="highlight";G.Highlight.ATTRS={startColor:{value:"#ff9",validator:I.isString},endColor:{value:"#fff",validator:I.isString},restoreColor:{value:"",validator:I.isString}};D.extend(G.Highlight,G.BaseEffect,{_previousBackgroundImage:"",initializer:function(){this.addToQueue();},setup:function(){var L=D.merge({iterations:1,direction:"alternate"},this.get("config")),O=this.get("node");L.from={backgroundColor:this.get("startColor")};L.to={backgroundColor:this.get("endColor")};if(!this.get("restoreColor")){this.set("restoreColor",O.getStyle("backgroundColor"));}this._previousBackgroundImage=O.getStyle("backgroundImage");O.setStyle("backgroundImage","none");this.set("anim",new D.Anim(L));},_finish:function(){this.get("node").setStyles({backgroundImage:this._previousBackgroundImage,backgroundColor:this.get("restoreColor")});}});G.Puff=function(L){var P=D.one(L.node),O={opacity:P.getStyle("opacity"),position:P.getStyle("position"),top:P.getStyle("top"),left:P.getStyle("left"),width:P.getStyle("width"),height:P.getStyle("height")};return new G.Parallel(D.merge({effects:[new G.Scale({node:P,managed:true,scaleTo:200,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new G.Opacity({node:P,managed:true,to:0})],duration:1,beforeSetup:function(){this.get("node").positionAbsolutely();},afterFinish:function(){this.get("node").hide().setStyles(O);}},L));};G.Appear=function(L){var O=D.one(L.node),P=!O.displayed()?0:O.getStyle("opacity")||0;return new G.Opacity(D.merge({from:P,to:1,beforeSetup:function(){this.get("node").setStyle("opacity",P).show();}},L));};G.Fade=function(O){var Q=D.one(O.node),P=Q.getStyle("opacity"),L=O.to||0;return new G.Opacity(D.merge({from:P||1,to:L,afterFinish:function(){if(L!==0){return;}this.get("node").hide().setStyle("opacity",P);}},O));};G.BlindUp=function(L){var O=D.one(L.node);O._makeClipping();return new G.Scale(D.merge({scaleTo:0,scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinish:function(){this.get("node").hide()._undoClipping();}},L));};G.BlindDown=function(O){var P=D.one(O.node),L=P.getDimensions();return new G.Scale(D.merge({scaleTo:100,scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:L[1],originalWidth:L[0]},restoreAfterFinish:true,afterSetup:function(){var Q=this.get("node");Q._makeClipping().setStyle("height","0px").show();},afterFinish:function(){this.get("node")._undoClipping();}},O));};D.Effects=G;var J={},C="opacity move scale morph highlight appear fade puff blindUp blindDown".split(" ");D.Array.each(C,function(L){J[L]=function(P,O){O=D.merge({node:D.get(P)},O||{});var Q=new D.Effects[L.charAt(0).toUpperCase()+L.substring(1)](O);};});D.Node.importMethod(J,C);},"gallery-2010.03.23-17-54",{requires:["node","anim","async-queue"]}); \ No newline at end of file +YUI.add("gallery-effects",function(B){var F=B.Lang,I=B.DOM,H="global",E={};E.EffectQueues={instances:{},get:function(K){if(!F.isString(K)){return K;}if(!this.instances[K]){this.instances[K]=new B.AsyncQueue();}return this.instances[K];}};E.GlobalQueue=E.EffectQueues.get(H);B.mix(B.DOM,{show:function(K){B.DOM.setStyle(K,"display","");},hide:function(K){B.DOM.setStyle(K,"display","none");},displayed:function(K){return B.DOM.getStyle(K,"display")!=="none";},toggle:function(K){B.DOM[B.DOM.displayed(K)?"hide":"show"](K);},getPositionedOffset:function(L){var K=0,N=0;do{K+=L.offsetTop||0;N+=L.offsetLeft||0;L=L.offsetParent;if(L){if(L.tagName==="BODY"){break;}var M=I.getStyle(L,"position");if(M!=="static"){break;}}}while(L);return[N,K];},positionAbsolutely:function(L){if(I.getStyle(L,"position")==="absolute"){return;}var K=I.getPositionedOffset(L);I.setStyles(L,{position:"absolute",top:K[1]+"px",left:K[0]+"px",width:L.clientWidth+"px",height:L.clientHeight+"px"});},getDimensions:function(L){var O;if(I.displayed(L)){O=I.region(L);return[O.width,O.height];}var M=I.getStyle(L,"visibility"),P=I.getStyle(L,"position"),K=I.getStyle(L,"display"),N;I.setStyles(L,{visibility:"hidden",position:"absolute",display:"block"});O=I.region(L);N=[O.width,O.height];I.setStyles(L,{visibility:M,position:P,display:K});return N;},makePositioned:function(K){var L=I.getStyle(K,"position");if(L==="static"||!L){I.setStyle(K,"position","relative");}},undoPositioned:function(K){I.setStyles(K,{position:"",top:"",left:"",bottom:"",right:""});},_makeClipping:function(K){if(K._overflow){return K;}K._overflow=I.getStyle(K,"overflow")||"auto";if(K._overflow!=="hidden"){I.setStyle(K,"overflow","hidden");}},_undoClipping:function(K){if(!K._overflow){return;}I.setStyle(K,"overflow",K._overflow==="auto"?"":K._overflow);K._overflow=undefined;}});B.Node.importMethod(B.DOM,["show","hide","displayed","toggle","getPositionedOffset","positionAbsolutely","getDimensions","makePositioned","undoPositioned","_makeClipping","_undoClipping"]);var C="queue",J="setup",D="finish";E.BaseEffect=function(K){E.BaseEffect.superclass.constructor.apply(this,arguments);};E.BaseEffect.NAME="baseEffect";E.BaseEffect.ATTRS={scope:{value:H,validator:F.isString},wait:{value:true,validator:F.isBoolean},managed:{value:false,validator:F.isBoolean},anim:{validator:function(K){return K instanceof B.Anim;}},node:{writeOnce:true,validator:function(K){return K instanceof B.Node;}},config:{validator:F.isObject}};B.extend(E.BaseEffect,B.Base,{initializer:function(K){this.set("config",K);this.set("node",B.one(K.node));this.publish(C,{defaultFn:this._queue});this.publish(J,{defaultFn:this.setup});this.publish(D,{defaultFn:this.finish});if(K.beforeStart){this.on(C,K.beforeStart);}if(K.beforeSetup){this.on(J,K.beforeSetup);}if(K.afterSetup){this.after(J,K.afterSetup);}if(K.beforeFinish){this.on(D,K.beforeFinish);}if(K.afterFinish){this.after(D,K.afterFinish);}},setup:function(){},addToQueue:function(){if(!this.get("managed")){this.fire(C);}},run:function(){this.fire(J);var K=this.get("anim");K.on("end",function(L){this.fire(D,{animEnd:L});},this);K.run();},finish:function(){this._finish();if(!this.get("managed")&&!this._getQueue().isRunning()){this._getQueue().run();}},_queue:function(){var K=this._getQueue();K.add({fn:this.run,context:this,autoContinue:!this.get("wait")});if(!K.isRunning()){K.run();}},_getQueue:function(){return E.EffectQueues.get(this.get("scope"));},_finish:function(){}});E.Parallel=function(K){E.Parallel.superclass.constructor.apply(this,arguments);};E.Parallel.NAME="parallel";E.Parallel.ATTRS={effects:{value:[],validator:F.isArray}};B.extend(E.Parallel,E.BaseEffect,{initializer:function(K){this.addToQueue();},run:function(){var L=this.get("effects"),K=this.get("config");this.fire(J);if(L.length){L[L.length-1].after("animChange",function(M){M.newVal.on("end",function(){this.fire(D,{animEnd:null});},this);},this);B.Array.each(L,function(M){M.set("config",B.merge(M.get("config"),K));M.run();});}else{this.fire(D,{animEnd:null});}}});E.Opacity=function(K){E.Opacity.superclass.constructor.apply(this,arguments);};E.Opacity.NAME="opacity";B.extend(E.Opacity,E.BaseEffect,{_startOpacity:0,initializer:function(K){this._startOpacity=this.get("node").getStyle("opacity")||0;this.addToQueue();},setup:function(){var K=this.get("config");K.from={opacity:K.from!==undefined?K.from:this._startOpacity};K.to={opacity:K.to!==undefined?K.to:1};this.set("anim",new B.Anim(K));}});E.Move=function(K){E.Move.superclass.constructor.apply(this,arguments);};E.Move.NAME="move";B.extend(E.Move,E.BaseEffect,{initializer:function(K){this.addToQueue();},setup:function(){var K=this.get("config"),M=this.get("node"),L=B.Node.getDOMNode(M);M.makePositioned();if(K.mode==="absolute"){K.to={xy:[K.x,K.y]};}else{K.to={left:((K.x||0)+parseFloat(L.style.left||"0"))+"px",top:((K.y||0)+parseFloat(L.style.top||"0"))+"px"};}this.set("anim",new B.Anim(K));}});E.Scroll=function(K){E.Scroll.superclass.constructor.apply(this,arguments);};E.Scroll.NAME="scroll";B.extend(E.Scroll,E.BaseEffect,{initializer:function(K){this.addToQueue();},setup:function(){var K=this.get("config");K.to={scroll:K.to};K.from={scroll:K.from};this.set("anim",new B.Anim(K));}});E.Morph=function(K){E.Morph.superclass.constructor.apply(this,arguments);};E.Morph.NAME="morph";B.extend(E.Morph,E.BaseEffect,{initializer:function(K){this.addToQueue();},setup:function(){this.set("anim",new B.Anim(this.get("config")));}});E.Scale=function(K){E.Scale.superclass.constructor.apply(this,arguments);};E.Scale.NAME="scale";E.Scale.ATTRS={scaleX:{value:true,validator:F.isBoolean},scaleY:{value:true,validator:F.isBoolean},scaleContent:{value:true,validator:F.isBoolean},scaleFromCenter:{value:false,validator:F.isBoolean},scaleMode:{value:"box",validator:function(K){return K==="box"||K==="contents"||F.isObject(K);}},scaleFrom:{value:100,validator:F.isNumber},scaleTo:{value:200,validator:F.isNumber,setter:function(K){return K;}},restoreAfterFinish:{value:false,validator:F.isBoolean}}; +B.extend(E.Scale,E.BaseEffect,{_originalStyle:{},initializer:function(K){this.addToQueue();},setup:function(){var h=this.get("config"),b=this.get("node"),g=this.get("scaleX"),f=this.get("scaleY"),a=this.get("scaleContent"),S=this.get("scaleFromCenter"),d=this.get("scaleMode"),j=this.get("scaleFrom"),Q=this.get("scaleTo"),T=b.getStyle("position"),U=b.getPositionedOffset(),O=b.getStyle("fontSize")||"100%",Y,Z;B.Array.each(["top","left","width","height","fontSize"],B.bind(function(l){this._originalStyle[l]=b.getStyle(l);},this));B.Array.each(["em","px","%","pt"],function(k){if(O.toString().indexOf(k)>0){O=parseFloat(O);Y=k;}});if(d==="box"){Z=[b.get("offsetHeight"),b.get("offsetWidth")];}else{if(/^content/.test(d)){Z=[b.get("scrollHeight"),b.get("scrollWidth")];}else{Z=[d.originalHeight,d.originalWidth];}}var N={},c={},W=Q/100,L=j/100,X=Z[1]*L,V=Z[0]*L,M=Z[1]*W,R=Z[0]*W;if(a&&O){c.fontSize=O*L+Y;N.fontSize=O*W+Y;}if(g){c.width=X+"px";N.width=M+"px";}if(f){c.height=V+"px";N.height=R+"px";}if(S){var K=(V-Z[0])/2,e=(X-Z[1])/2,i=(R-Z[0])/2,P=(M-Z[1])/2;if(T==="absolute"){if(f){c.top=(U[1]-K)+"px";N.top=(U[1]-i)+"px";}if(g){c.left=(U[0]-e)+"px";N.left=(U[0]-P)+"px";}}else{if(f){c.top=-K+"px";N.top=-i+"px";}if(g){c.left=-e+"px";N.left=-P+"px";}}}h.to=N;h.from=c;this.set("anim",new B.Anim(h));},_finish:function(){if(this.get("restoreAfterFinish")){this.get("node").setStyles(this._originalStyle);}}});E.Highlight=function(K){if(!B.one(K.node).displayed()){return;}E.Highlight.superclass.constructor.apply(this,arguments);};E.Highlight.NAME="highlight";E.Highlight.ATTRS={startColor:{value:"#ff9",validator:F.isString},endColor:{value:"#fff",validator:F.isString},restoreColor:{value:"",validator:F.isString}};B.extend(E.Highlight,E.BaseEffect,{_previousBackgroundImage:"",initializer:function(K){this.addToQueue();},setup:function(){var K=B.merge({iterations:1,direction:"alternate"},this.get("config")),L=this.get("node");K.from={backgroundColor:this.get("startColor")};K.to={backgroundColor:this.get("endColor")};if(!this.get("restoreColor")){this.set("restoreColor",L.getStyle("backgroundColor"));}this._previousBackgroundImage=L.getStyle("backgroundImage");L.setStyle("backgroundImage","none");this.set("anim",new B.Anim(K));},_finish:function(){this.get("node").setStyles({backgroundImage:this._previousBackgroundImage,backgroundColor:this.get("restoreColor")});}});E.Puff=function(K){var N=B.one(K.node),M={opacity:N.getStyle("opacity"),position:N.getStyle("position"),top:N.getStyle("top"),left:N.getStyle("left"),width:N.getStyle("width"),height:N.getStyle("height")},L=new E.Parallel(B.merge({effects:[new E.Scale({node:N,managed:true,scaleTo:200,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new E.Opacity({node:N,managed:true,to:0})],duration:1},K));L.on("setup",function(){this.get("node").positionAbsolutely();});L.after("finish",function(){this.get("node").hide().setStyles(M);});return L;};E.Appear=function(K){var M=B.one(K.node),N=!M.displayed()?0:M.getStyle("opacity")||0,L=new E.Opacity(B.merge({from:N,to:1},K));L.on("setup",function(){this.get("node").setStyle("opacity",N).show();});return L;};E.Fade=function(L){var O=B.one(L.node),M=O.getStyle("opacity"),K=L.to||0,N=new E.Opacity(B.merge({from:M||1,to:K},L));N.after("finish",function(){if(K!==0){return;}this.get("node").hide().setStyle("opacity",M);});return N;};E.BlindUp=function(K){var M=B.one(K.node);M._makeClipping();var L=new E.Scale(B.merge({scaleTo:0,scaleContent:false,scaleX:false,restoreAfterFinish:true},K));L.after("finish",function(){this.get("node").hide()._undoClipping();});return L;};E.BlindDown=function(L){var N=B.one(L.node),K=N.getDimensions(),M=new E.Scale(B.merge({scaleTo:100,scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:K[1],originalWidth:K[0]},restoreAfterFinish:true},L));M.after("setup",function(){var O=this.get("node");O._makeClipping().setStyle("height","0px").show();});M.after("finish",function(){this.get("node")._undoClipping();});return M;};B.Effects=E;var G={},A="opacity move scroll scale morph highlight appear fade puff blindUp blindDown".split(" ");B.Array.each(A,function(K){G[K]=function(M,L){L=B.merge({node:B.get(M)},L||{});var N=new B.Effects[K.charAt(0).toUpperCase()+K.substring(1)](L);};});B.Node.importMethod(G,A);},"gallery-2010.03.30-17-26",{requires:["node","anim","async-queue"]}); \ No newline at end of file diff --git a/build/gallery-resource/gallery-resource-debug.js b/build/gallery-resource/gallery-resource-debug.js index da2e0ff73f..318846b896 100644 --- a/build/gallery-resource/gallery-resource-debug.js +++ b/build/gallery-resource/gallery-resource-debug.js @@ -338,4 +338,4 @@ YUI.add('gallery-resource', function(Y) { Y.Resource = Resource; -}, 'gallery-2010.03.29-18-07' ,{requires:['base-base','io-base','json','substitute']}); +}, 'gallery-2010.03.30-17-26' ,{requires:['base-base', 'io-base', 'querystring-stringify-simple', 'substitute', 'json']}); diff --git a/build/gallery-resource/gallery-resource-min.js b/build/gallery-resource/gallery-resource-min.js index 73d96e70ca..9e485ce1a1 100644 --- a/build/gallery-resource/gallery-resource-min.js +++ b/build/gallery-resource/gallery-resource-min.js @@ -6,4 +6,4 @@ YUI.add("gallery-resource",function(Y){ * Copyright (c) 2009 Eric Ferraiuolo - http://eric.ferraiuolo.name * YUI BSD License - http://developer.yahoo.com/yui/license.html */ -var Resource,RESOURCE="resource",URI="uri",HEADERS="headers",TIMEOUT="timeout",ENTITY_TRANSLATORS="entityTranslators",E_REQUEST="request",E_RESPONSE="response",E_SUCCESS="success",E_FAILURE="failure",HEAD="HEAD",OPTIONS="OPTIONS",GET="GET",POST="POST",PUT="PUT",DELETE="DELETE",isString=Y.Lang.isString,isObject=Y.Lang.isObject,isNumber=Y.Lang.isNumber,isFunction=Y.Lang.isFunction;Resource=function(config){Resource.superclass.constructor.apply(this,arguments);};Y.mix(Resource,{NAME:RESOURCE,ATTRS:{uri:{validator:isString},headers:{validator:isObject},timeout:{validator:isNumber},entityTranslators:{validator:isObject}},ENTITY_TRANSLATORS:{JSON:{contentType:"application/json; charset=UTF-8",serialize:Y.JSON.stringify,deserialize:Y.JSON.parse},FORM:{contentType:"application/x-www-form-urlencoded; charset=UTF-8",serialize:Y.QueryString.stringify,deserialize:null}},NO_ENTITY_METHODS:[GET,HEAD,DELETE],isNoEntityMethod:function(method){return Y.Array.indexOf(Resource.NO_ENTITY_METHODS,method.toUpperCase())>=0;}});Y.extend(Resource,Y.Base,{_request:null,initializer:function(config){if(!this.get(URI)){Y.error("A Resource needs to be configured with: uri");}config=config||{};this.publish(E_REQUEST,{defaultFn:this._defRequestFn});this.publish(E_RESPONSE,{preventable:false});this.publish(E_SUCCESS,{preventable:false});this.publish(E_FAILURE,{preventable:false});Y.each(Resource.ENTITY_TRANSLATORS,Y.bind(this.registerEntityTranslator,this));Y.each(config[ENTITY_TRANSLATORS],Y.bind(this.registerEntityTranslator,this));},destructor:function(){this._request=null;},registerEntityTranslator:function(translator){var transObj={};if(translator&&translator.contentType){transObj[translator.contentType.split(";")[0]]=translator;this.set(ENTITY_TRANSLATORS,Y.merge(this.get(ENTITY_TRANSLATORS),transObj));}},unregisterEntityTranslator:function(contentType){var translators=this.get(ENTITY_TRANSLATORS);if(contentType){delete translators[contentType.split(";")[0]];this.set(ENTITY_TRANSLATORS,translators);}},getEntityTranslator:function(contentType){return(contentType?this.get(ENTITY_TRANSLATORS)[contentType.split(";")[0]]:null);},sendRequest:function(config){var uri=this.get(URI),defHeaders=this.get(HEADERS),defTimeout=this.get(TIMEOUT),method,headers,timeout,entity;config=config||{};method=config.method?config.method.toUpperCase():GET;headers=Y.merge(defHeaders,config.headers);timeout=config.timeout||defTimeout;if(Resource.isNoEntityMethod(method)){delete headers["Content-Type"];}else{entity=config.entity;}this._request=null;this.fire(E_REQUEST,{uri:uri,headers:headers,timeout:timeout,method:method,params:config.params,entity:entity,on:config.on});return this._request;},HEAD:function(config){return this.sendRequest(Y.merge(config,{method:HEAD}));},OPTIONS:function(config){return this.sendRequest(Y.merge(config,{method:OPTIONS}));},GET:function(config){return this.sendRequest(Y.merge(config,{method:GET}));},POST:function(config){return this.sendRequest(Y.merge(config,{method:POST}));},PUT:function(config){return this.sendRequest(Y.merge(config,{method:PUT}));},DELETE:function(config){return this.sendRequest(Y.merge(config,{method:DELETE}));},_defRequestFn:function(e){var methodRequest=e.method.toLowerCase()+"Request";this.publish(methodRequest,{defaultFn:this._sendRequest});this.fire(methodRequest,{uri:e.uri,headers:e.headers,timeout:e.timeout,method:e.method,params:e.params,entity:e.entity,on:e.on});},_sendRequest:function(e){var uri=e.uri,method=e.method,headers=e.headers,timeout=e.timeout,on=e.on,params,entity,translator;if(isObject(e.params)){params=Y.clone(e.params,true);uri=Y.substitute(uri,params,function(k,v){delete params[k];return v;});if(Y.Object.size(params)>0){uri+=uri.indexOf("?")<0?"?":"";uri+=uri[uri.length-1]!=="?"&&uri[uri.length-1]!=="&"?"&":"";uri+=Y.QueryString.stringify(params);}}entity=e.entity;translator=this.getEntityTranslator(headers["Content-Type"]);if(entity&&translator&&translator.serialize){try{entity=translator.serialize(entity);}catch(err){}}this._request=Y.io(uri,{method:method,headers:headers,data:entity,timeout:timeout,context:this,on:{complete:this._onComplete,success:this._onSuccess,failure:this._onFailure},"arguments":{request:{method:e.method,params:e.params,entity:e.entity},on:on}});},_onComplete:function(txId,r,args){var methodResponse=args.request.method.toLowerCase()+"Response",payLoad={txId:txId,request:args.request,response:r};this.fire(E_RESPONSE,payLoad);this.fire(methodResponse,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.response)){args.on.response(payLoad);}},_onSuccess:function(txId,r,args){var methodSuccess=args.request.method.toLowerCase()+"Success",entity=r.responseText,translator=this.getEntityTranslator(r.getResponseHeader("Content-Type")),payLoad;if(entity&&translator&&translator.deserialize){try{entity=translator.deserialize(entity);}catch(err){}}payLoad={txId:txId,request:args.request,response:r,entity:entity};this.fire(E_SUCCESS,payLoad);this.fire(methodSuccess,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.success)){args.on.success(payLoad);}},_onFailure:function(txId,r,args){var methodFailure=args.request.method.toLowerCase()+"Failure",payLoad={txId:txId,request:args.request,response:r};this.fire(E_FAILURE,payLoad);this.fire(methodFailure,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.failure)){args.on.failure(payLoad);}}});Y.Resource=Resource;},"gallery-2010.03.29-18-07",{requires:["base-base","io-base","json","substitute"]}); \ No newline at end of file +var Resource,RESOURCE="resource",URI="uri",HEADERS="headers",TIMEOUT="timeout",ENTITY_TRANSLATORS="entityTranslators",E_REQUEST="request",E_RESPONSE="response",E_SUCCESS="success",E_FAILURE="failure",HEAD="HEAD",OPTIONS="OPTIONS",GET="GET",POST="POST",PUT="PUT",DELETE="DELETE",isString=Y.Lang.isString,isObject=Y.Lang.isObject,isNumber=Y.Lang.isNumber,isFunction=Y.Lang.isFunction;Resource=function(config){Resource.superclass.constructor.apply(this,arguments);};Y.mix(Resource,{NAME:RESOURCE,ATTRS:{uri:{validator:isString},headers:{validator:isObject},timeout:{validator:isNumber},entityTranslators:{validator:isObject}},ENTITY_TRANSLATORS:{JSON:{contentType:"application/json; charset=UTF-8",serialize:Y.JSON.stringify,deserialize:Y.JSON.parse},FORM:{contentType:"application/x-www-form-urlencoded; charset=UTF-8",serialize:Y.QueryString.stringify,deserialize:null}},NO_ENTITY_METHODS:[GET,HEAD,DELETE],isNoEntityMethod:function(method){return Y.Array.indexOf(Resource.NO_ENTITY_METHODS,method.toUpperCase())>=0;}});Y.extend(Resource,Y.Base,{_request:null,initializer:function(config){if(!this.get(URI)){Y.error("A Resource needs to be configured with: uri");}config=config||{};this.publish(E_REQUEST,{defaultFn:this._defRequestFn});this.publish(E_RESPONSE,{preventable:false});this.publish(E_SUCCESS,{preventable:false});this.publish(E_FAILURE,{preventable:false});Y.each(Resource.ENTITY_TRANSLATORS,Y.bind(this.registerEntityTranslator,this));Y.each(config[ENTITY_TRANSLATORS],Y.bind(this.registerEntityTranslator,this));},destructor:function(){this._request=null;},registerEntityTranslator:function(translator){var transObj={};if(translator&&translator.contentType){transObj[translator.contentType.split(";")[0]]=translator;this.set(ENTITY_TRANSLATORS,Y.merge(this.get(ENTITY_TRANSLATORS),transObj));}},unregisterEntityTranslator:function(contentType){var translators=this.get(ENTITY_TRANSLATORS);if(contentType){delete translators[contentType.split(";")[0]];this.set(ENTITY_TRANSLATORS,translators);}},getEntityTranslator:function(contentType){return(contentType?this.get(ENTITY_TRANSLATORS)[contentType.split(";")[0]]:null);},sendRequest:function(config){var uri=this.get(URI),defHeaders=this.get(HEADERS),defTimeout=this.get(TIMEOUT),method,headers,timeout,entity;config=config||{};method=config.method?config.method.toUpperCase():GET;headers=Y.merge(defHeaders,config.headers);timeout=config.timeout||defTimeout;if(Resource.isNoEntityMethod(method)){delete headers["Content-Type"];}else{entity=config.entity;}this._request=null;this.fire(E_REQUEST,{uri:uri,headers:headers,timeout:timeout,method:method,params:config.params,entity:entity,on:config.on});return this._request;},HEAD:function(config){return this.sendRequest(Y.merge(config,{method:HEAD}));},OPTIONS:function(config){return this.sendRequest(Y.merge(config,{method:OPTIONS}));},GET:function(config){return this.sendRequest(Y.merge(config,{method:GET}));},POST:function(config){return this.sendRequest(Y.merge(config,{method:POST}));},PUT:function(config){return this.sendRequest(Y.merge(config,{method:PUT}));},DELETE:function(config){return this.sendRequest(Y.merge(config,{method:DELETE}));},_defRequestFn:function(e){var methodRequest=e.method.toLowerCase()+"Request";this.publish(methodRequest,{defaultFn:this._sendRequest});this.fire(methodRequest,{uri:e.uri,headers:e.headers,timeout:e.timeout,method:e.method,params:e.params,entity:e.entity,on:e.on});},_sendRequest:function(e){var uri=e.uri,method=e.method,headers=e.headers,timeout=e.timeout,on=e.on,params,entity,translator;if(isObject(e.params)){params=Y.clone(e.params,true);uri=Y.substitute(uri,params,function(k,v){delete params[k];return v;});if(Y.Object.size(params)>0){uri+=uri.indexOf("?")<0?"?":"";uri+=uri[uri.length-1]!=="?"&&uri[uri.length-1]!=="&"?"&":"";uri+=Y.QueryString.stringify(params);}}entity=e.entity;translator=this.getEntityTranslator(headers["Content-Type"]);if(entity&&translator&&translator.serialize){try{entity=translator.serialize(entity);}catch(err){}}this._request=Y.io(uri,{method:method,headers:headers,data:entity,timeout:timeout,context:this,on:{complete:this._onComplete,success:this._onSuccess,failure:this._onFailure},"arguments":{request:{method:e.method,params:e.params,entity:e.entity},on:on}});},_onComplete:function(txId,r,args){var methodResponse=args.request.method.toLowerCase()+"Response",payLoad={txId:txId,request:args.request,response:r};this.fire(E_RESPONSE,payLoad);this.fire(methodResponse,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.response)){args.on.response(payLoad);}},_onSuccess:function(txId,r,args){var methodSuccess=args.request.method.toLowerCase()+"Success",entity=r.responseText,translator=this.getEntityTranslator(r.getResponseHeader("Content-Type")),payLoad;if(entity&&translator&&translator.deserialize){try{entity=translator.deserialize(entity);}catch(err){}}payLoad={txId:txId,request:args.request,response:r,entity:entity};this.fire(E_SUCCESS,payLoad);this.fire(methodSuccess,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.success)){args.on.success(payLoad);}},_onFailure:function(txId,r,args){var methodFailure=args.request.method.toLowerCase()+"Failure",payLoad={txId:txId,request:args.request,response:r};this.fire(E_FAILURE,payLoad);this.fire(methodFailure,Y.merge(payLoad,{preventable:false}));if(args.on&&isFunction(args.on.failure)){args.on.failure(payLoad);}}});Y.Resource=Resource;},"gallery-2010.03.30-17-26",{requires:["base-base","io-base","querystring-stringify-simple","substitute","json"]}); \ No newline at end of file diff --git a/build/gallery-resource/gallery-resource.js b/build/gallery-resource/gallery-resource.js index da2e0ff73f..318846b896 100644 --- a/build/gallery-resource/gallery-resource.js +++ b/build/gallery-resource/gallery-resource.js @@ -338,4 +338,4 @@ YUI.add('gallery-resource', function(Y) { Y.Resource = Resource; -}, 'gallery-2010.03.29-18-07' ,{requires:['base-base','io-base','json','substitute']}); +}, 'gallery-2010.03.30-17-26' ,{requires:['base-base', 'io-base', 'querystring-stringify-simple', 'substitute', 'json']}); diff --git a/build/gallery-yquery/gallery-yquery-debug.js b/build/gallery-yquery/gallery-yquery-debug.js new file mode 100644 index 0000000000..a283e5a136 --- /dev/null +++ b/build/gallery-yquery/gallery-yquery-debug.js @@ -0,0 +1,120 @@ +YUI.add('gallery-yquery', function(Y) { + + + +/** +* YQuery is a widget for YUI3 that simplifies implementing both jQuery and jQuery plugins into your code +* +* +* +* +* Project Home - http://kickballcreative.com/yui/modules/yquery/ +* Copyright (c) 2010 Lauren Smith +* YUI BSD - http://developer.yahoo.com/yui/license.html +* +* +*/ + +var opts = {}, win = window, JQUERY_BASE = 'http://ajax.googleapis.com/ajax/libs/jquery/'; + +function YQuery( src ) { + + return { + + // Allows for override of the version to use + version : '1.4.2', + + // Allows for override of autodetection + autodetect : true, + + // Allows for override to use dev version + type : 'production', + + // Undocumented but allows for override of the setTimeout function; in milliseconds + timeout : 10000, + + // Undocumented but allows for overriding the callback if ever necessary + callback : null, + + use : function() { + + var queue = Array.prototype.slice.call( arguments, 0 ); + opts.timeout = this.timeout; + opts.scope = this; + + var type = ( this.type === 'production' ) ? '.min' : ''; + + if ( Y.Lang.isNull( this.callback ) ) { this.callback = queue.pop(); } + + if ( this.autodetect || Y.Lang.isObject( this.version ) ) { + + if ( Y.Lang.isArray( queue[0] ) ) { queue = queue[0]; } + + if ( typeof( jQuery ) === 'undefined' && this.autodetect && ! Y.Lang.isObject( this.version ) ) { + queue.unshift( JQUERY_BASE + this.version + '/jquery' + type +'.js' ); + } + + if ( Y.Lang.isObject( this.version ) ) { + + if ( typeof( jQuery) === 'undefined' && this.autodetect ) { + + for( var i = 0; i < this.version.length; i++ ) { + + var url = JQUERY_BASE + this.version[ i ].version + '/jquery' + type + '.js'; + + var c = ( queue.length <= 0 && i == ( this.version.length - 1 ) ) ? true : false; + + opts.data = { + space : this.version[ i ].namespace, + callback : c + }; + + opts.onSuccess = function( d ) { + if ( ! Y.Lang.isUndefined( d.data.space ) ) { win[d.data.space] = jQuery.noConflict( true ); } + if ( d.data.callback ) { this.scope._invokeReady(); } + }; + opts.onTimeout = function( d ) { + if ( ! Y.Lang.isUndefined( d.data.space ) ) { win[d.data.space] = jQuery.noConflict( true ); } + if ( d.data.callback ) { this.scope._invokeReady(); } + }; + + Y.Get.script( url, opts ); + + } + + } + + } + + if( queue.length > 0 ) { + + opts.onSuccess = function( d ) { this.scope._invokeReady(); }; + opts.onTimeout = function( d ) { this.scope._invokeReady(); }; + + Y.Get.script( queue, opts ); + + } + + } else { + + // This gets fired if jQuery autodetect has been overridden + this._invokeReady(); + + } + + }, + + _invokeReady : function() { + + Y.on( 'domready', function() { this.callback(); }, this ); + + } + + }; + +} + +Y.YQuery = YQuery; + + +}, 'gallery-2010.03.30-17-26' ,{requires:['get','event']}); diff --git a/build/gallery-yquery/gallery-yquery-min.js b/build/gallery-yquery/gallery-yquery-min.js new file mode 100644 index 0000000000..b3fc98e006 --- /dev/null +++ b/build/gallery-yquery/gallery-yquery-min.js @@ -0,0 +1 @@ +YUI.add("gallery-yquery",function(E){var B={},C=window,D="http://ajax.googleapis.com/ajax/libs/jquery/";function A(F){return{version:"1.4.2",autodetect:true,type:"production",timeout:10000,callback:null,use:function(){var G=Array.prototype.slice.call(arguments,0);B.timeout=this.timeout;B.scope=this;var J=(this.type==="production")?".min":"";if(E.Lang.isNull(this.callback)){this.callback=G.pop();}if(this.autodetect||E.Lang.isObject(this.version)){if(E.Lang.isArray(G[0])){G=G[0];}if(typeof(jQuery)==="undefined"&&this.autodetect&&!E.Lang.isObject(this.version)){G.unshift(D+this.version+"/jquery"+J+".js");}if(E.Lang.isObject(this.version)){if(typeof(jQuery)==="undefined"&&this.autodetect){for(var I=0;I0){B.onSuccess=function(L){this.scope._invokeReady();};B.onTimeout=function(L){this.scope._invokeReady();};E.Get.script(G,B);}}else{this._invokeReady();}},_invokeReady:function(){E.on("domready",function(){this.callback();},this);}};}E.YQuery=A;},"gallery-2010.03.30-17-26",{requires:["get","event"]}); \ No newline at end of file diff --git a/build/gallery-yquery/gallery-yquery.js b/build/gallery-yquery/gallery-yquery.js new file mode 100644 index 0000000000..a283e5a136 --- /dev/null +++ b/build/gallery-yquery/gallery-yquery.js @@ -0,0 +1,120 @@ +YUI.add('gallery-yquery', function(Y) { + + + +/** +* YQuery is a widget for YUI3 that simplifies implementing both jQuery and jQuery plugins into your code +* +* +* +* +* Project Home - http://kickballcreative.com/yui/modules/yquery/ +* Copyright (c) 2010 Lauren Smith +* YUI BSD - http://developer.yahoo.com/yui/license.html +* +* +*/ + +var opts = {}, win = window, JQUERY_BASE = 'http://ajax.googleapis.com/ajax/libs/jquery/'; + +function YQuery( src ) { + + return { + + // Allows for override of the version to use + version : '1.4.2', + + // Allows for override of autodetection + autodetect : true, + + // Allows for override to use dev version + type : 'production', + + // Undocumented but allows for override of the setTimeout function; in milliseconds + timeout : 10000, + + // Undocumented but allows for overriding the callback if ever necessary + callback : null, + + use : function() { + + var queue = Array.prototype.slice.call( arguments, 0 ); + opts.timeout = this.timeout; + opts.scope = this; + + var type = ( this.type === 'production' ) ? '.min' : ''; + + if ( Y.Lang.isNull( this.callback ) ) { this.callback = queue.pop(); } + + if ( this.autodetect || Y.Lang.isObject( this.version ) ) { + + if ( Y.Lang.isArray( queue[0] ) ) { queue = queue[0]; } + + if ( typeof( jQuery ) === 'undefined' && this.autodetect && ! Y.Lang.isObject( this.version ) ) { + queue.unshift( JQUERY_BASE + this.version + '/jquery' + type +'.js' ); + } + + if ( Y.Lang.isObject( this.version ) ) { + + if ( typeof( jQuery) === 'undefined' && this.autodetect ) { + + for( var i = 0; i < this.version.length; i++ ) { + + var url = JQUERY_BASE + this.version[ i ].version + '/jquery' + type + '.js'; + + var c = ( queue.length <= 0 && i == ( this.version.length - 1 ) ) ? true : false; + + opts.data = { + space : this.version[ i ].namespace, + callback : c + }; + + opts.onSuccess = function( d ) { + if ( ! Y.Lang.isUndefined( d.data.space ) ) { win[d.data.space] = jQuery.noConflict( true ); } + if ( d.data.callback ) { this.scope._invokeReady(); } + }; + opts.onTimeout = function( d ) { + if ( ! Y.Lang.isUndefined( d.data.space ) ) { win[d.data.space] = jQuery.noConflict( true ); } + if ( d.data.callback ) { this.scope._invokeReady(); } + }; + + Y.Get.script( url, opts ); + + } + + } + + } + + if( queue.length > 0 ) { + + opts.onSuccess = function( d ) { this.scope._invokeReady(); }; + opts.onTimeout = function( d ) { this.scope._invokeReady(); }; + + Y.Get.script( queue, opts ); + + } + + } else { + + // This gets fired if jQuery autodetect has been overridden + this._invokeReady(); + + } + + }, + + _invokeReady : function() { + + Y.on( 'domready', function() { this.callback(); }, this ); + + } + + }; + +} + +Y.YQuery = YQuery; + + +}, 'gallery-2010.03.30-17-26' ,{requires:['get','event']});