diff options
Diffstat (limited to 'static/js/src/userlist.js')
| -rw-r--r-- | static/js/src/userlist.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/static/js/src/userlist.js b/static/js/src/userlist.js index 9851ad8..7ac6e2f 100644 --- a/static/js/src/userlist.js +++ b/static/js/src/userlist.js @@ -1,13 +1,12 @@ -var MUTES = localStorage['mutes'] || {}; +var MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {} $(".mute").live("click", function(){ $(this).removeClass("mute"); $(this).addClass("unmute"); $(this).html("o"); var nick = $(this).parent().children("a").html().replace(/<img[^>]+>/,""); $(".nick_" + nick).hide(); - MUTES[nick] = true; - localStorage['mutes'] = localStorage['mutes'] || {} - localStorage['mutes'][nick] = true + MUTES[nick] = true + localStorage['mutes'] = JSON.stringify(MUTES) }); $(".unmute").live("click", function(){ $(this).removeClass("unmute"); @@ -16,8 +15,7 @@ $(".unmute").live("click", function(){ var nick = $(this).parent().children("a").html().replace(/<img[^>]+>/,""); $(".nick_" + nick).show(); delete MUTES[nick]; - localStorage['mutes'] = localStorage['mutes'] || {} - delete localStorage['mutes'][nick] + localStorage['mutes'] = JSON.stringify(MUTES) }); function buildUserDiv(user) { |
