Web/Content/js/js.js
(完整代码) 13KB
var showWindown=true;var templateSrc="http://bulo.hjenglish.com/app";function tipsWindown(title,content,width,height,drag,time,showbg,cssName){$("#windown-box").remove();var width=width>=950?this.width=950:this.width=width;var height=height>=527?this.height=527:this.height=height;if(showWindown==true){var simpleWindown_html=new String;simpleWindown_html="<div id=\"windownbg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;z-index: 999901\"></div>";simpleWindown_html+="<div id=\"windown-box\">";simpleWindown_html+="<div id=\"windown-title\"><h2></h2><span id=\"windown-close\">鍏抽棴</span></div>";simpleWindown_html+="<div id=\"windown-content-border\"><div id=\"windown-content\"></div></div>";simpleWindown_html+="</div>";$("body").append(simpleWindown_html);show=false;}
contentType=content.substring(0,content.indexOf(":"));content=content.substring(content.indexOf(":")+1,content.length);switch(contentType){case"text":$("#windown-content").html(content);break;case"id":$("#windown-content").html($("#"+content+"").html());break;case"img":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"/images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>鍔犺浇鏁版嵁鍑洪敊...</p>");},success:function(html){$("#windown-content").html("<img src="+content+" alt='' />");}});break;case"url":var content_array=content.split("?");$("#windown-content").html("<img src='"+templateSrc+"/images/loading.gif' class='loading' />");$.ajax({type:content_array[0],url:content_array[1],data:content_array[2],error:function(){$("#windown-content").html("<p class='windown-error'>鍔犺浇鏁版嵁鍑洪敊...</p>");},success:function(html){$("#windown-content").html(html);}});break;case"iframe":$.ajax({beforeSend:function(){$("#windown-content").html("<img src='"+templateSrc+"/images/loading.gif' class='loading' />");},error:function(){$("#windown-content").html("<p class='windown-error'>鍔犺浇鏁版嵁鍑洪敊...</p>");},success:function(html){$("#windown-content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+parseInt(height)+"px"+"\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");}});}
$("#windown-title h2").html(title);if(showbg=="true"){$("#windownbg").show();}else{$("#windownbg").remove();};$("#windownbg").animate({opacity:"0.5"},"normal");$("#windown-box").show();if(height>=527){$("#windown-title").css({width:(parseInt(width)+27)+"px"});$("#windown-content").css({width:(parseInt(width)+17)+"px",height:height+"px"});}else{$("#windown-title").css({width:(parseInt(width)+10)+"px"});$("#windown-content").css({width:width+"px",height:height+"px"});}
var cw=document.documentElement.clientWidth,ch=document.documentElement.clientHeight,est=document.documentElement.scrollTop;var _version=$.browser.version;if(_version==6.0){$("#windown-box").css({left:"50%",top:(parseInt((ch)/2)+est)+"px",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});}else{$("#windown-box").css({left:"50%",top:"50%",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});};var Drag_ID=document.getElementById("windown-box"),DragHead=document.getElementById("windown-title");var moveX=0,moveY=0,moveTop,moveLeft=0,moveable=false;if(_version==6.0){moveTop=est;}else{moveTop=0;}
var sw=Drag_ID.scrollWidth,sh=Drag_ID.scrollHeight;DragHead.onmouseover=function(e){if(drag=="true"){DragHead.style.cursor="move";}else{DragHead.style.cursor="default";}};DragHead.onmousedown=function(e){if(drag=="true"){moveable=true;}else{moveable=false;}
e=window.event?window.event:e;var ol=Drag_ID.offsetLeft,ot=Drag_ID.offsetTop-moveTop;moveX=e.clientX-ol;moveY=e.clientY-ot;document.onmousemove=function(e){if(moveable){e=window.event?window.event:e;var x=e.clientX-moveX;var y=e.clientY-moveY;if(x>0&&(x+sw<cw)&&y>0&&(y+sh<ch)){Drag_ID.style.left=x+"px";Drag_ID.style.top=parseInt(y+moveTop)+"px";Drag_ID.style.margin="auto";}}}
document.onmouseup=function(){moveable=false;};Drag_ID.onselectstart=function(e){return false;}}
$("#windown-content").attr("class","windown-"+cssName);var closeWindown=function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});}
if(time==""||typeof(time)=="undefined"){$("#windown-close").click(function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});if(contentType=="id"){$("#"+content+"").html("");}});}else{setTimeout(closeWindown,time);}}
/*====== /js/fastlogin_v2.js======*/
var login={doLogin:function(optOrCallback){var opt=null;if(typeof(optOrCallback)==='object'){opt=optOrCallback;}
else if(typeof(optOrCallback)==='function'){opt={callback:optOrCallback};}
window.hjquicklogin.doLogin(opt);return false;},doRegister:function(optOrCallback){var opt=null;if(typeof(optOrCallback)==='object'){opt=optOrCallback;}
else if(typeof(optOrCallback)==='function'){opt={callback:optOrCallback};}
window.hjquicklogin.doRegister(opt);return false;},checkInfo:function(userID){register_tooltip.userID=userID;register_tooltip.check();}};window.hjquicklogin={init:function(opt){var me=this;me.control=me.control||hui.Control.create('HJ_QuickLogin',{formName:'hj_quicklogin',top:0.33,className:'hj001_login_box'});me.control.getPassName=function(){var subName='http://pass';return subName;};me.control.source=opt&&opt.source?opt.source:'niming';if(opt&&opt.callback){me.control.onLoginSuccess=opt.callback;}
else{me.control.onLoginSuccess=function(result){setTimeout(function(){window.location.reload();},800);};}
me.control.onRegisteSuccessMobile=function(result){setTimeout(function(){window.location.reload();},800);};me.control.monitorList['hj_reg']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,4)}};me.control.monitorList['hj_reg_login']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,2)}};me.control.monitorList['hj_reg_mobile_success']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,10)}};me.control.monitorList['hj_reg_email_success']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,11)}};me.control.monitorList['hj_reg_login_submit']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,5)}};me.control.monitorList['hj_reg_mobile_submit']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,6)}};me.control.monitorList['hj_reg_email_submit']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,7)}};me.control.monitorList['hj_reg_email_success_active']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,8)}};me.control.monitorList['hj_reg_email_continue']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,9)}};me.control.monitorList['hj_reg_close']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,12)}};me.control.monitorList['hj_reg_mobile_sendsms']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,13)}};me.control.monitorList['hj_reg_mobile_email']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,16)}};me.control.monitorList['hj_reg_email_mobile']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,15)}};me.control.monitorList['hj_reg_login_qq']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,17)}};me.control.monitorList['hj_reg_login_weibo']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,18)}};me.control.monitorList['hj_reg_login_renren']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,19)}};me.control.monitorList['hj_reg_login_baidu']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,20)}};me.control.monitorList['hj_reg_login_douban']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,21)}};me.control.monitorList['hj_reg_login_zhifu']=function(){if(typeof SendEvent!=='undefined'){SendEvent(2,22)}};},doLogin:function(opt){var me=this;!me.control&&me.init(opt);me.control.showDialog('hj_reg_login');},doRegister:function(opt){var me=this;!me.control&&me.init(opt);me.control.showDialog('hj_reg_mobile');}};var register_tooltip={userID:0,check:function(){var userID=parseInt(register_tooltip.userID);if(userID>0){$.ajax({type:"GET",url:"http://pass.hujiang.com/quick/account/?act=check_tooltip&userid="+userID,data:"{}",contentType:"application/json; charset=utf-8",dataType:"jsonp",jsonp:"callback",success:function(result){if(result.data.showtips){var url="http://pass.hujiang.com/q/profile/?returnurl="+encodeURIComponent(document.location.href);$(".pass_register_tooltip").show();$(".pass_register_tooltip").attr("href","http://pass.hujiang.com/q/profile/?template=class&returnurl="+encodeURIComponent(document.location.href));$(".pass_register_tooltip").click(function(){if(typeof SendEvent!=='undefined'){SendEvent(2,23)}});}}});}}};
/*====== /js/head.js======*/
$.fn.lazyhover=function(fuc_on,fuc_out,de_on,de_out){var self=$(this);var flag=1;var h;var handle=function(elm){clearTimeout(h);if(!flag)self.removeData('timer');return flag?fuc_on.apply(elm):fuc_out.apply(elm)};var time_on=de_on||0;var time_out=de_out||500;var timer=function(elm){h&&clearTimeout(h);h=setTimeout(function(){handle(elm)},flag?time_on:time_out);self.data('timer',h)};self.hover(function(){flag=1;timer(this)},function(){flag=0;timer(this)})}
$(function(){var canHide=true;$("#cls_pnlHeader").find(".layer_slideTitle").lazyhover(function(){$("#cls_pnlHeader").find(".current").removeClass("current");$(this).parents("li").addClass("current");},function(){doHide();},90,200);$(".cls_listUserInfo,.cls_listApp").find(".layer_slideTitle").mouseover(function(){canHide=false;}).mouseout(function(){canHide=true;});$(".cls_pnlHeader_wrap").find('.layer_slideList').mouseover(function(){canHide=false;}).mouseout(function(){canHide=true;});$(".cls_pnlHeader_wrap").find('.layer_slideList').lazyhover(function(){},function(){doHide();},200,200);BindTextChange($("#cls_txtHeadSearch"));function doHide(){if(canHide){$(".cls_pnlHeader_wrap").find(".current").removeClass("current");canHide=true;}}
$(".cls_header_AppSlide_Title .link_header_AppSlide").lazyhover(function(){$("#cls_header_AppSlide").removeClass("current");$("#cls_header_AppSlide").addClass("current");},function(){doHide();},200,200);$("#cls_header_AppSlide").find("ul").mouseover(function(){canHide=false;}).mouseout(function(){canHide=true;});$("#cls_header_AppSlide").find("ul").lazyhover(function(){},function(){doHide();},200,200);function BindTextChange(obj){$(obj).focus(function(){var real=$(this).attr("rel");if(real==$(this).val()){$(this).val("").removeClass("lightgray");}});$(obj).blur(function(){if($(this).val()==""){$(this).val($(this).attr("rel")).addClass("lightgray");}});if($.browser.msie&&$.browser.version=='6.0'){$("#cls_pnlHeader").find(".menu").mouseover(function(){$(this).addClass("cls_headMenu_hover");PageSelect();}).mouseout(function(){$(this).removeClass("cls_headMenu_hover");PageSelect();});}}
$(".layer_slideTitle").each(function(){if($.browser.msie&&$.browser.version=='6.0'){$(this).css("width",$(this).width()+10);}});$("#cls_btnSearch").click(function(){var key=$.trim($("#cls_txtHeadSearch").val());var rel=$("#cls_txtHeadSearch").attr("rel");if(key==""||rel==key){$("#cls_txtHeadSearch").val("").focus().removeClass("lightgray");}
else{window.location.href="/search/all/"+encodeURIComponent(key)+"/";}
return false;});$("#cls_txtHeadSearch").keydown(function(e){if(e.keyCode==13){$("#cls_btnSearch").click();}});PageSelect();$("#headerBarLogin").click(function(){login.doLogin();return false;});$("#headerBarRegister").click(function(){login.doRegister();return false;});var hUserID=$("#hHeaderBarUserInfo").data("id");if(typeof(login.checkInfo)==='function')login.checkInfo(hUserID);})
function PageSelect(){if(document.URL.indexOf("com/home")>0){$("#cls_headMenu_home").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/myclass")>0){$("#cls_headMenu_myclass").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/public")>0||document.URL.indexOf("/app/public/topic/")>0){$("#cls_headMenu_public").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/course")>0){$("#cls_headMenu_course").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/app/list")>0){$("#cls_headMenu_using").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/xb")>0){$("#cls_headMenu_xb").addClass("cls_headMenu_hover");}
if(document.URL.indexOf("com/xb/classorder")>0||document.URL.indexOf("com/xb/order")>0){$("#cls_headMenu_myOrder").addClass("cls_headMenu_hover");}}
function hjd_onShiftDictEnable(status){if(status){$("#hjdict_slide").addClass("on").text("鍒掕瘝").attr("title","鍒掕瘝宸插紑鍚�");}else{$("#hjdict_slide").removeClass("on").text("鍒掕瘝").attr("title","鍒掕瘝宸插叧闂�");}}
function ToolDictQuick(){tipsWindown('娌睙灏廌 <span style=font-weight:200;color:gray;>(浣跨敤蹇嵎閿瓹trl+F8鍙揩閫熷懠鍙嚭鏌ヨ瘝绐楀彛鍝)</span>','iframe:http://dict.hujiang.com/outapp/bulo/en.aspx','530','440','true','','false','text','/images/dict_demo.gif');}
function hjd_onShiftDictEnable(status){if(status){$("#hjdict_slide").addClass("on").text("鍒掕瘝").attr("title","鍒掕瘝宸插紑鍚�");}else{$("#hjdict_slide").removeClass("on").text("鍒掕瘝").attr("title","鍒掕瘝宸插叧闂�");}}
function DelayScript(url,delay){var load=function(){var blnIsLoad=false;try{if(typeof(HJ)!="undefined"&&typeof(HJ.global)!="undefined"&&typeof(HJ.global.SearchType)!="undefined")
{blnIsLoad=true;}}
catch(e){}
if(!blnIsLoad)
{var el=document.createElement("script");el.type="text/javascript";el.src=url;var head=document.getElementsByTagName("head")[0];head.appendChild(el);}}
if(delay){window.setTimeout(load,delay);}else{$(document).ready(load);}}
DelayScript("http://dict.hujiang.com/app/js/dict_ajax.js",3000);
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
