[Phpfreechat-svn] SF.net SVN: phpfreechat: [1138] trunk/data/public/js/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <gpi...@us...> - 2007-08-21 02:16:15
|
Revision: 1138 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1138&view=rev Author: gpinzone Date: 2007-08-20 19:16:16 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Fixed new regex for smileys. Phew! Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-21 01:46:09 UTC (rev 1137) +++ trunk/data/public/js/pfcclient.js 2007-08-21 02:16:16 UTC (rev 1138) @@ -1461,8 +1461,8 @@ // Emulate negative lookbehind in JavaScript. // We don't want to replace smiley strings inside of tags. // See http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript for more info. - rx = new RegExp('(<[^>]*)?' + RegExp.escape(sl[i]),'g'); - msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : $1 + '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); + rx = new RegExp("(<[^>]*)?" + RegExp.escape(sl[i]),'g'); + msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); } // try to parse nickname for highlighting This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |