From 436c53f653d98b6ab153f8a046c550f4d3bbfd61 Mon Sep 17 00:00:00 2001 From: Azareal Date: Sat, 6 Oct 2018 16:35:53 +1000 Subject: [PATCH] The user box on Nox should be highlighted now when there's a new alert. Removed some notes as they're not really needed now that I've refactored the alert builder. --- common/alerts.go | 15 --------------- themes/nox/public/main.css | 5 +++++ themes/nox/public/misc.js | 6 ++++-- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/common/alerts.go b/common/alerts.go index 1c560b67..02131cc4 100644 --- a/common/alerts.go +++ b/common/alerts.go @@ -43,21 +43,6 @@ func init() { }) } -// These notes are for me, don't worry about it too much ^_^ -/* -"You received a friend invite from {user}" -"{x}{mentioned you on}{user}{'s profile}" -"{x}{mentioned you in}{topic}" -"{x}{likes}{you}" -"{x}{liked}{your topic}{topic}" -"{x}{liked}{your post on}{user}{'s profile}" todo -"{x}{liked}{your post in}{topic}" -"{x}{replied to}{your post in}{topic}" todo -"{x}{replied to}{topic}" -"{x}{replied to}{your topic}{topic}" -"{x}{created a new topic}{topic}" -*/ - // TODO: See if we can json.Marshal instead? func escapeTextInJson(in string) string { in = strings.Replace(in, "\"", "\\\"", -1) diff --git a/themes/nox/public/main.css b/themes/nox/public/main.css index 84b292be..7bfb1416 100644 --- a/themes/nox/public/main.css +++ b/themes/nox/public/main.css @@ -110,6 +110,11 @@ li a { padding-bottom: 11px; padding-left: 12px; } +.user_box.has_alerts { + padding-top: 10px; + padding-bottom: 10px; + border: 1px solid #444444; +} .user_box img { display: block; width: 36px; diff --git a/themes/nox/public/misc.js b/themes/nox/public/misc.js index d17ce72a..59a23503 100644 --- a/themes/nox/public/misc.js +++ b/themes/nox/public/misc.js @@ -3,9 +3,11 @@ (() => { addInitHook("after_update_alert_list", () => { if(alertCount==0) { - $(".alerts").html("No new alerts") + $(".alerts").html("No new alerts"); + $(".user_box").removeClass("has_alerts"); } else { - $(".alerts").html(alertCount + " new alerts") + $(".alerts").html(alertCount + " new alerts"); + $(".user_box").addClass("has_alerts"); } }) })();