messenger.v1200990482.js

来自「最强的爬虫工程」· JavaScript 代码 · 共 1,017 行 · 第 1/3 页

JS
1,017
字号
		}
		if($_fx==0){
			k++
			window.setTimeout("$_hint_xy(1)",1)
		}
		if($_fx==2){
			k--
			if(k==0){
				try{oDel(div)}catch(e){}
				return
			}
			window.setTimeout("$_hint_xy(1)",1)
		}
	}
	
	$_hint_xy(1)
	document.body.appendChild(div)
	document.getElementById("close_hint").onclick=function(){
		oDel(div)
	}
}


///删除好友
function del_friends(toid,utype,tonick){
	var key=utype==1?"好友":"联系人"
	if(utype==1){
		var str='<div style="padding-left:40px">您确认要删除该好友吗? <br><input type="checkbox" id="w_block" value="1">同时将该用户加入黑名单</div>'
	}else{
		var str='<div style="padding-left:40px">删除该联系人可能会造成对该用户好友邀请的失效。您确认要删除吗? <br><input type="checkbox" id="w_block" value="1">同时将该用户加入黑名单</div>'
	}
	$msg(str,"删除"+key,"setdel_friends("+toid+","+utype+",'"+tonick+"')")
}
function setdel_friends(toid,utype,tonick){
	var block
	if(document.getElementById("w_block").checked)
		block=1
	else
		block=0
	SetAjax("/control/friends/delfriend.php?t="+urlcache()+"&fromid="+myuid+"&toid="+toid+"&tonick="+tonick+"&utype="+utype+"&block="+block,"",delfriend_back)
}
function delfriend_back(xml){
	var result=xv(xml,"result")
	$close()
	if(result==1){
		$msg("您的操作已经成功,该页面将在3秒内自动刷新更新列表。")
		window.setTimeout("location.reload()",3000)
	}else
		$msg("删除失败!")
}
///////名片
function get_userinfo(uid,obj){
	var xy=objxy(obj)
	obj.setAttribute("mp",uid)
	if($("userinfo_"+uid)){
		var div=$("userinfo_"+uid)
		var shadow=$("shadow_"+uid)
		
		var sTop=xy[0]
		if(obj.getAttribute("tag")=="master"){
			sTop=sTop-$("master").scrollTop
		}
		div.style.top=sTop+"px"
		shadow.style.top=(sTop+6)+"px"

		$("userinfo_"+uid).style.display=""
		if(document.body.clientWidth/2<xy[1]){
			div.style.left=(xy[1]-div.offsetWidth-6)+"px"
			shadow.style.left=(xy[1]-div.offsetWidth-6+4)+"px"
		}else{
			div.style.left=(xy[1]+xy[2]+2)+"px"
			shadow.style.left=(xy[1]+xy[2]+2+4)+"px"
		}
		$("useriframe"+uid).style.top=div.style.top
		$("useriframe"+uid).style.left=div.style.left
		$("shadow_"+uid).style.display=""
		$("useriframe"+uid).style.display=""
	}else{
		var div=document.createElement("div");
		div.id="userinfo_"+uid
		div.className="q_card"
		var html='  <table width="100%" border="0" cellspacing="0" cellpadding="0">\
					  <tr>\
					    <td rowspan="2" valign="top" style="width:77px;padding-right:5px">\
							  	<a href="/u/$uid" target="_blank"><img src="http://image2.sina.com.cn/pay/quanzi/t2b.jpg"  id="icon_$uid" style="width:60px;height:60px;border:1px solid #d4d4d4;padding:1px;margin:0px"/></a>\
							  	<div style="padding:3px 0 0 5px"><a href="/u/$uid" style="margin:6px" target="_blank">个人中心</a></div>'
				html += '<div id="div_2008_' + uid + '" style="padding:3px 0 0 0;display:none;text-align:center"><a href="http://my2008.sina.com.cn/index1.shtml" style="margin:6px 6px 6px 0" target="_blank"><img src="http://www.sinaimg.cn/pay/quanzi/aoyun/mp_2008.gif"></img></a></div>';
		//if(typeof(groupinfo) != "undefined" && groupinfo.apptype == "4")
		//		html += '<div style="padding:3px 0 0 5px"><a href="http://music.sina.com.cn/shequ/u/$uid" style="margin:6px" target="_blank">我的乐库</a></div>';
				
		html+=	'</td>\
					    <td colspan="2" style="vertical-align:top;height:35px;border-bottom:1px solid #dedede;padding-bottom:5px">\
						  		<div style="float:left;width:180px;height:27px;line-height:18px;color:#5d5d5d">\
						  			昵  称:<a href="/u/$uid" target="_blank"><strong id="nickname_$uid">读取中...</strong></a><img id="gender_$uid" style="display:none;width:12px;height:12px"/><font id="online_$uid" style="display:none"><img src="http://www.sinaimg.cn/pay/quanzi/qsina/myindex/onlinenew.gif">在线</font><br/>\
									会员编码:<a href="/u/$uid" target="_blank"><strong id="loginname_$uid">[读取中...]</strong></a>\
								</div>\
								<img src="http://image2.sina.com.cn/pay/quanzi/order/card/close.gif" style="float:right;width:9px;height:9px;cursor:pointer;" id="close_$uid"/>	  </td>\
					  </tr>\
					  <tr>\
					   	<td valign="top" style="width:160px;padding:5px 0 3px 0">\
							<div style="border-right:1px solid #dedede;margin:0 3px 3px 0;padding-right:3px;color:#3e2cb0">\
								<div style="color:#7d7d7d">我的签名:</div>\
								<div id="intro_$uid" style="width:155px;height:50px;word-break:break-all;overflow:hidden;line-height:18px">读取中...</div>\
							</div>\
							</td>\
					   	 <td style="line-height:24px;width:50px;padding:5px 0 3px 0"" valign="bottom">\
						 	 	<img src="http://image2.sina.com.cn/pay/quanzi/order/card/friend.gif" style="cursor:pointer" alt="加为好友" id="friend_$uid"/><br />\
					   	   <img src="http://image2.sina.com.cn/pay/quanzi/order/card/scrip.gif" style="margin-top:3px;cursor:pointer" alt="发纸条" id="scrip_$uid"/>\
							</td>\
					  </tr>\
					  <tr>\
					    <td colspan="3" style="text-align:center;padding-top:5px;margin-top:5px;vertical-align:top;background:url(http://image2.sina.com.cn/pay/quanzi/order/card/solid.gif) no-repeat top center">\
						  	<div style="color:#d9d9d9;padding:3px 0 0 0;text-align:center">\
								<a href="http://blog.sina.com.cn/u/$uid" target="_blank">博客</a> | <a href="http://you.video.sina.com.cn/m/$uid" target="_blank">播客</a> | <a href="http://bbs.service.sina.com.cn/forum/disprofile.php?uid=$uid" target="_blank">论坛</a> | <a href="/u/$uid" target="_blank">圈子</a> | <a href="http://photo.sina.com.cn/u/$uid" target="_blank">相册</a>\
							</div>\
						  </td>\
					  </tr>\
					</table>'
		div.innerHTML=html.replace(/\$uid/gi,uid)
		document.body.appendChild(div)
		
		var shadow=document.createElement("div")
		shadow.id="shadow_"+uid
		shadow.className="q_cardshadow"
		shadow.style.cssText="width:310px !important;width:312px"
		if(navigator.userAgent.inc("IE 7"))
			shadow.style.cssText="width:310px"
		var sTop=xy[0]
		if(obj.getAttribute("tag")=="master"){
			sTop=sTop-$("master").scrollTop
		}
		
		div.style.top=sTop+"px"
		shadow.style.top=(sTop+6)+"px"
		if(document.body.clientWidth/2<xy[1]){
			div.style.left=(xy[1]-div.offsetWidth-6)+"px"
			shadow.style.left=(xy[1]-div.offsetWidth-6+4)+"px"
		}else{
			div.style.left=(xy[1]+xy[2]+2)+"px"
			shadow.style.left=(xy[1]+xy[2]+2+4)+"px"
		}
		shadow.style.height=div.offsetHeight+"px"
		document.body.appendChild(shadow)
		var useriframe=document.createElement("iframe")
		useriframe.id="useriframe"+uid
		useriframe.style.cssText="position:absolute;filter:alpha(opacity=0);-moz-opacity:0;top:"+div.style.top+";left:"+div.style.left+";width:315px;height:"+shadow.style.height
		document.body.appendChild(useriframe)
		
		
		SetAjax("/control/get_usrinfo.php","post:uid="+uid,showinfo)
		var eventclose=function(e){
			e=e||event
			try{
				var ee=e.srcElement
				if(ee.getAttribute("mp")!=null){
					if($("userinfo_"+ee.getAttribute("mp"))&&$("userinfo_"+ee.getAttribute("mp")).style.display=="")
						return
				}
				if(ee!=obj){
					while(ee){
							if(ee==div)
								return
							if(ee.tagName=="HTML"){
								useriframe.style.display=div.style.display=shadow.style.display="none"
								return
							}
							ee=ee.parentNode
					}
				}
			}catch(e){}
		}
		addEvent(document.body,"onmousedown",eventclose)
		$("close_"+uid).onclick=function(){
			div.style.display="none"
			shadow.style.display="none"
			useriframe.style.display="none"
		}
	}
}
function showinfo(xml){
	var uid=xv(xml,"uid")
	var loginname=xv(xml,"loginname")
	$("loginname_"+uid).innerHTML=uid
	var icon=xv(xml,"icon")
	$("icon_"+uid).src=icon
	var nickname=xv(xml,"nickname")
	if(xv(xml,"u_join2008") == "1"){
		$('div_2008_' + uid).style.display = "";
	}
	if(nickname=="")
		nickname=loginname
	$("nickname_"+uid).innerHTML=nickname.leftB(10)
	var intro=xv(xml,"intro")
	if(intro=="-")
		intro="-<br><br>"
	$("intro_"+uid).innerHTML='<a href="/u/'+uid+'" target="_blank" style="line-height:18px">'+intro+'</a>'
	$("intro_"+uid).title=intro.replace("<br><br>","").replace(/\'/g,"").replace(/\"/g,"").replace(/&quot;/g,"")
	var gender=xv(xml,"gender")
	if(gender && gender != ""){
		$("gender_"+uid).src=gender
		$("gender_"+uid).style.display=""
	}
	if(xv(xml,"online")==1)
		$("online_"+uid).style.display=""
	
	$("friend_"+uid).onclick=function(){
		add_friend(uid)
		$("userinfo_"+uid).style.display="none"
		$("shadow_"+uid).style.display="none"
		$("useriframe"+uid).style.display="none"
	}
	$("scrip_"+uid).onclick=function(){
		Scrip(nickname,uid)
		$("userinfo_"+uid).style.display="none"
		$("shadow_"+uid).style.display="none"
		$("useriframe"+uid).style.display="none"
	}
	$("shadow_"+uid).style.height=$("userinfo_"+uid).offsetHeight+"px"
}
//站内留言
var message_gid = "";
var message_mid = "";
var message_gname = "";
function sendguestbook(gid,mid,gname,personal){
	if(ISlogin()==false)
		return
	message_gid = gid;
	message_mid = mid;
	message_gname = gname;
	if(personal)
		SetAjax("/control/message/checkcodestatus.php?","id="+mid, guestbook_back3)
	else
		SetAjax("/control/message/checkcodestatus.php?","id="+mid, guestbook_back)
	
}
function guestbook_back(xml){
	var gid = message_gid
	var mid = message_mid
	var gname = message_gname
	if(xv(xml,"status")=="0")
		var title="@您正在给<span style='color:#3064AD'>"+gname+"</span>留言:"
	else
		var title="您正在给<span style='color:#3064AD'>"+gname+"</span>留言:"
	$send(title,"/control/message/addgrprev.php",guestbook_back2, "^id="+gid+"&mid="+mid)
	if($("w_content")){
		$("w_content").value="回复"+gname+":"
	}
}
function guestbook_back3(xml){
	var gid = message_gid
	var mid = message_mid
	var gname = message_gname
	if(xv(xml,"status")=="0")
		var title="@您正在给<span style='color:#3064AD'>"+gname+"</span>留言:"
	else
		var title="您正在给<span style='color:#3064AD'>"+gname+"</span>留言:"
	$send(title,"@/control/message/addusrrev.php",guestbook_back2, "^uid="+gid+"&mid="+mid)
	if($("w_content")){
		$("w_content").value="回复"+gname+":"
	}
}
function guestbook_back2(xml){
	var result=xv(xml,"message");
	var status = xv(xml, "status");
	
	if(status == "0"){
		if(result==" 您输入的验证码有误。"){
			$msg("您输入的验证码有误。")
			if($("checkwd_img"))
				$("checkwd_img").src="/control/checkpng.php?t="+urlcache()
		}
		else
			$msg(result);
		return;
	}
	
	/*if(result=="您输入的验证码有误。"){
		$msg("您输入的验证码有误。")
		if($("checkwd_img"))
			$("checkwd_img").src="/control/checkpng.php?t="+urlcache()
		return
	}*/
	$close()
	if(status=="1"){
		if(norefresh25 == undefined)
			$msg(result,null, refreshCurrent)
		else
			$msg(result);
		return
	}
}
function refreshCurrent(){
	if(typeof(gbreload)=="undefined")
		window.location.reload();
	else{
		if(gbreload == 10)
			pageframe.model10.setlist()
		if(gbreload == 9)
			model9_refresh()
		$close()
	}
}

//触发留言数
function sethint(xml){
	var s=xv(xml,"/root/result")
	var body=document.body
	if(!document.all){
		$_hint(s)
		return
	}
	if(!body.readyState||body.readyState == "loaded" || body.readyState == "complete")
		$_hint(s)
//	else
//		window.setTimeout("$_hint("+s+")",3000)
}
function $gethint(){
	if(typeof(islogin)=="undefined"||islogin==0)
		return
	SetAjax("/control/friends/countmsg.php?fromid="+myuid,"",sethint)
}
function refreshCheckCode(){
	if($("checkwd_img"))
		$("checkwd_img").src="/control/checkpng.php?t="+urlcache()
}
if(typeof(msgcount)=="undefined"){
	window.setTimeout("$gethint()",3000)
	var msgcount=false
}

function getByteLen(str)
{
	var l = str.length;
	var n = l;
	for ( var i=0; i<l; i++ )
		if ( str.charCodeAt(i)<0 || str.charCodeAt(i)>255 )
			n++;
	return n
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?