Fix issue #6 (Clickable channel names) - double-click channel names to /join them
[KiwiIRC.git] / js / front.js
index 1f013ba847c15091be40f481cd06a0ff36052f85..0dfdd74cfb61d4257882c5168ba7d18409f3ea6c 100644 (file)
@@ -1010,7 +1010,13 @@ tabview.prototype.addMsg = function(time, nick, msg, type, style){
                if(next == '</u>') msg =+ '</u>';
        }
        
+    var re = '\\B(#[^ ,\\007]+)';
+    re = new RegExp(re, 'g');
        
+    msg = msg.replace(re, function(match) {
+        return '<a class="chan" href="#">' + match + '</a>';
+    });
+
        var line_msg = $('<div class="msg '+type+'"><div class="time">'+time+'</div><div class="nick">'+html_nick+'</div><div class="text" style="'+style+'">'+msg+' </div></div>');
        this.div.append(line_msg);