Chat URLs now open in a new tab

Implement Issue#2
This commit is contained in:
calzoneman 2013-03-17 09:45:16 -05:00
parent a8076f0e15
commit 64bdbe7084
1 changed files with 1 additions and 1 deletions

View File

@ -448,7 +448,7 @@ Channel.prototype.sendMessage = function(username, msg, msgclass) {
// I don't want HTML from strangers // I don't want HTML from strangers
msg = msg.replace(/</g, "&lt;").replace(/>/g, "&gt;"); msg = msg.replace(/</g, "&lt;").replace(/>/g, "&gt;");
// Match URLs // Match URLs
msg = msg.replace(/(((https?)|(ftp))(:\/\/[0-9a-zA-Z\.]+(:[0-9]+)?[^\s$]+))/, "<a href=\"$1\">$1</a>"); msg = msg.replace(/(((https?)|(ftp))(:\/\/[0-9a-zA-Z\.]+(:[0-9]+)?[^\s$]+))/, "<a href=\"$1\" target=\"_blank\">$1</a>");
this.sendAll('chatMsg', { this.sendAll('chatMsg', {
username: username, username: username,
msg: msg, msg: msg,