[mw-devel] MW3 r1208 - trunk/webclient

dez at sucs.org dez at sucs.org
Sat Oct 9 23:03:56 BST 2010


Author: dez
Date: 2010-10-09 23:03:56 +0100 (Sat, 09 Oct 2010)
New Revision: 1208

Modified:
   trunk/webclient/mw.css
   trunk/webclient/say.js
Log:
Introduces colour support; some colours need improving to make them more different


Modified: trunk/webclient/mw.css
===================================================================
--- trunk/webclient/mw.css	2010-10-09 20:10:10 UTC (rev 1207)
+++ trunk/webclient/mw.css	2010-10-09 22:03:56 UTC (rev 1208)
@@ -16,11 +16,10 @@
 	padding: 5px;;
 	height: 70%;
 	overflow: auto;
+	background-color: #000000;
+	color: #d6d6d6;
 }
 
-.idle {
-	color: #aaaaaa;
-}
 
 #textlist, #sayit {
 	float: left;
@@ -157,7 +156,6 @@
 /* * System Colours (Fry's Standard Colour Scheme) * */
 /* ************************************************* */
 
-
 .colour00 {
 }
 
@@ -241,3 +239,33 @@
 	font-weight: bold;
 	color: #de47cc;
 }
+
+/* ************************************************* */
+/* * User Colours                                  * */
+/* ************************************************* */
+
+.user_0 .msg_poster, .who.user_0 {color: #c00;}
+.user_1 .msg_poster, .who.user_1 {color: #0c0;}
+.user_2 .msg_poster, .who.user_2 {color: #33f;}
+.user_3 .msg_poster, .who.user_3 {color: #0aa;}
+.user_4 .msg_poster, .who.user_4 {color: #aa0;}
+.user_5 .msg_poster, .who.user_5 {color: #a0a;}
+.user_6 .msg_poster, .who.user_6 {color: #8d0;}
+.user_7 .msg_poster, .who.user_7 {color: #d80;}
+.user_8 .msg_poster, .who.user_8 {color: #d08;}
+.user_9 .msg_poster, .who.user_9 {color: #80d;}
+.user_10 .msg_poster, .who.user_10 {color: #08d;}
+.user_11 .msg_poster, .who.user_11 {color: #0d8;}
+.user_12 .msg_poster, .who.user_12 {color: #6e0;}
+.user_13 .msg_poster, .who.user_13 {color: #e60;}
+.user_14 .msg_poster, .who.user_14 {color: #60e;}
+.user_14 .msg_poster, .who.user_14 {color: #e06;}
+.user_15 .msg_poster, .who.user_15 {color: #0e6;}
+.user_16 .msg_poster, .who.user_16 {color: #06e;}
+
+
+/* ... */
+
+.idle {
+	background-color: #333;
+}

Modified: trunk/webclient/say.js
===================================================================
--- trunk/webclient/say.js	2010-10-09 20:10:10 UTC (rev 1207)
+++ trunk/webclient/say.js	2010-10-09 22:03:56 UTC (rev 1208)
@@ -1,5 +1,6 @@
 var die=0;
 
+
 function pageInit() {
 	sendCmdHandle('who', drawWhoList);
 }
@@ -22,7 +23,7 @@
 			for (one in msg) {
 				if (msg[one].state == 23) { // CheckOnOff
 					sendCmdHandle('who', drawWhoList);
-					return tmo;
+					continue;
 				}
 				if (msg[one].state == 14) { // IPC_KICK
 					var what = "<div class='msgkick user_system'>";
@@ -76,7 +77,7 @@
 				}
 
 				/* Output the processed line */
-				$("#textlist").append( "<p class='msg"+type+" user_"+msg[one].username+"'>" + escapedMsg + "</p");
+				$("#textlist").append( "<p class='msg"+type+" user_"+userIndex[msg[one].username]+"'>" + escapedMsg + "</p");
 			}
 		}
 		var objDiv = document.getElementById("textlist");
@@ -184,12 +185,19 @@
 function drawWhoList(data, stat)
 {
 	var idleness;
+	userIndex=new Object;
 	$("li").remove();
 	data.sort(sortWho);
-	for (person in data) {
+	var usercount=0;
+	for (var person in data) {
 		idleness="";
 		if (data[person].idle>1800) idleness=" idle";
-		$("#wholist").append("<li class=\"who"+idleness+"\" id=\"who_"+data[person].username+"\">"+data[person].username+"</li");
+
+		var thisUsername=data[person].username;
+		if (thisUsername in userIndex) usercount--;
+		userIndex[thisUsername]=usercount;
+		$("#wholist").append("<li class=\"who user_"+usercount+idleness+"\">"+data[person].username+"</li>");
+		usercount++;
 	}
 }
 




More information about the mw-devel mailing list