Skip to content
Snippets Groups Projects
Commit 760b110b authored by Michael Long's avatar Michael Long
Browse files

restore whitespace

parent 5fb1ecb5
No related branches found
No related tags found
No related merge requests found
......@@ -62,21 +62,21 @@ function scrollUp() {
}
function sendTelegram(alias) {
function send_tg(evt) {
if (typeof evt !== 'undefined') evt.preventDefault();
function send_tg(evt) {
if (typeof evt !== 'undefined') evt.preventDefault();
v4_post('./api/system.ssjs', { call: 'send-telegram', user: alias, telegram: $('#telegram').val() });
$('#popUpModal').modal('hide');
}
$('#popUpModal').modal('hide');
}
$('#popUpModalTitle').html('Send a telegram to ' + alias);
$('#popUpModalBody').html(
'<form id="send-telegram-form">'
'<form id="send-telegram-form">'
+ '<input type="text" class="form-control" placeholder="My message" name="telegram" id="telegram">'
+ '<input type="submit" value="submit" class="hidden">'
+ '</form>'
+ '<input type="submit" value="submit" class="hidden">'
+ '</form>'
);
$('#send-telegram-form').submit(send_tg);
$('#send-telegram-form').submit(send_tg);
$('#popUpModalActionButton').click(send_tg);
$('#popUpModalActionButton').show();
$('#popUpModalActionButton').show();
$('#popUpModal').modal('show');
}
......@@ -125,6 +125,7 @@ document.addEventListener("DOMContentLoaded", function(){
});
window.onload = function () {
$('#button-logout').click(logout);
$('#button-login').click(login);
$('#form-login').submit(login);
......@@ -144,20 +145,20 @@ window.onload = function () {
if ($('#button-logout').length > 0) {
registerEventListener('mail', function (e) {
const data = JSON.parse(e.data);
if (typeof data.count != 'number') return;
$('#badge-unread-mail').text(data.count < 1 ? '' : data.count);
$('#badge-unread-mail-inner').text(data.count < 1 ? '' : data.count);
const data = JSON.parse(e.data);
if (typeof data.count != 'number') return;
$('#badge-unread-mail').text(data.count < 1 ? '' : data.count);
$('#badge-unread-mail-inner').text(data.count < 1 ? '' : data.count);
});
registerEventListener('telegram', function (e) {
const tg = JSON.parse(e.data).replace(/\1./g, '').replace(
/\r?\n/g, '<br>'
);
$('#popUpModalTitle').html('New telegram(s) received');
$('#popUpModalBody').append(tg);
$('#popUpModalActionButton').hide();
$('#popUpModal').modal('show');
const tg = JSON.parse(e.data).replace(/\1./g, '').replace(
/\r?\n/g, '<br>'
);
$('#popUpModalTitle').html('New telegram(s) received');
$('#popUpModalBody').append(tg);
$('#popUpModalActionButton').hide();
$('#popUpModal').modal('show');
});
}
......@@ -166,8 +167,9 @@ window.onload = function () {
return a + (i == 0 ? '?' : '&') + _sbbs_events[c].qs;
}, '');
const es = new EventSource('/api/events.ssjs' + qs);
Object.keys(_sbbs_events).forEach(function (e) {
es.addEventListener(e, _sbbs_events[e].callback);
});
const es = new EventSource('/api/events.ssjs' + qs);
Object.keys(_sbbs_events).forEach(function (e) {
es.addEventListener(e, _sbbs_events[e].callback);
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment