From b04eea907242bb895f9578638f5f05612311fa66 Mon Sep 17 00:00:00 2001 From: dumpfmprod Date: Sat, 28 Jun 2014 12:22:17 -0400 Subject: fix bug where personal mutes didnt affect .oldmsg divs --- build-js.sh | 2 +- static/css/dump.css | 1 + static/js/pichat.js | 27 ++++++++++----- static/js/src/chat.js | 14 ++++++-- static/js/src/userlist.js | 13 +++++--- static/register.html | 85 ++++++++++++++++++----------------------------- 6 files changed, 73 insertions(+), 69 deletions(-) diff --git a/build-js.sh b/build-js.sh index e314b59..42d0dd7 100755 --- a/build-js.sh +++ b/build-js.sh @@ -1,3 +1,3 @@ #!/bin/sh -cat static/js/src/*/*.js static/js/src/*.js > static/js/pichat2.js +cat static/js/src/*/*.js static/js/src/*.js > static/js/pichat.js diff --git a/static/css/dump.css b/static/css/dump.css index 33211a3..acf9ea6 100755 --- a/static/css/dump.css +++ b/static/css/dump.css @@ -847,6 +847,7 @@ a:active { } #userList { + z-index: 20; overflow-x: hidden; overflow-y: auto; max-height: 76%; diff --git a/static/js/pichat.js b/static/js/pichat.js index b0bba88..1003880 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -281,6 +281,7 @@ window.Away = { function initChat() { Search.initInpage() + initMutes() $('#textbutton input').attr('checked', TextEnabled).change(setTextEnable); $('#imgbutton input').attr('checked', ImgsEnabled).change(setImgsEnable); @@ -298,10 +299,17 @@ function initChat() { MessageContentCache[dump.attr("id").substr(8)] = content.text() content.html(buildMsgContent(content.text(), Recips)); - if ((ImgsEnabled && dump.hasClass('contains-image')) || (TextEnabled && !dump.hasClass('contains-image'))) - dump.show(); - else + if ((ImgsEnabled && dump.hasClass('contains-image')) || (TextEnabled && !dump.hasClass('contains-image'))) { + if (dump.attr('nick') in MUTES) { + dump.hide(); + } + else { + dump.show(); + } + } + else { dump.hide(); + } }); Drag.bindImages(); @@ -2248,11 +2256,14 @@ function linkReplaceWithoutImage(url){ return "" + url + "" } -try { - var MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {}; -} -catch (e) { - delete localStorage["mutes"] +function initMutes(){ + try { + window.MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {}; + } + catch (e) { + delete localStorage["mutes"] + window.MUTES = {} + } } $(".mute").live("click", function(){ $(this).removeClass("mute"); diff --git a/static/js/src/chat.js b/static/js/src/chat.js index e59e948..b2816c7 100644 --- a/static/js/src/chat.js +++ b/static/js/src/chat.js @@ -2,6 +2,7 @@ function initChat() { Search.initInpage() + initMutes() $('#textbutton input').attr('checked', TextEnabled).change(setTextEnable); $('#imgbutton input').attr('checked', ImgsEnabled).change(setImgsEnable); @@ -19,10 +20,17 @@ function initChat() { MessageContentCache[dump.attr("id").substr(8)] = content.text() content.html(buildMsgContent(content.text(), Recips)); - if ((ImgsEnabled && dump.hasClass('contains-image')) || (TextEnabled && !dump.hasClass('contains-image'))) - dump.show(); - else + if ((ImgsEnabled && dump.hasClass('contains-image')) || (TextEnabled && !dump.hasClass('contains-image'))) { + if (dump.attr('nick') in MUTES) { + dump.hide(); + } + else { + dump.show(); + } + } + else { dump.hide(); + } }); Drag.bindImages(); diff --git a/static/js/src/userlist.js b/static/js/src/userlist.js index 3ccb9b2..5ed34be 100644 --- a/static/js/src/userlist.js +++ b/static/js/src/userlist.js @@ -1,8 +1,11 @@ -try { - var MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {}; -} -catch (e) { - delete localStorage["mutes"] +function initMutes(){ + try { + window.MUTES = localStorage["mutes"] ? JSON.parse(localStorage["mutes"]) : {}; + } + catch (e) { + delete localStorage["mutes"] + window.MUTES = {} + } } $(".mute").live("click", function(){ $(this).removeClass("mute"); diff --git a/static/register.html b/static/register.html index 0382d56..7ccf80d 100644 --- a/static/register.html +++ b/static/register.html @@ -1,67 +1,48 @@ - + + - - + + - - - + + - dump.fm - register - - -
-
+ -
+
+
-
- -
-
- -
- - -
- - - -
- - - - - - +
- - -
- - -
- +
+
+
+ +
+ + +
+
+
-
-
-
-
- - + + - + -- cgit v1.2.3-70-g09d2