| 11 | | eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","</2y>"]||!s.J("<7g")&&[1,"<52>","</52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","</1r>"]||!s.J("<2V")&&[2,"<1r><1z>","</1z></1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","</2V></1z></1r>"]||!s.J("<73")&&[2,"<1r><4W>","</4W></1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1o(/^\\s+|\\s+$/g,"")},2L:q(a){u r=[];7(1g a!="6I")E(u i=0,26=a.C;i<26;i++)r.R(a[i]);B r=a.51(0);v r},2w:q(b,a){E(u i=0,26=a.C;i<26;i++)7(a[i]==b)v i;v-1},1T:q(a,b){E(u i=0;b[i];i++)a.R(b[i]);v a},5g:q(a){u r=[],3P=6.1k++;E(u i=0,4G=a.C;i<4G;i++)7(3P!=a[i].1k){a[i].1k=3P;r.R(a[i])}v r},1k:0,2s:q(c,b,d){7(1g b=="1s")b=14 45("a","i","v "+b);u a=[];E(u i=0,30=c.C;i<30;i++)7(!d&&b(c[i],i)||d&&!b(c[i],i))a.R(c[i]);v a},3k:q(c,b){7(1g b=="1s")b=14 45("a","v "+b);u d=[];E(u i=0,30=c.C;i<30;i++){u a=b(c[i],i);7(a!==H&&a!=I){7(a.15!=2b)a=[a];d=d.6v(a)}}v d}});14 q(){u b=6u.6t.2H();6.M={4D:(b.3t(/.+(?:6s|6q|6o|6m)[\\/: ]([\\d.]+)/)||[])[1],20:/5l/.17(b),2a:/2a/.17(b),1h:/1h/.17(b)&&!/2a/.17(b),3j:/3j/.17(b)&&!/(6h|5l)/.17(b)};6.6g=!6.M.1h||P.6f=="6c";6.1U=6.M.1h?"1U":"5x",6.3H={"E":"68","67":"12","3x":6.1U,5x:6.1U,1U:6.1U,27:"27",12:"12",2v:"2v",2r:"2r",2B:"2B",65:"63",2T:"2T",62:"5Z"}};6.F({4v:"a.L",4p:"6.4p(a)",8o:"6.22(a,2,\'1X\')",8n:"6.22(a,2,\'4t\')",8k:"6.4q(a.L.1d,a)",8h:"6.4q(a.1d)"},q(i,n){6.11[i]=q(a){u b=6.3k(9,n);7(a&&1g a=="1s")b=6.2x(a,b);v 9.1Z(b)}});6.F({5o:"3e",8g:"5w",2K:"5t",8f:"5s"},q(i,n){6.11[i]=q(){u a=19;v 9.F(q(){E(u j=0,26=a.C;j<26;j++)6(a[j])[n](9)})}});6.F({5v:q(a){6.1b(9,a,"");9.8d(a)},8c:q(c){6.12.1A(9,c)},88:q(c){6.12.1E(9,c)},87:q(c){6.12[6.12.3w(9,c)?"1E":"1A"](9,c)},1E:q(a){7(!a||6.1i(a,[9]).r.C)9.L.3q(9)},2Y:q(){1v(9.1d)9.3q(9.1d)}},q(i,n){6.11[i]=q(){v 9.F(n,19)}});6.F(["5Q","5P","5O","5N"],q(i,n){6.11[n]=q(a,b){v 9.1i(":"+n+"("+a+")",b)}});6.F(["1u","29"],q(i,n){6.11[n]=q(h){v h==I?(9.C?6.1f(9[0],n):H):9.1f(n,h.15==33?h:h+"4o")}});6.1c({4n:{"":"m[2]==\'*\'||6.Q(a,m[2])","#":"a.35(\'2m\')==m[2]",":":{5P:"i<m[3]-0",5O:"i>m[3]-0",22:"m[3]-0==i",5Q:"m[3]-0==i",2Q:"i==0",2P:"i==r.C-1",5L:"i%2==0",5K:"i%2","2Q-3u":"a.L.3R(\'*\')[0]==a","2P-3u":"6.22(a.L.5J,1,\'4t\')==a","86-3u":"!6.22(a.L.5J,2,\'4t\')",4v:"a.1d",2Y:"!a.1d",5N:"(a.5H||a.85||\'\').J(m[3])>=0",4f:\'"1y"!=a.G&&6.1f(a,"U")!="1P"&&6.1f(a,"48")!="1y"\',1y:\'"1y"==a.G||6.1f(a,"U")=="1P"||6.1f(a,"48")=="1y"\',84:"!a.2r",2r:"a.2r",2B:"a.2B",2T:"a.2T||6.1b(a,\'2T\')",2A:"\'2A\'==a.G",4b:"\'4b\'==a.G",5F:"\'5F\'==a.G",4l:"\'4l\'==a.G",5E:"\'5E\'==a.G",4k:"\'4k\'==a.G",5D:"\'5D\'==a.G",5C:"\'5C\'==a.G",1J:\'"1J"==a.G||6.Q(a,"1J")\',5B:"/5B|2y|82|1J/i.17(a.Q)"},"[":"6.1L(m[2],a).C"},5A:[/^\\[ *(@)([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,14 3o("^([:.#]*)("+(6.2J=6.M.20&&6.M.4D<"3.0.0"?"\\\\w":"(?:[\\\\w\\7Z-\\7X*1I-]|\\\\\\\\.)")+"+)")],2x:q(a,c,b){u d,1K=[];1v(a&&a!=d){d=a;u f=6.1i(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1K=b?c=f.r:6.1T(1K,f.r)}v 1K},1L:q(t,l){7(1g t!="1s")v[t];7(l&&!l.1q)l=H;l=l||P;7(!t.J("//")){l=l.4h;t=t.2G(2,t.C)}B 7(!t.J("/")&&!l.2O){l=l.4h;t=t.2G(1,t.C);7(t.J("/")>=1)t=t.2G(t.J("/"),t.C)}u b=[l],2j=[],2P;1v(t&&2P!=t){u r=[];2P=t;t=6.2C(t).1o(/^\\/\\//,"");u k=N;u g=14 3o("^[/>]\\\\s*("+6.2J+"+)");u m=g.1V(t);7(m){u o=m[1].1D();E(u i=0;b[i];i++)E(u c=b[i].1d;c;c=c.1X)7(c.1q==1&&(o=="*"||c.Q.1D()==o.1D()))r.R(c);b=r;t=t.1o(g,"");7(t.J(" ")==0)7R;k=K}B{g=/^((\\/?\\.\\.)|([>\\/+~]))\\s*([a-z]*)/i;7((m=g.1V(t))!=H){r=[];u o=m[4],1k=6.1k++;m=m[1];E(u j=0,2e=b.C;j<2e;j++)7(m.J("..")<0){u n=m=="~"||m=="+"?b[j].1X:b[j].1d;E(;n;n=n.1X)7(n.1q==1){7(m=="~"&&n.1k==1k)1F;7(!o||n.Q.1D()==o.1D()){7(m=="~")n.1k=1k;r.R(n)}7(m=="+")1F}}B r.R(b[j].L);b=r;t=6.2C(t.1o(g,""));k=K}}7(t&&!k){7(!t.J(",")){7(l==b[0])b.4e();2j=6.1T(2j,b);r=b=[l];t=" "+t.2G(1,t.C)}B{u h=14 3o("^("+6.2J+"+)(#)("+6.2J+"+)");u m=h.1V(t);7(m){m=[0,m[2],m[3],m[1]]}B{h=14 3o("^([#.]?)("+6.2J+"*)");m=h.1V(t)}m[2]=m[2].1o(/\\\\/g,"");u f=b[b.C-1];7(m[1]=="#"&&f&&f.4d){u p=f.4d(m[2]);7((6.M.1h||6.M.2a)&&p&&1g p.2m=="1s"&&p.2m!=m[2])p=6(\'[@2m="\'+m[2]+\'"]\',f)[0];b=r=p&&(!m[3]||6.Q(p,m[3]))?[p]:[]}B{E(u i=0;b[i];i++){u a=m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&b[i].Q.2H()=="7P")a="2E";r=6.1T(r,b[i].3R(a))}7(m[1]==".")r=6.4c(r,m[2]);7(m[1]=="#"){u e=[];E(u i=0;r[i];i++)7(r[i].35("2m")==m[2]){e=[r[i]];1F}r=e}b=r}t=t.1o(h,"")}}7(t){u d=6.1i(t,r);b=r=d.r;t=6.2C(d.t)}}7(t)b=[];7(b&&l==b[0])b.4e();2j=6.1T(2j,b);v 2j},4c:q(r,m,a){m=" "+m+" ";u b=[];E(u i=0;r[i];i++){u c=(" "+r[i].12+" ").J(m)>=0;7(!a&&c||a&&!c)b.R(r[i])}v b},1i:q(t,r,h){u d;1v(t&&t!=d){d=t;u p=6.5A,m;E(u i=0;p[i];i++){m=p[i].1V(t);7(m){t=t.7N(m[0].C);m[2]=m[2].1o(/\\\\/g,"");1F}}7(!m)1F;7(m[1]==":"&&m[2]=="4Y")r=6.1i(m[3],r,K).r;B 7(m[1]==".")r=6.4c(r,m[2],h);B 7(m[1]=="@"){u g=[],G=m[3];E(u i=0,2e=r.C;i<2e;i++){u a=r[i],z=a[6.3H[m[2]]||m[2]];7(z==H||/4M|2u/.17(m[2]))z=6.1b(a,m[2])||\'\';7((G==""&&!!z||G=="="&&z==m[5]||G=="!="&&z!=m[5]||G=="^="&&z&&!z.J(m[5])||G=="$="&&z.2G(z.C-m[5].C)==m[5]||(G=="*="||G=="~=")&&z.J(m[5])>=0)^h)g.R(a)}r=g}B 7(m[1]==":"&&m[2]=="22-3u"){u e=6.1k++,g=[],17=/(\\d*)n\\+?(\\d*)/.1V(m[3]=="5L"&&"2n"||m[3]=="5K"&&"2n+1"||!/\\D/.17(m[3])&&"n+"+m[3]||m[3]),2Q=(17[1]||1)-0,d=17[2]-0;E(u i=0,2e=r.C;i<2e;i++){u j=r[i],L=j.L;7(e!=L.1k){u c=1;E(u n=L.1d;n;n=n.1X)7(n.1q==1)n.4a=c++;L.1k=e}u b=N;7(2Q==1){7(d==0||j.4a==d)b=K}B 7((j.4a+d)%2Q==0)b=K;7(b^h)g.R(j)}r=g}B{u f=6.4n[m[1]];7(1g f!="1s")f=6.4n[m[1]][m[2]];49("f = q(a,i){v "+f+"}");r=6.2s(r,f,h)}}v{r:r,t:t}},4p:q(c){u b=[];u a=c.L;1v(a&&a!=P){b.R(a);a=a.L}v b},22:q(a,e,c,b){e=e||1;u d=0;E(;a;a=a[c])7(a.1q==1&&++d==e)1F;v a},4q:q(n,a){u r=[];E(;n;n=n.1X){7(n.1q==1&&(!a||n!=a))r.R(n)}v r}});6.S={1A:q(d,e,c,b){7(6.M.1h&&d.3m!=I)d=18;7(!c.1Q)c.1Q=9.1Q++;7(b!=I){u f=c;c=q(){v f.O(9,19)};c.W=b;c.1Q=f.1Q}7(!d.$1a)d.$1a={};7(!d.$1p)d.$1p=q(){u a;7(1g 6=="I"||6.S.47)v a;a=6.S.1p.O(d,19);v a};u g=d.$1a[e];7(!g){g=d.$1a[e]={};7(d.46)d.46(e,d.$1p,N);B d.7M("5r"+e,d.$1p)}g[c.1Q]=c;7(!9.Y[e])9.Y[e]=[];7(6.2w(d,9.Y[e])==-1)9.Y[e].R(d)},1Q:1,Y:{},1E:q(b,c,a){u d=b.$1a,1Y,2p;7(d){7(c&&c.G){a=c.44;c=c.G}7(!c){E(c V d)9.1E(b,c)}B 7(d[c]){7(a)3l d[c][a.1Q];B E(a V b.$1a[c])3l d[c][a];E(1Y V d[c])1F;7(!1Y){7(b.43)b.43(c,b.$1p,N);B b.7J("5r"+c,b.$1p);1Y=H;3l d[c];1v(9.Y[c]&&((2p=6.2w(b,9.Y[c]))>=0))3l 9.Y[c][2p]}}E(1Y V d)1F;7(!1Y)b.$1p=b.$1a=H}},1t:q(c,b,d){b=6.2L(b||[]);7(!d)6.F(9.Y[c]||[],q(){6.S.1t(c,b,9)});B{u a,1Y,11=6.16(d[c]||H);b.5p(9.42({G:c,1O:d}));7(6.16(d.$1p)&&(a=d.$1p.O(d,b))!==N)9.47=K;7(11&&a!==N&&!6.Q(d,\'a\'))d[c]();9.47=N}},1p:q(b){u a;b=6.S.42(b||18.S||{});u c=9.$1a&&9.$1a[b.G],1S=[].51.3D(19,1);1S.5p(b);E(u j V c){1S[0].44=c[j];1S[0].W=c[j].W;7(c[j].O(9,1S)===N){b.2d();b.2D();a=N}}7(6.M.1h)b.1O=b.2d=b.2D=b.44=b.W=H;v a},42:q(c){u a=c;c=6.1c({},a);c.2d=q(){7(a.2d)v a.2d();a.7H=N};c.2D=q(){7(a.2D)v a.2D();a.7F=K};7(!c.1O&&c.5n)c.1O=c.5n;7(6.M.20&&c.1O.1q==3)c.1O=a.1O.L;7(!c.41&&c.4j)c.41=c.4j==c.1O?c.7C:c.4j;7(c.5k==H&&c.5j!=H){u e=P.4h,b=P.4y;c.5k=c.5j+(e&&e.5i||b.5i);c.7z=c.7y+(e&&e.5f||b.5f)}7(!c.3h&&(c.5e||c.5d))c.3h=c.5e||c.5d;7(!c.5c&&c.5b)c.5c=c.5b;7(!c.3h&&c.1J)c.3h=(c.1J&1?1:(c.1J&2?3:(c.1J&4?2:0)));v c}};6.11.1c({3g:q(c,a,b){v c=="3z"?9.3Z(c,a,b):9.F(q(){6.S.1A(9,c,b||a,b&&a)})},3Z:q(d,b,c){v 9.F(q(){6.S.1A(9,d,q(a){6(9).3U(a);v(c||b).O(9,19)},c&&b)})},3U:q(a,b){v 9.F(q(){6.S.1E(9,a,b)})},1t:q(a,b){v 9.F(q(){6.S.1t(a,b,9)})},1R:q(){u a=19;v 9.5a(q(e){9.4u=0==9.4u?1:0;e.2d();v a[9.4u].O(9,[e])||N})},7w:q(f,g){q 3W(e){u p=e.41;1v(p&&p!=9)2g{p=p.L}25(e){p=9};7(p==9)v N;v(e.G=="3V"?f:g).O(9,[e])}v 9.3V(3W).59(3W)},1G:q(f){7(6.3d)f.O(P,[6]);B 6.2q.R(q(){v f.O(9,[6])});v 9}});6.1c({3d:N,2q:[],1G:q(){7(!6.3d){6.3d=K;7(6.2q){6.F(6.2q,q(){9.O(P)});6.2q=H}7(6.M.3j||6.M.2a)P.43("58",6.1G,N);7(!18.7v.C)6(18).1W(q(){6("#3T").1E()})}}});14 q(){6.F(("7u,7t,1W,7s,7r,3z,5a,7q,"+"7p,7o,7n,3V,59,7m,2y,"+"4k,7l,7k,7j,2c").2R(","),q(i,o){6.11[o]=q(f){v f?9.3g(o,f):9.1t(o)}});7(6.M.3j||6.M.2a)P.46("58",6.1G,N);B 7(6.M.1h){P.7i("<7h"+"7f 2m=3T 7e=K "+"2u=//:><\\/3b>");u a=P.4d("3T");7(a)a.7d=q(){7(9.3a!="1n")v;6.1G()};a=H}B 7(6.M.20)6.3N=3m(q(){7(P.3a=="79"||P.3a=="1n"){3M(6.3N);6.3N=H;6.1G()}},10);6.S.1A(18,"1W",6.1G)};7(6.M.1h)6(18).3Z("3z",q(){u a=6.S.Y;E(u b V a){u c=a[b],i=c.C;7(i&&b!=\'3z\')77 c[i-1]&&6.S.1E(c[i-1],b);1v(--i)}});6.11.1c({76:q(c,b,a){9.1W(c,b,a,1)},1W:q(g,d,c,e){7(6.16(g))v 9.3g("1W",g);c=c||q(){};u f="3K";7(d)7(6.16(d)){c=d;d=H}B{d=6.2E(d);f="50"}u h=9;6.2Z({1C:g,G:f,W:d,2t:e,1n:q(a,b){7(b=="28"||!e&&b=="4V")h.1b("27",a.3c).3J().F(c,[a.3c,b,a]);B c.O(h,[a.3c,b,a])}});v 9},72:q(){v 6.2E(9)},3J:q(){v 9.1L("3b").F(q(){7(9.2u)6.4U(9.2u);B 6.3I(9.2A||9.5H||9.27||"")}).2U()}});6.F("4T,4I,4S,4R,4Q,4P".2R(","),q(i,o){6.11[o]=q(f){v 9.3g(o,f)}});6.1c({1M:q(e,c,a,d,b){7(6.16(c)){a=c;c=H}v 6.2Z({G:"3K",1C:e,W:c,28:a,3G:d,2t:b})},6X:q(d,b,a,c){v 6.1M(d,b,a,c,1)},4U:q(b,a){v 6.1M(b,H,a,"3b")},6V:q(c,b,a){v 6.1M(c,b,a,"4N")},6T:q(d,b,a,c){7(6.16(b)){a=b;b={}}v 6.2Z({G:"50",1C:d,W:b,28:a,3G:c})},6S:q(a){6.36.21=a},6Q:q(a){6.1c(6.36,a)},36:{Y:K,G:"3K",21:0,4O:"6P/x-6O-34-6N",4K:K,38:K,W:H},32:{},2Z:q(s){s=6.1c({},6.36,s);7(s.W){7(s.4K&&1g s.W!="1s")s.W=6.2E(s.W);7(s.G.2H()=="1M"){s.1C+=((s.1C.J("?")>-1)?"&":"?")+s.W;s.W=H}}7(s.Y&&!6.3L++)6.S.1t("4T");u f=N;u h=18.4Z?14 4Z("6L.6J"):14 4J();h.7b(s.G,s.1C,s.38);7(s.W)h.3Q("6H-6G",s.4O);7(s.2t)h.3Q("6F-3O-6D",6.32[s.1C]||"6C, 6B 6A 6z 4r:4r:4r 6y");h.3Q("X-6x-6w","4J");7(s.56)s.56(h);7(s.Y)6.S.1t("4P",[h,s]);u g=q(d){7(h&&(h.3a==4||d=="21")){f=K;7(i){3M(i);i=H}u c;2g{c=6.54(h)&&d!="21"?s.2t&&6.4F(h,s.1C)?"4V":"28":"2c";7(c!="2c"){u b;2g{b=h.3E("53-3O")}25(e){}7(s.2t&&b)6.32[s.1C]=b;u a=6.55(h,s.3G);7(s.28)s.28(a,c);7(s.Y)6.S.1t("4Q",[h,s])}B 6.2X(s,h,c)}25(e){c="2c";6.2X(s,h,c,e)}7(s.Y)6.S.1t("4S",[h,s]);7(s.Y&&!--6.3L)6.S.1t("4I");7(s.1n)s.1n(h,c);7(s.38)h=H}};u i=3m(g,13);7(s.21>0)4C(q(){7(h){h.6r();7(!f)g("21")}},s.21);2g{h.6p(s.W)}25(e){6.2X(s,h,H,e)}7(!s.38)g();v h},2X:q(s,a,b,e){7(s.2c)s.2c(a,b,e);7(s.Y)6.S.1t("4R",[a,s,e])},3L:0,54:q(r){2g{v!r.23&&7A.7B=="4l:"||(r.23>=5u&&r.23<6l)||r.23==5m||6.M.20&&r.23==I}25(e){}v N},4F:q(a,c){2g{u b=a.3E("53-3O");v a.23==5m||b==6.32[c]||6.M.20&&a.23==I}25(e){}v N},55:q(r,b){u c=r.3E("6k-G");u a=!b&&c&&c.J("4B")>=0;a=b=="4B"||a?r.6j:r.3c;7(b=="3b")6.3I(a);7(b=="4N")a=49("("+a+")");7(b=="3F")6("<1x>").3F(a).3J();v a},2E:q(a){u s=[];7(a.15==2b||a.3C)6.F(a,q(){s.R(2l(9.6i)+"="+2l(9.2v))});B E(u j V a)7(a[j]&&a[j].15==2b)6.F(a[j],q(){s.R(2l(j)+"="+2l(9))});B s.R(2l(j)+"="+2l(a[j]));v s.5M("&")},3I:q(a){7(18.4A)18.4A(a);B 7(6.M.20)18.4C(a,0);B 49.3D(18,a)}});6.11.1c({1m:q(b,a){v b?9.1w({1u:"1m",29:"1m",1e:"1m"},b,a):9.1i(":1y").F(q(){9.T.U=9.2i?9.2i:"";7(6.1f(9,"U")=="1P")9.T.U="2h"}).2U()},1j:q(b,a){v b?9.1w({1u:"1j",29:"1j",1e:"1j"},b,a):9.1i(":4f").F(q(){9.2i=9.2i||6.1f(9,"U");7(9.2i=="1P")9.2i="2h";9.T.U="1P"}).2U()},5G:6.11.1R,1R:q(a,b){v 6.16(a)&&6.16(b)?9.5G(a,b):a?9.1w({1u:"1R",29:"1R",1e:"1R"},a,b):9.F(q(){6(9)[6(9).37(":1y")?"1m":"1j"]()})},6e:q(b,a){v 9.1w({1u:"1m"},b,a)},6d:q(b,a){v 9.1w({1u:"1j"},b,a)},6b:q(b,a){v 9.1w({1u:"1R"},b,a)},6a:q(b,a){v 9.1w({1e:"1m"},b,a)},69:q(b,a){v 9.1w({1e:"1j"},b,a)},7U:q(c,a,b){v 9.1w({1e:a},c,b)},1w:q(d,h,f,g){v 9.1l(q(){u c=6(9).37(":1y"),1H=6.5z(h,f,g),5y=9;E(u p V d){7(d[p]=="1j"&&c||d[p]=="1m"&&!c)v 6.16(1H.1n)&&1H.1n.O(9);7(p=="1u"||p=="29"){1H.U=6.1f(9,"U");1H.2f=9.T.2f}}7(1H.2f!=H)9.T.2f="1y";9.2k=6.1c({},d);6.F(d,q(a,b){u e=14 6.2M(5y,1H,a);7(b.15==3y)e.2W(e.1K(),b);B e[b=="1R"?c?"1m":"1j":b](d)})})},1l:q(a,b){7(!b){b=a;a="2M"}v 9.F(q(){7(!9.1l)9.1l={};7(!9.1l[a])9.1l[a]=[];9.1l[a].R(b);7(9.1l[a].C==1)b.O(9)})}});6.1c({5z:q(b,a,c){u d=b&&b.15==64?b:{1n:c||!c&&a||6.16(b)&&b,1B:b,2I:c&&a||a&&a.15!=45&&a||(6.2I.4i?"4i":"4w")};d.1B=(d.1B&&d.1B.15==3y?d.1B:{61:60,89:5u}[d.1B])||8a;d.2N=d.1n;d.1n=q(){6.5I(9,"2M");7(6.16(d.2N))d.2N.O(9)};v d},2I:{4w:q(p,n,b,a){v b+a*p},4i:q(p,n,b,a){v((-5W.5X(p*5W.8e)/2)+0.5)*a+b}},1l:{},5I:q(b,a){a=a||"2M";7(b.1l&&b.1l[a]){b.1l[a].4e();u f=b.1l[a][0];7(f)f.O(b)}},3B:[],2M:q(f,e,g){u z=9;u y=f.T;z.a=q(){7(e.3A)e.3A.O(f,[z.2o]);7(g=="1e")6.1b(y,"1e",z.2o);B{y[g]=8m(z.2o)+"4o";y.U="2h"}};z.5V=q(){v 39(6.1f(f,g))};z.1K=q(){u r=39(6.2z(f,g));v r&&r>-8l?r:z.5V()};z.2W=q(c,b){z.4s=(14 5T()).5S();z.2o=c;z.a();6.3B.R(q(){v z.3A(c,b)});7(6.3B.C==1){u d=3m(q(){u a=6.3B;E(u i=0;i<a.C;i++)7(!a[i]())a.8j(i--,1);7(!a.C)3M(d)},13)}};z.1m=q(){7(!f.24)f.24={};f.24[g]=6.1b(f.T,g);e.1m=K;z.2W(0,9.1K());7(g!="1e")y[g]="8q";6(f).1m()};z.1j=q(){7(!f.24)f.24={};f.24[g]=6.1b(f.T,g);e.1j=K;z.2W(9.1K(),0)};z.3A=q(a,c){u t=(14 5T()).5S();7(t>e.1B+z.4s){z.2o=c;z.a();7(f.2k)f.2k[g]=K;u b=K;E(u i V f.2k)7(f.2k[i]!==K)b=N;7(b){7(e.U!=H){y.2f=e.2f;y.U=e.U;7(6.1f(f,"U")=="1P")y.U="2h"}7(e.1j)y.U="1P";7(e.1j||e.1m)E(u p V f.2k)6.1b(y,p,f.24[p])}7(b&&6.16(e.1n))e.1n.O(f);v N}B{u n=t-9.4s;u p=n/e.1B;z.2o=6.2I[e.2I](p,n,a,(c-a),e.1B);z.a()}v K}}})}',62,524,'||||||jQuery|if||this|||||||||||||||||function||||var|return||||||else|length||for|each|type|null|undefined|indexOf|true|parentNode|browser|false|apply|document|nodeName|push|event|style|display|in|data||global|||fn|className||new|constructor|isFunction|test|window|arguments|events|attr|extend|firstChild|opacity|css|typeof|msie|filter|hide|mergeNum|queue|show|complete|replace|handle|nodeType|table|string|trigger|height|while|animate|div|hidden|tbody|add|duration|url|toUpperCase|remove|break|ready|opt|_|button|cur|find|get|tb|target|none|guid|toggle|args|merge|styleFloat|exec|load|nextSibling|ret|pushStack|safari|timeout|nth|status|orig|catch|al|innerHTML|success|width|opera|Array|error|preventDefault|rl|overflow|try|block|oldblock|done|curAnim|encodeURIComponent|id||now|index|readyList|disabled|grep|ifModified|src|value|inArray|multiFilter|select|curCSS|text|checked|trim|stopPropagation|param|domManip|substr|toLowerCase|easing|chars|insertBefore|makeArray|fx|old|ownerDocument|last|first|split|childNodes|selected|end|tr|custom|handleError|empty|ajax|el|clean|lastModified|String|form|getAttribute|ajaxSettings|is|async|parseFloat|readyState|script|responseText|isReady|append|defaultView|bind|which|position|mozilla|map|delete|setInterval|static|RegExp|oWidth|removeChild|oHeight|cloneNode|match|child|toString|has|float|Number|unload|step|timers|jquery|call|getResponseHeader|html|dataType|props|globalEval|evalScripts|GET|active|clearInterval|safariTimer|Modified|num|setRequestHeader|getElementsByTagName|currentStyle|__ie_init|unbind|mouseover|handleHover|init|getComputedStyle|one|isXMLDoc|relatedTarget|fix|removeEventListener|handler|Function|addEventListener|triggered|visibility|eval|nodeIndex|radio|classFilter|getElementById|shift|visible|appendChild|documentElement|swing|fromElement|submit|file|swap|expr|px|parents|sibling|00|startTime|previousSibling|lastToggle|parent|linear|ol|body|tagName|execScript|xml|setTimeout|version|setArray|httpNotModified|fl|prop|ajaxStop|XMLHttpRequest|processData|alpha|href|json|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxComplete|ajaxStart|getScript|notmodified|colgroup|100|not|ActiveXObject|POST|slice|fieldset|Last|httpSuccess|httpData|beforeSend|getPropertyValue|DOMContentLoaded|mouseout|click|ctrlKey|metaKey|keyCode|charCode|scrollTop|unique|createElement|scrollLeft|clientX|pageX|webkit|304|srcElement|appendTo|unshift|prevObject|on|after|before|200|removeAttr|prepend|cssFloat|self|speed|parse|input|reset|image|password|checkbox|_toggle|textContent|dequeue|lastChild|odd|even|join|contains|gt|lt|eq|nodeValue|getTime|Date|zoom|max|Math|cos|font|maxLength|600|slow|maxlength|readOnly|Object|readonly|createTextNode|class|htmlFor|fadeOut|fadeIn|slideToggle|CSS1Compat|slideUp|slideDown|compatMode|boxModel|compatible|name|responseXML|content|300|ie|noConflict|ra|send|it|abort|rv|userAgent|navigator|concat|With|Requested|GMT|1970|Jan|01|Thu|Since|reverse|If|Type|Content|array|XMLHTTP|ig|Microsoft|NaN|urlencoded|www|application|ajaxSetup|val|ajaxTimeout|post|setAttribute|getJSON|getAttributeNode|getIfModified|method|FORM|action|options|serialize|col|th|td|loadIfModified|do|colg|loaded|tfoot|open|thead|onreadystatechange|defer|ipt|leg|scr|write|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|dblclick|scroll|resize|focus|blur|frames|hover|clone|clientY|pageY|location|protocol|toElement|clientWidth|clientHeight|cancelBubble|relative|returnValue|left|detachEvent|right|absolute|attachEvent|substring|offsetWidth|object|offsetHeight|continue|Width|border|fadeTo|padding|size|uFFFF|Left|u0128|Right|Bottom|textarea|Top|enabled|innerText|only|toggleClass|removeClass|fast|400|wrap|addClass|removeAttribute|PI|insertAfter|prependTo|children|line|splice|siblings|10000|parseInt|prev|next|weight|1px|prototype'.split('|'),0,{})) |
|---|
| | 13 | |
|---|
| | 14 | // Global undefined variable |
|---|
| | 15 | window.undefined = window.undefined; |
|---|
| | 16 | var jQuery = function(a,c) { |
|---|
| | 17 | // If the context is global, return a new object |
|---|
| | 18 | if ( window == this || !this.init ) |
|---|
| | 19 | return new jQuery(a,c); |
|---|
| | 20 | |
|---|
| | 21 | return this.init(a,c); |
|---|
| | 22 | }; |
|---|
| | 23 | |
|---|
| | 24 | // Map over the $ in case of overwrite |
|---|
| | 25 | if ( typeof $ != "undefined" ) |
|---|
| | 26 | jQuery._$ = $; |
|---|
| | 27 | |
|---|
| | 28 | // Map the jQuery namespace to the '$' one |
|---|
| | 29 | var $ = jQuery; |
|---|
| | 30 | |
|---|
| | 31 | jQuery.fn = jQuery.prototype = { |
|---|
| | 32 | init: function(a,c) { |
|---|
| | 33 | // Make sure that a selection was provided |
|---|
| | 34 | a = a || document; |
|---|
| | 35 | |
|---|
| | 36 | // HANDLE: $(function) |
|---|
| | 37 | // Shortcut for document ready |
|---|
| | 38 | if ( jQuery.isFunction(a) ) |
|---|
| | 39 | return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a ); |
|---|
| | 40 | |
|---|
| | 41 | // Handle HTML strings |
|---|
| | 42 | if ( typeof a == "string" ) { |
|---|
| | 43 | // HANDLE: $(html) -> $(array) |
|---|
| | 44 | var m = /^[^<]*(<(.|\s)+>)[^>]*$/.exec(a); |
|---|
| | 45 | if ( m ) |
|---|
| | 46 | a = jQuery.clean( [ m[1] ] ); |
|---|
| | 47 | |
|---|
| | 48 | // HANDLE: $(expr) |
|---|
| | 49 | else |
|---|
| | 50 | return new jQuery( c ).find( a ); |
|---|
| | 51 | } |
|---|
| | 52 | |
|---|
| | 53 | return this.setArray( |
|---|
| | 54 | // HANDLE: $(array) |
|---|
| | 55 | a.constructor == Array && a || |
|---|
| | 56 | |
|---|
| | 57 | // HANDLE: $(arraylike) |
|---|
| | 58 | // Watch for when an array-like object is passed as the selector |
|---|
| | 59 | (a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) || |
|---|
| | 60 | |
|---|
| | 61 | // HANDLE: $(*) |
|---|
| | 62 | [ a ] ); |
|---|
| | 63 | }, |
|---|
| | 64 | jquery: "1.1.3.1", |
|---|
| | 65 | |
|---|
| | 66 | size: function() { |
|---|
| | 67 | return this.length; |
|---|
| | 68 | }, |
|---|
| | 69 | |
|---|
| | 70 | length: 0, |
|---|
| | 71 | |
|---|
| | 72 | get: function( num ) { |
|---|
| | 73 | return num == undefined ? |
|---|
| | 74 | |
|---|
| | 75 | // Return a 'clean' array |
|---|
| | 76 | jQuery.makeArray( this ) : |
|---|
| | 77 | |
|---|
| | 78 | // Return just the object |
|---|
| | 79 | this[num]; |
|---|
| | 80 | }, |
|---|
| | 81 | pushStack: function( a ) { |
|---|
| | 82 | var ret = jQuery(a); |
|---|
| | 83 | ret.prevObject = this; |
|---|
| | 84 | return ret; |
|---|
| | 85 | }, |
|---|
| | 86 | setArray: function( a ) { |
|---|
| | 87 | this.length = 0; |
|---|
| | 88 | [].push.apply( this, a ); |
|---|
| | 89 | return this; |
|---|
| | 90 | }, |
|---|
| | 91 | each: function( fn, args ) { |
|---|
| | 92 | return jQuery.each( this, fn, args ); |
|---|
| | 93 | }, |
|---|
| | 94 | index: function( obj ) { |
|---|
| | 95 | var pos = -1; |
|---|
| | 96 | this.each(function(i){ |
|---|
| | 97 | if ( this == obj ) pos = i; |
|---|
| | 98 | }); |
|---|
| | 99 | return pos; |
|---|
| | 100 | }, |
|---|
| | 101 | |
|---|
| | 102 | attr: function( key, value, type ) { |
|---|
| | 103 | var obj = key; |
|---|
| | 104 | |
|---|
| | 105 | // Look for the case where we're accessing a style value |
|---|
| | 106 | if ( key.constructor == String ) |
|---|
| | 107 | if ( value == undefined ) |
|---|
| | 108 | return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined; |
|---|
| | 109 | else { |
|---|
| | 110 | obj = {}; |
|---|
| | 111 | obj[ key ] = value; |
|---|
| | 112 | } |
|---|
| | 113 | |
|---|
| | 114 | // Check to see if we're setting style values |
|---|
| | 115 | return this.each(function(index){ |
|---|
| | 116 | // Set all the styles |
|---|
| | 117 | for ( var prop in obj ) |
|---|
| | 118 | jQuery.attr( |
|---|
| | 119 | type ? this.style : this, |
|---|
| | 120 | prop, jQuery.prop(this, obj[prop], type, index, prop) |
|---|
| | 121 | ); |
|---|
| | 122 | }); |
|---|
| | 123 | }, |
|---|
| | 124 | |
|---|
| | 125 | css: function( key, value ) { |
|---|
| | 126 | return this.attr( key, value, "curCSS" ); |
|---|
| | 127 | }, |
|---|
| | 128 | |
|---|
| | 129 | text: function(e) { |
|---|
| | 130 | if ( typeof e == "string" ) |
|---|
| | 131 | return this.empty().append( document.createTextNode( e ) ); |
|---|
| | 132 | |
|---|
| | 133 | var t = ""; |
|---|
| | 134 | jQuery.each( e || this, function(){ |
|---|
| | 135 | jQuery.each( this.childNodes, function(){ |
|---|
| | 136 | if ( this.nodeType != 8 ) |
|---|
| | 137 | t += this.nodeType != 1 ? |
|---|
| | 138 | this.nodeValue : jQuery.fn.text([ this ]); |
|---|
| | 139 | }); |
|---|
| | 140 | }); |
|---|
| | 141 | return t; |
|---|
| | 142 | }, |
|---|
| | 143 | |
|---|
| | 144 | wrap: function() { |
|---|
| | 145 | // The elements to wrap the target around |
|---|
| | 146 | var a, args = arguments; |
|---|
| | 147 | |
|---|
| | 148 | // Wrap each of the matched elements individually |
|---|
| | 149 | return this.each(function(){ |
|---|
| | 150 | if ( !a ) |
|---|
| | 151 | a = jQuery.clean(args, this.ownerDocument); |
|---|
| | 152 | |
|---|
| | 153 | // Clone the structure that we're using to wrap |
|---|
| | 154 | var b = a[0].cloneNode(true); |
|---|
| | 155 | |
|---|
| | 156 | // Insert it before the element to be wrapped |
|---|
| | 157 | this.parentNode.insertBefore( b, this ); |
|---|
| | 158 | |
|---|
| | 159 | // Find the deepest point in the wrap structure |
|---|
| | 160 | while ( b.firstChild ) |
|---|
| | 161 | b = b.firstChild; |
|---|
| | 162 | |
|---|
| | 163 | // Move the matched element to within the wrap structure |
|---|
| | 164 | b.appendChild( this ); |
|---|
| | 165 | }); |
|---|
| | 166 | }, |
|---|
| | 167 | append: function() { |
|---|
| | 168 | return this.domManip(arguments, true, 1, function(a){ |
|---|
| | 169 | this.appendChild( a ); |
|---|
| | 170 | }); |
|---|
| | 171 | }, |
|---|
| | 172 | prepend: function() { |
|---|
| | 173 | return this.domManip(arguments, true, -1, function(a){ |
|---|
| | 174 | this.insertBefore( a, this.firstChild ); |
|---|
| | 175 | }); |
|---|
| | 176 | }, |
|---|
| | 177 | before: function() { |
|---|
| | 178 | return this.domManip(arguments, false, 1, function(a){ |
|---|
| | 179 | this.parentNode.insertBefore( a, this ); |
|---|
| | 180 | }); |
|---|
| | 181 | }, |
|---|
| | 182 | after: function() { |
|---|
| | 183 | return this.domManip(arguments, false, -1, function(a){ |
|---|
| | 184 | this.parentNode.insertBefore( a, this.nextSibling ); |
|---|
| | 185 | }); |
|---|
| | 186 | }, |
|---|
| | 187 | end: function() { |
|---|
| | 188 | return this.prevObject || jQuery([]); |
|---|
| | 189 | }, |
|---|
| | 190 | find: function(t) { |
|---|
| | 191 | var data = jQuery.map(this, function(a){ return jQuery.find(t,a); }); |
|---|
| | 192 | return this.pushStack( /[^+>] [^+>]/.test( t ) || t.indexOf("..") > -1 ? |
|---|
| | 193 | jQuery.unique( data ) : data ); |
|---|
| | 194 | }, |
|---|
| | 195 | clone: function(deep) { |
|---|
| | 196 | // Need to remove events on the element and its descendants |
|---|
| | 197 | var $this = this.add(this.find("*")); |
|---|
| | 198 | $this.each(function() { |
|---|
| | 199 | this._$events = {}; |
|---|
| | 200 | for (var type in this.$events) |
|---|
| | 201 | this._$events[type] = jQuery.extend({},this.$events[type]); |
|---|
| | 202 | }).unbind(); |
|---|
| | 203 | |
|---|
| | 204 | // Do the clone |
|---|
| | 205 | var r = this.pushStack( jQuery.map( this, function(a){ |
|---|
| | 206 | return a.cloneNode( deep != undefined ? deep : true ); |
|---|
| | 207 | }) ); |
|---|
| | 208 | |
|---|
| | 209 | // Add the events back to the original and its descendants |
|---|
| | 210 | $this.each(function() { |
|---|
| | 211 | var events = this._$events; |
|---|
| | 212 | for (var type in events) |
|---|
| | 213 | for (var handler in events[type]) |
|---|
| | 214 | jQuery.event.add(this, type, events[type][handler], events[type][handler].data); |
|---|
| | 215 | this._$events = null; |
|---|
| | 216 | }); |
|---|
| | 217 | |
|---|
| | 218 | // Return the cloned set |
|---|
| | 219 | return r; |
|---|
| | 220 | }, |
|---|
| | 221 | |
|---|
| | 222 | filter: function(t) { |
|---|
| | 223 | return this.pushStack( |
|---|
| | 224 | jQuery.isFunction( t ) && |
|---|
| | 225 | jQuery.grep(this, function(el, index){ |
|---|
| | 226 | return t.apply(el, [index]) |
|---|
| | 227 | }) || |
|---|
| | 228 | |
|---|
| | 229 | jQuery.multiFilter(t,this) ); |
|---|
| | 230 | }, |
|---|
| | 231 | |
|---|
| | 232 | not: function(t) { |
|---|
| | 233 | return this.pushStack( |
|---|
| | 234 | t.constructor == String && |
|---|
| | 235 | jQuery.multiFilter(t, this, true) || |
|---|
| | 236 | |
|---|
| | 237 | jQuery.grep(this, function(a) { |
|---|
| | 238 | return ( t.constructor == Array || t.jquery ) |
|---|
| | 239 | ? jQuery.inArray( a, t ) < 0 |
|---|
| | 240 | : a != t; |
|---|
| | 241 | }) |
|---|
| | 242 | ); |
|---|
| | 243 | }, |
|---|
| | 244 | |
|---|
| | 245 | add: function(t) { |
|---|
| | 246 | return this.pushStack( jQuery.merge( |
|---|
| | 247 | this.get(), |
|---|
| | 248 | t.constructor == String ? |
|---|
| | 249 | jQuery(t).get() : |
|---|
| | 250 | t.length != undefined && (!t.nodeName || t.nodeName == "FORM") ? |
|---|
| | 251 | t : [t] ) |
|---|
| | 252 | ); |
|---|
| | 253 | }, |
|---|
| | 254 | is: function(expr) { |
|---|
| | 255 | return expr ? jQuery.multiFilter(expr,this).length > 0 : false; |
|---|
| | 256 | }, |
|---|
| | 257 | |
|---|
| | 258 | val: function( val ) { |
|---|
| | 259 | return val == undefined ? |
|---|
| | 260 | ( this.length ? this[0].value : null ) : |
|---|
| | 261 | this.attr( "value", val ); |
|---|
| | 262 | }, |
|---|
| | 263 | |
|---|
| | 264 | html: function( val ) { |
|---|
| | 265 | return val == undefined ? |
|---|
| | 266 | ( this.length ? this[0].innerHTML : null ) : |
|---|
| | 267 | this.empty().append( val ); |
|---|
| | 268 | }, |
|---|
| | 269 | domManip: function(args, table, dir, fn){ |
|---|
| | 270 | var clone = this.length > 1, a; |
|---|
| | 271 | |
|---|
| | 272 | return this.each(function(){ |
|---|
| | 273 | if ( !a ) { |
|---|
| | 274 | a = jQuery.clean(args, this.ownerDocument); |
|---|
| | 275 | if ( dir < 0 ) |
|---|
| | 276 | a.reverse(); |
|---|
| | 277 | } |
|---|
| | 278 | |
|---|
| | 279 | var obj = this; |
|---|
| | 280 | |
|---|
| | 281 | if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") ) |
|---|
| | 282 | obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody")); |
|---|
| | 283 | |
|---|
| | 284 | jQuery.each( a, function(){ |
|---|
| | 285 | fn.apply( obj, [ clone ? this.cloneNode(true) : this ] ); |
|---|
| | 286 | }); |
|---|
| | 287 | |
|---|
| | 288 | }); |
|---|
| | 289 | } |
|---|
| | 290 | }; |
|---|
| | 291 | |
|---|
| | 292 | jQuery.extend = jQuery.fn.extend = function() { |
|---|
| | 293 | // copy reference to target object |
|---|
| | 294 | var target = arguments[0], a = 1; |
|---|
| | 295 | |
|---|
| | 296 | // extend jQuery itself if only one argument is passed |
|---|
| | 297 | if ( arguments.length == 1 ) { |
|---|
| | 298 | target = this; |
|---|
| | 299 | a = 0; |
|---|
| | 300 | } |
|---|
| | 301 | var prop; |
|---|
| | 302 | while ( (prop = arguments[a++]) != null ) |
|---|
| | 303 | // Extend the base object |
|---|
| | 304 | for ( var i in prop ) target[i] = prop[i]; |
|---|
| | 305 | |
|---|
| | 306 | // Return the modified object |
|---|
| | 307 | return target; |
|---|
| | 308 | }; |
|---|
| | 309 | |
|---|
| | 310 | jQuery.extend({ |
|---|
| | 311 | noConflict: function() { |
|---|
| | 312 | if ( jQuery._$ ) |
|---|
| | 313 | $ = jQuery._$; |
|---|
| | 314 | return jQuery; |
|---|
| | 315 | }, |
|---|
| | 316 | |
|---|
| | 317 | // This may seem like some crazy code, but trust me when I say that this |
|---|
| | 318 | // is the only cross-browser way to do this. --John |
|---|
| | 319 | isFunction: function( fn ) { |
|---|
| | 320 | return !!fn && typeof fn != "string" && !fn.nodeName && |
|---|
| | 321 | fn.constructor != Array && /function/i.test( fn + "" ); |
|---|
| | 322 | }, |
|---|
| | 323 | |
|---|
| | 324 | // check if an element is in a XML document |
|---|
| | 325 | isXMLDoc: function(elem) { |
|---|
| | 326 | return elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; |
|---|
| | 327 | }, |
|---|
| | 328 | |
|---|
| | 329 | nodeName: function( elem, name ) { |
|---|
| | 330 | return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); |
|---|
| | 331 | }, |
|---|
| | 332 | // args is for internal usage only |
|---|
| | 333 | each: function( obj, fn, args ) { |
|---|
| | 334 | if ( obj.length == undefined ) |
|---|
| | 335 | for ( var i in obj ) |
|---|
| | 336 | fn.apply( obj[i], args || [i, obj[i]] ); |
|---|
| | 337 | else |
|---|
| | 338 | for ( var i = 0, ol = obj.length; i < ol; i++ ) |
|---|
| | 339 | if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break; |
|---|
| | 340 | return obj; |
|---|
| | 341 | }, |
|---|
| | 342 | |
|---|
| | 343 | prop: function(elem, value, type, index, prop){ |
|---|
| | 344 | // Handle executable functions |
|---|
| | 345 | if ( jQuery.isFunction( value ) ) |
|---|
| | 346 | value = value.call( elem, [index] ); |
|---|
| | 347 | |
|---|
| | 348 | // exclude the following css properties to add px |
|---|
| | 349 | var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; |
|---|
| | 350 | |
|---|
| | 351 | // Handle passing in a number to a CSS property |
|---|
| | 352 | return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ? |
|---|
| | 353 | value + "px" : |
|---|
| | 354 | value; |
|---|
| | 355 | }, |
|---|
| | 356 | |
|---|
| | 357 | className: { |
|---|
| | 358 | // internal only, use addClass("class") |
|---|
| | 359 | add: function( elem, c ){ |
|---|
| | 360 | jQuery.each( c.split(/\s+/), function(i, cur){ |
|---|
| | 361 | if ( !jQuery.className.has( elem.className, cur ) ) |
|---|
| | 362 | elem.className += ( elem.className ? " " : "" ) + cur; |
|---|
| | 363 | }); |
|---|
| | 364 | }, |
|---|
| | 365 | |
|---|
| | 366 | // internal only, use removeClass("class") |
|---|
| | 367 | remove: function( elem, c ){ |
|---|
| | 368 | elem.className = c != undefined ? |
|---|
| | 369 | jQuery.grep( elem.className.split(/\s+/), function(cur){ |
|---|
| | 370 | return !jQuery.className.has( c, cur ); |
|---|
| | 371 | }).join(" ") : ""; |
|---|
| | 372 | }, |
|---|
| | 373 | |
|---|
| | 374 | // internal only, use is(".class") |
|---|
| | 375 | has: function( t, c ) { |
|---|
| | 376 | return jQuery.inArray( c, (t.className || t).toString().split(/\s+/) ) > -1; |
|---|
| | 377 | } |
|---|
| | 378 | }, |
|---|
| | 379 | swap: function(e,o,f) { |
|---|
| | 380 | for ( var i in o ) { |
|---|
| | 381 | e.style["old"+i] = e.style[i]; |
|---|
| | 382 | e.style[i] = o[i]; |
|---|
| | 383 | } |
|---|
| | 384 | f.apply( e, [] ); |
|---|
| | 385 | for ( var i in o ) |
|---|
| | 386 | e.style[i] = e.style["old"+i]; |
|---|
| | 387 | }, |
|---|
| | 388 | |
|---|
| | 389 | css: function(e,p) { |
|---|
| | 390 | if ( p == "height" || p == "width" ) { |
|---|
| | 391 | var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"]; |
|---|
| | 392 | |
|---|
| | 393 | jQuery.each( d, function(){ |
|---|
| | 394 | old["padding" + this] = 0; |
|---|
| | 395 | old["border" + this + "Width"] = 0; |
|---|
| | 396 | }); |
|---|
| | 397 | |
|---|
| | 398 | jQuery.swap( e, old, function() { |
|---|
| | 399 | if ( jQuery(e).is(':visible') ) { |
|---|
| | 400 | oHeight = e.offsetHeight; |
|---|
| | 401 | oWidth = e.offsetWidth; |
|---|
| | 402 | } else { |
|---|
| | 403 | e = jQuery(e.cloneNode(true)) |
|---|
| | 404 | .find(":radio").removeAttr("checked").end() |
|---|
| | 405 | .css({ |
|---|
| | 406 | visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" |
|---|
| | 407 | }).appendTo(e.parentNode)[0]; |
|---|
| | 408 | |
|---|
| | 409 | var parPos = jQuery.css(e.parentNode,"position") || "static"; |
|---|
| | 410 | if ( parPos == "static" ) |
|---|
| | 411 | e.parentNode.style.position = "relative"; |
|---|
| | 412 | |
|---|
| | 413 | oHeight = e.clientHeight; |
|---|
| | 414 | oWidth = e.clientWidth; |
|---|
| | 415 | |
|---|
| | 416 | if ( parPos == "static" ) |
|---|
| | 417 | e.parentNode.style.position = "static"; |
|---|
| | 418 | |
|---|
| | 419 | e.parentNode.removeChild(e); |
|---|
| | 420 | } |
|---|
| | 421 | }); |
|---|
| | 422 | |
|---|
| | 423 | return p == "height" ? oHeight : oWidth; |
|---|
| | 424 | } |
|---|
| | 425 | |
|---|
| | 426 | return jQuery.curCSS( e, p ); |
|---|
| | 427 | }, |
|---|
| | 428 | |
|---|
| | 429 | curCSS: function(elem, prop, force) { |
|---|
| | 430 | var ret; |
|---|
| | 431 | |
|---|
| | 432 | if (prop == "opacity" && jQuery.browser.msie) { |
|---|
| | 433 | ret = jQuery.attr(elem.style, "opacity"); |
|---|
| | 434 | return ret == "" ? "1" : ret; |
|---|
| | 435 | } |
|---|
| | 436 | |
|---|
| | 437 | if (prop.match(/float/i)) |
|---|
| | 438 | prop = jQuery.styleFloat; |
|---|
| | 439 | |
|---|
| | 440 | if (!force && elem.style[prop]) |
|---|
| | 441 | ret = elem.style[prop]; |
|---|
| | 442 | |
|---|
| | 443 | else if (document.defaultView && document.defaultView.getComputedStyle) { |
|---|
| | 444 | |
|---|
| | 445 | if (prop.match(/float/i)) |
|---|
| | 446 | prop = "float"; |
|---|
| | 447 | |
|---|
| | 448 | prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase(); |
|---|
| | 449 | var cur = document.defaultView.getComputedStyle(elem, null); |
|---|
| | 450 | |
|---|
| | 451 | if ( cur ) |
|---|
| | 452 | ret = cur.getPropertyValue(prop); |
|---|
| | 453 | else if ( prop == "display" ) |
|---|
| | 454 | ret = "none"; |
|---|
| | 455 | else |
|---|
| | 456 | jQuery.swap(elem, { display: "block" }, function() { |
|---|
| | 457 | var c = document.defaultView.getComputedStyle(this, ""); |
|---|
| | 458 | ret = c && c.getPropertyValue(prop) || ""; |
|---|
| | 459 | }); |
|---|
| | 460 | |
|---|
| | 461 | } else if (elem.currentStyle) { |
|---|
| | 462 | var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}); |
|---|
| | 463 | ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; |
|---|
| | 464 | } |
|---|
| | 465 | |
|---|
| | 466 | return ret; |
|---|
| | 467 | }, |
|---|
| | 468 | |
|---|
| | 469 | clean: function(a, doc) { |
|---|
| | 470 | var r = []; |
|---|
| | 471 | doc = doc || document; |
|---|
| | 472 | |
|---|
| | 473 | jQuery.each( a, function(i,arg){ |
|---|
| | 474 | if ( !arg ) return; |
|---|
| | 475 | |
|---|
| | 476 | if ( arg.constructor == Number ) |
|---|
| | 477 | arg = arg.toString(); |
|---|
| | 478 | |
|---|
| | 479 | // Convert html string into DOM nodes |
|---|
| | 480 | if ( typeof arg == "string" ) { |
|---|
| | 481 | // Trim whitespace, otherwise indexOf won't work as expected |
|---|
| | 482 | var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = []; |
|---|
| | 483 | |
|---|
| | 484 | var wrap = |
|---|
| | 485 | // option or optgroup |
|---|
| | 486 | !s.indexOf("<opt") && |
|---|
| | 487 | [1, "<select>", "</select>"] || |
|---|
| | 488 | |
|---|
| | 489 | !s.indexOf("<leg") && |
|---|
| | 490 | [1, "<fieldset>", "</fieldset>"] || |
|---|
| | 491 | |
|---|
| | 492 | (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") || !s.indexOf("<colg")) && |
|---|
| | 493 | [1, "<table>", "</table>"] || |
|---|
| | 494 | |
|---|
| | 495 | !s.indexOf("<tr") && |
|---|
| | 496 | [2, "<table><tbody>", "</tbody></table>"] || |
|---|
| | 497 | |
|---|
| | 498 | // <thead> matched above |
|---|
| | 499 | (!s.indexOf("<td") || !s.indexOf("<th")) && |
|---|
| | 500 | [3, "<table><tbody><tr>", "</tr></tbody></table>"] || |
|---|
| | 501 | |
|---|
| | 502 | !s.indexOf("<col") && |
|---|
| | 503 | [2, "<table><colgroup>", "</colgroup></table>"] || |
|---|
| | 504 | |
|---|
| | 505 | [0,"",""]; |
|---|
| | 506 | |
|---|
| | 507 | // Go to html and back, then peel off extra wrappers |
|---|
| | 508 | div.innerHTML = wrap[1] + arg + wrap[2]; |
|---|
| | 509 | |
|---|
| | 510 | // Move to the right depth |
|---|
| | 511 | while ( wrap[0]-- ) |
|---|
| | 512 | div = div.firstChild; |
|---|
| | 513 | |
|---|
| | 514 | // Remove IE's autoinserted <tbody> from table fragments |
|---|
| | 515 | if ( jQuery.browser.msie ) { |
|---|
| | 516 | |
|---|
| | 517 | // String was a <table>, *may* have spurious <tbody> |
|---|
| | 518 | if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 ) |
|---|
| | 519 | tb = div.firstChild && div.firstChild.childNodes; |
|---|
| | 520 | |
|---|
| | 521 | // String was a bare <thead> or <tfoot> |
|---|
| | 522 | else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 ) |
|---|
| | 523 | tb = div.childNodes; |
|---|
| | 524 | |
|---|
| | 525 | for ( var n = tb.length-1; n >= 0 ; --n ) |
|---|
| | 526 | if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length ) |
|---|
| | 527 | tb[n].parentNode.removeChild(tb[n]); |
|---|
| | 528 | |
|---|
| | 529 | } |
|---|
| | 530 | |
|---|
| | 531 | arg = jQuery.makeArray( div.childNodes ); |
|---|
| | 532 | } |
|---|
| | 533 | |
|---|
| | 534 | if ( 0 === arg.length && (!jQuery.nodeName(arg, "form") && !jQuery.nodeName(arg, "select")) ) |
|---|
| | 535 | return; |
|---|
| | 536 | |
|---|
| | 537 | if ( arg[0] == undefined || jQuery.nodeName(arg, "form") || arg.options ) |
|---|
| | 538 | r.push( arg ); |
|---|
| | 539 | else |
|---|
| | 540 | r = jQuery.merge( r, arg ); |
|---|
| | 541 | |
|---|
| | 542 | }); |
|---|
| | 543 | |
|---|
| | 544 | return r; |
|---|
| | 545 | }, |
|---|
| | 546 | |
|---|
| | 547 | attr: function(elem, name, value){ |
|---|
| | 548 | var fix = jQuery.isXMLDoc(elem) ? {} : jQuery.props; |
|---|
| | 549 | |
|---|
| | 550 | // Certain attributes only work when accessed via the old DOM 0 way |
|---|
| | 551 | if ( fix[name] ) { |
|---|
| | 552 | if ( value != undefined ) elem[fix[name]] = value; |
|---|
| | 553 | return elem[fix[name]]; |
|---|
| | 554 | |
|---|
| | 555 | } else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") ) |
|---|
| | 556 | return elem.getAttributeNode(name).nodeValue; |
|---|
| | 557 | |
|---|
| | 558 | // IE elem.getAttribute passes even for style |
|---|
| | 559 | else if ( elem.tagName ) { |
|---|
| | 560 | |
|---|
| | 561 | |
|---|
| | 562 | if ( value != undefined ) elem.setAttribute( name, value ); |
|---|
| | 563 | if ( jQuery.browser.msie && /href|src/.test(name) && !jQuery.isXMLDoc(elem) ) |
|---|
| | 564 | return elem.getAttribute( name, 2 ); |
|---|
| | 565 | return elem.getAttribute( name ); |
|---|
| | 566 | |
|---|
| | 567 | // elem is actually elem.style ... set the style |
|---|
| | 568 | } else { |
|---|
| | 569 | // IE actually uses filters for opacity |
|---|
| | 570 | if ( name == "opacity" && jQuery.browser.msie ) { |
|---|
| | 571 | if ( value != undefined ) { |
|---|
| | 572 | // IE has trouble with opacity if it does not have layout |
|---|
| | 573 | // Force it by setting the zoom level |
|---|
| | 574 | elem.zoom = 1; |
|---|
| | 575 | |
|---|
| | 576 | // Set the alpha filter to set the opacity |
|---|
| | 577 | elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/,"") + |
|---|
| | 578 | (parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); |
|---|
| | 579 | } |
|---|
| | 580 | |
|---|
| | 581 | return elem.filter ? |
|---|
| | 582 | (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() : ""; |
|---|
| | 583 | } |
|---|
| | 584 | name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); |
|---|
| | 585 | if ( value != undefined ) elem[name] = value; |
|---|
| | 586 | return elem[name]; |
|---|
| | 587 | } |
|---|
| | 588 | }, |
|---|
| | 589 | trim: function(t){ |
|---|
| | 590 | return t.replace(/^\s+|\s+$/g, ""); |
|---|
| | 591 | }, |
|---|
| | 592 | |
|---|
| | 593 | makeArray: function( a ) { |
|---|
| | 594 | var r = []; |
|---|
| | 595 | |
|---|
| | 596 | // Need to use typeof to fight Safari childNodes crashes |
|---|
| | 597 | if ( typeof a != "array" ) |
|---|
| | 598 | for ( var i = 0, al = a.length; i < al; i++ ) |
|---|
| | 599 | r.push( a[i] ); |
|---|
| | 600 | else |
|---|
| | 601 | r = a.slice( 0 ); |
|---|
| | 602 | |
|---|
| | 603 | return r; |
|---|
| | 604 | }, |
|---|
| | 605 | |
|---|
| | 606 | inArray: function( b, a ) { |
|---|
| | 607 | for ( var i = 0, al = a.length; i < al; i++ ) |
|---|
| | 608 | if ( a[i] == b ) |
|---|
| | 609 | return i; |
|---|
| | 610 | return -1; |
|---|
| | 611 | }, |
|---|
| | 612 | merge: function(first, second) { |
|---|
| | 613 | // We have to loop this way because IE & Opera overwrite the length |
|---|
| | 614 | // expando of getElementsByTagName |
|---|
| | 615 | for ( var i = 0; second[i]; i++ ) |
|---|
| | 616 | first.push(second[i]); |
|---|
| | 617 | return first; |
|---|
| | 618 | }, |
|---|
| | 619 | unique: function(first) { |
|---|
| | 620 | var r = [], num = jQuery.mergeNum++; |
|---|
| | 621 | |
|---|
| | 622 | for ( var i = 0, fl = first.length; i < fl; i++ ) |
|---|
| | 623 | if ( num != first[i].mergeNum ) { |
|---|
| | 624 | first[i].mergeNum = num; |
|---|
| | 625 | r.push(first[i]); |
|---|
| | 626 | } |
|---|
| | 627 | |
|---|
| | 628 | return r; |
|---|
| | 629 | }, |
|---|
| | 630 | |
|---|
| | 631 | mergeNum: 0, |
|---|
| | 632 | grep: function(elems, fn, inv) { |
|---|
| | 633 | // If a string is passed in for the function, make a function |
|---|
| | 634 | // for it (a handy shortcut) |
|---|
| | 635 | if ( typeof fn == "string" ) |
|---|
| | 636 | fn = new Function("a","i","return " + fn); |
|---|
| | 637 | |
|---|
| | 638 | var result = []; |
|---|
| | 639 | |
|---|
| | 640 | // Go through the array, only saving the items |
|---|
| | 641 | // that pass the validator function |
|---|
| | 642 | for ( var i = 0, el = elems.length; i < el; i++ ) |
|---|
| | 643 | if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) ) |
|---|
| | 644 | result.push( elems[i] ); |
|---|
| | 645 | |
|---|
| | 646 | return result; |
|---|
| | 647 | }, |
|---|
| | 648 | map: function(elems, fn) { |
|---|
| | 649 | // If a string is passed in for the function, make a function |
|---|
| | 650 | // for it (a handy shortcut) |
|---|
| | 651 | if ( typeof fn == "string" ) |
|---|
| | 652 | fn = new Function("a","return " + fn); |
|---|
| | 653 | |
|---|
| | 654 | var result = []; |
|---|
| | 655 | |
|---|
| | 656 | // Go through the array, translating each of the items to their |
|---|
| | 657 | // new value (or values). |
|---|
| | 658 | for ( var i = 0, el = elems.length; i < el; i++ ) { |
|---|
| | 659 | var val = fn(elems[i],i); |
|---|
| | 660 | |
|---|
| | 661 | if ( val !== null && val != undefined ) { |
|---|
| | 662 | if ( val.constructor != Array ) val = [val]; |
|---|
| | 663 | result = result.concat( val ); |
|---|
| | 664 | } |
|---|
| | 665 | } |
|---|
| | 666 | |
|---|
| | 667 | return result; |
|---|
| | 668 | } |
|---|
| | 669 | }); |
|---|
| | 670 | |
|---|
| | 671 | /* |
|---|
| | 672 | * Whether the W3C compliant box model is being used. |
|---|
| | 673 | * |
|---|
| | 674 | * @property |
|---|
| | 675 | * @name $.boxModel |
|---|
| | 676 | * @type Boolean |
|---|
| | 677 | * @cat JavaScript |
|---|
| | 678 | */ |
|---|
| | 679 | new function() { |
|---|
| | 680 | var b = navigator.userAgent.toLowerCase(); |
|---|
| | 681 | |
|---|
| | 682 | // Figure out what browser is being used |
|---|
| | 683 | jQuery.browser = { |
|---|
| | 684 | version: (b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], |
|---|
| | 685 | safari: /webkit/.test(b), |
|---|
| | 686 | opera: /opera/.test(b), |
|---|
| | 687 | msie: /msie/.test(b) && !/opera/.test(b), |
|---|
| | 688 | mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b) |
|---|
| | 689 | }; |
|---|
| | 690 | |
|---|
| | 691 | // Check to see if the W3C box model is being used |
|---|
| | 692 | jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat"; |
|---|
| | 693 | |
|---|
| | 694 | jQuery.styleFloat = jQuery.browser.msie ? "styleFloat" : "cssFloat", |
|---|
| | 695 | |
|---|
| | 696 | jQuery.props = { |
|---|
| | 697 | "for": "htmlFor", |
|---|
| | 698 | "class": "className", |
|---|
| | 699 | "float": jQuery.styleFloat, |
|---|
| | 700 | cssFloat: jQuery.styleFloat, |
|---|
| | 701 | styleFloat: jQuery.styleFloat, |
|---|
| | 702 | innerHTML: "innerHTML", |
|---|
| | 703 | className: "className", |
|---|
| | 704 | value: "value", |
|---|
| | 705 | disabled: "disabled", |
|---|
| | 706 | checked: "checked", |
|---|
| | 707 | readonly: "readOnly", |
|---|
| | 708 | selected: "selected", |
|---|
| | 709 | maxlength: "maxLength" |
|---|
| | 710 | }; |
|---|
| | 711 | }; |
|---|
| | 712 | |
|---|
| | 713 | jQuery.each({ |
|---|
| | 714 | parent: "a.parentNode", |
|---|
| | 715 | parents: "jQuery.parents(a)", |
|---|
| | 716 | next: "jQuery.nth(a,2,'nextSibling')", |
|---|
| | 717 | prev: "jQuery.nth(a,2,'previousSibling')", |
|---|
| | 718 | siblings: "jQuery.sibling(a.parentNode.firstChild,a)", |
|---|
| | 719 | children: "jQuery.sibling(a.firstChild)" |
|---|
| | 720 | }, function(i,n){ |
|---|
| | 721 | jQuery.fn[ i ] = function(a) { |
|---|
| | 722 | var ret = jQuery.map(this,n); |
|---|
| | 723 | if ( a && typeof a == "string" ) |
|---|
| | 724 | ret = jQuery.multiFilter(a,ret); |
|---|
| | 725 | return this.pushStack( ret ); |
|---|
| | 726 | }; |
|---|
| | 727 | }); |
|---|
| | 728 | |
|---|
| | 729 | jQuery.each({ |
|---|
| | 730 | appendTo: "append", |
|---|
| | 731 | prependTo: "prepend", |
|---|
| | 732 | insertBefore: "before", |
|---|
| | 733 | insertAfter: "after" |
|---|
| | 734 | }, function(i,n){ |
|---|
| | 735 | jQuery.fn[ i ] = function(){ |
|---|
| | 736 | var a = arguments; |
|---|
| | 737 | return this.each(function(){ |
|---|
| | 738 | for ( var j = 0, al = a.length; j < al; j++ ) |
|---|
| | 739 | jQuery(a[j])[n]( this ); |
|---|
| | 740 | }); |
|---|
| | 741 | }; |
|---|
| | 742 | }); |
|---|
| | 743 | |
|---|
| | 744 | jQuery.each( { |
|---|
| | 745 | removeAttr: function( key ) { |
|---|
| | 746 | jQuery.attr( this, key, "" ); |
|---|
| | 747 | this.removeAttribute( key ); |
|---|
| | 748 | }, |
|---|
| | 749 | addClass: function(c){ |
|---|
| | 750 | jQuery.className.add(this,c); |
|---|
| | 751 | }, |
|---|
| | 752 | removeClass: function(c){ |
|---|
| | 753 | jQuery.className.remove(this,c); |
|---|
| | 754 | }, |
|---|
| | 755 | toggleClass: function( c ){ |
|---|
| | 756 | jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c); |
|---|
| | 757 | }, |
|---|
| | 758 | remove: function(a){ |
|---|
| | 759 | if ( !a || jQuery.filter( a, [this] ).r.length ) |
|---|
| | 760 | this.parentNode.removeChild( this ); |
|---|
| | 761 | }, |
|---|
| | 762 | empty: function() { |
|---|
| | 763 | while ( this.firstChild ) |
|---|
| | 764 | this.removeChild( this.firstChild ); |
|---|
| | 765 | } |
|---|
| | 766 | }, function(i,n){ |
|---|
| | 767 | jQuery.fn[ i ] = function() { |
|---|
| | 768 | return this.each( n, arguments ); |
|---|
| | 769 | }; |
|---|
| | 770 | }); |
|---|
| | 771 | |
|---|
| | 772 | jQuery.each( [ "eq", "lt", "gt", "contains" ], function(i,n){ |
|---|
| | 773 | jQuery.fn[ n ] = function(num,fn) { |
|---|
| | 774 | return this.filter( ":" + n + "(" + num + ")", fn ); |
|---|
| | 775 | }; |
|---|
| | 776 | }); |
|---|
| | 777 | |
|---|
| | 778 | jQuery.each( [ "height", "width" ], function(i,n){ |
|---|
| | 779 | jQuery.fn[ n ] = function(h) { |
|---|
| | 780 | return h == undefined ? |
|---|
| | 781 | ( this.length ? jQuery.css( this[0], n ) : null ) : |
|---|
| | 782 | this.css( n, h.constructor == String ? h : h + "px" ); |
|---|
| | 783 | }; |
|---|
| | 784 | }); |
|---|
| | 785 | jQuery.extend({ |
|---|
| | 786 | expr: { |
|---|
| | 787 | "": "m[2]=='*'||jQuery.nodeName(a,m[2])", |
|---|
| | 788 | "#": "a.getAttribute('id')==m[2]", |
|---|
| | 789 | ":": { |
|---|
| | 790 | // Position Checks |
|---|
| | 791 | lt: "i<m[3]-0", |
|---|
| | 792 | gt: "i>m[3]-0", |
|---|
| | 793 | nth: "m[3]-0==i", |
|---|
| | 794 | eq: "m[3]-0==i", |
|---|
| | 795 | first: "i==0", |
|---|
| | 796 | last: "i==r.length-1", |
|---|
| | 797 | even: "i%2==0", |
|---|
| | 798 | odd: "i%2", |
|---|
| | 799 | |
|---|
| | 800 | // Child Checks |
|---|
| | 801 | "first-child": "a.parentNode.getElementsByTagName('*')[0]==a", |
|---|
| | 802 | "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a", |
|---|
| | 803 | "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')", |
|---|
| | 804 | |
|---|
| | 805 | // Parent Checks |
|---|
| | 806 | parent: "a.firstChild", |
|---|
| | 807 | empty: "!a.firstChild", |
|---|
| | 808 | |
|---|
| | 809 | // Text Check |
|---|
| | 810 | contains: "(a.textContent||a.innerText||'').indexOf(m[3])>=0", |
|---|
| | 811 | |
|---|
| | 812 | // Visibility |
|---|
| | 813 | visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"', |
|---|
| | 814 | hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"', |
|---|
| | 815 | |
|---|
| | 816 | // Form attributes |
|---|
| | 817 | enabled: "!a.disabled", |
|---|
| | 818 | disabled: "a.disabled", |
|---|
| | 819 | checked: "a.checked", |
|---|
| | 820 | selected: "a.selected||jQuery.attr(a,'selected')", |
|---|
| | 821 | |
|---|
| | 822 | // Form elements |
|---|
| | 823 | text: "'text'==a.type", |
|---|
| | 824 | radio: "'radio'==a.type", |
|---|
| | 825 | checkbox: "'checkbox'==a.type", |
|---|
| | 826 | file: "'file'==a.type", |
|---|
| | 827 | password: "'password'==a.type", |
|---|
| | 828 | submit: "'submit'==a.type", |
|---|
| | 829 | image: "'image'==a.type", |
|---|
| | 830 | reset: "'reset'==a.type", |
|---|
| | 831 | button: '"button"==a.type||jQuery.nodeName(a,"button")', |
|---|
| | 832 | input: "/input|select|textarea|button/i.test(a.nodeName)" |
|---|
| | 833 | }, |
|---|
| | 834 | "[": "jQuery.find(m[2],a).length" |
|---|
| | 835 | }, |
|---|
| | 836 | |
|---|
| | 837 | // The regular expressions that power the parsing engine |
|---|
| | 838 | parse: [ |
|---|
| | 839 | // Match: [@value='test'], [@foo] |
|---|
| | 840 | /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, |
|---|
| | 841 | |
|---|
| | 842 | // Match: [div], [div p] |
|---|
| | 843 | /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, |
|---|
| | 844 | |
|---|
| | 845 | // Match: :contains('foo') |
|---|
| | 846 | /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, |
|---|
| | 847 | |
|---|
| | 848 | // Match: :even, :last-chlid, #id, .class |
|---|
| | 849 | new RegExp("^([:.#]*)(" + |
|---|
| | 850 | ( jQuery.chars = jQuery.browser.safari && jQuery.browser.version < "3.0.0" ? "\\w" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ) + "+)") |
|---|
| | 851 | ], |
|---|
| | 852 | |
|---|
| | 853 | multiFilter: function( expr, elems, not ) { |
|---|
| | 854 | var old, cur = []; |
|---|
| | 855 | |
|---|
| | 856 | while ( expr && expr != old ) { |
|---|
| | 857 | old = expr; |
|---|
| | 858 | var f = jQuery.filter( expr, elems, not ); |
|---|
| | 859 | expr = f.t.replace(/^\s*,\s*/, "" ); |
|---|
| | 860 | cur = not ? elems = f.r : jQuery.merge( cur, f.r ); |
|---|
| | 861 | } |
|---|
| | 862 | |
|---|
| | 863 | return cur; |
|---|
| | 864 | }, |
|---|
| | 865 | find: function( t, context ) { |
|---|
| | 866 | // Quickly handle non-string expressions |
|---|
| | 867 | if ( typeof t != "string" ) |
|---|
| | 868 | return [ t ]; |
|---|
| | 869 | |
|---|
| | 870 | // Make sure that the context is a DOM Element |
|---|
| | 871 | if ( context && !context.nodeType ) |
|---|
| | 872 | context = null; |
|---|
| | 873 | |
|---|
| | 874 | // Set the correct context (if none is provided) |
|---|
| | 875 | context = context || document; |
|---|
| | 876 | |
|---|
| | 877 | // Handle the common XPath // expression |
|---|
| | 878 | if ( !t.indexOf("//") ) { |
|---|
| | 879 | context = context.documentElement; |
|---|
| | 880 | t = t.substr(2,t.length); |
|---|
| | 881 | |
|---|
| | 882 | // And the / root expression |
|---|
| | 883 | } else if ( !t.indexOf("/") && !context.ownerDocument ) { |
|---|
| | 884 | context = context.documentElement; |
|---|
| | 885 | t = t.substr(1,t.length); |
|---|
| | 886 | if ( t.indexOf("/") >= 1 ) |
|---|
| | 887 | t = t.substr(t.indexOf("/"),t.length); |
|---|
| | 888 | } |
|---|
| | 889 | |
|---|
| | 890 | // Initialize the search |
|---|
| | 891 | var ret = [context], done = [], last; |
|---|
| | 892 | |
|---|
| | 893 | // Continue while a selector expression exists, and while |
|---|
| | 894 | // we're no longer looping upon ourselves |
|---|
| | 895 | while ( t && last != t ) { |
|---|
| | 896 | var r = []; |
|---|
| | 897 | last = t; |
|---|
| | 898 | |
|---|
| | 899 | t = jQuery.trim(t).replace( /^\/\//, "" ); |
|---|
| | 900 | |
|---|
| | 901 | var foundToken = false; |
|---|
| | 902 | |
|---|
| | 903 | // An attempt at speeding up child selectors that |
|---|
| | 904 | // point to a specific element tag |
|---|
| | 905 | var re = new RegExp("^[/>]\\s*(" + jQuery.chars + "+)"); |
|---|
| | 906 | var m = re.exec(t); |
|---|
| | 907 | |
|---|
| | 908 | if ( m ) { |
|---|
| | 909 | var nodeName = m[1].toUpperCase(); |
|---|
| | 910 | |
|---|
| | 911 | // Perform our own iteration and filter |
|---|
| | 912 | for ( var i = 0; ret[i]; i++ ) |
|---|
| | 913 | for ( var c = ret[i].firstChild; c; c = c.nextSibling ) |
|---|
| | 914 | if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName.toUpperCase()) ) |
|---|
| | 915 | r.push( c ); |
|---|
| | 916 | |
|---|
| | 917 | ret = r; |
|---|
| | 918 | t = t.replace( re, "" ); |
|---|
| | 919 | if ( t.indexOf(" ") == 0 ) continue; |
|---|
| | 920 | foundToken = true; |
|---|
| | 921 | } else { |
|---|
| | 922 | re = /^((\/?\.\.)|([>\/+~]))\s*([a-z]*)/i; |
|---|
| | 923 | |
|---|
| | 924 | if ( (m = re.exec(t)) != null ) { |
|---|
| | 925 | r = []; |
|---|
| | 926 | |
|---|
| | 927 | var nodeName = m[4], mergeNum = jQuery.mergeNum++; |
|---|
| | 928 | m = m[1]; |
|---|
| | 929 | |
|---|
| | 930 | for ( var j = 0, rl = ret.length; j < rl; j++ ) |
|---|
| | 931 | if ( m.indexOf("..") < 0 ) { |
|---|
| | 932 | var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; |
|---|
| | 933 | for ( ; n; n = n.nextSibling ) |
|---|
| | 934 | if ( n.nodeType == 1 ) { |
|---|
| | 935 | if ( m == "~" && n.mergeNum == mergeNum ) break; |
|---|
| | 936 | |
|---|
| | 937 | if (!nodeName || n.nodeName.toUpperCase() == nodeName.toUpperCase() ) { |
|---|
| | 938 | if ( m == "~" ) n.mergeNum = mergeNum; |
|---|
| | 939 | r.push( n ); |
|---|
| | 940 | } |
|---|
| | 941 | |
|---|
| | 942 | if ( m == "+" ) break; |
|---|
| | 943 | } |
|---|
| | 944 | } else |
|---|
| | 945 | r.push( ret[j].parentNode ); |
|---|
| | 946 | |
|---|
| | 947 | ret = r; |
|---|
| | 948 | |
|---|
| | 949 | // And remove the token |
|---|
| | 950 | t = jQuery.trim( t.replace( re, "" ) ); |
|---|
| | 951 | foundToken = true; |
|---|
| | 952 | } |
|---|
| | 953 | } |
|---|
| | 954 | |
|---|
| | 955 | // See if there's still an expression, and that we haven't already |
|---|
| | 956 | // matched a token |
|---|
| | 957 | if ( t && !foundToken ) { |
|---|
| | 958 | // Handle multiple expressions |
|---|
| | 959 | if ( !t.indexOf(",") ) { |
|---|
| | 960 | // Clean the result set |
|---|
| | 961 | if ( context == ret[0] ) ret.shift(); |
|---|
| | 962 | |
|---|
| | 963 | // Merge the result sets |
|---|
| | 964 | done = jQuery.merge( done, ret ); |
|---|
| | 965 | |
|---|
| | 966 | // Reset the context |
|---|
| | 967 | r = ret = [context]; |
|---|
| | 968 | |
|---|
| | 969 | // Touch up the selector string |
|---|
| | 970 | t = " " + t.substr(1,t.length); |
|---|
| | 971 | |
|---|
| | 972 | } else { |
|---|
| | 973 | // Optomize for the case nodeName#idName |
|---|
| | 974 | var re2 = new RegExp("^(" + jQuery.chars + "+)(#)(" + jQuery.chars + "+)"); |
|---|
| | 975 | var m = re2.exec(t); |
|---|
| | 976 | |
|---|
| | 977 | // Re-organize the results, so that they're consistent |
|---|
| | 978 | if ( m ) { |
|---|
| | 979 | m = [ 0, m[2], m[3], m[1] ]; |
|---|
| | 980 | |
|---|
| | 981 | } else { |
|---|
| | 982 | // Otherwise, do a traditional filter check for |
|---|
| | 983 | // ID, class, and element selectors |
|---|
| | 984 | re2 = new RegExp("^([#.]?)(" + jQuery.chars + "*)"); |
|---|
| | 985 | m = re2.exec(t); |
|---|
| | 986 | } |
|---|
| | 987 | |
|---|
| | 988 | m[2] = m[2].replace(/\\/g, ""); |
|---|
| | 989 | |
|---|
| | 990 | var elem = ret[ret.length-1]; |
|---|
| | 991 | |
|---|
| | 992 | // Try to do a global search by ID, where we can |
|---|
| | 993 | if ( m[1] == "#" && elem && elem.getElementById ) { |
|---|
| | 994 | // Optimization for HTML document case |
|---|
| | 995 | var oid = elem.getElementById(m[2]); |
|---|
| | 996 | |
|---|
| | 997 | // Do a quick check for the existence of the actual ID attribute |
|---|
| | 998 | // to avoid selecting by the name attribute in IE |
|---|
| | 999 | // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form |
|---|
| | 1000 | if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] ) |
|---|
| | 1001 | oid = jQuery('[@id="'+m[2]+'"]', elem)[0]; |
|---|
| | 1002 | |
|---|
| | 1003 | // Do a quick check for node name (where applicable) so |
|---|
| | 1004 | // that div#foo searches will be really fast |
|---|
| | 1005 | ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : []; |
|---|
| | 1006 | } else { |
|---|
| | 1007 | // We need to find all descendant elements |
|---|
| | 1008 | for ( var i = 0; ret[i]; i++ ) { |
|---|
| | 1009 | // Grab the tag name being searched for |
|---|
| | 1010 | var tag = m[1] != "" || m[0] == "" ? "*" : m[2]; |
|---|
| | 1011 | |
|---|
| | 1012 | // Handle IE7 being really dumb about <object>s |
|---|
| | 1013 | if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" ) |
|---|
| | 1014 | tag = "param"; |
|---|
| | 1015 | |
|---|
| | 1016 | r = jQuery.merge( r, ret[i].getElementsByTagName( tag )); |
|---|
| | 1017 | } |
|---|
| | 1018 | |
|---|
| | 1019 | // It's faster to filter by class and be done with it |
|---|
| | 1020 | if ( m[1] == "." ) |
|---|
| | 1021 | r = jQuery.classFilter( r, m[2] ); |
|---|
| | 1022 | |
|---|
| | 1023 | // Same with ID filtering |
|---|
| | 1024 | if ( m[1] == "#" ) { |
|---|
| | 1025 | var tmp = []; |
|---|
| | 1026 | |
|---|
| | 1027 | // Try to find the element with the ID |
|---|
| | 1028 | for ( var i = 0; r[i]; i++ ) |
|---|
| | 1029 | if ( r[i].getAttribute("id") == m[2] ) { |
|---|
| | 1030 | tmp = [ r[i] ]; |
|---|
| | 1031 | break; |
|---|
| | 1032 | } |
|---|
| | 1033 | |
|---|
| | 1034 | r = tmp; |
|---|
| | 1035 | } |
|---|
| | 1036 | |
|---|
| | 1037 | ret = r; |
|---|
| | 1038 | } |
|---|
| | 1039 | |
|---|
| | 1040 | t = t.replace( re2, "" ); |
|---|
| | 1041 | } |
|---|
| | 1042 | |
|---|
| | 1043 | } |
|---|
| | 1044 | |
|---|
| | 1045 | // If a selector string still exists |
|---|
| | 1046 | if ( t ) { |
|---|
| | 1047 | // Attempt to filter it |
|---|
| | 1048 | var val = jQuery.filter(t,r); |
|---|
| | 1049 | ret = r = val.r; |
|---|
| | 1050 | t = jQuery.trim(val.t); |
|---|
| | 1051 | } |
|---|
| | 1052 | } |
|---|
| | 1053 | |
|---|
| | 1054 | // An error occurred with the selector; |
|---|
| | 1055 | // just return an empty set instead |
|---|
| | 1056 | if ( t ) |
|---|
| | 1057 | ret = []; |
|---|
| | 1058 | |
|---|
| | 1059 | // Remove the root context |
|---|
| | 1060 | if ( ret && context == ret[0] ) |
|---|
| | 1061 | ret.shift(); |
|---|
| | 1062 | |
|---|
| | 1063 | // And combine the results |
|---|
| | 1064 | done = jQuery.merge( done, ret ); |
|---|
| | 1065 | |
|---|
| | 1066 | return done; |
|---|
| | 1067 | }, |
|---|
| | 1068 | |
|---|
| | 1069 | classFilter: function(r,m,not){ |
|---|
| | 1070 | m = " " + m + " "; |
|---|
| | 1071 | var tmp = []; |
|---|
| | 1072 | for ( var i = 0; r[i]; i++ ) { |
|---|
| | 1073 | var pass = (" " + r[i].className + " ").indexOf( m ) >= 0; |
|---|
| | 1074 | if ( !not && pass || not && !pass ) |
|---|
| | 1075 | tmp.push( r[i] ); |
|---|
| | 1076 | } |
|---|
| | 1077 | return tmp; |
|---|
| | 1078 | }, |
|---|
| | 1079 | |
|---|
| | 1080 | filter: function(t,r,not) { |
|---|
| | 1081 | var last; |
|---|
| | 1082 | |
|---|
| | 1083 | // Look for common filter expressions |
|---|
| | 1084 | while ( t && t != last ) { |
|---|
| | 1085 | last = t; |
|---|
| | 1086 | |
|---|
| | 1087 | var p = jQuery.parse, m; |
|---|
| | 1088 | |
|---|
| | 1089 | for ( var i = 0; p[i]; i++ ) { |
|---|
| | 1090 | m = p[i].exec( t ); |
|---|
| | 1091 | |
|---|
| | 1092 | if ( m ) { |
|---|
| | 1093 | // Remove what we just matched |
|---|
| | 1094 | t = t.substring( m[0].length ); |
|---|
| | 1095 | |
|---|
| | 1096 | m[2] = m[2].replace(/\\/g, ""); |
|---|
| | 1097 | break; |
|---|
| | 1098 | } |
|---|
| | 1099 | } |
|---|
| | 1100 | |
|---|
| | 1101 | if ( !m ) |
|---|
| | 1102 | break; |
|---|
| | 1103 | |
|---|
| | 1104 | // :not() is a special case that can be optimized by |
|---|
| | 1105 | // keeping it out of the expression list |
|---|
| | 1106 | if ( m[1] == ":" && m[2] == "not" ) |
|---|
| | 1107 | r = jQuery.filter(m[3], r, true).r; |
|---|
| | 1108 | |
|---|
| | 1109 | // We can get a big speed boost by filtering by class here |
|---|
| | 1110 | else if ( m[1] == "." ) |
|---|
| | 1111 | r = jQuery.classFilter(r, m[2], not); |
|---|
| | 1112 | |
|---|
| | 1113 | else if ( m[1] == "@" ) { |
|---|
| | 1114 | var tmp = [], type = m[3]; |
|---|
| | 1115 | |
|---|
| | 1116 | for ( var i = 0, rl = r.length; i < rl; i++ ) { |
|---|
| | 1117 | var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; |
|---|
| | 1118 | |
|---|
| | 1119 | if ( z == null || /href|src/.test(m[2]) ) |
|---|
| | 1120 | z = jQuery.attr(a,m[2]) || ''; |
|---|
| | 1121 | |
|---|
| | 1122 | if ( (type == "" && !!z || |
|---|
| | 1123 | type == "=" && z == m[5] || |
|---|
| | 1124 | type == "!=" && z != m[5] || |
|---|
| | 1125 | type == "^=" && z && !z.indexOf(m[5]) || |
|---|
| | 1126 | type == "$=" && z.substr(z.length - m[5].length) == m[5] || |
|---|
| | 1127 | (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) |
|---|
| | 1128 | tmp.push( a ); |
|---|
| | 1129 | } |
|---|
| | 1130 | |
|---|
| | 1131 | r = tmp; |
|---|
| | 1132 | |
|---|
| | 1133 | // We can get a speed boost by handling nth-child here |
|---|
| | 1134 | } else if ( m[1] == ":" && m[2] == "nth-child" ) { |
|---|
| | 1135 | var num = jQuery.mergeNum++, tmp = [], |
|---|
| | 1136 | test = /(\d*)n\+?(\d*)/.exec( |
|---|
| | 1137 | m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || |
|---|
| | 1138 | !/\D/.test(m[3]) && "n+" + m[3] || m[3]), |
|---|
| | 1139 | first = (test[1] || 1) - 0, last = test[2] - 0; |
|---|
| | 1140 | |
|---|
| | 1141 | for ( var i = 0, rl = r.length; i < rl; i++ ) { |
|---|
| | 1142 | var node = r[i], parentNode = node.parentNode; |
|---|
| | 1143 | |
|---|
| | 1144 | if ( num != parentNode.mergeNum ) { |
|---|
| | 1145 | var c = 1; |
|---|
| | 1146 | |
|---|
| | 1147 | for ( var n = parentNode.firstChild; n; n = n.nextSibling ) |
|---|
| | 1148 | if ( n.nodeType == 1 ) |
|---|
| | 1149 | n.nodeIndex = c++; |
|---|
| | 1150 | |
|---|
| | 1151 | parentNode.mergeNum = num; |
|---|
| | 1152 | } |
|---|
| | 1153 | |
|---|
| | 1154 | var add = false; |
|---|
| | 1155 | |
|---|
| | 1156 | if ( first == 1 ) { |
|---|
| | 1157 | if ( last == 0 || node.nodeIndex == last ) |
|---|
| | 1158 | add = true; |
|---|
| | 1159 | } else if ( (node.nodeIndex + last) % first == 0 ) |
|---|
| | 1160 | add = true; |
|---|
| | 1161 | |
|---|
| | 1162 | if ( add ^ not ) |
|---|
| | 1163 | tmp.push( node ); |
|---|
| | 1164 | } |
|---|
| | 1165 | |
|---|
| | 1166 | r = tmp; |
|---|
| | 1167 | |
|---|
| | 1168 | // Otherwise, find the expression to execute |
|---|
| | 1169 | } else { |
|---|
| | 1170 | var f = jQuery.expr[m[1]]; |
|---|
| | 1171 | if ( typeof f != "string" ) |
|---|
| | 1172 | f = jQuery.expr[m[1]][m[2]]; |
|---|
| | 1173 | |
|---|
| | 1174 | // Build a custom macro to enclose it |
|---|
| | 1175 | eval("f = function(a,i){return " + f + "}"); |
|---|
| | 1176 | |
|---|
| | 1177 | // Execute it against the current filter |
|---|
| | 1178 | r = jQuery.grep( r, f, not ); |
|---|
| | 1179 | } |
|---|
| | 1180 | } |
|---|
| | 1181 | |
|---|
| | 1182 | // Return an array of filtered elements (r) |
|---|
| | 1183 | // and the modified expression string (t) |
|---|
| | 1184 | return { r: r, t: t }; |
|---|
| | 1185 | }, |
|---|
| | 1186 | parents: function( elem ){ |
|---|
| | 1187 | var matched = []; |
|---|
| | 1188 | var cur = elem.parentNode; |
|---|
| | 1189 | while ( cur && cur != document ) { |
|---|
| | 1190 | matched.push( cur ); |
|---|
| | 1191 | cur = cur.parentNode; |
|---|
| | 1192 | } |
|---|
| | 1193 | return matched; |
|---|
| | 1194 | }, |
|---|
| | 1195 | nth: function(cur,result,dir,elem){ |
|---|
| | 1196 | result = result || 1; |
|---|
| | 1197 | var num = 0; |
|---|
| | 1198 | |
|---|
| | 1199 | for ( ; cur; cur = cur[dir] ) |
|---|
| | 1200 | if ( cur.nodeType == 1 && ++num == result ) |
|---|
| | 1201 | break; |
|---|
| | 1202 | |
|---|
| | 1203 | return cur; |
|---|
| | 1204 | }, |
|---|
| | 1205 | sibling: function( n, elem ) { |
|---|
| | 1206 | var r = []; |
|---|
| | 1207 | |
|---|
| | 1208 | for ( ; n; n = n.nextSibling ) { |
|---|
| | 1209 | if ( n.nodeType == 1 && (!elem || n != elem) ) |
|---|
| | 1210 | r.push( n ); |
|---|
| | 1211 | } |
|---|
| | 1212 | |
|---|
| | 1213 | return r; |
|---|
| | 1214 | } |
|---|
| | 1215 | }); |
|---|
| | 1216 | /* |
|---|
| | 1217 | * A number of helper functions used for managing events. |
|---|
| | 1218 | * Many of the ideas behind this code orignated from |
|---|
| | 1219 | * Dean Edwards' addEvent library. |
|---|
| | 1220 | */ |
|---|
| | 1221 | jQuery.event = { |
|---|
| | 1222 | |
|---|
| | 1223 | // Bind an event to an element |
|---|
| | 1224 | // Original by Dean Edwards |
|---|
| | 1225 | add: function(element, type, handler, data) { |
|---|
| | 1226 | // For whatever reason, IE has trouble passing the window object |
|---|
| | 1227 | // around, causing it to be cloned in the process |
|---|
| | 1228 | if ( jQuery.browser.msie && element.setInterval != undefined ) |
|---|
| | 1229 | element = window; |
|---|
| | 1230 | |
|---|
| | 1231 | // Make sure that the function being executed has a unique ID |
|---|
| | 1232 | if ( !handler.guid ) |
|---|
| | 1233 | handler.guid = this.guid++; |
|---|
| | 1234 | |
|---|
| | 1235 | // if data is passed, bind to handler |
|---|
| | 1236 | if( data != undefined ) { |
|---|
| | 1237 | // Create temporary function pointer to original handler |
|---|
| | 1238 | var fn = handler; |
|---|
| | 1239 | |
|---|
| | 1240 | // Create unique handler function, wrapped around original handler |
|---|
| | 1241 | handler = function() { |
|---|
| | 1242 | // Pass arguments and context to original handler |
|---|
| | 1243 | return fn.apply(this, arguments); |
|---|
| | 1244 | }; |
|---|
| | 1245 | |
|---|
| | 1246 | // Store data in unique handler |
|---|
| | 1247 | handler.data = data; |
|---|
| | 1248 | |
|---|
| | 1249 | // Set the guid of unique handler to the same of original handler, so it can be removed |
|---|
| | 1250 | handler.guid = fn.guid; |
|---|
| | 1251 | } |
|---|
| | 1252 | |
|---|
| | 1253 | // Init the element's event structure |
|---|
| | 1254 | if (!element.$events) |
|---|
| | 1255 | element.$events = {}; |
|---|
| | 1256 | |
|---|
| | 1257 | if (!element.$handle) |
|---|
| | 1258 | element.$handle = function() { |
|---|
| | 1259 | // returned undefined or false |
|---|
| | 1260 | var val; |
|---|
| | 1261 | |
|---|
| | 1262 | // Handle the second event of a trigger and when |
|---|
| | 1263 | // an event is called after a page has unloaded |
|---|
| | 1264 | if ( typeof jQuery == "undefined" || jQuery.event.triggered ) |
|---|
| | 1265 | return val; |
|---|
| | 1266 | |
|---|
| | 1267 | val = jQuery.event.handle.apply(element, arguments); |
|---|
| | 1268 | |
|---|
| | 1269 | return val; |
|---|
| | 1270 | }; |
|---|
| | 1271 | |
|---|
| | 1272 | // Get the current list of functions bound to this event |
|---|
| | 1273 | var handlers = element.$events[type]; |
|---|
| | 1274 | |
|---|
| | 1275 | // Init the event handler queue |
|---|
| | 1276 | if (!handlers) { |
|---|
| | 1277 | handlers = element.$events[type] = {}; |
|---|
| | 1278 | |
|---|
| | 1279 | // And bind the global event handler to the element |
|---|
| | 1280 | if (element.addEventListener) |
|---|
| | 1281 | element.addEventListener(type, element.$handle, false); |
|---|
| | 1282 | else |
|---|
| | 1283 | element.attachEvent("on" + type, element.$handle); |
|---|
| | 1284 | } |
|---|
| | 1285 | |
|---|
| | 1286 | // Add the function to the element's handler list |
|---|
| | 1287 | handlers[handler.guid] = handler; |
|---|
| | 1288 | |
|---|
| | 1289 | // Remember the function in a global list (for triggering) |
|---|
| | 1290 | if (!this.global[type]) |
|---|
| | 1291 | this.global[type] = []; |
|---|
| | 1292 | // Only add the element to the global list once |
|---|
| | 1293 | if (jQuery.inArray(element, this.global[type]) == -1) |
|---|
| | 1294 | this.global[type].push( element ); |
|---|
| | 1295 | }, |
|---|
| | 1296 | |
|---|
| | 1297 | guid: 1, |
|---|
| | 1298 | global: {}, |
|---|
| | 1299 | |
|---|
| | 1300 | // Detach an event or set of events from an element |
|---|
| | 1301 | remove: function(element, type, handler) { |
|---|
| | 1302 | var events = element.$events, ret, index; |
|---|
| | 1303 | |
|---|
| | 1304 | if ( events ) { |
|---|
| | 1305 | // type is actually an event object here |
|---|
| | 1306 | if ( type && type.type ) { |
|---|
| | 1307 | handler = type.handler; |
|---|
| | 1308 | type = type.type; |
|---|
| | 1309 | } |
|---|
| | 1310 | |
|---|
| | 1311 | if ( !type ) { |
|---|
| | 1312 | for ( type in events ) |
|---|
| | 1313 | this.remove( element, type ); |
|---|
| | 1314 | |
|---|
| | 1315 | } else if ( events[type] ) { |
|---|
| | 1316 | // remove the given handler for the given type |
|---|
| | 1317 | if ( handler ) |
|---|
| | 1318 | delete events[type][handler.guid]; |
|---|
| | 1319 | |
|---|
| | 1320 | // remove all handlers for the given type |
|---|
| | 1321 | else |
|---|
| | 1322 | for ( handler in element.$events[type] ) |
|---|
| | 1323 | delete events[type][handler]; |
|---|
| | 1324 | |
|---|
| | 1325 | // remove generic event handler if no more handlers exist |
|---|
| | 1326 | for ( ret in events[type] ) break; |
|---|
| | 1327 | if ( !ret ) { |
|---|
| | 1328 | if (element.removeEventListener) |
|---|
| | 1329 | element.removeEventListener(type, element.$handle, false); |
|---|
| | 1330 | else |
|---|
| | 1331 | element.detachEvent("on" + type, element.$handle); |
|---|
| | 1332 | ret = null; |
|---|
| | 1333 | delete events[type]; |
|---|
| | 1334 | |
|---|
| | 1335 | // Remove element from the global event type cache |
|---|
| | 1336 | while ( this.global[type] && ( (index = jQuery.inArray(element, this.global[type])) >= 0 ) ) |
|---|
| | 1337 | delete this.global[type][index]; |
|---|
| | 1338 | } |
|---|
| | 1339 | } |
|---|
| | 1340 | |
|---|
| | 1341 | // Remove the expando if it's no longer used |
|---|
| | 1342 | for ( ret in events ) break; |
|---|
| | 1343 | if ( !ret ) |
|---|
| | 1344 | element.$handle = element.$events = null; |
|---|
| | 1345 | } |
|---|
| | 1346 | }, |
|---|
| | 1347 | |
|---|
| | 1348 | trigger: function(type, data, element) { |
|---|
| | 1349 | // Clone the incoming data, if any |
|---|
| | 1350 | data = jQuery.makeArray(data || []); |
|---|
| | 1351 | |
|---|
| | 1352 | // Handle a global trigger |
|---|
| | 1353 | if ( !element ) |
|---|
| | 1354 | jQuery.each( this.global[type] || [], function(){ |
|---|
| | 1355 | jQuery.event.trigger( type, data, this ); |
|---|
| | 1356 | }); |
|---|
| | 1357 | |
|---|
| | 1358 | // Handle triggering a single element |
|---|
| | 1359 | else { |
|---|
| | 1360 | var val, ret, fn = jQuery.isFunction( element[ type ] || null ); |
|---|
| | 1361 | |
|---|
| | 1362 | // Pass along a fake event |
|---|
| | 1363 | data.unshift( this.fix({ type: type, target: element }) ); |
|---|
| | 1364 | |
|---|
| | 1365 | // Trigger the event |
|---|
| | 1366 | if ( jQuery.isFunction(element.$handle) && (val = element.$handle.apply( element, data )) !== false ) |
|---|
| | 1367 | this.triggered = true; |
|---|
| | 1368 | |
|---|
| | 1369 | if ( fn && val !== false && !jQuery.nodeName(element, 'a') ) |
|---|
| | 1370 | element[ type ](); |
|---|
| | 1371 | |
|---|
| | 1372 | this.triggered = false; |
|---|
| | 1373 | } |
|---|
| | 1374 | }, |
|---|
| | 1375 | |
|---|
| | 1376 | handle: function(event) { |
|---|
| | 1377 | // returned undefined or false |
|---|
| | 1378 | var val; |
|---|
| | 1379 | |
|---|
| | 1380 | // Empty object is for triggered events with no data |
|---|
| | 1381 | event = jQuery.event.fix( event || window.event || {} ); |
|---|
| | 1382 | |
|---|
| | 1383 | var c = this.$events && this.$events[event.type], args = [].slice.call( arguments, 1 ); |
|---|
| | 1384 | args.unshift( event ); |
|---|
| | 1385 | |
|---|
| | 1386 | for ( var j in c ) { |
|---|
| | 1387 | // Pass in a reference to the handler function itself |
|---|
| | 1388 | // So that we can later remove it |
|---|
| | 1389 | args[0].handler = c[j]; |
|---|
| | 1390 | args[0].data = c[j].data; |
|---|
| | 1391 | |
|---|
| | 1392 | if ( c[j].apply( this, args ) === false ) { |
|---|
| | 1393 | event.preventDefault(); |
|---|
| | 1394 | event.stopPropagation(); |
|---|
| | 1395 | val = false; |
|---|
| | 1396 | } |
|---|
| | 1397 | } |
|---|
| | 1398 | |
|---|
| | 1399 | // Clean up added properties in IE to prevent memory leak |
|---|
| | 1400 | if (jQuery.browser.msie) |
|---|
| | 1401 | event.target = event.preventDefault = event.stopPropagation = |
|---|
| | 1402 | event.handler = event.data = null; |
|---|
| | 1403 | |
|---|
| | 1404 | return val; |
|---|
| | 1405 | }, |
|---|
| | 1406 | |
|---|
| | 1407 | fix: function(event) { |
|---|
| | 1408 | // store a copy of the original event object |
|---|
| | 1409 | // and clone to set read-only properties |
|---|
| | 1410 | var originalEvent = event; |
|---|
| | 1411 | event = jQuery.extend({}, originalEvent); |
|---|
| | 1412 | |
|---|
| | 1413 | // add preventDefault and stopPropagation since |
|---|
| | 1414 | // they will not work on the clone |
|---|
| | 1415 | event.preventDefault = function() { |
|---|
| | 1416 | // if preventDefault exists run it on the original event |
|---|
| | 1417 | if (originalEvent.preventDefault) |
|---|
| | 1418 | return originalEvent.preventDefault(); |
|---|
| | 1419 | // otherwise set the returnValue property of the original event to false (IE) |
|---|
| | 1420 | originalEvent.returnValue = false; |
|---|
| | 1421 | }; |
|---|
| | 1422 | event.stopPropagation = function() { |
|---|
| | 1423 | // if stopPropagation exists run it on the original event |
|---|
| | 1424 | if (originalEvent.stopPropagation) |
|---|
| | 1425 | return originalEvent.stopPropagation(); |
|---|
| | 1426 | // otherwise set the cancelBubble property of the original event to true (IE) |
|---|
| | 1427 | originalEvent.cancelBubble = true; |
|---|
| | 1428 | }; |
|---|
| | 1429 | |
|---|
| | 1430 | // Fix target property, if necessary |
|---|
| | 1431 | if ( !event.target && event.srcElement ) |
|---|
| | 1432 | event.target = event.srcElement; |
|---|
| | 1433 | |
|---|
| | 1434 | // check if target is a textnode (safari) |
|---|
| | 1435 | if (jQuery.browser.safari && event.target.nodeType == 3) |
|---|
| | 1436 | event.target = originalEvent.target.parentNode; |
|---|
| | 1437 | |
|---|
| | 1438 | // Add relatedTarget, if necessary |
|---|
| | 1439 | if ( !event.relatedTarget && event.fromElement ) |
|---|
| | 1440 | event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; |
|---|
| | 1441 | |
|---|
| | 1442 | // Calculate pageX/Y if missing and clientX/Y available |
|---|
| | 1443 | if ( event.pageX == null && event.clientX != null ) { |
|---|
| | 1444 | var e = document.documentElement, b = document.body; |
|---|
| | 1445 | event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft); |
|---|
| | 1446 | event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop); |
|---|
| | 1447 | } |
|---|
| | 1448 | |
|---|
| | 1449 | // Add which for key events |
|---|
| | 1450 | if ( !event.which && (event.charCode || event.keyCode) ) |
|---|
| | 1451 | event.which = event.charCode || event.keyCode; |
|---|
| | 1452 | |
|---|
| | 1453 | // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
|---|
| | 1454 | if ( !event.metaKey && event.ctrlKey ) |
|---|
| | 1455 | event.metaKey = event.ctrlKey; |
|---|
| | 1456 | |
|---|
| | 1457 | // Add which for click: 1 == left; 2 == middle; 3 == right |
|---|
| | 1458 | // Note: button is not normalized, so don't use it |
|---|
| | 1459 | if ( !event.which && event.button ) |
|---|
| | 1460 | event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
|---|
| | 1461 | |
|---|
| | 1462 | return event; |
|---|
| | 1463 | } |
|---|
| | 1464 | }; |
|---|
| | 1465 | |
|---|
| | 1466 | jQuery.fn.extend({ |
|---|
| | 1467 | bind: function( type, data, fn ) { |
|---|
| | 1468 | return type == "unload" ? this.one(type, data, fn) : this.each(function(){ |
|---|
| | 1469 | jQuery.event.add( this, type, fn || data, fn && data ); |
|---|
| | 1470 | }); |
|---|
| | 1471 | }, |
|---|
| | 1472 | one: function( type, data, fn ) { |
|---|
| | 1473 | return this.each(function(){ |
|---|
| | 1474 | jQuery.event.add( this, type, function(event) { |
|---|
| | 1475 | jQuery(this).unbind(event); |
|---|
| | 1476 | return (fn || data).apply( this, arguments); |
|---|
| | 1477 | }, fn && data); |
|---|
| | 1478 | }); |
|---|
| | 1479 | }, |
|---|
| | 1480 | unbind: function( type, fn ) { |
|---|
| | 1481 | return this.each(function(){ |
|---|
| | 1482 | jQuery.event.remove( this, type, fn ); |
|---|
| | 1483 | }); |
|---|
| | 1484 | }, |
|---|
| | 1485 | trigger: function( type, data ) { |
|---|
| | 1486 | return this.each(function(){ |
|---|
| | 1487 | jQuery.event.trigger( type, data, this ); |
|---|
| | 1488 | }); |
|---|
| | 1489 | }, |
|---|
| | 1490 | toggle: function() { |
|---|
| | 1491 | // Save reference to arguments for access in closure |
|---|
| | 1492 | var a = arguments; |
|---|
| | 1493 | |
|---|
| | 1494 | return this.click(function(e) { |
|---|
| | 1495 | // Figure out which function to execute |
|---|
| | 1496 | this.lastToggle = 0 == this.lastToggle ? 1 : 0; |
|---|
| | 1497 | |
|---|
| | 1498 | // Make sure that clicks stop |
|---|
| | 1499 | e.preventDefault(); |
|---|
| | 1500 | |
|---|
| | 1501 | // and execute the function |
|---|
| | 1502 | return a[this.lastToggle].apply( this, [e] ) || false; |
|---|
| | 1503 | }); |
|---|
| | 1504 | }, |
|---|
| | 1505 | hover: function(f,g) { |
|---|
| | 1506 | |
|---|
| | 1507 | // A private function for handling mouse 'hovering' |
|---|
| | 1508 | function handleHover(e) { |
|---|
| | 1509 | // Check if mouse(over|out) are still within the same parent element |
|---|
| | 1510 | var p = e.relatedTarget; |
|---|
| | 1511 | |
|---|
| | 1512 | // Traverse up the tree |
|---|
| | 1513 | while ( p && p != this ) try { p = p.parentNode } catch(e) { p = this; }; |
|---|
| | 1514 | |
|---|
| | 1515 | // If we actually just moused on to a sub-element, ignore it |
|---|
| | 1516 | if ( p == this ) return false; |
|---|
| | 1517 | |
|---|
| | 1518 | // Execute the right function |
|---|
| | 1519 | return (e.type == "mouseover" ? f : g).apply(this, [e]); |
|---|
| | 1520 | } |
|---|
| | 1521 | |
|---|
| | 1522 | // Bind the function to the two event listeners |
|---|
| | 1523 | return this.mouseover(handleHover).mouseout(handleHover); |
|---|
| | 1524 | }, |
|---|
| | 1525 | ready: function(f) { |
|---|
| | 1526 | // If the DOM is already ready |
|---|
| | 1527 | if ( jQuery.isReady ) |
|---|
| | 1528 | // Execute the function immediately |
|---|
| | 1529 | f.apply( document, [jQuery] ); |
|---|
| | 1530 | |
|---|
| | 1531 | // Otherwise, remember the function for later |
|---|
| | 1532 | else |
|---|
| | 1533 | // Add the function to the wait list |
|---|
| | 1534 | jQuery.readyList.push( function() { return f.apply(this, [jQuery]) } ); |
|---|
| | 1535 | |
|---|
| | 1536 | return this; |
|---|
| | 1537 | } |
|---|
| | 1538 | }); |
|---|
| | 1539 | |
|---|
| | 1540 | jQuery.extend({ |
|---|
| | 1541 | /* |
|---|
| | 1542 | * All the code that makes DOM Ready work nicely. |
|---|
| | 1543 | */ |
|---|
| | 1544 | isReady: false, |
|---|
| | 1545 | readyList: [], |
|---|
| | 1546 | |
|---|
| | 1547 | // Handle when the DOM is ready |
|---|
| | 1548 | ready: function() { |
|---|
| | 1549 | // Make sure that the DOM is not already loaded |
|---|
| | 1550 | if ( !jQuery.isReady ) { |
|---|
| | 1551 | // Remember that the DOM is ready |
|---|
| | 1552 | jQuery.isReady = true; |
|---|
| | 1553 | |
|---|
| | 1554 | // If there are functions bound, to execute |
|---|
| | 1555 | if ( jQuery.readyList ) { |
|---|
| | 1556 | // Execute all of them |
|---|
| | 1557 | jQuery.each( jQuery.readyList, function(){ |
|---|
| | 1558 | this.apply( document ); |
|---|
| | 1559 | }); |
|---|
| | 1560 | |
|---|
| | 1561 | // Reset the list of functions |
|---|
| | 1562 | jQuery.readyList = null; |
|---|
| | 1563 | } |
|---|
| | 1564 | // Remove event listener to avoid memory leak |
|---|
| | 1565 | if ( jQuery.browser.mozilla || jQuery.browser.opera ) |
|---|
| | 1566 | document.removeEventListener( "DOMContentLoaded", jQuery.ready, false ); |
|---|
| | 1567 | |
|---|
| | 1568 | // Remove script element used by IE hack |
|---|
| | 1569 | if( !window.frames.length ) // don't remove if frames are present (#1187) |
|---|
| | 1570 | jQuery(window).load(function(){ jQuery("#__ie_init").remove(); }); |
|---|
| | 1571 | } |
|---|
| | 1572 | } |
|---|
| | 1573 | }); |
|---|
| | 1574 | |
|---|
| | 1575 | new function(){ |
|---|
| | 1576 | |
|---|
| | 1577 | jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + |
|---|
| | 1578 | "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + |
|---|
| | 1579 | "submit,keydown,keypress,keyup,error").split(","), function(i,o){ |
|---|
| | 1580 | |
|---|
| | 1581 | // Handle event binding |
|---|
| | 1582 | jQuery.fn[o] = function(f){ |
|---|
| | 1583 | return f ? this.bind(o, f) : this.trigger(o); |
|---|
| | 1584 | }; |
|---|
| | 1585 | |
|---|
| | 1586 | }); |
|---|
| | 1587 | |
|---|
| | 1588 | // If Mozilla is used |
|---|
| | 1589 | if ( jQuery.browser.mozilla || jQuery.browser.opera ) |
|---|
| | 1590 | // Use the handy event callback |
|---|
| | 1591 | document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); |
|---|
| | 1592 | |
|---|
| | 1593 | // If IE is used, use the excellent hack by Matthias Miller |
|---|
| | 1594 | // http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited |
|---|
| | 1595 | else if ( jQuery.browser.msie ) { |
|---|
| | 1596 | |
|---|
| | 1597 | // Only works if you document.write() it |
|---|
| | 1598 | document.write("<scr" + "ipt id=__ie_init defer=true " + |
|---|
| | 1599 | "src=//:><\/script>"); |
|---|
| | 1600 | |
|---|
| | 1601 | // Use the defer script hack |
|---|
| | 1602 | var script = document.getElementById("__ie_init"); |
|---|
| | 1603 | |
|---|
| | 1604 | // script does not exist if jQuery is loaded dynamically |
|---|
| | 1605 | if ( script ) |
|---|
| | 1606 | script.onreadystatechange = function() { |
|---|
| | 1607 | if ( this.readyState != "complete" ) return; |
|---|
| | 1608 | jQuery.ready(); |
|---|
| | 1609 | }; |
|---|
| | 1610 | |
|---|
| | 1611 | // Clear from memory |
|---|
| | 1612 | script = null; |
|---|
| | 1613 | |
|---|
| | 1614 | // If Safari is used |
|---|
| | 1615 | } else if ( jQuery.browser.safari ) |
|---|
| | 1616 | // Continually check to see if the document.readyState is valid |
|---|
| | 1617 | jQuery.safariTimer = setInterval(function(){ |
|---|
| | 1618 | // loaded and complete are both valid states |
|---|
| | 1619 | if ( document.readyState == "loaded" || |
|---|
| | 1620 | document.readyState == "complete" ) { |
|---|
| | 1621 | |
|---|
| | 1622 | // If either one are found, remove the timer |
|---|
| | 1623 | clearInterval( jQuery.safariTimer ); |
|---|
| | 1624 | jQuery.safariTimer = null; |
|---|
| | 1625 | |
|---|
| | 1626 | // and execute any waiting functions |
|---|
| | 1627 | jQuery.ready(); |
|---|
| | 1628 | } |
|---|
| | 1629 | }, 10); |
|---|
| | 1630 | |
|---|
| | 1631 | // A fallback to window.onload, that will always work |
|---|
| | 1632 | jQuery.event.add( window, "load", jQuery.ready ); |
|---|
| | 1633 | |
|---|
| | 1634 | }; |
|---|
| | 1635 | |
|---|
| | 1636 | // Clean up after IE to avoid memory leaks |
|---|
| | 1637 | if (jQuery.browser.msie) |
|---|
| | 1638 | jQuery(window).one("unload", function() { |
|---|
| | 1639 | var global = jQuery.event.global; |
|---|
| | 1640 | for ( var type in global ) { |
|---|
| | 1641 | var els = global[type], i = els.length; |
|---|
| | 1642 | if ( i && type != 'unload' ) |
|---|
| | 1643 | do |
|---|
| | 1644 | els[i-1] && jQuery.event.remove(els[i-1], type); |
|---|
| | 1645 | while (--i); |
|---|
| | 1646 | } |
|---|
| | 1647 | }); |
|---|
| | 1648 | jQuery.fn.extend({ |
|---|
| | 1649 | loadIfModified: function( url, params, callback ) { |
|---|
| | 1650 | this.load( url, params, callback, 1 ); |
|---|
| | 1651 | }, |
|---|
| | 1652 | load: function( url, params, callback, ifModified ) { |
|---|
| | 1653 | if ( jQuery.isFunction( url ) ) |
|---|
| | 1654 | return this.bind("load", url); |
|---|
| | 1655 | |
|---|
| | 1656 | callback = callback || function(){}; |
|---|
| | 1657 | |
|---|
| | 1658 | // Default to a GET request |
|---|
| | 1659 | var type = "GET"; |
|---|
| | 1660 | |
|---|
| | 1661 | // If the second parameter was provided |
|---|
| | 1662 | if ( params ) |
|---|
| | 1663 | // If it's a function |
|---|
| | 1664 | if ( jQuery.isFunction( params ) ) { |
|---|
| | 1665 | // We assume that it's the callback |
|---|
| | 1666 | callback = params; |
|---|
| | 1667 | params = null; |
|---|
| | 1668 | |
|---|
| | 1669 | // Otherwise, build a param string |
|---|
| | 1670 | } else { |
|---|
| | 1671 | params = jQuery.param( params ); |
|---|
| | 1672 | type = "POST"; |
|---|
| | 1673 | } |
|---|
| | 1674 | |
|---|
| | 1675 | var self = this; |
|---|
| | 1676 | |
|---|
| | 1677 | // Request the remote document |
|---|
| | 1678 | jQuery.ajax({ |
|---|
| | 1679 | url: url, |
|---|
| | 1680 | type: type, |
|---|
| | 1681 | data: params, |
|---|
| | 1682 | ifModified: ifModified, |
|---|
| | 1683 | complete: function(res, status){ |
|---|
| | 1684 | if ( status == "success" || !ifModified && status == "notmodified" ) |
|---|
| | 1685 | // Inject the HTML into all the matched elements |
|---|
| | 1686 | self.attr("innerHTML", res.responseText) |
|---|
| | 1687 | // Execute all the scripts inside of the newly-injected HTML |
|---|
| | 1688 | .evalScripts() |
|---|
| | 1689 | // Execute callback |
|---|
| | 1690 | .each( callback, [res.responseText, status, res] ); |
|---|
| | 1691 | else |
|---|
| | 1692 | callback.apply( self, [res.responseText, status, res] ); |
|---|
| | 1693 | } |
|---|
| | 1694 | }); |
|---|
| | 1695 | return this; |
|---|
| | 1696 | }, |
|---|
| | 1697 | serialize: function() { |
|---|
| | 1698 | return jQuery.param( this ); |
|---|
| | 1699 | }, |
|---|
| | 1700 | evalScripts: function() { |
|---|
| | 1701 | return this.find("script").each(function(){ |
|---|
| | 1702 | if ( this.src ) |
|---|
| | 1703 | jQuery.getScript( this.src ); |
|---|
| | 1704 | else |
|---|
| | 1705 | jQuery.globalEval( this.text || this.textContent || this.innerHTML || "" ); |
|---|
| | 1706 | }).end(); |
|---|
| | 1707 | } |
|---|
| | 1708 | |
|---|
| | 1709 | }); |
|---|
| | 1710 | |
|---|
| | 1711 | // Attach a bunch of functions for handling common AJAX events |
|---|
| | 1712 | |
|---|
| | 1713 | jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ |
|---|
| | 1714 | jQuery.fn[o] = function(f){ |
|---|
| | 1715 | return this.bind(o, f); |
|---|
| | 1716 | }; |
|---|
| | 1717 | }); |
|---|
| | 1718 | |
|---|
| | 1719 | jQuery.extend({ |
|---|
| | 1720 | get: function( url, data, callback, type, ifModified ) { |
|---|
| | 1721 | // shift arguments if data argument was ommited |
|---|
| | 1722 | if ( jQuery.isFunction( data ) ) { |
|---|
| | 1723 | callback = data; |
|---|
| | 1724 | data = null; |
|---|
| | 1725 | } |
|---|
| | 1726 | |
|---|
| | 1727 | return jQuery.ajax({ |
|---|
| | 1728 | type: "GET", |
|---|
| | 1729 | url: url, |
|---|
| | 1730 | data: data, |
|---|
| | 1731 | success: callback, |
|---|
| | 1732 | dataType: type, |
|---|
| | 1733 | ifModified: ifModified |
|---|
| | 1734 | }); |
|---|
| | 1735 | }, |
|---|
| | 1736 | getIfModified: function( url, data, callback, type ) { |
|---|
| | 1737 | return jQuery.get(url, data, callback, type, 1); |
|---|
| | 1738 | }, |
|---|
| | 1739 | getScript: function( url, callback ) { |
|---|
| | 1740 | return jQuery.get(url, null, callback, "script"); |
|---|
| | 1741 | }, |
|---|
| | 1742 | getJSON: function( url, data, callback ) { |
|---|
| | 1743 | return jQuery.get(url, data, callback, "json"); |
|---|
| | 1744 | }, |
|---|
| | 1745 | post: function( url, data, callback, type ) { |
|---|
| | 1746 | if ( jQuery.isFunction( data ) ) { |
|---|
| | 1747 | callback = data; |
|---|
| | 1748 | data = {}; |
|---|
| | 1749 | } |
|---|
| | 1750 | |
|---|
| | 1751 | return jQuery.ajax({ |
|---|
| | 1752 | type: "POST", |
|---|
| | 1753 | url: url, |
|---|
| | 1754 | data: data, |
|---|
| | 1755 | success: callback, |
|---|
| | 1756 | dataType: type |
|---|
| | 1757 | }); |
|---|
| | 1758 | }, |
|---|
| | 1759 | ajaxTimeout: function( timeout ) { |
|---|
| | 1760 | jQuery.ajaxSettings.timeout = timeout; |
|---|
| | 1761 | }, |
|---|
| | 1762 | ajaxSetup: function( settings ) { |
|---|
| | 1763 | jQuery.extend( jQuery.ajaxSettings, settings ); |
|---|
| | 1764 | }, |
|---|
| | 1765 | |
|---|
| | 1766 | ajaxSettings: { |
|---|
| | 1767 | global: true, |
|---|
| | 1768 | type: "GET", |
|---|
| | 1769 | timeout: 0, |
|---|
| | 1770 | contentType: "application/x-www-form-urlencoded", |
|---|
| | 1771 | processData: true, |
|---|
| | 1772 | async: true, |
|---|
| | 1773 | data: null |
|---|
| | 1774 | }, |
|---|
| | 1775 | |
|---|
| | 1776 | // Last-Modified header cache for next request |
|---|
| | 1777 | lastModified: {}, |
|---|
| | 1778 | ajax: function( s ) { |
|---|
| | 1779 | // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout |
|---|
| | 1780 | s = jQuery.extend({}, jQuery.ajaxSettings, s); |
|---|
| | 1781 | |
|---|
| | 1782 | // if data available |
|---|
| | 1783 | if ( s.data ) { |
|---|
| | 1784 | // convert data if not already a string |
|---|
| | 1785 | if (s.processData && typeof s.data != "string") |
|---|
| | 1786 | s.data = jQuery.param(s.data); |
|---|
| | 1787 | // append data to url for get requests |
|---|
| | 1788 | if( s.type.toLowerCase() == "get" ) { |
|---|
| | 1789 | // "?" + data or "&" + data (in case there are already params) |
|---|
| | 1790 | s.url += ((s.url.indexOf("?") > -1) ? "&" : "?") + s.data; |
|---|
| | 1791 | // IE likes to send both get and post data, prevent this |
|---|
| | 1792 | s.data = null; |
|---|
| | 1793 | } |
|---|
| | 1794 | } |
|---|
| | 1795 | |
|---|
| | 1796 | // Watch for a new set of requests |
|---|
| | 1797 | if ( s.global && ! jQuery.active++ ) |
|---|
| | 1798 | jQuery.event.trigger( "ajaxStart" ); |
|---|
| | 1799 | |
|---|
| | 1800 | var requestDone = false; |
|---|
| | 1801 | |
|---|
| | 1802 | // Create the request object; Microsoft failed to properly |
|---|
| | 1803 | // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available |
|---|
| | 1804 | var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); |
|---|
| | 1805 | |
|---|
| | 1806 | // Open the socket |
|---|
| | 1807 | xml.open(s.type, s.url, s.async); |
|---|
| | 1808 | |
|---|
| | 1809 | // Set the correct header, if data is being sent |
|---|
| | 1810 | if ( s.data ) |
|---|
| | 1811 | xml.setRequestHeader("Content-Type", s.contentType); |
|---|
| | 1812 | |
|---|
| | 1813 | // Set the If-Modified-Since header, if ifModified mode. |
|---|
| | 1814 | if ( s.ifModified ) |
|---|
| | 1815 | xml.setRequestHeader("If-Modified-Since", |
|---|
| | 1816 | jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); |
|---|
| | 1817 | |
|---|
| | 1818 | // Set header so the called script knows that it's an XMLHttpRequest |
|---|
| | 1819 | xml.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
|---|
| | 1820 | |
|---|
| | 1821 | // Allow custom headers/mimetypes |
|---|
| | 1822 | if( s.beforeSend ) |
|---|
| | 1823 | s.beforeSend(xml); |
|---|
| | 1824 | |
|---|
| | 1825 | if ( s.global ) |
|---|
| | 1826 | jQuery.event.trigger("ajaxSend", [xml, s]); |
|---|
| | 1827 | |
|---|
| | 1828 | // Wait for a response to come back |
|---|
| | 1829 | var onreadystatechange = function(isTimeout){ |
|---|
| | 1830 | // The transfer is complete and the data is available, or the request timed out |
|---|
| | 1831 | if ( xml && (xml.readyState == 4 || isTimeout == "timeout") ) { |
|---|
| | 1832 | requestDone = true; |
|---|
| | 1833 | |
|---|
| | 1834 | // clear poll interval |
|---|
| | 1835 | if (ival) { |
|---|
| | 1836 | clearInterval(ival); |
|---|
| | 1837 | ival = null; |
|---|
| | 1838 | } |
|---|
| | 1839 | |
|---|
| | 1840 | var status; |
|---|
| | 1841 | try { |
|---|
| | 1842 | status = jQuery.httpSuccess( xml ) && isTimeout != "timeout" ? |
|---|
| | 1843 | s.ifModified && jQuery.httpNotModified( xml, s.url ) ? "notmodified" : "success" : "error"; |
|---|
| | 1844 | // Make sure that the request was successful or notmodified |
|---|
| | 1845 | if ( status != "error" ) { |
|---|
| | 1846 | // Cache Last-Modified header, if ifModified mode. |
|---|
| | 1847 | var modRes; |
|---|
| | 1848 | try { |
|---|
| | 1849 | modRes = xml.getResponseHeader("Last-Modified"); |
|---|
| | 1850 | } catch(e) {} // swallow exception thrown by FF if header is not available |
|---|
| | 1851 | |
|---|
| | 1852 | if ( s.ifModified && modRes ) |
|---|
| | 1853 | jQuery.lastModified[s.url] = modRes; |
|---|
| | 1854 | |
|---|
| | 1855 | // process the data (runs the xml through httpData regardless of callback) |
|---|
| | 1856 | var data = jQuery.httpData( xml, s.dataType ); |
|---|
| | 1857 | |
|---|
| | 1858 | // If a local callback was specified, fire it and pass it the data |
|---|
| | 1859 | if ( s.success ) |
|---|
| | 1860 | s.success( data, status ); |
|---|
| | 1861 | |
|---|
| | 1862 | // Fire the global callback |
|---|
| | 1863 | if( s.global ) |
|---|
| | 1864 | jQuery.event.trigger( "ajaxSuccess", [xml, s] ); |
|---|
| | 1865 | } else |
|---|
| | 1866 | jQuery.handleError(s, xml, status); |
|---|
| | 1867 | } catch(e) { |
|---|
| | 1868 | status = "error"; |
|---|
| | 1869 | jQuery.handleError(s, xml, status, e); |
|---|
| | 1870 | } |
|---|
| | 1871 | |
|---|
| | 1872 | // The request was completed |
|---|
| | 1873 | if( s.global ) |
|---|
| | 1874 | jQuery.event.trigger( "ajaxComplete", [xml, s] ); |
|---|
| | 1875 | |
|---|
| | 1876 | // Handle the global AJAX counter |
|---|
| | 1877 | if ( s.global && ! --jQuery.active ) |
|---|
| | 1878 | jQuery.event.trigger( "ajaxStop" ); |
|---|
| | 1879 | |
|---|
| | 1880 | // Process result |
|---|
| | 1881 | if ( s.complete ) |
|---|
| | 1882 | s.complete(xml, status); |
|---|
| | 1883 | |
|---|
| | 1884 | // Stop memory leaks |
|---|
| | 1885 | if(s.async) |
|---|
| | 1886 | xml = null; |
|---|
| | 1887 | } |
|---|
| | 1888 | }; |
|---|
| | 1889 | |
|---|
| | 1890 | // don't attach the handler to the request, just poll it instead |
|---|
| | 1891 | var ival = setInterval(onreadystatechange, 13); |
|---|
| | 1892 | |
|---|
| | 1893 | // Timeout checker |
|---|
| | 1894 | if ( s.timeout > 0 ) |
|---|
| | 1895 | setTimeout(function(){ |
|---|
| | 1896 | // Check to see if the request is still happening |
|---|
| | 1897 | if ( xml ) { |
|---|
| | 1898 | // Cancel the request |
|---|
| | 1899 | xml.abort(); |
|---|
| | 1900 | |
|---|
| | 1901 | if( !requestDone ) |
|---|
| | 1902 | onreadystatechange( "timeout" ); |
|---|
| | 1903 | } |
|---|
| | 1904 | }, s.timeout); |
|---|
| | 1905 | |
|---|
| | 1906 | // Send the data |
|---|
| | 1907 | try { |
|---|
| | 1908 | xml.send(s.data); |
|---|
| | 1909 | } catch(e) { |
|---|
| | 1910 | jQuery.handleError(s, xml, null, e); |
|---|
| | 1911 | } |
|---|
| | 1912 | |
|---|
| | 1913 | // firefox 1.5 doesn't fire statechange for sync requests |
|---|
| | 1914 | if ( !s.async ) |
|---|
| | 1915 | onreadystatechange(); |
|---|
| | 1916 | |
|---|
| | 1917 | // return XMLHttpRequest to allow aborting the request etc. |
|---|
| | 1918 | return xml; |
|---|
| | 1919 | }, |
|---|
| | 1920 | |
|---|
| | 1921 | handleError: function( s, xml, status, e ) { |
|---|
| | 1922 | // If a local callback was specified, fire it |
|---|
| | 1923 | if ( s.error ) s.error( xml, status, e ); |
|---|
| | 1924 | |
|---|
| | 1925 | // Fire the global callback |
|---|
| | 1926 | if ( s.global ) |
|---|
| | 1927 | jQuery.event.trigger( "ajaxError", [xml, s, e] ); |
|---|
| | 1928 | }, |
|---|
| | 1929 | |
|---|
| | 1930 | // Counter for holding the number of active queries |
|---|
| | 1931 | active: 0, |
|---|
| | 1932 | |
|---|
| | 1933 | // Determines if an XMLHttpRequest was successful or not |
|---|
| | 1934 | httpSuccess: function( r ) { |
|---|
| | 1935 | try { |
|---|
| | 1936 | return !r.status && location.protocol == "file:" || |
|---|
| | 1937 | ( r.status >= 200 && r.status < 300 ) || r.status == 304 || |
|---|
| | 1938 | jQuery.browser.safari && r.status == undefined; |
|---|
| | 1939 | } catch(e){} |
|---|
| | 1940 | return false; |
|---|
| | 1941 | }, |
|---|
| | 1942 | |
|---|
| | 1943 | // Determines if an XMLHttpRequest returns NotModified |
|---|
| | 1944 | httpNotModified: function( xml, url ) { |
|---|
| | 1945 | try { |
|---|
| | 1946 | var xmlRes = xml.getResponseHeader("Last-Modified"); |
|---|
| | 1947 | |
|---|
| | 1948 | // Firefox always returns 200. check Last-Modified date |
|---|
| | 1949 | return xml.status == 304 || xmlRes == jQuery.lastModified[url] || |
|---|
| | 1950 | jQuery.browser.safari && xml.status == undefined; |
|---|
| | 1951 | } catch(e){} |
|---|
| | 1952 | return false; |
|---|
| | 1953 | }, |
|---|
| | 1954 | |
|---|
| | 1955 | /* Get the data out of an XMLHttpRequest. |
|---|
| | 1956 | * Return parsed XML if content-type header is "xml" and type is "xml" or omitted, |
|---|
| | 1957 | * otherwise return plain text. |
|---|
| | 1958 | * (String) data - The type of data that you're expecting back, |
|---|
| | 1959 | * (e.g. "xml", "html", "script") |
|---|
| | 1960 | */ |
|---|
| | 1961 | httpData: function( r, type ) { |
|---|
| | 1962 | var ct = r.getResponseHeader("content-type"); |
|---|
| | 1963 | var data = !type && ct && ct.indexOf("xml") >= 0; |
|---|
| | 1964 | data = type == "xml" || data ? r.responseXML : r.responseText; |
|---|
| | 1965 | |
|---|
| | 1966 | // If the type is "script", eval it in global context |
|---|
| | 1967 | if ( type == "script" ) |
|---|
| | 1968 | jQuery.globalEval( data ); |
|---|
| | 1969 | |
|---|
| | 1970 | // Get the JavaScript object, if JSON is used. |
|---|
| | 1971 | if ( type == "json" ) |
|---|
| | 1972 | data = eval("(" + data + ")"); |
|---|
| | 1973 | |
|---|
| | 1974 | // evaluate scripts within html |
|---|
| | 1975 | if ( type == "html" ) |
|---|
| | 1976 | jQuery("<div>").html(data).evalScripts(); |
|---|
| | 1977 | |
|---|
| | 1978 | return data; |
|---|
| | 1979 | }, |
|---|
| | 1980 | |
|---|
| | 1981 | // Serialize an array of form elements or a set of |
|---|
| | 1982 | // key/values into a query string |
|---|
| | 1983 | param: function( a ) { |
|---|
| | 1984 | var s = []; |
|---|
| | 1985 | |
|---|
| | 1986 | // If an array was passed in, assume that it is an array |
|---|
| | 1987 | // of form elements |
|---|
| | 1988 | if ( a.constructor == Array || a.jquery ) |
|---|
| | 1989 | // Serialize the form elements |
|---|
| | 1990 | jQuery.each( a, function(){ |
|---|
| | 1991 | s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) ); |
|---|
| | 1992 | }); |
|---|
| | 1993 | |
|---|
| | 1994 | // Otherwise, assume that it's an object of key/value pairs |
|---|
| | 1995 | else |
|---|
| | 1996 | // Serialize the key/values |
|---|
| | 1997 | for ( var j in a ) |
|---|
| | 1998 | // If the value is an array then the key names need to be repeated |
|---|
| | 1999 | if ( a[j] && a[j].constructor == Array ) |
|---|
| | 2000 | jQuery.each( a[j], function(){ |
|---|
| | 2001 | s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) ); |
|---|
| | 2002 | }); |
|---|
| | 2003 | else |
|---|
| | 2004 | s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) ); |
|---|
| | 2005 | |
|---|
| | 2006 | // Return the resulting serialization |
|---|
| | 2007 | return s.join("&"); |
|---|
| | 2008 | }, |
|---|
| | 2009 | |
|---|
| | 2010 | // evalulates a script in global context |
|---|
| | 2011 | // not reliable for safari |
|---|
| | 2012 | globalEval: function( data ) { |
|---|
| | 2013 | if ( window.execScript ) |
|---|
| | 2014 | window.execScript( data ); |
|---|
| | 2015 | else if ( jQuery.browser.safari ) |
|---|
| | 2016 | // safari doesn't provide a synchronous global eval |
|---|
| | 2017 | window.setTimeout( data, 0 ); |
|---|
| | 2018 | else |
|---|
| | 2019 | eval.call( window, data ); |
|---|
| | 2020 | } |
|---|
| | 2021 | |
|---|
| | 2022 | }); |
|---|
| | 2023 | jQuery.fn.extend({ |
|---|
| | 2024 | |
|---|
| | 2025 | show: function(speed,callback){ |
|---|
| | 2026 | return speed ? |
|---|
| | 2027 | this.animate({ |
|---|
| | 2028 | height: "show", width: "show", opacity: "show" |
|---|
| | 2029 | }, speed, callback) : |
|---|
| | 2030 | |
|---|
| | 2031 | this.filter(":hidden").each(function(){ |
|---|
| | 2032 | this.style.display = this.oldblock ? this.oldblock : ""; |
|---|
| | 2033 | if ( jQuery.css(this,"display") == "none" ) |
|---|
| | 2034 | this.style.display = "block"; |
|---|
| | 2035 | }).end(); |
|---|
| | 2036 | }, |
|---|
| | 2037 | |
|---|
| | 2038 | hide: function(speed,callback){ |
|---|
| | 2039 | return speed ? |
|---|
| | 2040 | this.animate({ |
|---|
| | 2041 | height: "hide", width: "hide", opacity: "hide" |
|---|
| | 2042 | }, speed, callback) : |
|---|
| | 2043 | |
|---|
| | 2044 | this.filter(":visible").each(function(){ |
|---|
| | 2045 | this.oldblock = this.oldblock || jQuery.css(this,"display"); |
|---|
| | 2046 | if ( this.oldblock == "none" ) |
|---|
| | 2047 | this.oldblock = "block"; |
|---|
| | 2048 | this.style.display = "none"; |
|---|
| | 2049 | }).end(); |
|---|
| | 2050 | }, |
|---|
| | 2051 | |
|---|
| | 2052 | // Save the old toggle function |
|---|
| | 2053 | _toggle: jQuery.fn.toggle, |
|---|
| | 2054 | toggle: function( fn, fn2 ){ |
|---|
| | 2055 | return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? |
|---|
| | 2056 | this._toggle( fn, fn2 ) : |
|---|
| | 2057 | fn ? |
|---|
| | 2058 | this.animate({ |
|---|
| | 2059 | height: "toggle", width: "toggle", opacity: "toggle" |
|---|
| | 2060 | }, fn, fn2) : |
|---|
| | 2061 | this.each(function(){ |
|---|
| | 2062 | jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); |
|---|
| | 2063 | }); |
|---|
| | 2064 | }, |
|---|
| | 2065 | slideDown: function(speed,callback){ |
|---|
| | 2066 | return this.animate({height: "show"}, speed, callback); |
|---|
| | 2067 | }, |
|---|
| | 2068 | slideUp: function(speed,callback){ |
|---|
| | 2069 | return this.animate({height: "hide"}, speed, callback); |
|---|
| | 2070 | }, |
|---|
| | 2071 | slideToggle: function(speed, callback){ |
|---|
| | 2072 | return this.animate({height: "toggle"}, speed, callback); |
|---|
| | 2073 | }, |
|---|
| | 2074 | fadeIn: function(speed, callback){ |
|---|
| | 2075 | return this.animate({opacity: "show"}, speed, callback); |
|---|
| | 2076 | }, |
|---|
| | 2077 | fadeOut: function(speed, callback){ |
|---|
| | 2078 | return this.animate({opacity: "hide"}, speed, callback); |
|---|
| | 2079 | }, |
|---|
| | 2080 | fadeTo: function(speed,to,callback){ |
|---|
| | 2081 | return this.animate({opacity: to}, speed, callback); |
|---|
| | 2082 | }, |
|---|
| | 2083 | animate: function( prop, speed, easing, callback ) { |
|---|
| | 2084 | return this.queue(function(){ |
|---|
| | 2085 | var hidden = jQuery(this).is(":hidden"), |
|---|
| | 2086 | opt = jQuery.speed(speed, easing, callback), |
|---|
| | 2087 | self = this; |
|---|
| | 2088 | |
|---|
| | 2089 | for ( var p in prop ) { |
|---|
| | 2090 | if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) |
|---|
| | 2091 | return jQuery.isFunction(opt.complete) && opt.complete.apply(this); |
|---|
| | 2092 | |
|---|
| | 2093 | if ( p == "height" || p == "width" ) { |
|---|
| | 2094 | // Store display property |
|---|
| | 2095 | opt.display = jQuery.css(this, "display"); |
|---|
| | 2096 | |
|---|
| | 2097 | // Make sure that nothing sneaks out |
|---|
| | 2098 | opt.overflow = this.style.overflow; |
|---|
| | 2099 | } |
|---|
| | 2100 | } |
|---|
| | 2101 | |
|---|
| | 2102 | if ( opt.overflow != null ) |
|---|
| | 2103 | this.style.overflow = "hidden"; |
|---|
| | 2104 | |
|---|
| | 2105 | this.curAnim = jQuery.extend({}, prop); |
|---|
| | 2106 | |
|---|
| | 2107 | jQuery.each( prop, function(name, val){ |
|---|
| | 2108 | var e = new jQuery.fx( self, opt, name ); |
|---|
| | 2109 | if ( val.constructor == Number ) |
|---|
| | 2110 | e.custom( e.cur(), val ); |
|---|
| | 2111 | else |
|---|
| | 2112 | e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); |
|---|
| | 2113 | }); |
|---|
| | 2114 | }); |
|---|
| | 2115 | }, |
|---|
| | 2116 | queue: function(type,fn){ |
|---|
| | 2117 | if ( !fn ) { |
|---|
| | 2118 | fn = type; |
|---|
| | 2119 | type = "fx"; |
|---|
| | 2120 | } |
|---|
| | 2121 | |
|---|
| | 2122 | return this.each(function(){ |
|---|
| | 2123 | if ( !this.queue ) |
|---|
| | 2124 | this.queue = {}; |
|---|
| | 2125 | |
|---|
| | 2126 | if ( !this.queue[type] ) |
|---|
| | 2127 | this.queue[type] = []; |
|---|
| | 2128 | |
|---|
| | 2129 | this.queue[type].push( fn ); |
|---|
| | 2130 | |
|---|
| | 2131 | if ( this.queue[type].length == 1 ) |
|---|
| | 2132 | fn.apply(this); |
|---|
| | 2133 | }); |
|---|
| | 2134 | } |
|---|
| | 2135 | |
|---|
| | 2136 | }); |
|---|
| | 2137 | |
|---|
| | 2138 | jQuery.extend({ |
|---|
| | 2139 | |
|---|
| | 2140 | speed: function(speed, easing, fn) { |
|---|
| | 2141 | var opt = speed && speed.constructor == Object ? speed : { |
|---|
| | 2142 | complete: fn || !fn && easing || |
|---|
| | 2143 | jQuery.isFunction( speed ) && speed, |
|---|
| | 2144 | duration: speed, |
|---|
| | 2145 | easing: fn && easing || easing && easing.constructor != Function && easing || (jQuery.easing.swing ? "swing" : "linear") |
|---|
| | 2146 | }; |
|---|
| | 2147 | |
|---|
| | 2148 | opt.duration = (opt.duration && opt.duration.constructor == Number ? |
|---|
| | 2149 | opt.duration : |
|---|
| | 2150 | { slow: 600, fast: 200 }[opt.duration]) || 400; |
|---|
| | 2151 | |
|---|
| | 2152 | // Queueing |
|---|
| | 2153 | opt.old = opt.complete; |
|---|
| | 2154 | opt.complete = function(){ |
|---|
| | 2155 | jQuery.dequeue(this, "fx"); |
|---|
| | 2156 | if ( jQuery.isFunction( opt.old ) ) |
|---|
| | 2157 | opt.old.apply( this ); |
|---|
| | 2158 | }; |
|---|
| | 2159 | |
|---|
| | 2160 | return opt; |
|---|
| | 2161 | }, |
|---|
| | 2162 | |
|---|
| | 2163 | easing: { |
|---|
| | 2164 | linear: function( p, n, firstNum, diff ) { |
|---|
| | 2165 | return firstNum + diff * p; |
|---|
| | 2166 | }, |
|---|
| | 2167 | swing: function( p, n, firstNum, diff ) { |
|---|
| | 2168 | return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
|---|
| | 2169 | } |
|---|
| | 2170 | }, |
|---|
| | 2171 | |
|---|
| | 2172 | queue: {}, |
|---|
| | 2173 | |
|---|
| | 2174 | dequeue: function(elem,type){ |
|---|
| | 2175 | type = type || "fx"; |
|---|
| | 2176 | |
|---|
| | 2177 | if ( elem.queue && elem.queue[type] ) { |
|---|
| | 2178 | // Remove self |
|---|
| | 2179 | elem.queue[type].shift(); |
|---|
| | 2180 | |
|---|
| | 2181 | // Get next function |
|---|
| | 2182 | var f = elem.queue[type][0]; |
|---|
| | 2183 | |
|---|
| | 2184 | if ( f ) f.apply( elem ); |
|---|
| | 2185 | } |
|---|
| | 2186 | }, |
|---|
| | 2187 | |
|---|
| | 2188 | timers: [], |
|---|
| | 2189 | |
|---|
| | 2190 | /* |
|---|
| | 2191 | * I originally wrote fx() as a clone of moo.fx and in the process |
|---|
| | 2192 | * of making it small in size the code became illegible to sane |
|---|
| | 2193 | * people. You've been warned. |
|---|
| | 2194 | */ |
|---|
| | 2195 | |
|---|
| | 2196 | fx: function( elem, options, prop ){ |
|---|
| | 2197 | |
|---|
| | 2198 | var z = this; |
|---|
| | 2199 | |
|---|
| | 2200 | // The styles |
|---|
| | 2201 | var y = elem.style; |
|---|
| | 2202 | |
|---|
| | 2203 | // Simple function for setting a style value |
|---|
| | 2204 | z.a = function(){ |
|---|
| | 2205 | if ( options.step ) |
|---|
| | 2206 | options.step.apply( elem, [ z.now ] ); |
|---|
| | 2207 | |
|---|
| | 2208 | if ( prop == "opacity" ) |
|---|
| | 2209 | jQuery.attr(y, "opacity", z.now); // Let attr handle opacity |
|---|
| | 2210 | else { |
|---|
| | 2211 | y[prop] = parseInt(z.now) + "px"; |
|---|
| | 2212 | y.display = "block"; // Set display property to block for animation |
|---|
| | 2213 | } |
|---|
| | 2214 | }; |
|---|
| | 2215 | |
|---|
| | 2216 | // Figure out the maximum number to run to |
|---|
| | 2217 | z.max = function(){ |
|---|
| | 2218 | return parseFloat( jQuery.css(elem,prop) ); |
|---|
| | 2219 | }; |
|---|
| | 2220 | |
|---|
| | 2221 | // Get the current size |
|---|
| | 2222 | z.cur = function(){ |
|---|
| | 2223 | var r = parseFloat( jQuery.curCSS(elem, prop) ); |
|---|
| | 2224 | return r && r > -10000 ? r : z.max(); |
|---|
| | 2225 | }; |
|---|
| | 2226 | |
|---|
| | 2227 | // Start an animation from one number to another |
|---|
| | 2228 | z.custom = function(from,to){ |
|---|
| | 2229 | z.startTime = (new Date()).getTime(); |
|---|
| | 2230 | z.now = from; |
|---|
| | 2231 | z.a(); |
|---|
| | 2232 | |
|---|
| | 2233 | jQuery.timers.push(function(){ |
|---|
| | 2234 | return z.step(from, to); |
|---|
| | 2235 | }); |
|---|
| | 2236 | |
|---|
| | 2237 | if ( jQuery.timers.length == 1 ) { |
|---|
| | 2238 | var timer = setInterval(function(){ |
|---|
| | 2239 | var timers = jQuery.timers; |
|---|
| | 2240 | |
|---|
| | 2241 | for ( var i = 0; i < timers.length; i++ ) |
|---|
| | 2242 | if ( !timers[i]() ) |
|---|
| | 2243 | timers.splice(i--, 1); |
|---|
| | 2244 | |
|---|
| | 2245 | if ( !timers.length ) |
|---|
| | 2246 | clearInterval( timer ); |
|---|
| | 2247 | }, 13); |
|---|
| | 2248 | } |
|---|
| | 2249 | }; |
|---|
| | 2250 | |
|---|
| | 2251 | // Simple 'show' function |
|---|
| | 2252 | z.show = function(){ |
|---|
| | 2253 | if ( !elem.orig ) elem.orig = {}; |
|---|
| | 2254 | |
|---|
| | 2255 | // Remember where we started, so that we can go back to it later |
|---|
| | 2256 | elem.orig[prop] = jQuery.attr( elem.style, prop ); |
|---|
| | 2257 | |
|---|
| | 2258 | options.show = true; |
|---|
| | 2259 | |
|---|
| | 2260 | // Begin the animation |
|---|
| | 2261 | z.custom(0, this.cur()); |
|---|
| | 2262 | |
|---|
| | 2263 | // Make sure that we start at a small width/height to avoid any |
|---|
| | 2264 | // flash of content |
|---|
| | 2265 | if ( prop != "opacity" ) |
|---|
| | 2266 | y[prop] = "1px"; |
|---|
| | 2267 | |
|---|
| | 2268 | // Start by showing the element |
|---|
| | 2269 | jQuery(elem).show(); |
|---|
| | 2270 | }; |
|---|
| | 2271 | |
|---|
| | 2272 | // Simple 'hide' function |
|---|
| | 2273 | z.hide = function(){ |
|---|
| | 2274 | if ( !elem.orig ) elem.orig = {}; |
|---|
| | 2275 | |
|---|
| | 2276 | // Remember where we started, so that we can go back to it later |
|---|
| | 2277 | elem.orig[prop] = jQuery.attr( elem.style, prop ); |
|---|
| | 2278 | |
|---|
| | 2279 | options.hide = true; |
|---|
| | 2280 | |
|---|
| | 2281 | // Begin the animation |
|---|
| | 2282 | z.custom(this.cur(), 0); |
|---|
| | 2283 | }; |
|---|
| | 2284 | |
|---|
| | 2285 | // Each step of an animation |
|---|
| | 2286 | z.step = function(firstNum, lastNum){ |
|---|
| | 2287 | var t = (new Date()).getTime(); |
|---|
| | 2288 | |
|---|
| | 2289 | if (t > options.duration + z.startTime) { |
|---|
| | 2290 | z.now = lastNum; |
|---|
| | 2291 | z.a(); |
|---|
| | 2292 | |
|---|
| | 2293 | if (elem.curAnim) elem.curAnim[ prop ] = true; |
|---|
| | 2294 | |
|---|
| | 2295 | var done = true; |
|---|
| | 2296 | for ( var i in elem.curAnim ) |
|---|
| | 2297 | if ( elem.curAnim[i] !== true ) |
|---|
| | 2298 | done = false; |
|---|
| | 2299 | |
|---|
| | 2300 | if ( done ) { |
|---|
| | 2301 | if ( options.display != null ) { |
|---|
| | 2302 | // Reset the overflow |
|---|
| | 2303 | y.overflow = options.overflow; |
|---|
| | 2304 | |
|---|
| | 2305 | // Reset the display |
|---|
| | 2306 | y.display = options.display; |
|---|
| | 2307 | if ( jQuery.css(elem, "display") == "none" ) |
|---|
| | 2308 | y.display = "block"; |
|---|
| | 2309 | } |
|---|
| | 2310 | |
|---|
| | 2311 | // Hide the element if the "hide" operation was done |
|---|
| | 2312 | if ( options.hide ) |
|---|
| | 2313 | y.display = "none"; |
|---|
| | 2314 | |
|---|
| | 2315 | // Reset the properties, if the item has been hidden or shown |
|---|
| | 2316 | if ( options.hide || options.show ) |
|---|
| | 2317 | for ( var p in elem.curAnim ) |
|---|
| | 2318 | jQuery.attr(y, p, elem.orig[p]); |
|---|
| | 2319 | } |
|---|
| | 2320 | |
|---|
| | 2321 | // If a callback was provided, execute it |
|---|
| | 2322 | if ( done && jQuery.isFunction( options.complete ) ) |
|---|
| | 2323 | // Execute the complete function |
|---|
| | 2324 | options.complete.apply( elem ); |
|---|
| | 2325 | |
|---|
| | 2326 | return false; |
|---|
| | 2327 | } else { |
|---|
| | 2328 | var n = t - this.startTime; |
|---|
| | 2329 | // Figure out where in the animation we are and set the number |
|---|
| | 2330 | var p = n / options.duration; |
|---|
| | 2331 | |
|---|
| | 2332 | // Perform the easing function, defaults to swing |
|---|
| | 2333 | z.now = jQuery.easing[options.easing](p, n, firstNum, (lastNum-firstNum), options.duration); |
|---|
| | 2334 | |
|---|
| | 2335 | // Perform the next step of the animation |
|---|
| | 2336 | z.a(); |
|---|
| | 2337 | } |
|---|
| | 2338 | |
|---|
| | 2339 | return true; |
|---|
| | 2340 | }; |
|---|
| | 2341 | |
|---|
| | 2342 | } |
|---|
| | 2343 | }); |
|---|
| | 2344 | } |
|---|