|
|
@ -972,6 +972,19 @@ define([
|
|
|
|
require(['/api/broadcast?'+ (+new Date())], function (Broadcast) {
|
|
|
|
require(['/api/broadcast?'+ (+new Date())], function (Broadcast) {
|
|
|
|
// XXX require.s.contexts._ can be used to erase old loaded objects
|
|
|
|
// XXX require.s.contexts._ can be used to erase old loaded objects
|
|
|
|
cb(Broadcast);
|
|
|
|
cb(Broadcast);
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var ctx = require.s.contexts._;
|
|
|
|
|
|
|
|
var defined = ctx.defined;
|
|
|
|
|
|
|
|
Object.keys(defined).forEach(function (href) {
|
|
|
|
|
|
|
|
if (/^\/api\/broadcast\?[0-9]{13}/.test(href)) {
|
|
|
|
|
|
|
|
console.error(href);
|
|
|
|
|
|
|
|
delete defined[href];
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -1061,7 +1074,7 @@ define([
|
|
|
|
var form = h('div.cp-admin-broadcast-form');
|
|
|
|
var form = h('div.cp-admin-broadcast-form');
|
|
|
|
var $form = $(form).appendTo($div);
|
|
|
|
var $form = $(form).appendTo($div);
|
|
|
|
|
|
|
|
|
|
|
|
var refresh = getApi(function (/* Broadcast */) { // XXX unused argument
|
|
|
|
var refresh = getApi(function (Broadcast) {
|
|
|
|
var button = h('button.btn.btn-primary', Messages.admin_broadcastButton);
|
|
|
|
var button = h('button.btn.btn-primary', Messages.admin_broadcastButton);
|
|
|
|
var $button = $(button);
|
|
|
|
var $button = $(button);
|
|
|
|
var removeButton = h('button.btn.btn-danger', Messages.admin_broadcastCancel);
|
|
|
|
var removeButton = h('button.btn.btn-danger', Messages.admin_broadcastCancel);
|
|
|
@ -1071,8 +1084,7 @@ define([
|
|
|
|
var deleted = [];
|
|
|
|
var deleted = [];
|
|
|
|
|
|
|
|
|
|
|
|
// Render active message (if there is one)
|
|
|
|
// Render active message (if there is one)
|
|
|
|
require(['/api/broadcast?'+ (+new Date())], function (BCast) {
|
|
|
|
var hash = Broadcast.lastBroadcastHash || '1'; // Truthy value if no lastKnownHash
|
|
|
|
var hash = BCast.lastBroadcastHash || '1'; // Truthy value if no lastKnownHash
|
|
|
|
|
|
|
|
common.mailbox.getNotificationsHistory('broadcast', null, hash, function (e, msgs) {
|
|
|
|
common.mailbox.getNotificationsHistory('broadcast', null, hash, function (e, msgs) {
|
|
|
|
if (e) { return void console.error(e); }
|
|
|
|
if (e) { return void console.error(e); }
|
|
|
|
if (!Array.isArray(msgs)) { return; }
|
|
|
|
if (!Array.isArray(msgs)) { return; }
|
|
|
@ -1109,7 +1121,6 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (!activeUid) { $active.hide(); }
|
|
|
|
if (!activeUid) { $active.hide(); }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Custom message
|
|
|
|
// Custom message
|
|
|
|
var container = h('div.cp-broadcast-container');
|
|
|
|
var container = h('div.cp-broadcast-container');
|
|
|
|