From 29a4834baae3bc8c418b291d063d44c68695a14a Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 14 Jul 2016 23:25:17 -0700 Subject: [PATCH] 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. --- www/js/acp.js | 3 ++- www/js/callbacks.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/www/js/acp.js b/www/js/acp.js index 6356b72b..20393840 100644 --- a/www/js/acp.js +++ b/www/js/acp.js @@ -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 = "
\u2014" + data.from; + var al = makeAlert(data.title, data.text + signature) .removeClass("col-md-12") .addClass("announcement") .insertAfter($("#acp-announcements h3")[0]); diff --git a/www/js/callbacks.js b/www/js/callbacks.js index ae309e85..30223e80 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -67,7 +67,8 @@ Callbacks = { announcement: function(data) { $("#announcements").html(""); - makeAlert(data.title, data.text) + var signature = "
\u2014" + data.from; + var announcement = makeAlert(data.title, data.text + signature) .appendTo($("#announcements")); },