1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<title>JWChat - Roster</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() {
14
if (parent.top.user && parent.top.user.roster)
15
parent.top.user.roster.updateStyleIE();
18
onresize = updateStyleIE;
21
body { background-color: white; }
25
<div id="ie5menu" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" display:none>
26
<nobr><div class="menuitems" func="user.roster.openChat">Start Chat</div></nobr>
28
<nobr><div class="menuitems" func="changeRole" param="'none',1">Kick</div></nobr>
29
<nobr><div class="menuitems" func="changeAffiliation" param="'outcast',1">Ban</div></nobr>
30
<nobr><div class="menuitems" func="changeRole" param="'participant'">Grant Voice</div></nobr>
31
<nobr><div class="menuitems" func="changeRole" param="'visitor'">Revoke Voice</div></nobr>
32
<nobr><div class="menuitems" func="changeAffiliation" param="'member'">Grant Membership</div></nobr>
33
<nobr><div class="menuitems" func="changeAffiliation" param="'none'">Revoke Membership</div></nobr>
34
<nobr><div class="menuitems" func="changeRole" param="'moderator'">Grant Moderator Privilege</div></nobr>
35
<nobr><div class="menuitems" func="changeRole" param="'participant'">Revoke Moderator Privilege</div></nobr>
36
<nobr><div class="menuitems" func="changeAffiliation" param="'admin'">Grant Administrative Privilege</div></nobr>
37
<nobr><div class="menuitems" func="changeAffiliation" param="'member'">Revoke Administrative Privilege</div></nobr>
39
<nobr><div class="menuitems" func="srcW.openUserInfo">Show Info</div></nobr>
42
<div id="roster" class="roster">
45
<script language="JavaScript1.2">
47
//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
50
var ie5=document.all&&document.getElementById;
51
var ns6=document.getElementById&&!document.all;
53
var menuobj=document.getElementById("ie5menu");
56
function showmenuie5(e){
57
var firingobj=ie5? event.srcElement : e.target;
58
while (firingobj && (!firingobj.className || (firingobj.className != "rosterUser" && firingobj.className != "rosterUserSelected")))
59
firingobj = firingobj.parentNode;
60
if (!firingobj || (firingobj.className != "rosterUser" && firingobj.className != "rosterUserSelected"))
65
//Find out how close the mouse is to the corner of the window
66
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX;
67
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY;
69
//if the horizontal distance isn't enough to accomodate the width of the context menu
70
if (rightedge<menuobj.offsetWidth) {
71
//move the horizontal position of the menu to the left by it's width
72
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth;
73
if (menuobj.style.left < "2px")
74
menuobj.style.left = "2px";
77
//position the horizontal position of the menu where the mouse was clicked
78
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX
80
//same concept with the vertical position
81
if (bottomedge<menuobj.offsetHeight) {
82
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
83
if (menuobj.style.top < "2px")
84
menuobj.style.top = "2px";
87
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY
89
menuobj.style.visibility="visible"
93
function hidemenuie5(e){
94
menuobj.style.visibility="hidden"
97
function highlightie5(e){
98
var firingobj=ie5? event.srcElement : e.target;
99
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
100
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
101
firingobj.style.backgroundColor="highlight";
102
firingobj.style.color="white";
104
window.status=event.srcElement.url;
108
function lowlightie5(e){
109
var firingobj=ie5? event.srcElement : e.target;
110
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
111
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode; //up one node
112
firingobj.style.backgroundColor="";
113
firingobj.style.color="black";
118
function jumptoie5(e){
119
var firingobj=ie5? event.srcElement : e.target;
120
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
121
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode;
122
if (firingobj.getAttribute("func")) {
123
var jid = selobj.id.substring(0,selobj.id.lastIndexOf("/"));
124
eval("parent.top."+firingobj.getAttribute("func")+"('"+jid+"',"+firingobj.getAttribute("param")+")");
129
var lastUserSelected;
130
function selectUser(el) {
132
lastUserSelected.className = "rosterUser";
133
el.className = "rosterUserSelected";
134
lastUserSelected = el;
137
function userClicked(el,jid) {
139
return parent.top.user.roster.openChat(jid);
142
menuobj.style.display='';
143
document.oncontextmenu=showmenuie5;
144
document.onclick=hidemenuie5;