2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
|
|
/**/_jsload2&&_jsload2('buslinesearch', 'x.extend(Ee.prototype,{Td:function(){for(var a=0,b=this.Oa.length;a<b;a++){var c=this.Oa[a];this[c.method].apply(this,c.arguments)}delete this.Oa},sv:function(a,b,c){a=T.tb(a);return B.Fp+"?c="+a.lng+","+a.lat+"&i="+b+","+encodeURIComponent(c)+"&s="+encodeURIComponent("tpl:LinesQuery")},getBusList:function(a){var b=this;this.Og(this.Ad,function(c){c?$d.fb(function(a,c){b.HQ(a,c)},{qt:b.VP,c:c,wd:a},{wb:a}):(this.uc=new Li({wb:a,city:"",xi:"",Kh:""}),b.sb(5),b.Ra(Y.Ju,this.uc))})},HQ:function(a,b){this.clearResults(); var c=a.result;if(!a.content||0!=c.error||c.type!=this.XP)this.uc=new Li({wb:b.wb,city:a.current_city.name,xi:"",Kh:a.current_city.code}),this.sb(7),this.Ra(Y.Ju,this.uc);else{for(var c=a.content,d=[],e=0,f=c.length;e<f;e++)d.push({name:c[e].name,nk:c[e].uid,Kh:a.current_city.code,Zj:e,$A:b.wb,Yi:c[e].poiType||2});this.uc=new Li({wb:b.wb,city:a.current_city.name,xi:this.sv(Q.eb(a.current_city.geo,o).point,a.current_city.code,b.wb),TM:d,Kh:a.current_city.code});this.sb(0);this.Ra(Y.Ju,this.uc);this.fU(); this.gT(a.current_city.geo,a.current_city.level,a.current_city.code)}},fU:function(){if(this.k.ja.Ha&&this.k.ja.Ha.appendChild&&this.uc&&0<this.uc.gt()){var a=H("div",{style:"font:12px "+I.fontFamily+";background:#fff"});a.id="divResult"+this.ba;for(var b=this.uc.gt(),c=[],d=0;d<b;d++){var e=this.uc.VD(d).name;c.push(\'<dl style="margin:3px 3px"><dt><span style="cursor:pointer" onclick=Instance(\\\'\'+this.ba+"\')._selectBusListItem("+d+")><img id=imgBLIcon"+d+" src="+Ee.Bv+\' style="border:none" /></span> <a style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.ba+"\')._selectBusListItem("+d+")>"+e+"</a></dt><dd id=ddBLInfo"+d+\' style="display:none;margin:2px 0px"></dd></dl>\')}b="";this.uc.moreResultsUrl&&(b=b+"<div style=\'color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right\'>"+("<a style=\'color:#7777cc\' href=\'"+this.uc.moreResultsUrl+"\' target=\'_blank\'>\\u5230\\u767e\\u5ea6\\u5730\\u56fe\\u67e5\\u770b»</a>"),b+=" </div>");a.innerHTML=c.join("")+b;this.k.ja.Ha.appendChild(a);this.Ra(Y.AG,a)}},gT:function(a,b,c){var d=this.k.ja.map; d&&(a=Q.eb(a,o).point,this.wB?this.wB!=c&&(d.Gd(a,b),this.wB=c):(d.Gd(a,b),this.wB=c))},TU:function(a){if(this.uc)for(var b=0,c=this.uc.gt();b<c;b++){var d=x.Ec("ddBLInfo"+b),e=x.Ec("imgBLIcon"+b);b==a?"none"==d.style.display?(d.style.display="block",e.src=Ee.ZS):(d.style.display="none",e.src=Ee.Bv):(d.style.display="none",e.src=Ee.Bv)}},_selectBusListItem:function(a,b){if(!b){var c=x.Ec("ddBLInfo"+a),d=x.Ec("imgBLIcon"+a);if("block"==c.style.display){c.style.display="none";d.src=Ee.Bv;return}}if(this.uc&& this.uc[a]&&0<this.uc[a].ip())this.Fc=this.uc[a],this.sb(0),this.Ra(Y.Iu,this.Fc),this.dJ(a),this.cJ(a);else{var e=this,c=this.uc.VD(a);$d.fb(function(b,c){e.GQ(b,c,a)},{qt:e.UP,c:c.Kh,uid:c.nk},{name:c.name,Yi:c.Yi})}},clearResults:function(){delete this.uc;delete this.Fc;delete this.aj;delete this.D1;this.Rj();this.k.ja.Ha&&(this.k.ja.Ha.innerHTML="")},getBusLine:function(a){a&&("object"==typeof a&&a.nk&&""!=a.nk&&"undefined"!=typeof a.Kh&&""!=a.Kh.toString()&&"undefined"!=typeof a.Zj&&""!=a.Zj.toString()&& "undefined"!=typeof a.$A&&""!=a.$A.toString())&&(this.uc&&0<this.uc.gt()&&a.Kh==this.uc.Kh&&a.$A==this.uc.keyword)&&this._selectBusListItem(a.Zj,o)},GQ:function(a,b,c){var d=a.result;if(!a.content||!a.content[0]||0!=d.error||d.type!=this.WP)this.Fc=new Mi({name:b.name}),this.sb(7),this.Ra(Y.Iu,this.Fc);else{var a=a.content[0],e=d="",f="",g={},i=[],d=a.startTime,e=a.endTime,f=a.company;a.geo&&(g=Q.eb(a.geo,o),g=new zd(g.ha));if(a.stations)for(var k=0,l=a.stations.length;k<l;k++)if(a.stations[k].geo){var m= Q.eb(a.stations[k].geo,o);i.push({name:a.stations[k].name,position:m.point,nk:a.stations[k].uid})}this.Fc=new Mi({name:b.name,startTime:d,XW:e,ZV:f,EZ:g,GO:i,Yi:b.Yi});this.sb(0);this.Ra(Y.Iu,this.Fc);this.uc[c]=this.Fc;this.dJ(c);this.cJ(c)}},dJ:function(a){if(this.k.ja.Ha&&this.k.ja.Ha.appendChild&&this.Fc&&0<this.Fc.ip()){this.TU(a);var b=x.Ec("ddBLInfo
|