Add a signature to announcements

The `from` field has existed for ages, but was never actually displayed.
Displaying it to users reduces confusion about who is making the
announcement.
This commit is contained in:
calzoneman 2016-07-14 23:25:17 -07:00
parent 9e00bb133e
commit 29a4834baa
2 changed files with 4 additions and 2 deletions

View File

@ -91,7 +91,8 @@ $("#acp-announce-submit").click(function () {
socket.on("announcement", function (data) {
$("#acp-announcements").find(".announcement").remove();
var al = makeAlert(data.title, data.text)
var signature = "<br>\u2014" + data.from;
var al = makeAlert(data.title, data.text + signature)
.removeClass("col-md-12")
.addClass("announcement")
.insertAfter($("#acp-announcements h3")[0]);

View File

@ -67,7 +67,8 @@ Callbacks = {
announcement: function(data) {
$("#announcements").html("");
makeAlert(data.title, data.text)
var signature = "<br>\u2014" + data.from;
var announcement = makeAlert(data.title, data.text + signature)
.appendTo($("#announcements"));
},