summaryrefslogtreecommitdiff
path: root/static/js/pichat.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/pichat.js')
-rw-r--r--static/js/pichat.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index 62cf52e..a236ba0 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -18,7 +18,7 @@ Imgs = {
}
Anim = {
- "chatThumbBig": {"width": "27px", "height": "27px", "right": "0px", "bottom": "2px"},
+ "chatThumbBig": {"width": "54px", "height": "54px", "right": "0px", "bottom": "2px"},
"chatThumbTiny": {"width": "8px", "height": "8px", "right": "8px", "bottom": "8px"},
"chatThumb": {"width": "16px", "height": "16px", "right": "4px", "bottom": "4px"},
"logThumb": {"width": "27px", "height": "27px", "marginRight": "0px", "marginTop": "0px"},
@@ -199,10 +199,10 @@ function buildMessageDiv(msg, isLoading) {
var loadingClass = isLoading ? ' loading' : '';
var containsImageClass = LastMsgContainsImage ? ' contains-image' : '';
return '<div class="msgDiv dump ' + loadingClass + containsImageClass + '" ' + msgId + '>'
- + '<span class="nick"><b><a href="http://dump.fm/' + nick + ' ">' + nick + '</a></b>'
+ + '<span class="nick"><b><a href="http://dump.fm/' + nick + ' " target="_blank">' + nick + '</a></b>'
+ ' <img src="'+Imgs.chatThumbDot+'" class="chat-thumb" onclick="Tag.favorite(this)"> '
+ '</span>'
- + buildMsgContent(msg.content)
+ + '<span class="content">' + buildMsgContent(msg.content) + '</span>'
+ '</div>';
}
@@ -1032,3 +1032,21 @@ function startTitleUpdater() {
$(function() {
OrigTitle = $('title').text();
});
+
+
+$('.msgDiv').live('click', function(e) {
+ var tagName = e.target.tagName;
+ if (tagName == 'A' || tagName == 'IMG') {
+ return;
+ }
+ var wasFavorited = $(this).hasClass("favorite");
+ var button = $(this).find('.chat-thumb');
+ if (wasFavorited) {
+ $(button).attr("src", Imgs.chatThumbOff);
+ } else {
+ $(button).attr("src", Imgs.chatThumbBig);
+ $(button).stop().animate(Anim.chatThumbBig, 'fast').animate(Anim.chatThumb, 'fast', 'swing');
+ }
+ Tag.favorite(button);
+ return false;
+});