diff options
Diffstat (limited to 'static/js/pichat.js')
| -rw-r--r-- | static/js/pichat.js | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index a169090..32727f1 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -1038,32 +1038,48 @@ $(function() { OrigTitle = $('title').text(); }); -$('.msgDiv .content').live('mouseover', function(e) { - $(this).addClass('msg-hover'); -}); +function initChatMsgs() { + $('.msgDiv .content').live('mouseenter', function(e) { + $(this).addClass('msg-hover'); + }); -$('.msgDiv .content').live('mouseout', function(e) { - $(this).removeClass('msg-hover'); -}); + $('.msgDiv .content').live('mouseleave', function(e) { + $(this).removeClass('msg-hover'); + }); + $('.msgDiv .content .img-wrapper').live('mouseenter', function(e) { + var imgurl = $(this).find('img').attr('src'); + var zoomlink = $('<a>') + .attr({'href': imgurl }) + .addClass('msg-image-zoom') + .append($('<img>').attr('src', 'http://dump.fm/static/img/zoom.gif')) + .click(function() { window.open(imgurl); return false; }); + $(this).append(zoomlink); + }); -$('.content').live('click', function(e) { - var tagName = e.target.tagName; - if (tagName == 'A') { - return; - } - var msg = $(this).parent('.msgDiv'); - var wasFavorited = msg.hasClass("favorite"); - var button = msg.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; -}); + $('.msgDiv .content .img-wrapper').live('mouseleave', function(e) { + $(this).find('.msg-image-zoom').remove(); + }); + + + $('.content').live('click', function(e) { + var tagName = e.target.tagName; + if (tagName == 'A') { + return true; + } + var msg = $(this).parent('.msgDiv'); + var wasFavorited = msg.hasClass("favorite"); + var button = msg.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; + }); +} // sha1.js |
