Chat now supports markdown

This commit is contained in:
MrWaffle
2014-01-15 18:20:05 +01:00
parent 1bf3d33765
commit b78dc3eca8
4 changed files with 63 additions and 40 deletions

View File

@@ -227,8 +227,11 @@ define(['taskbar', 'string'], function(taskbar, S) {
var chatContent = chatModal.find('#chat-content');
var date = new Date(parseInt(timestamp, 10));
// todo Add this to a stylesheet instead of style tag
var prefix = '<span style="color: darkgrey;" class="chat-timestamp">' + date.toLocaleTimeString() + '</span> ';
message = "<div>" + S(prefix + message).stripTags('p').s + "</div>";
chatContent.append('[' + date.toLocaleTimeString() + '] ' + message);
chatContent.append(message);
scrollToBottom(chatContent);
};