move pocsag message panel

This commit is contained in:
Jakob Ketterl
2020-12-09 19:53:37 +01:00
parent 5474973752
commit 9bf4b149aa
3 changed files with 40 additions and 19 deletions

View File

@ -190,4 +190,41 @@ $.fn.packetMessagePanel = function() {
this.data('panel', new PacketMessagePanel(this));
};
return this.data('panel');
};
PocsagMessagePanel = function(el) {
MessagePanel.call(this, el);
this.initClearTimer();
}
PocsagMessagePanel.prototype = new MessagePanel();
PocsagMessagePanel.prototype.render = function() {
$(this.el).append($(
'<table>' +
'<thead><tr>' +
'<th class="address">Address</th>' +
'<th class="message">Message</th>' +
'</tr></thead>' +
'<tbody></tbody>' +
'</table>'
));
};
PocsagMessagePanel.prototype.pushMessage = function(msg) {
var $b = $(this.el).find('tbody');
$b.append($(
'<tr>' +
'<td class="address">' + msg.address + '</td>' +
'<td class="message">' + msg.message + '</td>' +
'</tr>'
));
$b.scrollTop($b[0].scrollHeight);
};
$.fn.pocsagMessagePanel = function() {
if (!this.data('panel')) {
this.data('panel', new PocsagMessagePanel(this));
};
return this.data('panel');
};