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.
This commit is contained in:
Azareal 2018-10-06 16:35:53 +10:00
parent 0b44d69efc
commit 436c53f653
3 changed files with 9 additions and 17 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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");
}
})
})();