summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/js/pichat.js10
-rw-r--r--static/js/pichat2.js10
-rw-r--r--static/js/src/userlist.js10
3 files changed, 12 insertions, 18 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) {
diff --git a/static/js/pichat2.js b/static/js/pichat2.js
index f678cc1..61ddf3c 100644
--- a/static/js/pichat2.js
+++ b/static/js/pichat2.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) {
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) {