1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
|
|
_jsload2&&_jsload2('citylistcontrol', 'z.object.extend(ac.prototype,{zf:function(){this.B&&this.He(this.B)},initialize:function(a){var b=this;if(this.TV&&!this.RQ(a))return s;Vb.prototype.initialize.call(this,a);Vb.prototype.Aa.call(this);this.ML(function(){b.ib();Vb.prototype.Nr.call(b);b.ba(a)});return this.C},ib:function(){var a=this.Hq=L("div",{"class":"ui_city_change"}),b=this.j.anchor,c="",e=t;switch(b){case Wb:c="float: left";break;case Xb:c="float: right";break;case Yb:c="float: left";e=q;break;case 3:c="float: right",e=q}a.innerHTML= \'<a href="javascript:void(0)" onclick="return false" class="ui_city_change_inner" style="\'+c+\'"><span id="cur_city_name" class="cur_city_name">\'+this.B.$g+"</span><i><em></em></i></a>";a.style.position="relative";a.style.height="26px";e||(z.D.Ua(a,"ui_city_change_top"),this.C.appendChild(a));c=this.Gj=L("div",{"class":"citylist_popup_main"});Ab(c,\'<div class="citylist_ctr_title">\\u57ce\\u5e02\\u5217\\u8868</div>\');var f=L("div",{"class":"citylist_ctr_content"}),g=L("div",{"class":"city_content_top"}); g.innerHTML=\'<p class="cur_city_info">\\u5f53\\u524d\\u57ce\\u5e02\\uff1a<span id="cur_city_spn">\'+this.B.$g+"</span</p>";Ab(g,\'<form id="city_ctrl_form" onsubmit="Instance("\'+this.aa+\'").search(this);return false"><input type="text" class="sel_city_input" id="selCityWd" name="wd" placeholder="\\u8bf7\\u8f93\\u5165\\u57ce\\u5e02\\u540d" autocomplete="off"><span id="selCitySubmit">\\u641c\\u7d22</span><div id="selCityTip" style="display:none;height:20px;line-height:20px;color:#AE6842;border:1px solid #E8AA6C;background:#FEFAF1;width:121px;text-align:center">\\u8bf7\\u8f93\\u5165\\u6b63\\u786e\\u7684\\u57ce\\u5e02</div></form>\'); f.appendChild(g);g=L("div",{"class":"city_content_medium"});Ab(g,\'<div id="hot_city_ids" class="sel_city_hotcity">\'+this.gS()+"</div>"+(\'<div id="sel_city_letter_list" class="sel_city_letterbar">\'+this.fS()+"</div>"));f.appendChild(g);g=L("div",{"class":"city_content_bottom",id:"city_detail_tpl"});g.innerHTML=this.eS();f.appendChild(g);c.appendChild(f);f=this.Bf=L("button",{id:"popup_close"});c.appendChild(f);this.j.expand?this.Tp(q):this.Tp(t);if(b==Xb||3==b)c.style.left="-2px";this.C.appendChild(c); e&&(z.D.Ua(a,"ui_city_change_bottom"),this.C.appendChild(a));z.D.Ua(this.C,"BMap_CityListCtrl")},RQ:function(a){return a.width&&400<a.width&&a.height&&350<a.height?q:t},ba:function(){function a(a){na(a);var b=(e.uI.clientHeight||e.uI.offsetHeight)-((e.Qg.clientHeight||e.Qg.offsetHeight)-20);0<(0<(Math.ceil(a.wheelDelta/120)||-a.detail/3)?1:-1)?(e.Qg.scrollTop-=60,0>=e.Qg.scrollTop&&(e.Qg.scrollTop=0)):(e.Qg.scrollTop+=60,e.Qg.scrollTop>=b&&(e.Qg.scrollTop=b))}function b(){e.YU()}function c(a,b){var a= a||window.event,c=(a.target||a.srcElement).getAttribute("name");ma(a);var g=q;switch(b){case "cityHotIds":for(var i=0;i<f.length;i++)f[i]&&f[i]();e.mC(c);break;case "cityLetters":"other"==c&&(c="Z");c=z.$("ctr_tr_"+c);e.Qg.scrollTop=c.offsetTop;g=t;break;case "cityName":for(i=0;i<f.length;i++)f[i]&&f[i]();e.mC(c)}g&&setTimeout(function(){e.Tp(t)},200)}var e=this,f=e.onChangeBefore||[];if(e.C){var g=e.Hq,i=e.Bf,k=z.$("hot_city_ids"),m=z.$("sel_city_letter_list"),n=z.$("city_detail_table"),o=z.$("cur_city_name"), p=z.$("cur_city_spn");Qb(c,k,"cityHotIds");Qb(c,m,"cityLetters");Qb(c,n,"cityName");z.M(g,"click",b);z.M(i,"click",function(){e.Tp(t)});e.B.addEventListener("citychange",function(){e.ML(function(){e.$i=e.B.$g;"\\u4e2d\\u56fd"==e.B.$g&&(e.$i="\\u5168\\u56fd");e.B2=e.B.fs;o.innerHTML=e.$i;p.innerHTML=e.$i})});z.M(e.Gj,"mousewheel",function(a){na(a)});window.addEventListener&&e.Gj.addEventListener("DOMMouseScroll",function(a){na(a)},t);g=e.Qg=z.$("city_detail_tpl");e.uI=z.$("city_detail_table");z.M(g,"mousewheel", a);window.addEventListener&&g.addEventListener("DOMMouseScroll",a,t);var v=new Zd({input:"selCityWd",types:"city"});z.$("selCitySubmit").addEventListener("click",function(a){na(a);for(a=0;a<f.length;a++)f[a]&&f[a]();v.U();a=z.$("selCityWd").value;0<a.length&&20>a.length?(a=a.replace(/(\\s)/g,"").replace(/</g,"<").replace(/>/g,">")
|