pull/1/head
yflory 4 years ago
parent 2aadb460b9
commit 732e92e17f

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

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

Loading…
Cancel
Save