|
|
@ -970,6 +970,7 @@ define([
|
|
|
|
var getApi = function (cb) {
|
|
|
|
var getApi = function (cb) {
|
|
|
|
return function () {
|
|
|
|
return function () {
|
|
|
|
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
|
|
|
|
cb(Broadcast);
|
|
|
|
cb(Broadcast);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -1219,7 +1220,7 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error) {
|
|
|
|
if (error) {
|
|
|
|
console.error('One of the selected languages has no data');
|
|
|
|
console.error('One of the selected languages has no data');
|
|
|
|
return false;
|
|
|
|
return false; // XXX better error handling?
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
defaultLanguage: defaultLanguage,
|
|
|
|
defaultLanguage: defaultLanguage,
|
|
|
@ -1229,7 +1230,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var send = function (data) {
|
|
|
|
var send = function (data) {
|
|
|
|
$button.prop('disabled', 'disabled');
|
|
|
|
$button.prop('disabled', 'disabled');
|
|
|
|
data.time = +new Date();
|
|
|
|
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 /*, data */) { // XXX unused argument
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
$button.prop('disabled', '');
|
|
|
|
$button.prop('disabled', '');
|
|
|
@ -1249,7 +1250,7 @@ define([
|
|
|
|
send(data);
|
|
|
|
send(data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
UI.confirmButton(removeButton, {
|
|
|
|
UI.confirmButton(removeButton, { // XXX table jank
|
|
|
|
classes: 'btn-danger',
|
|
|
|
classes: 'btn-danger',
|
|
|
|
}, function () {
|
|
|
|
}, function () {
|
|
|
|
if (!activeUid) { return; }
|
|
|
|
if (!activeUid) { return; }
|
|
|
@ -1311,7 +1312,8 @@ define([
|
|
|
|
var end = h('input');
|
|
|
|
var end = h('input');
|
|
|
|
var $start = $(start);
|
|
|
|
var $start = $(start);
|
|
|
|
var $end = $(end);
|
|
|
|
var $end = $(end);
|
|
|
|
var endPickr = Flatpickr(end, {
|
|
|
|
// XXX new Date().toLocaleString('fr-fr', {month: 'long'}).replace(/./, c => c.toUpperCase())
|
|
|
|
|
|
|
|
var endPickr = Flatpickr(end, { // XXX translations?
|
|
|
|
enableTime: true,
|
|
|
|
enableTime: true,
|
|
|
|
minDate: new Date()
|
|
|
|
minDate: new Date()
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -1411,7 +1413,7 @@ define([
|
|
|
|
common.openUnsafeURL(Broadcast.surveyURL);
|
|
|
|
common.openUnsafeURL(Broadcast.surveyURL);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
active = h('div.cp-broadcast-active', [
|
|
|
|
active = h('div.cp-broadcast-active', [
|
|
|
|
h('p', a),
|
|
|
|
h('p', a), // XXX spacing around this element is really cramped
|
|
|
|
removeButton
|
|
|
|
removeButton
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|