2018-09-20 10:45:33 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
(() => {
|
2018-11-30 03:02:20 +00:00
|
|
|
addInitHook("after_update_alert_list", (alertCount) => {
|
|
|
|
console.log("misc.js");
|
|
|
|
console.log("alertCount:",alertCount);
|
2018-09-20 10:45:33 +00:00
|
|
|
if(alertCount==0) {
|
2018-11-30 03:02:20 +00:00
|
|
|
$(".alerts").html(phraseBox["alerts"]["alerts.no_alerts_short"]);
|
2018-10-06 06:35:53 +00:00
|
|
|
$(".user_box").removeClass("has_alerts");
|
2018-09-20 10:45:33 +00:00
|
|
|
} else {
|
2018-11-30 03:02:20 +00:00
|
|
|
// TODO: Localise this
|
2018-10-06 06:35:53 +00:00
|
|
|
$(".alerts").html(alertCount + " new alerts");
|
|
|
|
$(".user_box").addClass("has_alerts");
|
2018-09-20 10:45:33 +00:00
|
|
|
}
|
2018-12-27 05:42:41 +00:00
|
|
|
});
|
|
|
|
addHook("open_edit", () => $('.topic_block').addClass("edithead"));
|
|
|
|
addHook("close_edit", () => $('.topic_block').removeClass("edithead"));
|
2018-09-20 10:45:33 +00:00
|
|
|
})();
|
|
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
|
$(".alerts").click((event) => {
|
|
|
|
event.stopPropagation();
|
|
|
|
var alerts = $(".menu_alerts")[0];
|
|
|
|
if($(alerts).hasClass("selectedAlert")) return;
|
|
|
|
if(!conn) loadAlerts(alerts);
|
|
|
|
alerts.className += " selectedAlert";
|
|
|
|
document.getElementById("back").className += " alertActive"
|
|
|
|
});
|
|
|
|
});
|