?? core3.js
字號:
className:'g_win_4',width:500,height:250,hideFlash:true,title:'登錄網易博客',onTop:true,notKeepPos:true});this.qLoginZone.panel.innerHTML=result;this.qLoginZone.showWindow();}}else{if(NetEase.indexLoginTemplate==null)NetEase.indexLoginTemplate=indexlogin_jst;var data={err:false};var result=NetEase.indexLoginTemplate;$("outLoginDiv").innerHTML=result;}this.frmLogin=$("frmLogin");this.divNotice=$("notice_bar");this.objUsername=$("in_username");this.objPassword=$("in_password");this.objSetCkCheck=$("setCookieCheck");if(document.all){this.objUsername.attachEvent("onblur",this.checkUsername.bind(this));this.objPassword.attachEvent("onfocus",this.fnPassOnFocus.bind(this));this.objPassword.attachEvent("onblur",this.checkPassword.bind(this));if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_a_"+i))$("tab_a_"+i).attachEvent("onclick",this.selectUserType.bind(this,i));else$("tab_"+i).attachEvent("onclick",this.selectUserType.bind(this,i));}}$("qLoginButt").attachEvent("onclick",this.dologin.bind(this));this.frmLogin.attachEvent("onkeypress",this.frmDologinIE.bind(this));this.objSetCkCheck.attachEvent("onclick",this.changeCookieCheck.bind(this));}else{this.objUsername.addEventListener("blur",this.checkUsername.bind(this),true);this.objPassword.addEventListener("focus",this.fnPassOnFocus.bind(this),true);this.objPassword.addEventListener("blur",this.checkPassword.bind(this),true);if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_a_"+i))$("tab_a_"+i).onclick=this.selectUserType.bind(this,i);else$("tab_"+i).onclick=this.selectUserType.bind(this,i);}}$("qLoginButt").onclick=this.dologin.bind(this);this.frmLogin.onkeypress=this.frmDologin.bind(this);this.objSetCkCheck.onclick=this.changeCookieCheck.bind(this);}if(this.bFromIndex)showLoginType(this.curUserType);this.selectUserType(this.curUserType);},showWindow:function(target){if(target){this.loginTarget=target;}this.qLoginZone.showWindow();},frmDologinIE:function(){if(event.keyCode==13)this.dologin();},frmDologin:function(event){if(event.keyCode==13)this.dologin();},changeCookieCheck:function(){if(!this.objSetCkCheck.checked){clearLoginCookie();}},checkUsername:function(){var strUsername=this.objUsername.value;if(strUsername.length>0){this.divNotice.innerHTML=this.noticeAccount;}else{this.divNotice.innerHTML=this.noticeInit;}return true;},checkPasswordFocus:function(){var strPassword=this.objPassword.value;if(strPassword==""){var strUsername=this.objUsername.value+getNameSuffix(this.curUserType);strPassword=ckLoginInfo.pass;if(null!=strPassword){this.pwdFromCk=strPassword;this.pwdFromCkTrim=strPassword;this.isPwdFromCk=true;this.objPassword.value=strPassword;}}this.checkPassword();},fnPassOnFocus:function(){this.objPassword.select();this.checkPassword();},checkPassword:function(){var strPassword=this.objPassword.value;if(null==strPassword||strPassword==""){this.isPwdFromCk=false;}var rePassword=/^[\s]*$/g;if(strPassword.match(rePassword)!=null){this.divNotice.innerHTML=this.noticePassword;return false;}else{this.divNotice.innerHTML=this.noticeInit;return true;}},dologin:function(){if(this.checkUsername()&&this.checkPassword()){this.divNotice.innerHTML="正在登錄,請稍候...";this.objUsername.disabled=true;this.objPassword.disabled=true;if(document.all){this.objUsername.detachEvent("onblur",this.checkUsername);this.objPassword.detachEvent("onfocus",this.checkPassword);this.objPassword.detachEvent("onblur",this.checkPassword);$("frmLogin").detachEvent("onkeypress",this.frmDologinIE);$("qLoginButt").detachEvent("onclick",this.dologin);this.objSetCkCheck.detachEvent("onclick",this.changeCookieCheck);}else{this.objUsername.removeEventListener("blur",this.checkUsername,true);this.objPassword.removeEventListener("focus",this.checkPassword,true);this.objPassword.removeEventListener("blur",this.checkPassword,true);}var strPassword=this.objPassword.value;var strPwdOld;if(!this.isPwdFromCk||strPassword!=this.pwdFromCkTrim){if(this.curUserType==typeVip)strPassword=this.pwd_js_string(strPassword);if(this.curUserType==type163||this.curUserType==typeVip){strPassword=strPassword.substring(0,16);}else if(this.curUserType==typePopo){strPassword=strPassword.substring(0,21);}strPwdOld=strPassword;strPassword=hex_md5(strPassword);}else{strPassword=this.pwdFromCk;strPwdOld=strPassword;}var strUsername=Trim(this.objUsername.value.toLowerCase());var strUsernameOld=strUsername;strUsername+=getNameSuffix(this.curUserType);if(this.curUserType==type126||this.curUserType==type188||this.curUserType==typeYeah){strPassword=strPwdOld;}if(this.objSetCkCheck.checked){clearLoginCookie();setLoginCookie(1,strUsernameOld);setLoginCookie(2,strPassword);}else{clearLoginCookie();}var bSavePass=this.objSetCkCheck.checked;setLoginCookie(0,this.curUserType);this.strUsername=strUsername;this.strPassword=strPassword;if(this.bFromIndex||this.presentShowId=="qIndexLoginDiv"){loginFromIndex(strUsername,strPassword,bSavePass);}else{UserBean.checkPassport(strUsername,strPassword,bSavePass,this.dologinCb.bind(this));}}return false;},dologinCb:function(b){if(b!=null){if(b=="not reg!!"){location.href="http://blog.163.com/passportIn.do?in_username="+this.strUsername+"&in_password="+this.strPassword;}else{Cookie.set("NETEASE_AUTH_USERNAME",this.strUsername,0,"/",".163.com");if(this.loginTarget==null){if($("$_oppoPageUrlForLogin")&&(UD.hostName==this.strUsername)){if(UD.hostPath=="")this.loginTarget="http://"+DomainMap.getParentDomain(this.strUsername)+$("$_oppoPageUrlForLogin").value;elsethis.loginTarget=$("$_oppoPageUrlForLogin").value;}elsethis.loginTarget=window.location;}location.href="http://blog.163.com/loginGate.do?username="+this.strUsername+"&target="+encodeURIComponent(this.loginTarget);setYodaoCookie(this.strUsername,this.objSetCkCheck.checked);}}else{this.objPassword.value="";this.objUsername.disabled=false;this.objPassword.disabled=false;this.divNotice.innerHTML="<span class='clr03'>用戶名或密碼不正確,請重新輸入。</span>";$("in_username").focus();}return false;},pwd_js_string:function(s){return String(s).replace(/\\/g,"\\\\").replace(/'/g,"\\\'").replace(/"/g,"\\\"");},updateSuffix:function(suffix){var e=$("account_suffix");e.innerHTML=suffix;},selectUserType:function(type){if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_"+i)){if(type==i){if(!this.bFromIndex)$("tab_"+i).className="g_f_hov selected";}else{if(!this.bFromIndex)$("tab_"+i).className="g_f_hov";}}}}var regAdd=$("reg_add");var getPassAdd=$("getPass_add");var innerLoginDiv=$("innerLoginDiv");var sbStr="bg_taglog";if(!this.bFromIndex){sbStr="bg_menu";}if(!this.bFromIndex&&innerLoginDiv)innerLoginDiv.style.backgroundImage="url(http://st.blog.163.com/style/common/index/"+sbStr+type+".gif)";if(this.bFromIndex){this.noticeInit="已擁有""+getShowLogName(type)+""的用戶直接登錄";this.noticeAccount="請輸入"+getShowLogName(type)+"用戶名";}else{this.noticeInit="請輸入"+getShowLogName(type)+"用戶名和密碼登錄";this.noticeAccount="請輸入"+getShowLogName(type)+"用戶名";}if(type==type163){this.updateSuffix("@163.com");regAdd.href="http://reg.163.com/reg/reg0.jsp?url=http://blog.163.com/ntesRegBlank.html";getPassAdd.setAttribute("href","http://reg.163.com/RecoverPasswd1.shtml");}else if(type==type126){this.updateSuffix("@126.com");getPassAdd.setAttribute("href","http://reg.126.com/recoverpass/");}else if(type==typePopo){this.updateSuffix(".popo ");regAdd.href="http://reg.popo.163.com/";getPassAdd.setAttribute("href","http://popo.163.com/prtpass/getpass.sp");getPassAdd.href="http://popo.163.com/prtpass/getpass.sp";}else if(type==type188){this.updateSuffix("@188.com");regAdd.href="http://reg.mail.188.com/index.jsp?from=";getPassAdd.setAttribute("href","http://reg.mail.188.com/rstpsw/rpsel.htm");}else if(type==typeVip){this.updateSuffix("@vip.163.com");regAdd.href="http://vip.163.com/register.m";getPassAdd.setAttribute("href","http://vip.163.com/PwdRepair/index.htm");}else if(type==typeYeah){this.updateSuffix("@yeah.net");regAdd.href="http://reg.mail.yeah.net/reg/reg1.jsp";getPassAdd.setAttribute("href","http://reg.mail.yeah.net/reg/recoverpass/");}$("reg_add").innerHTML="注冊"+getShowRegName(type)+" -->";this.curUserType=type;this.objUsername.value="";this.objPassword.value="";var userNameInit=ckLoginInfo.name;if(userNameInit&&ckLoginInfo.type==type){this.objUsername.value=userNameInit;this.checkPasswordFocus();this.objSetCkCheck.checked=true;this.noticeAccount="請點擊登錄按鈕";this.noticeInit="請點擊登錄按鈕";}else{this.objSetCkCheck.checked=false;}var urlStr=window.location.href;var i=urlStr.indexOf("err=");if(i!=-1){var errStr=urlStr.charAt(i+4);if(errStr=="1"||errStr=="2"||errStr=="3"||errStr=="4"){var n=parseInt(errStr);if(n>3)n=1;this.noticeInit=this.noticeAccount="<span class='cr'>"+errInfo[n-1]+"</span>";}}this.checkUsername();if($("in_username"))try{Field.activate("in_username");}catch(e){};if(this.bFromIndex)showLoginType(type);return false;}}function closeLogin(){$("loginNewDiv").style.display="none";}function getLogStr(type){if(type==type163)return"163";else if(type==typePopo)return"POPO";else if(type==type126)return"126";else if(type==type188)return"188";else if(type==typeVip)return"VIP";else if(type==typeYeah)return"YEAH";}function getNameSuffix(type){if(type==type163)return"";else if(type==typePopo)return".popo";else if(type==type126)return"@126";else if(type==type188)return"@188";else if(type==typeVip)return".vip";else if(type==typeYeah)return"@yeah";}function getShowLogName(type){if(type==type163)return"網易通行證";else if(type==typePopo)return"POPO";else if(type==type126)return"126郵箱";else if(type==type188)return"188郵箱";else if(type==typeVip)return"VIP郵箱";else if(type==typeYeah)return"YEAH郵箱";}function getShowRegName(type){if(type==type163)return"通行證";else if(type==typePopo)return"POPO";else if(type==type126)return"126郵箱";else if(type==type188)return"188郵箱";else if(type==typeVip)return"VIP郵箱";else if(type==typeYeah)return"YEAH郵箱";}function getLoginCookie(){var a;var v=Cookie.get(ckLoginInfoKey);if(v){a=v.split("|");var type=null;if(a[0])ckLoginInfo.type=parseInt(a[0]);if(ckLoginInfo.type==null||ckLoginInfo.type==undefined||ckLoginInfo.type<0||ckLoginInfo.type>4){ckLoginInfo.type=null;return;}if(a[1]!=null&&a[1]!=undefined&&a[1]!="null"&&a[2]!=null&&a[2]!=undefined){ckLoginInfo.name=a[1];var pos=v.indexOf('|',2);ckLoginInfo.pass=v.substring(pos+1);}}}function setLoginCookie(which,value){getLoginCookie();if(which==0)ckLoginInfo.type=value;else if(which==1)ckLoginInfo.name=value;else if(which==2)ckLoginInfo.pass=value;Cookie.clear(ckLoginInfoKey,ckPath);Cookie.set(ckLoginInfoKey,ckLoginInfo.type+"|"+ckLoginInfo.name+"|"+ckLoginInfo.pass,30,ckPath,ckDomain);}function clearLoginCookie(){ckLoginInfo.name=null;ckLoginInfo.pass=null;Cookie.clear(ckLoginInfoKey,ckPath);clearYodaoPersistCookie();if(ckLoginInfo.type!=null&&ckLoginInfo.type!=undefined&&ckLoginInfo.type!="null")Cookie.set(ckLoginInfoKey,ckLoginInfo.type,30,ckPath,ckDomain);}var Cookie={set:function(name,value,expirationInDays,path,domain){var cookie=escape(name)+"="+escape(value);if(expirationInDays){var date=new Date();date.setDate(date.getDate()+expirationInDays);cookie+="; expires="+date.toGMTString();}if(path){
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -