#! Render the fjsc page importing the required
#! scripts.
serving-html {
- "/responder/fjsc-resources/yahoo/yahoo.js"
- "/responder/fjsc-resources/yahoo/event.js"
- "/responder/fjsc-resources/yahoo/connection.js"
+ "/responder/fjsc-resources/jquery.js"
"/responder/fjsc-resources/bootstrap.js"
} swap [
[
-<form id="toeval" onsubmit="factor.fjsc_eval(document.getElementById('toeval'));return false;" method="post">
+<form id="toeval" onsubmit="factor.server_eval($('#code').get(0).value);return false;" method="post">
<textarea name="code" id="code" cols="64" rows="10">
</textarea>
<input type="submit"/>
this.in_vocab = "scratchpad";
this.using_vocabs = [ "scratchpad", "kernel","math","sequences","parser","alien","browser-dom", "words" ];
this.cont = new Continuation();
- this.form = false ;
}
var factor = new Factor();
Factor.prototype.server_eval = function(text, next) {
var self = this;
- var callback = {
- success: function(o) {
- var v = o.responseText;
- document.getElementById('compiled').innerHTML="<pre>" + v + "</pre>";
- document.getElementById('code').value="";
- var func = eval(v);
- factor.cont.next = function() { self.display_datastack(); }
- func(factor);
- if(next)
- factor.call_next(next);
- }
- };
- this.form.code.value=text;
- YAHOO.util.Connect.setForm(this.form);
- YAHOO.util.Connect.asyncRequest('POST', "/responder/fjsc/compile", callback);
-}
-
-Factor.prototype.fjsc_eval = function(form) {
- this.form = form;
- this.server_eval(form.code.value);
+ $.post("/responder/fjsc/compile", { code: text }, function(result) {
+ document.getElementById('compiled').innerHTML="<pre>" + result + "</pre>";
+ document.getElementById('code').value="";
+ var func = eval(result);
+ factor.cont.next = function() { self.display_datastack(); }
+ func(factor);
+ if(next)
+ factor.call_next(next);
+ });
}
Factor.prototype.display_datastack = function() {
factor.add_word("parser", "run-file", "primitive", function(next) {
var stack = factor.cont.data_stack;
var url = stack.pop();
- var callback = {
- success: function(o) {
- var result = o.responseText;
- factor.server_eval(result, next);
- },
- failure: function(o) {
- alert('run-file failed');
- factor.call_next(next);
- }
- };
- YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+ $.get(url, function(result) {
+ factor.server_eval(result, next);
+ });
});
--- /dev/null
+eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('l(1T 1z.6=="Q"){1z.Q=1z.Q;u 6=q(a,c){l(a&&1T a=="q"&&6.C.1W)v 6(17).1W(a);a=a||6.1o||17;l(a.3E)v 6(6.1X(a,[]));l(c&&c.3E)v 6(c).1V(a);l(1z==7)v 1h 6(a,c);l(a.O==1C){u m=/^[^<]*(<.+>)[^>]*$/.3d(a);l(m)a=6.3D([m[1]])}7.1n(a.O==2z||a.D&&!a.1R&&a[0]!=Q&&a[0].1R?6.1X(a,[]):6.1V(a,c));u C=19[19.D-1];l(C&&1T C=="q")7.W(C);v 7};l(1T $!="Q")6.44$=$;u $=6;6.C=6.8b={3E:"1.0.3",5J:q(){v 7.D},1n:q(23){l(23&&23.O==2z){7.D=0;[].1k.16(7,23);v 7}G v 23==Q?6.1X(7,[]):7[23]},W:q(C,1g){v 6.W(7,C,1g)},8g:q(15){u 2j=-1;7.W(q(i){l(7==15)2j=i});v 2j},1t:q(1L,Y,B){v 1L.O!=1C||Y!=Q?7.W(q(){l(Y==Q)I(u E 1r 1L)6.1t(B?7.1a:7,E,1L[E]);G 6.1t(B?7.1a:7,1L,Y)}):6[B||"1t"](7[0],1L)},1f:q(1L,Y){v 7.1t(1L,Y,"26")},2B:q(e){e=e||7;u t="";I(u j=0;j<e.D;j++){u r=e[j].2f;I(u i=0;i<r.D;i++)l(r[i].1R!=8)t+=r[i].1R!=1?r[i].4Z:6.C.2B([r[i]])}v t},1Y:q(){u a=6.3D(19);v 7.W(q(){u b=a[0].3f(T);7.1i.2Y(b,7);24(b.2a)b=b.2a;b.4e(7)})},5g:q(){v 7.2T(19,T,1,q(a){7.4e(a)})},5h:q(){v 7.2T(19,T,-1,q(a){7.2Y(a,7.2a)})},5i:q(){v 7.2T(19,U,1,q(a){7.1i.2Y(a,7)})},5j:q(){v 7.2T(19,U,-1,q(a){7.1i.2Y(a,7.8j)})},4q:q(){v 7.1n(7.33.8k())},1V:q(t){v 7.2n(6.2r(7,q(a){v 6.1V(t,a)}),19)},4f:q(4D){v 7.2n(6.2r(7,q(a){v a.3f(4D!=Q?4D:T)}),19)},1c:q(t){v 7.2n(t.O==2z&&6.2r(7,q(a){I(u i=0;i<t.D;i++)l(6.1c(t[i],[a]).r.D)v a;v U})||t.O==8l&&(t?7.1n():[])||1T t=="q"&&6.2O(7,t)||6.1c(t,7).r,19)},2t:q(t){v 7.2n(t.O==1C?6.1c(t,7,U).r:6.2O(7,q(a){v a!=t}),19)},2g:q(t){v 7.2n(6.1X(7,t.O==1C?6.1V(t):t.O==2z?t:[t]),19)},4E:q(2u){v 2u?6.1c(2u,7).r.D>0:U},2T:q(1g,22,2X,C){u 4f=7.5J()>1;u a=6.3D(1g);v 7.W(q(){u 15=7;l(22&&7.2p.2b()=="8m"&&a[0].2p.2b()!="62"){u 29=7.4S("29");l(!29.D){15=17.5N("29");7.4e(15)}G 15=29[0]}I(u i=(2X<0?a.D-1:0);i!=(2X<0?2X:a.D);i+=2X){C.16(15,[4f?a[i].3f(T):a[i]])}})},2n:q(a,1g){u C=1g&&1g[1g.D-1];u 2d=1g&&1g[1g.D-2];l(C&&C.O!=1v)C=M;l(2d&&2d.O!=1v)2d=M;l(!C){l(!7.33)7.33=[];7.33.1k(7.1n());7.1n(a)}G{u 1Z=7.1n();7.1n(a);l(2d&&a.D||!2d)7.W(2d||C).1n(1Z);G 7.1n(1Z).W(C)}v 7}};6.1y=6.C.1y=q(15,E){l(19.D>1&&(E===M||E==Q))v 15;l(!E){E=15;15=7}I(u i 1r E)15[i]=E[i];v 15};6.1y({5C:q(){6.65=T;6.W(6.2e.5r,q(i,n){6.C[i]=q(a){u L=6.2r(7,n);l(a&&a.O==1C)L=6.1c(a,L).r;v 7.2n(L,19)}});6.W(6.2e.2o,q(i,n){6.C[i]=q(){u a=19;v 7.W(q(){I(u j=0;j<a.D;j++)6(a[j])[n](7)})}});6.W(6.2e.W,q(i,n){6.C[i]=q(){v 7.W(n,19)}});6.W(6.2e.1c,q(i,n){6.C[n]=q(23,C){v 7.1c(":"+n+"("+23+")",C)}});6.W(6.2e.1t,q(i,n){n=n||i;6.C[i]=q(h){v h==Q?7.D?7[0][n]:M:7.1t(n,h)}});6.W(6.2e.1f,q(i,n){6.C[n]=q(h){v h==Q?(7.D?6.1f(7[0],n):M):7.1f(n,h)}})},W:q(15,C,1g){l(15.D==Q)I(u i 1r 15)C.16(15[i],1g||[i,15[i]]);G I(u i=0;i<15.D;i++)l(C.16(15[i],1g||[i,15[i]])===U)45;v 15},1j:{2g:q(o,c){l(6.1j.3t(o,c))v;o.1j+=(o.1j?" ":"")+c},25:q(o,c){l(!c){o.1j=""}G{u 2L=o.1j.3b(" ");I(u i=0;i<2L.D;i++){l(2L[i]==c){2L.67(i,1);45}}o.1j=2L.5Z(\' \')}},3t:q(e,a){l(e.1j!=Q)e=e.1j;v 1h 43("(^|\\\\s)"+a+"(\\\\s|$)").28(e)}},4A:q(e,o,f){I(u i 1r o){e.1a["1Z"+i]=e.1a[i];e.1a[i]=o[i]}f.16(e,[]);I(u i 1r o)e.1a[i]=e.1a["1Z"+i]},1f:q(e,p){l(p=="1G"||p=="2c"){u 1Z={},3K,3F,d=["68","6O","69","7c"];I(u i 1r d){1Z["6b"+d[i]]=0;1Z["6c"+d[i]+"6e"]=0}6.4A(e,1Z,q(){l(6.1f(e,"1u")!="20"){3K=e.6f;3F=e.6g}G{e=6(e.3f(T)).1V(":3W").5u("2J").4q().1f({3U:"1S",2H:"6i",1u:"2F",6j:"0",5l:"0"}).4H(e.1i)[0];u 31=6.1f(e.1i,"2H");l(31==""||31=="3R")e.1i.1a.2H="6k";3K=e.6l;3F=e.6m;l(31==""||31=="3R")e.1i.1a.2H="3R";e.1i.3s(e)}});v p=="1G"?3K:3F}v 6.26(e,p)},26:q(F,E,4I){u L;l(E==\'1m\'&&6.11.1p)v 6.1t(F.1a,\'1m\');l(E=="3p"||E=="2y")E=6.11.1p?"37":"2y";l(!4I&&F.1a[E]){L=F.1a[E]}G l(F.34){u 5S=E.1B(/\\-(\\w)/g,q(m,c){v c.2b()});L=F.34[E]||F.34[5S]}G l(17.3g&&17.3g.4u){l(E=="2y"||E=="37")E="3p";E=E.1B(/([A-Z])/g,"-$1").4d();u 1l=17.3g.4u(F,M);l(1l)L=1l.5P(E);G l(E==\'1u\')L=\'20\';G 6.4A(F,{1u:\'2F\'},q(){L=17.3g.4u(7,M).5P(E)})}v L},3D:q(a){u r=[];I(u i=0;i<a.D;i++){u 1M=a[i];l(1M.O==1C){u s=6.2K(1M),21=17.5N("21"),1Y=[0,"",""];l(!s.1b("<6v"))1Y=[1,"<3c>","</3c>"];G l(!s.1b("<6w")||!s.1b("<29"))1Y=[1,"<22>","</22>"];G l(!s.1b("<4t"))1Y=[2,"<22>","</22>"];G l(!s.1b("<6x")||!s.1b("<6z"))1Y=[3,"<22><29><4t>","</4t></29></22>"];21.2V=1Y[1]+s+1Y[2];24(1Y[0]--)21=21.2a;I(u j=0;j<21.2f.D;j++)r.1k(21.2f[j])}G l(1M.D!=Q&&!1M.1R)I(u n=0;n<1M.D;n++)r.1k(1M[n]);G r.1k(1M.1R?1M:17.6A(1M.6C()))}v r},2u:{"":"m[2]== \'*\'||a.2p.2b()==m[2].2b()","#":"a.3a(\'3H\')&&a.3a(\'3H\')==m[2]",":":{5o:"i<m[3]-0",5X:"i>m[3]-0",5L:"m[3]-0==i",5n:"m[3]-0==i",2h:"i==0",1N:"i==r.D-1",52:"i%2==0",53:"i%2","5L-3x":"6.1x(a,m[3]).1l","2h-3x":"6.1x(a,0).1l","1N-3x":"6.1x(a,0).1N","6D-3x":"6.1x(a).D==1",5s:"a.2f.D",5B:"!a.2f.D",5p:"6.C.2B.16([a]).1b(m[3])>=0",6E:"a.B!=\'1S\'&&6.1f(a,\'1u\')!=\'20\'&&6.1f(a,\'3U\')!=\'1S\'",1S:"a.B==\'1S\'||6.1f(a,\'1u\')==\'20\'||6.1f(a,\'3U\')==\'1S\'",6F:"!a.2P",2P:"a.2P",2J:"a.2J",3V:"a.3V || 6.1t(a, \'3V\')",2B:"a.B==\'2B\'",3W:"a.B==\'3W\'",5y:"a.B==\'5y\'",3Q:"a.B==\'3Q\'",5v:"a.B==\'5v\'",4x:"a.B==\'4x\'",5w:"a.B==\'5w\'",4w:"a.B==\'4w\'",4s:"a.B==\'4s\'",5z:"a.2p.4d().4T(/5z|3c|6L|4s/)"},".":"6.1j.3t(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z && !z.1b(m[4])","$=":"z && z.32(z.D - m[4].D,m[4].D)==m[4]","*=":"z && z.1b(m[4])>=0","":"z"},"[":"6.1V(m[2],a).D"},3B:["\\\\.\\\\.|/\\\\.\\\\.","a.1i",">|/","6.1x(a.2a)","\\\\+","6.1x(a).3z","~",q(a){u r=[];u s=6.1x(a);l(s.n>0)I(u i=s.n;i<s.D;i++)r.1k(s[i]);v r}],1V:q(t,1o){l(1o&&1o.1R==Q)1o=M;1o=1o||6.1o||17;l(t.O!=1C)v[t];l(!t.1b("//")){1o=1o.4Q;t=t.32(2,t.D)}G l(!t.1b("/")){1o=1o.4Q;t=t.32(1,t.D);l(t.1b("/")>=1)t=t.32(t.1b("/"),t.D)}u L=[1o];u 1K=[];u 1N=M;24(t.D>0&&1N!=t){u r=[];1N=t;t=6.2K(t).1B(/^\\/\\//i,"");u 36=U;I(u i=0;i<6.3B.D;i+=2){l(36)51;u 2v=1h 43("^("+6.3B[i]+")");u m=2v.3d(t);l(m){r=L=6.2r(L,6.3B[i+1]);t=6.2K(t.1B(2v,""));36=T}}l(!36){l(!t.1b(",")||!t.1b("|")){l(L[0]==1o)L.4h();1K=6.1X(1K,L);r=L=[1o];t=" "+t.32(1,t.D)}G{u 3Z=/^([#.]?)([a-4Y-9\\\\*44-]*)/i;u m=3Z.3d(t);l(m[1]=="#"){u 4l=17.5V(m[2]);r=L=4l?[4l]:[];t=t.1B(3Z,"")}G{l(!m[2]||m[1]==".")m[2]="*";I(u i=0;i<L.D;i++)r=6.1X(r,m[2]=="*"?6.40(L[i]):L[i].4S(m[2]))}}}l(t){u 1D=6.1c(t,r);L=r=1D.r;t=6.2K(1D.t)}}l(L&&L[0]==1o)L.4h();1K=6.1X(1K,L);v 1K},40:q(o,r){r=r||[];u s=o.2f;I(u i=0;i<s.D;i++)l(s[i].1R==1){r.1k(s[i]);6.40(s[i],r)}v r},1t:q(F,1d,Y){u 2m={"I":"7v","6P":"1j","3p":6.11.1p?"37":"2y",2y:6.11.1p?"37":"2y",2V:"2V",1j:"1j",Y:"Y",2P:"2P",2J:"2J",6R:"6S"};l(1d=="1m"&&6.11.1p&&Y!=Q){F[\'6U\']=1;l(Y==1)v F["1c"]=F["1c"].1B(/3k\\([^\\)]*\\)/5c,"");G v F["1c"]=F["1c"].1B(/3k\\([^\\)]*\\)/5c,"")+"3k(1m="+Y*4U+")"}G l(1d=="1m"&&6.11.1p){v F["1c"]?4c(F["1c"].4T(/3k\\(1m=(.*)\\)/)[1])/4U:1}l(1d=="1m"&&6.11.2I&&Y==1)Y=0.6W;l(2m[1d]){l(Y!=Q)F[2m[1d]]=Y;v F[2m[1d]]}G l(Y==Q&&6.11.1p&&F.2p&&F.2p.2b()==\'6X\'&&(1d==\'7f\'||1d==\'7e\')){v F.70(1d).4Z}G l(F.3a!=Q&&F.7b){l(Y!=Q)F.72(1d,Y);v F.3a(1d)}G{1d=1d.1B(/-([a-z])/73,q(z,b){v b.2b()});l(Y!=Q)F[1d]=Y;v F[1d]}},4X:["\\\\[ *(@)S *([!*$^=]*) *(\'?\\"?)(.*?)\\\\4 *\\\\]","(\\\\[)\\s*(.*?)\\s*\\\\]","(:)S\\\\(\\"?\'?([^\\\\)]*?)\\"?\'?\\\\)","([:.#]*)S"],1c:q(t,r,2t){u g=2t!==U?6.2O:q(a,f){v 6.2O(a,f,T)};24(t&&/^[a-z[({<*:.#]/i.28(t)){u p=6.4X;I(u i=0;i<p.D;i++){u 2v=1h 43("^"+p[i].1B("S","([a-z*44-][a-4Y-76-]*)"),"i");u m=2v.3d(t);l(m){l(!i)m=["",m[1],m[3],m[2],m[5]];t=t.1B(2v,"");45}}l(m[1]==":"&&m[2]=="2t")r=6.1c(m[3],r,U).r;G{u f=6.2u[m[1]];l(f.O!=1C)f=6.2u[m[1]][m[2]];3A("f = q(a,i){"+(m[1]=="@"?"z=6.1t(a,m[3]);":"")+"v "+f+"}");r=g(r,f)}}v{r:r,t:t}},2K:q(t){v t.1B(/^\\s+|\\s+$/g,"")},3L:q(F){u 47=[];u 1l=F.1i;24(1l&&1l!=17){47.1k(1l);1l=1l.1i}v 47},1x:q(F,2j,2t){u 14=[];l(F){u 2k=F.1i.2f;I(u i=0;i<2k.D;i++){l(2t===T&&2k[i]==F)51;l(2k[i].1R==1)14.1k(2k[i]);l(2k[i]==F)14.n=14.D-1}}v 6.1y(14,{1N:14.n==14.D-1,1l:2j=="52"&&14.n%2==0||2j=="53"&&14.n%2||14[2j]==F,4j:14[14.n-1],3z:14[14.n+1]})},1X:q(2h,35){u 1J=[];I(u k=0;k<2h.D;k++)1J[k]=2h[k];I(u i=0;i<35.D;i++){u 48=T;I(u j=0;j<2h.D;j++)l(35[i]==2h[j])48=U;l(48)1J.1k(35[i])}v 1J},2O:q(14,C,4a){l(C.O==1C)C=1h 1v("a","i","v "+C);u 1J=[];I(u i=0;i<14.D;i++)l(!4a&&C(14[i],i)||4a&&!C(14[i],i))1J.1k(14[i]);v 1J},2r:q(14,C){l(C.O==1C)C=1h 1v("a","v "+C);u 1J=[];I(u i=0;i<14.D;i++){u 1D=C(14[i],i);l(1D!==M&&1D!=Q){l(1D.O!=2z)1D=[1D];1J=6.1X(1J,1D)}}v 1J},J:{2g:q(P,B,1H){l(6.11.1p&&P.42!=Q)P=1z;l(!1H.2q)1H.2q=7.2q++;l(!P.1E)P.1E={};u 2W=P.1E[B];l(!2W){2W=P.1E[B]={};l(P["2N"+B])2W[0]=P["2N"+B]}2W[1H.2q]=1H;P["2N"+B]=7.58;l(!7.1e[B])7.1e[B]=[];7.1e[B].1k(P)},2q:1,1e:{},25:q(P,B,1H){l(P.1E)l(B&&P.1E[B])l(1H)57 P.1E[B][1H.2q];G I(u i 1r P.1E[B])57 P.1E[B][i];G I(u j 1r P.1E)7.25(P,j)},1P:q(B,K,P){K=K||[];l(!P){u g=7.1e[B];l(g)I(u i=0;i<g.D;i++)7.1P(B,K,g[i])}G l(P["2N"+B]){K.59(7.2m({B:B,2G:P}));P["2N"+B].16(P,K)}},58:q(J){l(1T 6=="Q")v U;J=J||6.J.2m(1z.J);l(!J)v U;u 3m=T;u c=7.1E[J.B];u 1g=[].7h.3O(19,1);1g.59(J);I(u j 1r c){l(c[j].16(7,1g)===U){J.4p();J.5a();3m=U}}v 3m},2m:q(J){l(6.11.1p){J=1z.J;J.2G=J.7i}G l(6.11.2M&&J.2G.1R==3){J=6.1y({},J);J.2G=J.2G.1i}J.4p=q(){7.3m=U};J.5a=q(){7.7l=T};v J}}});1h q(){u b=5I.5K.4d();6.11={2M:/5e/.28(b),30:/30/.28(b),1p:/1p/.28(b)&&!/30/.28(b),2I:/2I/.28(b)&&!/(7m|5e)/.28(b)};6.7n=!6.11.1p||17.7o=="7p"};6.2e={2o:{4H:"5g",7q:"5h",2Y:"5i",7r:"5j"},1f:"2c,1G,7s,5l,2H,3p,3h,7t,7u".3b(","),1c:["5n","5o","5X","5p"],1t:{1D:"Y",38:"2V",3H:M,7x:M,1d:M,7z:M,3w:M,7A:M},5r:{5s:"a.1i",7B:6.3L,3L:6.3L,3z:"6.1x(a).3z",4j:"6.1x(a).4j",2k:"6.1x(a, M, T)",7C:"6.1x(a.2a)"},W:{5u:q(1L){7.7E(1L)},1A:q(){7.1a.1u=7.2A?7.2A:"";l(6.1f(7,"1u")=="20")7.1a.1u="2F"},1s:q(){7.2A=7.2A||6.1f(7,"1u");l(7.2A=="20")7.2A="2F";7.1a.1u="20"},4o:q(){6(7)[6(7).4E(":1S")?"1A":"1s"].16(6(7),19)},7F:q(c){6.1j.2g(7,c)},7G:q(c){6.1j.25(7,c)},7H:q(c){6.1j[6.1j.3t(7,c)?"25":"2g"](7,c)},25:q(a){l(!a||6.1c(a,[7]).r)7.1i.3s(7)},5B:q(){24(7.2a)7.3s(7.2a)},2Z:q(B,C){l(C.O==1C)C=1h 1v("e",(!C.1b(".")?"6(7)":"v ")+C);6.J.2g(7,B,C)},4C:q(B,C){6.J.25(7,B,C)},1P:q(B,K){6.J.1P(B,K,7)}}};6.5C();6.C.1y({5E:6.C.4o,4o:q(a,b){v a&&b&&a.O==1v&&b.O==1v?7.5M(q(e){7.1N=7.1N==a?b:a;e.4p();v 7.1N.16(7,[e])||U}):7.5E.16(7,19)},7K:q(f,g){q 4r(e){u p=(e.B=="3C"?e.7M:e.7N)||e.7O;24(p&&p!=7)3u{p=p.1i}3o(e){p=7};l(p==7)v U;v(e.B=="3C"?f:g).16(7,[e])}v 7.3C(4r).5Q(4r)},1W:q(f){l(6.3y)f.16(17);G{6.2C.1k(f)}v 7}});6.1y({3y:U,2C:[],1W:q(){l(!6.3y){6.3y=T;l(6.2C){I(u i=0;i<6.2C.D;i++)6.2C[i].16(17);6.2C=M}l(6.11.2I||6.11.30)17.7P("5T",6.1W,U)}}});1h q(){u e=("7R,7S,2S,7T,7U,4z,5M,7V,"+"7X,7Y,81,3C,5Q,83,4w,3c,"+"4x,86,87,88,2l").3b(",");I(u i=0;i<e.D;i++)1h q(){u o=e[i];6.C[o]=q(f){v f?7.2Z(o,f):7.1P(o)};6.C["89"+o]=q(f){v 7.4C(o,f)};6.C["8a"+o]=q(f){u P=6(7);u 1H=q(){P.4C(o,1H);P=M;f.16(7,19)};v 7.2Z(o,1H)}};l(6.11.2I||6.11.30){17.8c("5T",6.1W,U)}G l(6.11.1p){17.8d("<8e"+"8f 3H=5W 8n=T "+"3w=//:><\\/27>");u 27=17.5V("5W");27.2w=q(){l(7.3n!="1I")v;7.1i.3s(7);6.1W()};27=M}G l(6.11.2M){6.3N=42(q(){l(17.3n=="63"||17.3n=="1I"){56(6.3N);6.3N=M;6.1W()}},10)}6.J.2g(1z,"2S",6.1W)};l(6.11.1p)6(1z).4z(q(){u J=6.J,1e=J.1e;I(u B 1r 1e){u 3P=1e[B],i=3P.D;l(i>0)6a l(B!=\'4z\')J.25(3P[i-1],B);24(--i)}});6.C.1y({60:6.C.1A,1A:q(12,H){v 12?7.1U({1G:"1A",2c:"1A",1m:"1A"},12,H):7.60()},5U:6.C.1s,1s:q(12,H){v 12?7.1U({1G:"1s",2c:"1s",1m:"1s"},12,H):7.5U()},6n:q(12,H){v 7.1U({1G:"1A"},12,H)},6o:q(12,H){v 7.1U({1G:"1s"},12,H)},6p:q(12,H){v 7.W(q(){u 4J=6(7).4E(":1S")?"1A":"1s";6(7).1U({1G:4J},12,H)})},6r:q(12,H){v 7.1U({1m:"1A"},12,H)},6s:q(12,H){v 7.1U({1m:"1s"},12,H)},6t:q(12,2o,H){v 7.1U({1m:2o},12,H)},1U:q(E,12,H){v 7.1w(q(){7.2U=6.1y({},E);I(u p 1r E){u e=1h 6.2R(7,6.12(12,H),p);l(E[p].O==4O)e.3e(e.1l(),E[p]);G e[E[p]](E)}})},1w:q(B,C){l(!C){C=B;B="2R"}v 7.W(q(){l(!7.1w)7.1w={};l(!7.1w[B])7.1w[B]=[];7.1w[B].1k(C);l(7.1w[B].D==1)C.16(7)})}});6.1y({5f:q(e,p){l(e.5F)v;l(p=="1G"&&e.4L!=3l(6.26(e,p)))v;l(p=="2c"&&e.4M!=3l(6.26(e,p)))v;u a=e.1a[p];u o=6.26(e,p,1);l(p=="1G"&&e.4L!=o||p=="2c"&&e.4M!=o)v;e.1a[p]=e.34?"":"5H";u n=6.26(e,p,1);l(o!=n&&n!="5H"){e.1a[p]=a;e.5F=T}},12:q(s,o){o=o||{};l(o.O==1v)o={1I:o};u 5D={6G:6H,6J:4K};o.2E=(s&&s.O==4O?s:5D[s])||5k;o.3J=o.1I;o.1I=q(){6.4R(7,"2R");l(o.3J&&o.3J.O==1v)o.3J.16(7)};v o},1w:{},4R:q(F,B){B=B||"2R";l(F.1w&&F.1w[B]){F.1w[B].4h();u f=F.1w[B][0];l(f)f.16(F)}},2R:q(F,2x,E){u z=7;z.o={2E:2x.2E||5k,1I:2x.1I,2s:2x.2s};z.V=F;u y=z.V.1a;z.a=q(){l(2x.2s)2x.2s.16(F,[z.2i]);l(E=="1m")6.1t(y,"1m",z.2i);G l(3l(z.2i))y[E]=3l(z.2i)+"5d";y.1u="2F"};z.61=q(){v 4c(6.1f(z.V,E))};z.1l=q(){u r=4c(6.26(z.V,E));v r&&r>-6Z?r:z.61()};z.3e=q(41,2o){z.3M=(1h 54()).55();z.2i=41;z.a();z.49=42(q(){z.2s(41,2o)},13)};z.1A=q(){l(!z.V.1Q)z.V.1Q={};z.V.1Q[E]=7.1l();z.3e(0,z.V.1Q[E]);l(E!="1m")y[E]="77"};z.1s=q(){l(!z.V.1Q)z.V.1Q={};z.V.1Q[E]=7.1l();z.o.1s=T;z.3e(z.V.1Q[E],0)};l(!z.V.4b)z.V.4b=6.1f(z.V,"3h");y.3h="1S";z.2s=q(4B,4g){u t=(1h 54()).55();l(t>z.o.2E+z.3M){56(z.49);z.49=M;z.2i=4g;z.a();z.V.2U[E]=T;u 1K=T;I(u i 1r z.V.2U)l(z.V.2U[i]!==T)1K=U;l(1K){y.3h=z.V.4b;l(z.o.1s)y.1u=\'20\';l(z.o.1s){I(u p 1r z.V.2U){l(p=="1m")6.1t(y,p,z.V.1Q[p]);G y[p]=z.V.1Q[p]+"5d";l(p==\'1G\'||p==\'2c\')6.5f(z.V,p)}}}l(1K&&z.o.1I&&z.o.1I.O==1v)z.o.1I.16(z.V)}G{u p=(t-7.3M)/z.o.2E;z.2i=((-5q.7w(p*5q.7y)/2)+0.5)*(4g-4B)+4B;z.a()}}}});6.C.1y({7D:q(N,1O,H){7.2S(N,1O,H,1)},2S:q(N,1O,H,1F){l(N.O==1v)v 7.2Z("2S",N);H=H||q(){};u B="3T";l(1O){l(1O.O==1v){H=1O;1O=M}G{1O=6.2Q(1O);B="4W"}}u 4m=7;6.3I(B,N,1O,q(3v,18){l(18=="2D"||!1F&&18=="5m"){4m.38(3v.3G).3X().W(H,[3v.3G,18])}G H.16(4m,[3v.3G,18])},1F);v 7},7J:q(){v 6.2Q(7)},3X:q(){v 7.1V(\'27\').W(q(){l(7.3w)6.5Y(7.3w,q(){});G 3A.3O(1z,7.2B||7.7L||7.2V||"")}).4q()}});l(6.11.1p&&1T 3i=="Q")3i=q(){v 1h 7Q(5I.5K.1b("7W 5")>=0?"82.5R":"84.5R")};1h q(){u e="5O,5G,5A,5x,5t".3b(",");I(u i=0;i<e.D;i++)1h q(){u o=e[i];6.C[o]=q(f){v 7.2Z(o,f)}}};6.1y({1n:q(N,K,H,B,1F){l(K&&K.O==1v){B=H;H=K;K=M}l(K)N+=((N.1b("?")>-1)?"&":"?")+6.2Q(K);6.3I("3T",N,M,q(r,18){l(H)H(6.3r(r,B),18)},1F)},8h:q(N,K,H,B){6.1n(N,K,H,B,1)},5Y:q(N,H){l(H)6.1n(N,M,H,"27");G{6.1n(N,M,M,"27")}},64:q(N,K,H){l(H)6.1n(N,K,H,"3S");G{6.1n(N,K,"3S")}},8o:q(N,K,H,B){6.3I("4W",N,6.2Q(K),q(r,18){l(H)H(6.3r(r,B),18)})},1q:0,6h:q(1q){6.1q=1q},39:{},3I:q(B,N,K,L,1F){u 1e=T;u 1q=6.1q;l(!N){L=B.1I;u 2D=B.2D;u 2l=B.2l;u 4k=B.4k;u 1e=1T B.1e=="6q"?B.1e:T;u 1q=1T B.1q=="6u"?B.1q:6.1q;1F=B.1F||U;K=B.K;N=B.N;B=B.B}l(1e&&!6.4v++)6.J.1P("5O");u 4y=U;u R=1h 3i();R.6B(B||"3T",N,T);l(K)R.3j("6I-6K","6M/x-6N-6Q-6T");l(1F)R.3j("6V-3Y-6Y",6.39[N]||"71, 74 75 78 46:46:46 79");R.3j("X-7a-7d","3i");l(R.7g)R.3j("7j","7k");u 2w=q(4F){l(R&&(R.3n==4||4F=="1q")){4y=T;u 18=6.4G(R)&&4F!="1q"?1F&&6.4N(R,N)?"5m":"2D":"2l";l(18!="2l"){u 3q;3u{3q=R.4i("4P-3Y")}3o(e){}l(1F&&3q)6.39[N]=3q;l(2D)2D(6.3r(R,4k),18);l(1e)6.J.1P("5t")}G{l(2l)2l(R,18);l(1e)6.J.1P("5x")}l(1e)6.J.1P("5A");l(1e&&!--6.4v)6.J.1P("5G");l(L)L(R,18);R.2w=q(){};R=M}};R.2w=2w;l(1q>0)7Z(q(){l(R){R.85();l(!4y)2w("1q");R=M}},1q);R.8i(K)},4v:0,4G:q(r){3u{v!r.18&&66.6d=="3Q:"||(r.18>=4K&&r.18<6y)||r.18==5b||6.11.2M&&r.18==Q}3o(e){}v U},4N:q(R,N){3u{u 4V=R.4i("4P-3Y");v R.18==5b||4V==6.39[N]||6.11.2M&&R.18==Q}3o(e){}v U},3r:q(r,B){u 4n=r.4i("7I-B");u K=!B&&4n&&4n.1b("R")>=0;K=B=="R"||K?r.80:r.3G;l(B=="27")3A.3O(1z,K);l(B=="3S")3A("K = "+K);l(B=="38")$("<21>").38(K).3X();v K},2Q:q(a){u s=[];l(a.O==2z||a.3E){I(u i=0;i<a.D;i++)s.1k(a[i].1d+"="+50(a[i].Y))}G{I(u j 1r a)s.1k(j+"="+50(a[j]))}v s.5Z("&")}})}',62,521,'||||||jQuery|this||||||||||||||if|||||function||||var|return||||||type|fn|length|prop|elem|else|callback|for|event|data|ret|null|url|constructor|element|undefined|xml||true|false|el|each||value|||browser|speed||elems|obj|apply|document|status|arguments|style|indexOf|filter|name|global|css|args|new|parentNode|className|push|cur|opacity|get|context|msie|timeout|in|hide|attr|display|Function|queue|sibling|extend|window|show|replace|String|val|events|ifModified|height|handler|complete|result|done|key|arg|last|params|trigger|orig|nodeType|hidden|typeof|animate|find|ready|merge|wrap|old|none|div|table|num|while|remove|curCSS|script|test|tbody|firstChild|toUpperCase|width|fn2|macros|childNodes|add|first|now|pos|siblings|error|fix|pushStack|to|nodeName|guid|map|step|not|expr|re|onreadystatechange|options|cssFloat|Array|oldblock|text|readyList|success|duration|block|target|position|mozilla|checked|trim|classes|safari|on|grep|disabled|param|fx|load|domManip|curAnim|innerHTML|handlers|dir|insertBefore|bind|opera|parPos|substr|stack|currentStyle|second|foundToken|styleFloat|html|lastModified|getAttribute|split|select|exec|custom|cloneNode|defaultView|overflow|XMLHttpRequest|setRequestHeader|alpha|parseInt|returnValue|readyState|catch|float|modRes|httpData|removeChild|has|try|res|src|child|isReady|next|eval|token|mouseover|clean|jquery|oWidth|responseText|id|ajax|oldComplete|oHeight|parents|startTime|safariTimer|call|els|file|static|json|GET|visibility|selected|radio|evalScripts|Modified|re2|getAll|from|setInterval|RegExp|_|break|00|matched|noCollision|timer|inv|oldOverflow|parseFloat|toLowerCase|appendChild|clone|lastNum|shift|getResponseHeader|prev|dataType|oid|self|ct|toggle|preventDefault|end|handleHover|button|tr|getComputedStyle|active|reset|submit|requestDone|unload|swap|firstNum|unbind|deep|is|istimeout|httpSuccess|appendTo|force|state|200|scrollHeight|scrollWidth|httpNotModified|Number|Last|documentElement|dequeue|getElementsByTagName|match|100|xmlRes|POST|parse|z0|nodeValue|encodeURIComponent|continue|even|odd|Date|getTime|clearInterval|delete|handle|unshift|stopPropagation|304|gi|px|webkit|setAuto|append|prepend|before|after|400|left|notmodified|eq|lt|contains|Math|axis|parent|ajaxSuccess|removeAttr|password|image|ajaxError|checkbox|input|ajaxComplete|empty|init|ss|_toggle|notAuto|ajaxStop|auto|navigator|size|userAgent|nth|click|createElement|ajaxStart|getPropertyValue|mouseout|XMLHTTP|newProp|DOMContentLoaded|_hide|getElementById|__ie_init|gt|getScript|join|_show|max|THEAD|loaded|getJSON|initDone|location|splice|Top|Right|do|padding|border|protocol|Width|offsetHeight|offsetWidth|ajaxTimeout|absolute|right|relative|clientHeight|clientWidth|slideDown|slideUp|slideToggle|boolean|fadeIn|fadeOut|fadeTo|number|opt|thead|td|300|th|createTextNode|open|toString|only|visible|enabled|slow|600|Content|fast|Type|textarea|application|www|Bottom|class|form|readonly|readOnly|urlencoded|zoom|If|9999|FORM|Since|10000|getAttributeNode|Thu|setAttribute|ig|01|Jan|9_|1px|1970|GMT|Requested|tagName|Left|With|method|action|overrideMimeType|slice|srcElement|Connection|close|cancelBubble|compatible|boxModel|compatMode|CSS1Compat|prependTo|insertAfter|top|color|background|htmlFor|cos|title|PI|href|rel|ancestors|children|loadIfModified|removeAttribute|addClass|removeClass|toggleClass|content|serialize|hover|textContent|fromElement|toElement|relatedTarget|removeEventListener|ActiveXObject|blur|focus|resize|scroll|dblclick|MSIE|mousedown|mouseup|setTimeout|responseXML|mousemove|Microsoft|change|Msxml2|abort|keydown|keypress|keyup|un|one|prototype|addEventListener|write|scr|ipt|index|getIfModified|send|nextSibling|pop|Boolean|TABLE|defer|post'.split('|'),0,{}))
+++ /dev/null
-/*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-*/
-
-/**
- * The Connection Manager provides a simplified interface to the XMLHttpRequest
- * object. It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
- * interactive states and server response, returning the results to a pre-defined
- * callback you create.
- * @ class
- */
-YAHOO.util.Connect =
-{
- /**
- * Array of MSFT ActiveX ids for XMLHttpRequest.
- * @private
- * @type array
- */
- _msxml_progid:[
- 'MSXML2.XMLHTTP.5.0',
- 'MSXML2.XMLHTTP.4.0',
- 'MSXML2.XMLHTTP.3.0',
- 'MSXML2.XMLHTTP',
- 'Microsoft.XMLHTTP'
- ],
-
- /**
- * Array of HTTP header(s)
- * @private
- * @type array
- */
- _http_header:{},
-
- /**
- * Determines if HTTP headers are set.
- * @private
- * @type boolean
- */
- _has_http_headers:false,
-
- /**
- * Property modified by setForm() to determine if the data
- * should be submitted as an HTML form.
- * @private
- * @type boolean
- */
- _isFormSubmit:false,
-
- /**
- * Property modified by setForm() to set the HTML form data
- * for each transaction.
- * @private
- * @type string
- */
- _sFormData:null,
-
- /**
- * Collection of polling references to the polling mechanism in handleReadyState.
- * @private
- * @type string
- */
- _poll:[],
-
- /**
- * The polling frequency, in milliseconds, for HandleReadyState.
- * when attempting to determine a transaction's XHR readyState.
- * The default is 50 milliseconds.
- * @private
- * @type int
- */
- _polling_interval:50,
-
- /**
- * A transaction counter that increments the transaction id for each transaction.
- * @private
- * @type int
- */
- _transaction_id:0,
-
- /**
- * Member to add an ActiveX id to the existing xml_progid array.
- * In the event(unlikely) a new ActiveX id is introduced, it can be added
- * without internal code modifications.
- * @public
- * @param string id The ActiveX id to be added to initialize the XHR object.
- * @return void
- */
- setProgId:function(id)
- {
- this.msxml_progid.unshift(id);
- },
-
- /**
- * Member to modify the default polling interval.
- * @public
- * @param {int} i The polling interval in milliseconds.
- * @return void
- */
- setPollingInterval:function(i)
- {
- if(typeof i == 'number' && isFinite(i)){
- this._polling_interval = i;
- }
- },
-
- /**
- * Instantiates a XMLHttpRequest object and returns an object with two properties:
- * the XMLHttpRequest instance and the transaction id.
- * @private
- * @param {int} transactionId Property containing the transaction id for this transaction.
- * @return connection object
- */
- createXhrObject:function(transactionId)
- {
- var obj,http;
- try
- {
- // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
- http = new XMLHttpRequest();
- // Object literal with http and tId properties
- obj = { conn:http, tId:transactionId };
- }
- catch(e)
- {
- for(var i=0; i<this._msxml_progid.length; ++i){
- try
- {
- // Instantiates XMLHttpRequest for IE and assign to http.
- http = new ActiveXObject(this._msxml_progid[i]);
- if(http){
- // Object literal with http and tId properties
- obj = { conn:http, tId:transactionId };
- break;
- }
- }
- catch(e){}
- }
- }
- finally
- {
- return obj;
- }
- },
-
- /**
- * This method is called by asyncRequest to create a
- * valid connection object for the transaction. It also passes a
- * transaction id and increments the transaction id counter.
- * @private
- * @return object
- */
- getConnectionObject:function()
- {
- var o;
- var tId = this._transaction_id;
-
- try
- {
- o = this.createXhrObject(tId);
- if(o){
- this._transaction_id++;
- }
- }
- catch(e){}
- finally
- {
- return o;
- }
- },
-
- /**
- * Method for initiating an asynchronous request via the XHR object.
- * @public
- * @param {string} method HTTP transaction method
- * @param {string} uri Fully qualified path of resource
- * @param callback User-defined callback function or object
- * @param {string} postData POST body
- * @return {object} Returns the connection object
- */
- asyncRequest:function(method, uri, callback, postData)
- {
- var o = this.getConnectionObject();
-
- if(!o){
- return null;
- }
- else{
- if(this._isFormSubmit){
- //If the specified HTTP method is GET, setForm() will return an
- //encoded string that is concatenated to the uri to
- //create a querystring.
- if(method == 'GET'){
- uri += "?" + this._sFormData;
- }
- else if(method == 'POST'){
- postData = this._sFormData;
- }
- this._sFormData = '';
- this._isFormSubmit = false;
- }
-
- o.conn.open(method, uri, true);
-
- if(postData){
- this.initHeader('Content-Type','application/x-www-form-urlencoded');
- }
-
- //Verify whether the transaction has any user-defined HTTP headers
- //and set them.
- if(this._has_http_headers){
- this.setHeader(o);
- }
-
- this.handleReadyState(o, callback);
- postData?o.conn.send(postData):o.conn.send(null);
-
- return o;
- }
- },
-
- /**
- * This method serves as a timer that polls the XHR object's readyState
- * property during a transaction, instead of binding a callback to the
- * onreadystatechange event. Upon readyState 4, handleTransactionResponse
- * will process the response, and the timer will be cleared.
- *
- * @private
- * @param {object} o The connection object
- * @param callback User-defined callback object
- * @return void
- */
- handleReadyState:function(o, callback)
- {
- var oConn = this;
- try
- {
- this._poll[o.tId] = window.setInterval(
- function(){
- if(o.conn && o.conn.readyState == 4){
- window.clearInterval(oConn._poll[o.tId]);
- oConn._poll.splice(o.tId);
- oConn.handleTransactionResponse(o, callback);
- }
- }
- ,this._polling_interval);
- }
- catch(e)
- {
- window.clearInterval(oConn._poll[o.tId]);
- oConn._poll.splice(o.tId);
- oConn.handleTransactionResponse(o, callback);
- }
- },
-
- /**
- * This method attempts to interpret the server response and
- * determine whether the transaction was successful, or if an error or
- * exception was encountered.
- *
- * @private
- * @param {object} o The connection object
- * @param {function} callback - User-defined callback object
- * @return void
- */
- handleTransactionResponse:function(o, callback)
- {
- // If no valid callback is provided, then do not process any callback handling.
- if(!callback){
- this.releaseObject(o);
- return;
- }
-
- var httpStatus;
- var responseObject;
-
- try
- {
- httpStatus = o.conn.status;
- }
- catch(e){
- // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
- // when the o object's status and statusText properties are
- // unavailable, and a query attempt throws an exception.
- httpStatus = 13030;
- }
-
- if(httpStatus >= 200 && httpStatus < 300){
- responseObject = this.createResponseObject(o, callback.argument);
- if(callback.success){
- if(!callback.scope){
- callback.success(responseObject);
- }
- else{
- // If a scope property is defined, the callback will be fired from
- // the context of the object.
- callback.success.apply(callback.scope, [responseObject]);
- }
- }
- }
- else{
- switch(httpStatus){
- // The following case labels are wininet.dll error codes that may be encountered.
- // Server timeout
- case 12002:
- // 12029 to 12031 correspond to dropped connections.
- case 12029:
- case 12030:
- case 12031:
- // Connection closed by server.
- case 12152:
- // See above comments for variable status.
- case 13030:
- responseObject = this.createExceptionObject(o, callback.argument);
- if(callback.failure){
- if(!callback.scope){
- callback.failure(responseObject);
- }
- else{
- callback.failure.apply(callback.scope,[responseObject]);
- }
- }
- break;
- default:
- responseObject = this.createResponseObject(o, callback.argument);
- if(callback.failure){
- if(!callback.scope){
- callback.failure(responseObject);
- }
- else{
- callback.failure.apply(callback.scope,[responseObject]);
- }
- }
- }
- }
-
- this.releaseObject(o);
- },
-
- /**
- * This method evaluates the server response, creates and returns the results via
- * its properties. Success and failure cases will differ in the response
- * object's property values.
- * @private
- * @param {object} o The connection object
- * @param {} callbackArg User-defined argument or arguments to be passed to the callback
- * @return object
- */
- createResponseObject:function(o, callbackArg)
- {
- var obj = {};
- var headerObj = {};
-
- try
- {
- var headerStr = o.conn.getAllResponseHeaders();
- var header = headerStr.split("\n");
- for(var i=0; i < header.length; i++){
- var delimitPos = header[i].indexOf(':');
- if(delimitPos != -1){
- headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+1);
- }
- }
-
- obj.tId = o.tId;
- obj.status = o.conn.status;
- obj.statusText = o.conn.statusText;
- obj.getResponseHeader = headerObj;
- obj.getAllResponseHeaders = headerStr;
- obj.responseText = o.conn.responseText;
- obj.responseXML = o.conn.responseXML;
- if(typeof callbackArg !== undefined){
- obj.argument = callbackArg;
- }
- }
- catch(e){}
- finally
- {
- return obj;
- }
- },
-
- /**
- * If a transaction cannot be completed due to dropped or closed connections,
- * there may be not be enough information to build a full response object.
- * The failure callback will be fired and this specific condition can be identified
- * by a status property value of 0.
- * @private
- * @param {int} tId Transaction Id
- * @param callbackArg The user-defined arguments
- * @return object
- */
- createExceptionObject:function(tId, callbackArg)
- {
- var COMM_CODE = 0;
- var COMM_ERROR = 'communication failure';
-
- var obj = {};
-
- obj.tId = tId;
- obj.status = COMM_CODE;
- obj.statusText = COMM_ERROR;
- if(callbackArg){
- obj.argument = callbackArg;
- }
-
- return obj;
- },
-
- /**
- * Public method that stores the custom HTTP headers for each transaction.
- * @public
- * @param {string} label The HTTP header label
- * @param {string} value The HTTP header value
- * @return void
- */
- initHeader:function(label,value)
- {
- if(this._http_header[label] === undefined){
- this._http_header[label] = value;
- }
- else{
- this._http_header[label] = value + "," + this._http_header[label];
- }
-
- this._has_http_headers = true;
- },
-
- /**
- * Accessor that sets the HTTP headers for each transaction.
- * @private
- * @param {object} o The connection object for the transaction.
- * @return void
- */
- setHeader:function(o)
- {
- for(var prop in this._http_header){
- o.conn.setRequestHeader(prop, this._http_header[prop]);
- }
- delete this._http_header;
-
- this._http_header = {};
- this._has_http_headers = false;
- },
-
- /**
- * This method assembles the form label and value pairs and
- * constructs an encoded string.
- * asyncRequest() will automatically initialize the
- * transaction with a HTTP header Content-Type of
- * application/x-www-form-urlencoded.
- * @public
- * @param {string || object} form id or name attribute, or form object.
- * @return void
- */
- setForm:function(formId)
- {
- this._sFormData = '';
- if(typeof formId == 'string'){
- // Determine if the argument is a form id or a form name.
- // Note form name usage is deprecated by supported
- // here for legacy reasons.
- var oForm = (document.getElementById(formId) || document.forms[formId] );
- }
- else if(typeof formId == 'object'){
- var oForm = formId;
- }
- else{
- return;
- }
- var oElement, oName, oValue, oDisabled;
- var hasSubmit = false;
-
- // Iterate over the form elements collection to construct the
- // label-value pairs.
- for (var i=0; i<oForm.elements.length; i++){
- oDisabled = oForm.elements[i].disabled;
- // If the name attribute is not populated, the form field's
- // value will not be submitted.
- if(oForm.elements[i].name != ""){
- oElement = oForm.elements[i];
- oName = oForm.elements[i].name;
- oValue = oForm.elements[i].value;
- }
-
- // Do not submit fields that are disabled.
- if(!oDisabled)
- {
- switch (oElement.type)
- {
- case 'select-one':
- case 'select-multiple':
- for(var j=0; j<oElement.options.length; j++){
- if(oElement.options[j].selected){
- this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].value || oElement.options[j].text) + '&';
- }
- }
- break;
- case 'radio':
- case 'checkbox':
- if(oElement.checked){
- this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
- }
- break;
- case 'file':
- // this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
- // stub case as XMLHttpRequest will only send the file path as a string.
- case undefined:
- // stub case for fieldset element which returns undefined.
- case 'reset':
- // stub case for input type reset button.
- case 'button':
- // stub case for input type button elements.
- break;
- case 'submit':
- if(hasSubmit == false){
- this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
- hasSubmit = true;
- }
- break;
- default:
- this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
- break;
- }
- }
- }
-
- this._isFormSubmit = true;
- this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
- },
-
- /**
- * Public method to terminate a transaction, if it has not reached readyState 4.
- * @public
- * @param {object} o The connection object returned by asyncRequest.
- * @return void
- */
- abort:function(o)
- {
- if(this.isCallInProgress(o)){
- window.clearInterval(this._poll[o.tId]);
- this._poll.splice(o.tId);
- o.conn.abort();
- this.releaseObject(o);
-
- return true;
- }
- else{
- return false;
- }
- },
-
- /**
- * Public method to check if the transaction is still being processed.
- * @public
- * @param {object} o The connection object returned by asyncRequest
- * @return boolean
- */
- isCallInProgress:function(o)
- {
- // if the XHR object assigned to the transaction has not been dereferenced,
- // then check its readyState status. Otherwise, return false.
- if(o.conn){
- return o.conn.readyState != 4 && o.conn.readyState != 0;
- }
- else{
- //The XHR object has been destroyed.
- return false;
- }
- },
-
- /**
- * Dereference the XHR instance and the connection object after the transaction is completed.
- * @private
- * @param {object} o The connection object
- * @return void
- */
- releaseObject:function(o)
- {
- //dereference the XHR instance.
- o.conn = null;
- //dereference the connection object.
- o = null;
- }
-};
+++ /dev/null
-/* \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved. \r
-Code licensed under the BSD License: \r
-http://developer.yahoo.net/yui/license.txt \r
-version: 0.10.0 \r
-*/ \r
-\r
-/**\r
- * The CustomEvent class lets you define events for your application\r
- * that can be subscribed to by one or more independent component.\r
- *\r
- * @param {String} type The type of event, which is passed to the callback\r
- * when the event fires\r
- * @param {Object} oScope The context the event will fire from. "this" will\r
- * refer to this object in the callback. Default value: \r
- * the window object. The listener can override this.\r
- * @constructor\r
- */\r
-YAHOO.util.CustomEvent = function(type, oScope) {\r
- /**\r
- * The type of event, returned to subscribers when the event fires\r
- * @type string\r
- */\r
- this.type = type;\r
-\r
- /**\r
- * The scope the the event will fire from by default. Defaults to the window \r
- * obj\r
- * @type object\r
- */\r
- this.scope = oScope || window;\r
-\r
- /**\r
- * The subscribers to this event\r
- * @type Subscriber[]\r
- */\r
- this.subscribers = [];\r
-\r
- // Register with the event utility for automatic cleanup. Made optional\r
- // so that CustomEvent can be used independently of pe.event\r
- if (YAHOO.util.Event) { \r
- YAHOO.util.Event.regCE(this);\r
- }\r
-};\r
-\r
-YAHOO.util.CustomEvent.prototype = {\r
- /**\r
- * Subscribes the caller to this event\r
- * @param {Function} fn The function to execute\r
- * @param {Object} obj An object to be passed along when the event fires\r
- * @param {boolean} bOverride If true, the obj passed in becomes the execution\r
- * scope of the listener\r
- */\r
- subscribe: function(fn, obj, bOverride) {\r
- this.subscribers.push( new YAHOO.util.Subscriber(fn, obj, bOverride) );\r
- },\r
-\r
- /**\r
- * Unsubscribes the caller from this event\r
- * @param {Function} fn The function to execute\r
- * @param {Object} obj An object to be passed along when the event fires\r
- * @return {boolean} True if the subscriber was found and detached.\r
- */\r
- unsubscribe: function(fn, obj) {\r
- var found = false;\r
- for (var i=0, len=this.subscribers.length; i<len; ++i) {\r
- var s = this.subscribers[i];\r
- if (s && s.contains(fn, obj)) {\r
- this._delete(i);\r
- found = true;\r
- }\r
- }\r
-\r
- return found;\r
- },\r
-\r
- /**\r
- * Notifies the subscribers. The callback functions will be executed\r
- * from the scope specified when the event was created, and with the following\r
- * parameters:\r
- * <pre>\r
- * - The type of event\r
- * - All of the arguments fire() was executed with as an array\r
- * - The custom object (if any) that was passed into the subscribe() method\r
- * </pre>\r
- * \r
- * @param {Array} an arbitrary set of parameters to pass to the handler\r
- */\r
- fire: function() {\r
- for (var i=0, len=this.subscribers.length; i<len; ++i) {\r
- var s = this.subscribers[i];\r
- if (s) {\r
- var scope = (s.override) ? s.obj : this.scope;\r
- s.fn.call(scope, this.type, arguments, s.obj);\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Removes all listeners\r
- */\r
- unsubscribeAll: function() {\r
- for (var i=0, len=this.subscribers.length; i<len; ++i) {\r
- this._delete(i);\r
- }\r
- },\r
-\r
- /**\r
- * @private\r
- */\r
- _delete: function(index) {\r
- var s = this.subscribers[index];\r
- if (s) {\r
- delete s.fn;\r
- delete s.obj;\r
- }\r
-\r
- delete this.subscribers[index];\r
- }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * @class Stores the subscriber information to be used when the event fires.\r
- * @param {Function} fn The function to execute\r
- * @param {Object} obj An object to be passed along when the event fires\r
- * @param {boolean} bOverride If true, the obj passed in becomes the execution\r
- * scope of the listener\r
- * @constructor\r
- */\r
-YAHOO.util.Subscriber = function(fn, obj, bOverride) {\r
- /**\r
- * The callback that will be execute when the event fires\r
- * @type function\r
- */\r
- this.fn = fn;\r
-\r
- /**\r
- * An optional custom object that will passed to the callback when\r
- * the event fires\r
- * @type object\r
- */\r
- this.obj = obj || null;\r
-\r
- /**\r
- * The default execution scope for the event listener is defined when the\r
- * event is created (usually the object which contains the event).\r
- * By setting override to true, the execution scope becomes the custom\r
- * object passed in by the subscriber\r
- * @type boolean\r
- */\r
- this.override = (bOverride);\r
-};\r
-\r
-/**\r
- * Returns true if the fn and obj match this objects properties.\r
- * Used by the unsubscribe method to match the right subscriber.\r
- *\r
- * @param {Function} fn the function to execute\r
- * @param {Object} obj an object to be passed along when the event fires\r
- * @return {boolean} true if the supplied arguments match this \r
- * subscriber's signature.\r
- */\r
-YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {\r
- return (this.fn == fn && this.obj == obj);\r
-};\r
-\r
-/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */\r
-\r
-// Only load this library once. If it is loaded a second time, existing\r
-// events cannot be detached.\r
-if (!YAHOO.util.Event) {\r
-\r
-/**\r
- * @class\r
- * The event utility provides functions to add and remove event listeners,\r
- * event cleansing. It also tries to automatically remove listeners it\r
- * registers during the unload event.\r
- * @constructor\r
- */\r
- YAHOO.util.Event = function() {\r
-\r
- /**\r
- * True after the onload event has fired\r
- * @type boolean\r
- * @private\r
- */\r
- var loadComplete = false;\r
-\r
- /**\r
- * Cache of wrapped listeners\r
- * @type array\r
- * @private\r
- */\r
- var listeners = [];\r
-\r
- /**\r
- * Listeners that will be attached during the onload event\r
- * @type array\r
- * @private\r
- */\r
- var delayedListeners = [];\r
-\r
- /**\r
- * User-defined unload function that will be fired before all events\r
- * are detached\r
- * @type array\r
- * @private\r
- */\r
- var unloadListeners = [];\r
-\r
- /**\r
- * Cache of the custom events that have been defined. Used for\r
- * automatic cleanup\r
- * @type array\r
- * @private\r
- */\r
- var customEvents = [];\r
-\r
- /**\r
- * Cache of DOM0 event handlers to work around issues with DOM2 events\r
- * in Safari\r
- * @private\r
- */\r
- var legacyEvents = [];\r
-\r
- /**\r
- * Listener stack for DOM0 events\r
- * @private\r
- */\r
- var legacyHandlers = [];\r
-\r
- /**\r
- * The number of times to poll after window.onload. This number is\r
- * increased if additional late-bound handlers are requested after\r
- * the page load.\r
- * @private\r
- */\r
- var retryCount = 0;\r
-\r
- /**\r
- * onAvailable listeners\r
- * @private\r
- */\r
- var onAvailStack = [];\r
-\r
- /**\r
- * Lookup table for legacy events\r
- * @private\r
- */\r
- var legacyMap = [];\r
-\r
- /**\r
- * Counter for auto id generation\r
- * @private\r
- */\r
- var counter = 0;\r
-\r
- return { // PREPROCESS\r
-\r
- /**\r
- * The number of times we should look for elements that are not\r
- * in the DOM at the time the event is requested after the document\r
- * has been loaded. The default is 200@50 ms, so it will poll\r
- * for 10 seconds or until all outstanding handlers are bound\r
- * (whichever comes first).\r
- * @type int\r
- */\r
- POLL_RETRYS: 200,\r
-\r
- /**\r
- * The poll interval in milliseconds\r
- * @type int\r
- */\r
- POLL_INTERVAL: 50,\r
-\r
- /**\r
- * Element to bind, int constant\r
- * @type int\r
- */\r
- EL: 0,\r
-\r
- /**\r
- * Type of event, int constant\r
- * @type int\r
- */\r
- TYPE: 1,\r
-\r
- /**\r
- * Function to execute, int constant\r
- * @type int\r
- */\r
- FN: 2,\r
-\r
- /**\r
- * Function wrapped for scope correction and cleanup, int constant\r
- * @type int\r
- */\r
- WFN: 3,\r
-\r
- /**\r
- * Object passed in by the user that will be returned as a \r
- * parameter to the callback, int constant\r
- * @type int\r
- */\r
- SCOPE: 3,\r
-\r
- /**\r
- * Adjusted scope, either the element we are registering the event\r
- * on or the custom object passed in by the listener, int constant\r
- * @type int\r
- */\r
- ADJ_SCOPE: 4,\r
-\r
- /**\r
- * Safari detection is necessary to work around the preventDefault\r
- * bug that makes it so you can't cancel a href click from the \r
- * handler. There is not a capabilities check we can use here.\r
- * @private\r
- */\r
- isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),\r
-\r
- /**\r
- * IE detection needed to properly calculate pageX and pageY. \r
- * capabilities checking didn't seem to work because another \r
- * browser that does not provide the properties have the values \r
- * calculated in a different manner than IE.\r
- * @private\r
- */\r
- isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && \r
- navigator.userAgent.match(/msie/gi)),\r
-\r
- /**\r
- * @private\r
- */\r
- addDelayedListener: function(el, sType, fn, oScope, bOverride) {\r
- delayedListeners[delayedListeners.length] =\r
- [el, sType, fn, oScope, bOverride];\r
-\r
- // If this happens after the inital page load, we need to\r
- // reset the poll counter so that we continue to search for\r
- // the element for a fixed period of time.\r
- if (loadComplete) {\r
- retryCount = this.POLL_RETRYS;\r
- this.startTimeout(0);\r
- // this._tryPreloadAttach();\r
- }\r
- },\r
-\r
- /**\r
- * @private\r
- */\r
- startTimeout: function(interval) {\r
- var i = (interval || interval === 0) ? interval : this.POLL_INTERVAL;\r
- var self = this;\r
- var callback = function() { self._tryPreloadAttach(); };\r
- this.timeout = setTimeout(callback, i);\r
- },\r
-\r
- /**\r
- * Executes the supplied callback when the item with the supplied\r
- * id is found. This is meant to be used to execute behavior as\r
- * soon as possible as the page loads. If you use this after the\r
- * initial page load it will poll for a fixed time for the element.\r
- * The number of times it will poll and the frequency are\r
- * configurable. By default it will poll for 10 seconds.\r
- * @param {string} p_id the id of the element to look for.\r
- * @param {function} p_fn what to execute when the element is found.\r
- * @param {object} p_obj an optional object to be passed back as\r
- * a parameter to p_fn.\r
- * @param {boolean} p_override If set to true, p_fn will execute\r
- * in the scope of p_obj\r
- *\r
- */\r
- onAvailable: function(p_id, p_fn, p_obj, p_override) {\r
- onAvailStack.push( { id: p_id, \r
- fn: p_fn, \r
- obj: p_obj, \r
- override: p_override } );\r
-\r
- retryCount = this.POLL_RETRYS;\r
- this.startTimeout(0);\r
- // this._tryPreloadAttach();\r
- },\r
-\r
- /**\r
- * Appends an event handler\r
- *\r
- * @param {Object} el The html element to assign the \r
- * event to\r
- * @param {String} sType The type of event to append\r
- * @param {Function} fn The method the event invokes\r
- * @param {Object} oScope An arbitrary object that will be \r
- * passed as a parameter to the handler\r
- * @param {boolean} bOverride If true, the obj passed in becomes\r
- * the execution scope of the listener\r
- * @return {boolean} True if the action was successful or defered,\r
- * false if one or more of the elements \r
- * could not have the event bound to it.\r
- */\r
- addListener: function(el, sType, fn, oScope, bOverride) {\r
-\r
- if (!fn || !fn.call) {\r
- return false;\r
- }\r
-\r
- // The el argument can be an array of elements or element ids.\r
- if ( this._isValidCollection(el)) {\r
- var ok = true;\r
- for (var i=0,len=el.length; i<len; ++i) {\r
- ok = ( this.on(el[i], \r
- sType, \r
- fn, \r
- oScope, \r
- bOverride) && ok );\r
- }\r
- return ok;\r
-\r
- } else if (typeof el == "string") {\r
- var oEl = this.getEl(el);\r
- // If the el argument is a string, we assume it is \r
- // actually the id of the element. If the page is loaded\r
- // we convert el to the actual element, otherwise we \r
- // defer attaching the event until onload event fires\r
-\r
- // check to see if we need to delay hooking up the event \r
- // until after the page loads.\r
- if (loadComplete && oEl) {\r
- el = oEl;\r
- } else {\r
- // defer adding the event until onload fires\r
- this.addDelayedListener(el, \r
- sType, \r
- fn, \r
- oScope, \r
- bOverride);\r
-\r
- return true;\r
- }\r
- }\r
-\r
- // Element should be an html element or an array if we get \r
- // here.\r
- if (!el) {\r
- return false;\r
- }\r
-\r
- // we need to make sure we fire registered unload events \r
- // prior to automatically unhooking them. So we hang on to \r
- // these instead of attaching them to the window and fire the\r
- // handles explicitly during our one unload event.\r
- if ("unload" == sType && oScope !== this) {\r
- unloadListeners[unloadListeners.length] =\r
- [el, sType, fn, oScope, bOverride];\r
- return true;\r
- }\r
-\r
-\r
- // if the user chooses to override the scope, we use the custom\r
- // object passed in, otherwise the executing scope will be the\r
- // HTML element that the event is registered on\r
- var scope = (bOverride) ? oScope : el;\r
-\r
- // wrap the function so we can return the oScope object when\r
- // the event fires;\r
- var wrappedFn = function(e) {\r
- return fn.call(scope, YAHOO.util.Event.getEvent(e), \r
- oScope);\r
- };\r
-\r
- var li = [el, sType, fn, wrappedFn, scope];\r
- var index = listeners.length;\r
- // cache the listener so we can try to automatically unload\r
- listeners[index] = li;\r
-\r
- if (this.useLegacyEvent(el, sType)) {\r
- var legacyIndex = this.getLegacyIndex(el, sType);\r
- if (legacyIndex == -1) {\r
-\r
- legacyIndex = legacyEvents.length;\r
- legacyMap[el.id + sType] = legacyIndex;\r
-\r
- // cache the signature for the DOM0 event, and \r
- // include the existing handler for the event, if any\r
- legacyEvents[legacyIndex] = \r
- [el, sType, el["on" + sType]];\r
- legacyHandlers[legacyIndex] = [];\r
-\r
- el["on" + sType] = \r
- function(e) {\r
- YAHOO.util.Event.fireLegacyEvent(\r
- YAHOO.util.Event.getEvent(e), legacyIndex);\r
- };\r
- }\r
-\r
- // add a reference to the wrapped listener to our custom\r
- // stack of events\r
- legacyHandlers[legacyIndex].push(index);\r
-\r
- // DOM2 Event model\r
- } else if (el.addEventListener) {\r
- el.addEventListener(sType, wrappedFn, false);\r
- // Internet Explorer abstraction\r
- } else if (el.attachEvent) {\r
- el.attachEvent("on" + sType, wrappedFn);\r
- }\r
-\r
- return true;\r
- \r
- },\r
-\r
- /**\r
- * Shorthand for YAHOO.util.Event.addListener\r
- * @type function\r
- */\r
- // on: this.addListener,\r
-\r
- /**\r
- * When using legacy events, the handler is routed to this object\r
- * so we can fire our custom listener stack.\r
- * @private\r
- */\r
- fireLegacyEvent: function(e, legacyIndex) {\r
- var ok = true;\r
-\r
- var le = legacyHandlers[legacyIndex];\r
- for (var i=0,len=le.length; i<len; ++i) {\r
- var index = le[i];\r
- if (index) {\r
- var li = listeners[index];\r
- if ( li && li[this.WFN] ) {\r
- var scope = li[this.ADJ_SCOPE];\r
- var ret = li[this.WFN].call(scope, e);\r
- ok = (ok && ret);\r
- } else {\r
- // This listener was removed, so delete it from\r
- // the array\r
- delete le[i];\r
- }\r
- }\r
- }\r
-\r
- return ok;\r
- },\r
-\r
- /**\r
- * Returns the legacy event index that matches the supplied \r
- * signature\r
- * @private\r
- */\r
- getLegacyIndex: function(el, sType) {\r
- /*\r
- for (var i=0,len=legacyEvents.length; i<len; ++i) {\r
- var le = legacyEvents[i];\r
- if (le && le[0] === el && le[1] === sType) {\r
- return i;\r
- }\r
- }\r
- return -1;\r
- */\r
-\r
- var key = this.generateId(el) + sType;\r
- if (typeof legacyMap[key] == "undefined") { \r
- return -1;\r
- } else {\r
- return legacyMap[key];\r
- }\r
-\r
- },\r
-\r
- /**\r
- * Logic that determines when we should automatically use legacy\r
- * events instead of DOM2 events.\r
- * @private\r
- */\r
- useLegacyEvent: function(el, sType) {\r
-\r
- if (!el.addEventListener && !el.attachEvent) {\r
- return true;\r
- } else if (this.isSafari) {\r
- if ("click" == sType || "dblclick" == sType) {\r
- return true;\r
- }\r
- }\r
-\r
- return false;\r
- },\r
- \r
- /**\r
- * Removes an event handler\r
- *\r
- * @param {Object} el the html element or the id of the element to \r
- * assign the event to.\r
- * @param {String} sType the type of event to remove\r
- * @param {Function} fn the method the event invokes\r
- * @return {boolean} true if the unbind was successful, false \r
- * otherwise\r
- */\r
- removeListener: function(el, sType, fn, index) {\r
-\r
- if (!fn || !fn.call) {\r
- return false;\r
- }\r
-\r
- // The el argument can be a string\r
- if (typeof el == "string") {\r
- el = this.getEl(el);\r
- // The el argument can be an array of elements or element ids.\r
- } else if ( this._isValidCollection(el)) {\r
- var ok = true;\r
- for (var i=0,len=el.length; i<len; ++i) {\r
- ok = ( this.removeListener(el[i], sType, fn) && ok );\r
- }\r
- return ok;\r
- }\r
-\r
- if ("unload" == sType) {\r
-\r
- for (i=0, len=unloadListeners.length; i<len; i++) {\r
- var li = unloadListeners[i];\r
- if (li && \r
- li[0] == el && \r
- li[1] == sType && \r
- li[2] == fn) {\r
- delete unloadListeners[i];\r
- return true;\r
- }\r
- }\r
-\r
- return false;\r
- }\r
-\r
- var cacheItem = null;\r
- \r
- if ("undefined" == typeof index) {\r
- index = this._getCacheIndex(el, sType, fn);\r
- }\r
-\r
- if (index >= 0) {\r
- cacheItem = listeners[index];\r
- }\r
-\r
- if (!el || !cacheItem) {\r
- return false;\r
- }\r
-\r
-\r
- if (el.removeEventListener) {\r
- el.removeEventListener(sType, cacheItem[this.WFN], false);\r
- } else if (el.detachEvent) {\r
- el.detachEvent("on" + sType, cacheItem[this.WFN]);\r
- }\r
-\r
- // removed the wrapped handler\r
- delete listeners[index][this.WFN];\r
- delete listeners[index][this.FN];\r
- delete listeners[index];\r
-\r
- return true;\r
-\r
- },\r
-\r
- /**\r
- * Returns the event's target element\r
- * @param {Event} ev the event\r
- * @param {boolean} resolveTextNode when set to true the target's\r
- * parent will be returned if the target is a \r
- * text node\r
- * @return {HTMLElement} the event's target\r
- */\r
- getTarget: function(ev, resolveTextNode) {\r
- var t = ev.target || ev.srcElement;\r
-\r
- if (resolveTextNode && t && "#text" == t.nodeName) {\r
- return t.parentNode;\r
- } else {\r
- return t;\r
- }\r
- },\r
-\r
- /**\r
- * Returns the event's pageX\r
- * @param {Event} ev the event\r
- * @return {int} the event's pageX\r
- */\r
- getPageX: function(ev) {\r
- var x = ev.pageX;\r
- if (!x && 0 !== x) {\r
- x = ev.clientX || 0;\r
-\r
- if ( this.isIE ) {\r
- x += this._getScrollLeft();\r
- }\r
- }\r
-\r
- return x;\r
- },\r
-\r
- /**\r
- * Returns the event's pageY\r
- * @param {Event} ev the event\r
- * @return {int} the event's pageY\r
- */\r
- getPageY: function(ev) {\r
- var y = ev.pageY;\r
- if (!y && 0 !== y) {\r
- y = ev.clientY || 0;\r
-\r
- if ( this.isIE ) {\r
- y += this._getScrollTop();\r
- }\r
- }\r
-\r
- return y;\r
- },\r
-\r
- /**\r
- * Returns the pageX and pageY properties as an indexed array.\r
- * @type int[]\r
- */\r
- getXY: function(ev) {\r
- return [this.getPageX(ev), this.getPageY(ev)];\r
- },\r
-\r
- /**\r
- * Returns the event's related target \r
- * @param {Event} ev the event\r
- * @return {HTMLElement} the event's relatedTarget\r
- */\r
- getRelatedTarget: function(ev) {\r
- var t = ev.relatedTarget;\r
- if (!t) {\r
- if (ev.type == "mouseout") {\r
- t = ev.toElement;\r
- } else if (ev.type == "mouseover") {\r
- t = ev.fromElement;\r
- }\r
- }\r
-\r
- return t;\r
- },\r
-\r
- /**\r
- * Returns the time of the event. If the time is not included, the\r
- * event is modified using the current time.\r
- * @param {Event} ev the event\r
- * @return {Date} the time of the event\r
- */\r
- getTime: function(ev) {\r
- if (!ev.time) {\r
- var t = new Date().getTime();\r
- try {\r
- ev.time = t;\r
- } catch(e) { \r
- // can't set the time property \r
- return t;\r
- }\r
- }\r
-\r
- return ev.time;\r
- },\r
-\r
- /**\r
- * Convenience method for stopPropagation + preventDefault\r
- * @param {Event} ev the event\r
- */\r
- stopEvent: function(ev) {\r
- this.stopPropagation(ev);\r
- this.preventDefault(ev);\r
- },\r
-\r
- /**\r
- * Stops event propagation\r
- * @param {Event} ev the event\r
- */\r
- stopPropagation: function(ev) {\r
- if (ev.stopPropagation) {\r
- ev.stopPropagation();\r
- } else {\r
- ev.cancelBubble = true;\r
- }\r
- },\r
-\r
- /**\r
- * Prevents the default behavior of the event\r
- * @param {Event} ev the event\r
- */\r
- preventDefault: function(ev) {\r
- if (ev.preventDefault) {\r
- ev.preventDefault();\r
- } else {\r
- ev.returnValue = false;\r
- }\r
- },\r
- \r
- /**\r
- * Finds the event in the window object, the caller's arguments, or\r
- * in the arguments of another method in the callstack. This is\r
- * executed automatically for events registered through the event\r
- * manager, so the implementer should not normally need to execute\r
- * this function at all.\r
- * @param {Event} the event parameter from the handler\r
- * @return {Event} the event \r
- */\r
- getEvent: function(e) {\r
- var ev = e || window.event;\r
-\r
- if (!ev) {\r
- var c = this.getEvent.caller;\r
- while (c) {\r
- ev = c.arguments[0];\r
- if (ev && Event == ev.constructor) {\r
- break;\r
- }\r
- c = c.caller;\r
- }\r
- }\r
-\r
- return ev;\r
- },\r
-\r
- /**\r
- * Returns the charcode for an event\r
- * @param {Event} ev the event\r
- * @return {int} the event's charCode\r
- */\r
- getCharCode: function(ev) {\r
- return ev.charCode || ((ev.type == "keypress") ? ev.keyCode : 0);\r
- },\r
-\r
- /**\r
- * @private\r
- * Locating the saved event handler data by function ref\r
- */\r
- _getCacheIndex: function(el, sType, fn) {\r
- for (var i=0,len=listeners.length; i<len; ++i) {\r
- var li = listeners[i];\r
- if ( li && \r
- li[this.FN] == fn && \r
- li[this.EL] == el && \r
- li[this.TYPE] == sType ) {\r
- return i;\r
- }\r
- }\r
-\r
- return -1;\r
- },\r
-\r
- /**\r
- * Generates an unique ID for the element if it does not already \r
- * have one.\r
- * @param el the element\r
- * @return {string} the id of the element\r
- */\r
- generateId: function(el) {\r
- var id = el.id;\r
-\r
- if (!id) {\r
- id = "yuievtautoid-" + (counter++);\r
- el.id = id;\r
- }\r
-\r
- return id;\r
- },\r
-\r
- /**\r
- * We want to be able to use getElementsByTagName as a collection\r
- * to attach a group of events to. Unfortunately, different \r
- * browsers return different types of collections. This function\r
- * tests to determine if the object is array-like. It will also \r
- * fail if the object is an array, but is empty.\r
- * @param o the object to test\r
- * @return {boolean} true if the object is array-like and populated\r
- * @private\r
- */\r
- _isValidCollection: function(o) {\r
-\r
- return ( o && // o is something\r
- o.length && // o is indexed\r
- typeof o != "string" && // o is not a string\r
- !o.tagName && // o is not an HTML element\r
- !o.alert && // o is not a window\r
- typeof o[0] != "undefined" );\r
-\r
- },\r
-\r
- /**\r
- * @private\r
- * DOM element cache\r
- */\r
- elCache: {},\r
-\r
- /**\r
- * We cache elements bound by id because when the unload event \r
- * fires, we can no longer use document.getElementById\r
- * @private\r
- */\r
- getEl: function(id) {\r
- return document.getElementById(id);\r
- },\r
-\r
- /**\r
- * Clears the element cache\r
- * @deprecated\r
- * @private\r
- */\r
- clearCache: function() { },\r
-\r
- /**\r
- * Called by CustomEvent instances to provide a handle to the \r
- * event * that can be removed later on. Should be package \r
- * protected.\r
- * @private\r
- */\r
- regCE: function(ce) {\r
- customEvents.push(ce);\r
- },\r
-\r
- /**\r
- * @private\r
- * hook up any deferred listeners\r
- */\r
- _load: function(e) {\r
- loadComplete = true;\r
- },\r
-\r
- /**\r
- * Polling function that runs before the onload event fires, \r
- * attempting * to attach to DOM Nodes as soon as they are \r
- * available\r
- * @private\r
- */\r
- _tryPreloadAttach: function() {\r
-\r
- if (this.locked) {\r
- return false;\r
- }\r
-\r
- this.locked = true;\r
-\r
-\r
- // keep trying until after the page is loaded. We need to \r
- // check the page load state prior to trying to bind the \r
- // elements so that we can be certain all elements have been \r
- // tested appropriately\r
- var tryAgain = !loadComplete;\r
- if (!tryAgain) {\r
- tryAgain = (retryCount > 0);\r
- }\r
-\r
- // Delayed listeners\r
- var stillDelayed = [];\r
-\r
- for (var i=0,len=delayedListeners.length; i<len; ++i) {\r
- var d = delayedListeners[i];\r
- // There may be a race condition here, so we need to \r
- // verify the array element is usable.\r
- if (d) {\r
-\r
- // el will be null if document.getElementById did not\r
- // work\r
- var el = this.getEl(d[this.EL]);\r
-\r
- if (el) {\r
- this.on(el, d[this.TYPE], d[this.FN], \r
- d[this.SCOPE], d[this.ADJ_SCOPE]);\r
- delete delayedListeners[i];\r
- } else {\r
- stillDelayed.push(d);\r
- }\r
- }\r
- }\r
-\r
- delayedListeners = stillDelayed;\r
-\r
- // onAvailable\r
- notAvail = [];\r
- for (i=0,len=onAvailStack.length; i<len ; ++i) {\r
- var item = onAvailStack[i];\r
- if (item) {\r
- el = this.getEl(item.id);\r
-\r
- if (el) {\r
- var scope = (item.override) ? item.obj : el;\r
- item.fn.call(scope, item.obj);\r
- delete onAvailStack[i];\r
- } else {\r
- notAvail.push(item);\r
- }\r
- }\r
- }\r
-\r
- retryCount = (stillDelayed.length === 0 && \r
- notAvail.length === 0) ? 0 : retryCount - 1;\r
-\r
- if (tryAgain) {\r
- this.startTimeout();\r
- }\r
-\r
- this.locked = false;\r
-\r
- },\r
-\r
- /**\r
- * Removes all listeners registered by pe.event. Called \r
- * automatically during the unload event.\r
- * @private\r
- */\r
- _unload: function(e, me) {\r
- for (var i=0,len=unloadListeners.length; i<len; ++i) {\r
- var l = unloadListeners[i];\r
- if (l) {\r
- var scope = (l[this.ADJ_SCOPE]) ? l[this.SCOPE]: window;\r
- l[this.FN].call(scope, this.getEvent(e), l[this.SCOPE] );\r
- }\r
- }\r
-\r
- if (listeners && listeners.length > 0) {\r
- for (i=0,len=listeners.length; i<len ; ++i) {\r
- l = listeners[i];\r
- if (l) {\r
- this.removeListener(l[this.EL], l[this.TYPE], \r
- l[this.FN], i);\r
- }\r
- }\r
-\r
- this.clearCache();\r
- }\r
-\r
- for (i=0,len=customEvents.length; i<len; ++i) {\r
- customEvents[i].unsubscribeAll();\r
- delete customEvents[i];\r
- }\r
-\r
- for (i=0,len=legacyEvents.length; i<len; ++i) {\r
- // dereference the element\r
- delete legacyEvents[i][0];\r
- // delete the array item\r
- delete legacyEvents[i];\r
- }\r
- },\r
-\r
- /**\r
- * Returns scrollLeft\r
- * @private\r
- */\r
- _getScrollLeft: function() {\r
- return this._getScroll()[1];\r
- },\r
-\r
- /**\r
- * Returns scrollTop\r
- * @private\r
- */\r
- _getScrollTop: function() {\r
- return this._getScroll()[0];\r
- },\r
-\r
- /**\r
- * Returns the scrollTop and scrollLeft. Used to calculate the \r
- * pageX and pageY in Internet Explorer\r
- * @private\r
- */\r
- _getScroll: function() {\r
- var dd = document.documentElement; db = document.body;\r
- if (dd && dd.scrollTop) {\r
- return [dd.scrollTop, dd.scrollLeft];\r
- } else if (db) {\r
- return [db.scrollTop, db.scrollLeft];\r
- } else {\r
- return [0, 0];\r
- }\r
- }\r
- };\r
- } ();\r
-\r
- /**\r
- * @private\r
- */\r
- YAHOO.util.Event.on = YAHOO.util.Event.addListener;\r
-\r
- if (document && document.body) {\r
- YAHOO.util.Event._load();\r
- } else {\r
- YAHOO.util.Event.on(window, "load", YAHOO.util.Event._load, \r
- YAHOO.util.Event, true);\r
- }\r
-\r
- YAHOO.util.Event.on(window, "unload", YAHOO.util.Event._unload, \r
- YAHOO.util.Event, true);\r
-\r
- YAHOO.util.Event._tryPreloadAttach();\r
-\r
-}\r
-\r
+++ /dev/null
-/* \r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved. \r
-Code licensed under the BSD License: \r
-http://developer.yahoo.net/yui/license.txt \r
-version: 0.10.0 \r
-*/ \r
-\r
-/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */\r
-\r
-/**\r
- * The Yahoo global namespace\r
- * @constructor\r
- */\r
-var YAHOO = window.YAHOO || {};\r
-\r
-/**\r
- * Returns the namespace specified and creates it if it doesn't exist\r
- *\r
- * YAHOO.namespace("property.package");\r
- * YAHOO.namespace("YAHOO.property.package");\r
- *\r
- * Either of the above would create YAHOO.property, then\r
- * YAHOO.property.package\r
- *\r
- * @param {String} sNameSpace String representation of the desired \r
- * namespace\r
- * @return {Object} A reference to the namespace object\r
- */\r
-YAHOO.namespace = function( sNameSpace ) {\r
-\r
- if (!sNameSpace || !sNameSpace.length) {\r
- return null;\r
- }\r
-\r
- var levels = sNameSpace.split(".");\r
-\r
- var currentNS = YAHOO;\r
-\r
- // YAHOO is implied, so it is ignored if it is included\r
- for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {\r
- currentNS[levels[i]] = currentNS[levels[i]] || {};\r
- currentNS = currentNS[levels[i]];\r
- }\r
-\r
- return currentNS;\r
-};\r
-\r
-/**\r
- * Global log method.\r
- */\r
-YAHOO.log = function(sMsg,sCategory) {\r
- if(YAHOO.widget.Logger) {\r
- YAHOO.widget.Logger.log(null, sMsg, sCategory);\r
- } else {\r
- return false;\r
- }\r
-};\r
-\r
-YAHOO.namespace("util");\r
-YAHOO.namespace("widget");\r
-YAHOO.namespace("example");\r