summaryrefslogtreecommitdiff
path: root/static/js/pichat.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-06-24 18:59:32 -0400
committerJulie Lala <jules@okfoc.us>2014-06-24 18:59:32 -0400
commit3d01a4b5e460c021554f0519722e558a5f12f1fd (patch)
tree5d7d30e4eb20c5d2d3d410d7b5899f07a9daa324 /static/js/pichat.js
parent050c61a79f2a58772a3d749c0a29d6e8fd2c34ef (diff)
forgot localstorage was a flat hash
Diffstat (limited to 'static/js/pichat.js')
-rw-r--r--static/js/pichat.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index f678cc1..61ddf3c 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -2248,16 +2248,15 @@ function linkReplaceWithoutImage(url){
return "<a target='_blank' href='" + linkUrl + "'>" + url + "</a>"
}
-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");
@@ -2266,8 +2265,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) {