From 732e92e17f91d7014e68b01c83713b1cae10b435 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 8 Apr 2021 15:46:24 +0200 Subject: [PATCH] Fix XXX --- www/admin/inner.js | 8 ++++---- www/common/notifications.js | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/www/admin/inner.js b/www/admin/inner.js index beafdf0b1..1063cec9d 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -1240,7 +1240,7 @@ define([ var send = function (data) { $button.prop('disabled', 'disabled'); data.time = +new Date(); // XXX not used anymore? - common.mailbox.sendTo('BROADCAST_CUSTOM', data, {}, function (err /*, data */) { // XXX unused argument + common.mailbox.sendTo('BROADCAST_CUSTOM', data, {}, function (err) { if (err) { $button.prop('disabled', ''); console.error(err); @@ -1265,7 +1265,7 @@ define([ if (!activeUid) { return; } common.mailbox.sendTo('BROADCAST_DELETE', { uid: activeUid - }, {}, function (err /* , data */) { // XXX unused argument + }, {}, function (err) { if (err) { return UI.warn(Messages.error); } UI.log(Messages.saved); refresh(); @@ -1360,7 +1360,7 @@ define([ return; } // Maintenance applied, send notification - common.mailbox.sendTo('BROADCAST_MAINTENANCE', {}, {}, function (/* err, data */) { // XXX unused arguments + common.mailbox.sendTo('BROADCAST_MAINTENANCE', {}, {}, function () { refresh(); checkLastBroadcastHash(); }); @@ -1456,7 +1456,7 @@ define([ // Maintenance applied, send notification common.mailbox.sendTo('BROADCAST_SURVEY', { url: data - }, {}, function (/* err, data */) { // XXX unused arguments + }, {}, function () { refresh(); checkLastBroadcastHash(); }); diff --git a/www/common/notifications.js b/www/common/notifications.js index 4a26cab44..d364bad6c 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -415,7 +415,7 @@ define([ }; content.handler = function () { common.openUnsafeURL(msg.url); - // XXX dismiss on click? + defaultDismiss(common, data)(); }; if (!content.archived) { content.dismissHandler = defaultDismiss(common, data); @@ -440,7 +440,6 @@ define([ toShow = Util.fixHTML(toShow); content.getFormatText = function () { - // XXX Add a title to custom messages? Or use a generic key in the notification and only display the text in the alert? if (slice) { return toShow.slice(0, 200) + '...'; } @@ -448,13 +447,11 @@ define([ }; if (slice) { content.handler = function () { - // XXX Allow markdown (sanitized)? var content = h('div', [ h('h4', Messages.broadcast_newCustom), h('div.cp-admin-message', toShow) ]); UI.alert(content); - // XXX Dismiss on click? }; } if (!content.archived) { @@ -466,7 +463,6 @@ define([ return { add: function(common, data) { - console.log(data); // XXX noise? var type = data.content.msg.type; if (handlers[type]) {