diff --git a/client/js/chat.js b/client/js/chat.js index 04b95d9e..dd2519c3 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -64,7 +64,12 @@ $(function() { .first() .addClass("active"); - chat.find(".messages").scrollGlue({animate: 400}).scrollToBottom(); + chat.find(".messages") + .scrollGlue({animate: 400}) + .scrollToBottom() + .find(".text") + .uri() + .end(); chat.find(".window") .find("input") .tabComplete(commands, {appendSpace: true}) @@ -122,9 +127,14 @@ $(function() { if (message.type == "error") { target = target.parent().find(".active"); } - + + var msg = $(render("#message", {messages: message})) + .find(".text") + .uri() + .end(); + target = target.find(".messages"); - target.append(render("#message", {messages: message})); + target.append(msg); break; } @@ -247,8 +257,21 @@ $(function() { .removeClass("active") .end(); }; + + $.fn.uri = function() { + return this.each(function() { + var html = $(this).html(); + return $(this).html(URI.withinString(html, function(url) { + return "" + url + ""; + })); + }); + }; }); +function linkify(text) { + +} + //Handlebars.registerHelper("link", function(text) { // var text = Handlebars.Utils.escapeExpression(text); // return URI.withinString(text, function(url) {