From c4338d2ae878a167c409e91dea6d1783fc7e30ba Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 18 Jul 2012 00:02:21 -0400 Subject: put away back --- static/js/src/userlist.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 static/js/src/userlist.js (limited to 'static/js/src/userlist.js') diff --git a/static/js/src/userlist.js b/static/js/src/userlist.js new file mode 100644 index 0000000..4af21c1 --- /dev/null +++ b/static/js/src/userlist.js @@ -0,0 +1,38 @@ +var MUTES = {}; +$(".mute").live("click", function(){ + $(this).removeClass("mute"); + $(this).addClass("unmute"); + $(this).html("o"); + var nick = $(this).parent().children("a").html().replace(/]+>/,""); + $(".nick_" + nick).hide(); + MUTES[nick] = true; +}); +$(".unmute").live("click", function(){ + $(this).removeClass("unmute"); + $(this).addClass("mute"); + $(this).html("x"); + var nick = $(this).parent().children("a").html().replace(/]+>/,""); + $(".nick_" + nick).show(); + delete MUTES[nick]; +}); + +function buildUserDiv(user) { + var muted = MUTES[user.nick] ? 'o' : 'x'; + if (user.avatar) { + return ''; + } else { + return ''; + } +} -- cgit v1.2.3-70-g09d2