1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<title>JWChat - 联系人</title>
5
<meta http-equiv="content-type" content="text/html; charset=utf-8">
6
<script src="switchStyle.js"></script>
7
<script language="JavaScript1.2">
8
function toggleGrp(name) {
9
parent.top.user.roster.toggleGrp(name);
12
function updateStyleIE() {
13
if (parent.top.user && parent.top.user.roster)
14
parent.top.user.roster.updateStyleIE();
16
onresize = updateStyleIE;
19
body { background-color: white; }
23
<div id="ie5menu" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" display:none>
24
<nobr><div class="menuitems" func="user.roster.openChat">开始聊天</div></nobr>
26
<nobr><div class="menuitems" func="changeRole" param="'none',1">踢出</div></nobr>
27
<nobr><div class="menuitems" func="changeAffiliation" param="'outcast',1">屏蔽</div></nobr>
28
<nobr><div class="menuitems" func="changeRole" param="'participant'">授予语音权限</div></nobr>
29
<nobr><div class="menuitems" func="changeRole" param="'visitor'">取消语音权限</div></nobr>
30
<nobr><div class="menuitems" func="changeAffiliation" param="'member'">授予成员权限</div></nobr>
31
<nobr><div class="menuitems" func="changeAffiliation" param="'none'">取消成员权限</div></nobr>
32
<nobr><div class="menuitems" func="changeRole" param="'moderator'">授予主持人权限</div></nobr>
33
<nobr><div class="menuitems" func="changeRole" param="'participant'">取消主持人权限</div></nobr>
34
<nobr><div class="menuitems" func="changeAffiliation" param="'admin'">授予管理权限</div></nobr>
35
<nobr><div class="menuitems" func="changeAffiliation" param="'member'">取消管理权限</div></nobr>
37
<nobr><div class="menuitems" func="srcW.openUserInfo">显示信息</div></nobr>
40
<div id="roster" class="roster">
43
<script language="JavaScript1.2">
45
//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
48
var ie5=document.all&&document.getElementById;
49
var ns6=document.getElementById&&!document.all;
51
var menuobj=document.getElementById("ie5menu");
54
function showmenuie5(e){
55
var firingobj=ie5? event.srcElement : e.target;
56
while (firingobj && (!firingobj.className || (firingobj.className != "rosterUser" && firingobj.className != "rosterUserSelected")))
57
firingobj = firingobj.parentNode;
58
if (!firingobj || (firingobj.className != "rosterUser" && firingobj.className != "rosterUserSelected"))
63
//Find out how close the mouse is to the corner of the window
64
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX;
65
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY;
67
//if the horizontal distance isn't enough to accomodate the width of the context menu
68
if (rightedge<menuobj.offsetWidth) {
69
//move the horizontal position of the menu to the left by it's width
70
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth;
71
if (menuobj.style.left < "2px")
72
menuobj.style.left = "2px";
75
//position the horizontal position of the menu where the mouse was clicked
76
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX
78
//same concept with the vertical position
79
if (bottomedge<menuobj.offsetHeight) {
80
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
81
if (menuobj.style.top < "2px")
82
menuobj.style.top = "2px";
85
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY
87
menuobj.style.visibility="visible"
91
function hidemenuie5(e){
92
menuobj.style.visibility="hidden"
95
function highlightie5(e){
96
var firingobj=ie5? event.srcElement : e.target;
97
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
98
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
99
firingobj.style.backgroundColor="highlight";
100
firingobj.style.color="white";
102
window.status=event.srcElement.url;
106
function lowlightie5(e){
107
var firingobj=ie5? event.srcElement : e.target;
108
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
109
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
110
firingobj.style.backgroundColor="";
111
firingobj.style.color="black";
116
function jumptoie5(e){
117
var firingobj=ie5? event.srcElement : e.target;
118
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
119
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode;
120
if (firingobj.getAttribute("func")) {
121
var jid = selobj.id.substring(0,selobj.id.lastIndexOf("/"));
122
eval("parent.top."+firingobj.getAttribute("func")+"('"+jid+"',"+firingobj.getAttribute("param")+")");
127
var lastUserSelected;
128
function selectUser(el) {
130
lastUserSelected.className = "rosterUser";
131
el.className = "rosterUserSelected";
132
lastUserSelected = el;
135
function userClicked(el,jid) {
137
return parent.top.user.roster.openChat(jid);
140
menuobj.style.display='';
141
document.oncontextmenu=showmenuie5;
142
document.onclick=hidemenuie5;