diff options
| author | sostler <sbostler@gmail.com> | 2010-02-01 20:56:43 -0500 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-02-01 20:56:43 -0500 |
| commit | 012293438dc4fe0b347e012970eb1187502d3fa3 (patch) | |
| tree | 72dc9f9ee55b214a31a6c7b825e0a275e7a64d48 /static/js/pichat.js | |
| parent | 997e7ae94a7b7348a7d3c53a41ed0e772c1ed136 (diff) | |
Fixed msg_id setting; re-added msg content escaping; don't make image tag for empty avatars
Diffstat (limited to 'static/js/pichat.js')
| -rwxr-xr-x | static/js/pichat.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index 01ae492..2804919 100755 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -22,12 +22,12 @@ function linkReplace(match){ } function buildMsgContent(content) { - return linkify(content) + return linkify(escapeHtml(content)); } function buildMessageDiv(msg, isLoading) { var nick = escapeHtml(msg.nick); - var msgId = !isLoading ? 'id="message-' + msg.message_id + '"' : ''; + var msgId = !isLoading ? 'id="message-' + msg.msg_id + '"' : ''; var loadingClass = isLoading ? ' loading' : ''; return '<div class="msgDiv ' + loadingClass + '" ' + msgId + '>' + '<b><a href="/u/' + nick + ' ">' + nick + '</a>: </b>' @@ -237,8 +237,13 @@ function initProfile() { data: { 'attr': attr, 'val': newVal } }); if (attr == 'avatar') { - var s = '<img id="avatarPic" src="' + newVal + '" width="150" />'; - $('#avatarPic').replaceWith(s); + console.log(newVal); + if (newVal != "") { + var s = '<img id="avatarPic" src="' + newVal + '" width="150" />'; + $('#avatarPic').replaceWith(s).show(); + } else { + $('#avatarPic').hide(); + } } return escapeHtml(newVal); }; |
