[mw-devel] MW3 r1223 - trunk/webclient
dez at sucs.org
dez at sucs.org
Sun Oct 10 21:12:44 BST 2010
Author: dez
Date: 2010-10-10 21:12:43 +0100 (Sun, 10 Oct 2010)
New Revision: 1223
Modified:
trunk/webclient/say.js
Log:
Strips newlines from output
Makes bold colour detection conservative
Modified: trunk/webclient/say.js
===================================================================
--- trunk/webclient/say.js 2010-10-10 19:46:43 UTC (rev 1222)
+++ trunk/webclient/say.js 2010-10-10 20:12:43 UTC (rev 1223)
@@ -28,6 +28,8 @@
var escapedMsg = msg[one].text.replace(/&/g, "&");
escapedMsg = escapedMsg.replace(/</g, "<");
escapedMsg = escapedMsg.replace(/>/g, ">");
+ escapedMsg = escapedMsg.replace(/\n/g, "");
+ escapedMsg = escapedMsg.replace(/\r/g, "");
/* Detect URIs and convert to links */
var uris = escapedMsg.match(/https?:\/\/[^ ]*/g);
@@ -56,7 +58,7 @@
if (isNaN(msgColours[i].charAt(1))) {
var colourBold = "";
var fgColour = msgColours[i].charAt(1);
- if (fgColour==fgColour.toUpperCase() && fgColour != "-") { colourBold = " bold"; }
+ if (fgColour!=fgColour.toLowerCase()) { colourBold = " bold"; }
escapedMsg = escapedMsg.replace(msgColours[i], "</span><span class='colourfg"+msgColours[i].charAt(1)+colourBold+" colourbg"+msgColours[i].charAt(2)+"'>");
} else {
escapedMsg = escapedMsg.replace(msgColours[i], "</span><span class='colour"+msgColours[i].replace(/\u001b/g, "")+"'>");
More information about the mw-devel
mailing list