|
|
@ -973,10 +973,36 @@ define([
|
|
|
|
UI.log(Messages.saved);
|
|
|
|
UI.log(Messages.saved);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$button.click(function () {
|
|
|
|
$button.click(function () {
|
|
|
|
send();
|
|
|
|
send();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var onPreview = function (l) {
|
|
|
|
|
|
|
|
var data = getData();
|
|
|
|
|
|
|
|
if (data === false) { return void UI.warn(Messages.error); }
|
|
|
|
|
|
|
|
var msg = {
|
|
|
|
|
|
|
|
uid: Util.uid(),
|
|
|
|
|
|
|
|
type: 'BROADCAST_'+key.toUpperCase(),
|
|
|
|
|
|
|
|
content: data
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
common.mailbox.onMessage({
|
|
|
|
|
|
|
|
lang: l,
|
|
|
|
|
|
|
|
type: 'broadcast',
|
|
|
|
|
|
|
|
content: {
|
|
|
|
|
|
|
|
msg: msg,
|
|
|
|
|
|
|
|
hash: 'LOCAL|' + JSON.stringify(msg).slice(0,58)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, function () {
|
|
|
|
|
|
|
|
UI.log(Messages.saved);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var preview = h('button.cp-broadcast-preview.btn.btn-secondary', Messages.share_linkOpen);
|
|
|
|
|
|
|
|
$(preview).click(function () {
|
|
|
|
|
|
|
|
onPreview();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (key === 'custom') {
|
|
|
|
if (key === 'custom') {
|
|
|
|
(function () {
|
|
|
|
(function () {
|
|
|
|
var container = h('div.cp-broadcast-container');
|
|
|
|
var container = h('div.cp-broadcast-container');
|
|
|
@ -984,10 +1010,6 @@ define([
|
|
|
|
var languages = Messages._languages;
|
|
|
|
var languages = Messages._languages;
|
|
|
|
var keys = Object.keys(languages).sort();
|
|
|
|
var keys = Object.keys(languages).sort();
|
|
|
|
|
|
|
|
|
|
|
|
var onPreview = function (l) {
|
|
|
|
|
|
|
|
// XXX
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var reorder = function () {
|
|
|
|
var reorder = function () {
|
|
|
|
$container.find('.cp-broadcast-lang').each(function (i, el) {
|
|
|
|
$container.find('.cp-broadcast-lang').each(function (i, el) {
|
|
|
|
var $el = $(el);
|
|
|
|
var $el = $(el);
|
|
|
@ -1117,7 +1139,8 @@ define([
|
|
|
|
h('label', Messages.broadcast_end),
|
|
|
|
h('label', Messages.broadcast_end),
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
h('br'),
|
|
|
|
h('br'),
|
|
|
|
button
|
|
|
|
button,
|
|
|
|
|
|
|
|
preview
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
})();
|
|
|
|
})();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1139,7 +1162,8 @@ define([
|
|
|
|
$form.append([
|
|
|
|
$form.append([
|
|
|
|
$cbox[0],
|
|
|
|
$cbox[0],
|
|
|
|
h('br'),
|
|
|
|
h('br'),
|
|
|
|
button
|
|
|
|
button,
|
|
|
|
|
|
|
|
preview
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
})();
|
|
|
|
})();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1166,7 +1190,8 @@ define([
|
|
|
|
label,
|
|
|
|
label,
|
|
|
|
input,
|
|
|
|
input,
|
|
|
|
h('br'),
|
|
|
|
h('br'),
|
|
|
|
button
|
|
|
|
button,
|
|
|
|
|
|
|
|
preview
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
})();
|
|
|
|
})();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|