mirror of
https://github.com/craigerl/aprsd.git
synced 2025-09-03 21:57:47 -04:00
Fixes for webchat UI.
Fixed a few issues with webchat UI. When sending a message, make sure the recipient tab is selected after sending. Also, don't reset the path selection after sending a message.
This commit is contained in:
parent
257fa0db7d
commit
f0b99564d1
@ -126,10 +126,14 @@ class APRSISClient(base.APRSClient):
|
|||||||
return aprs_client
|
return aprs_client
|
||||||
|
|
||||||
def consumer(self, callback, blocking=False, immortal=False, raw=False):
|
def consumer(self, callback, blocking=False, immortal=False, raw=False):
|
||||||
try:
|
if self._client:
|
||||||
self._client.consumer(
|
try:
|
||||||
callback, blocking=blocking,
|
self._client.consumer(
|
||||||
immortal=immortal, raw=raw,
|
callback, blocking=blocking,
|
||||||
)
|
immortal=immortal, raw=raw,
|
||||||
except Exception as e:
|
)
|
||||||
LOG.error(f"Exception in consumer: {e}")
|
except Exception as e:
|
||||||
|
LOG.error(e)
|
||||||
|
LOG.info(e.__cause__)
|
||||||
|
else:
|
||||||
|
LOG.warning("client is None, might be resetting.")
|
||||||
|
@ -101,7 +101,7 @@ function init_chat() {
|
|||||||
|
|
||||||
$("#sendform").submit(function(event) {
|
$("#sendform").submit(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
to_call = $('#to_call').val();
|
to_call = $('#to_call').val().toUpperCase();
|
||||||
message = $('#message').val();
|
message = $('#message').val();
|
||||||
path = $('#pkt_path option:selected').val();
|
path = $('#pkt_path option:selected').val();
|
||||||
if (to_call == "") {
|
if (to_call == "") {
|
||||||
@ -116,6 +116,8 @@ function init_chat() {
|
|||||||
//console.log(msg);
|
//console.log(msg);
|
||||||
socket.emit("send", msg);
|
socket.emit("send", msg);
|
||||||
$('#message').val('');
|
$('#message').val('');
|
||||||
|
callsign_select(to_call);
|
||||||
|
activate_callsign_tab(to_call);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -418,7 +420,7 @@ function append_message(callsign, msg, msg_html) {
|
|||||||
|
|
||||||
// Find the right div to place the html
|
// Find the right div to place the html
|
||||||
new_callsign = add_callsign(callsign, msg);
|
new_callsign = add_callsign(callsign, msg);
|
||||||
update_callsign_path(callsign, msg);
|
//update_callsign_path(callsign, msg);
|
||||||
append_message_html(callsign, msg_html, new_callsign);
|
append_message_html(callsign, msg_html, new_callsign);
|
||||||
len = Object.keys(callsign_list).length;
|
len = Object.keys(callsign_list).length;
|
||||||
if (new_callsign && len == 1) {
|
if (new_callsign && len == 1) {
|
||||||
@ -565,16 +567,21 @@ function ack_msg(msg) {
|
|||||||
scroll_main_content();
|
scroll_main_content();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function activate_callsign_tab(callsign) {
|
||||||
|
tab_content = tab_string(callsign, id=true);
|
||||||
|
$(tab_content).click();
|
||||||
|
}
|
||||||
|
|
||||||
function callsign_select(callsign) {
|
function callsign_select(callsign) {
|
||||||
var tocall = $("#to_call");
|
var tocall = $("#to_call");
|
||||||
tocall.val(callsign);
|
tocall.val(callsign.toUpperCase());
|
||||||
scroll_main_content(callsign);
|
scroll_main_content(callsign);
|
||||||
selected_tab_callsign = callsign;
|
selected_tab_callsign = callsign;
|
||||||
tab_notify_id = tab_notification_id(callsign, true);
|
tab_notify_id = tab_notification_id(callsign, true);
|
||||||
$(tab_notify_id).addClass('visually-hidden');
|
$(tab_notify_id).addClass('visually-hidden');
|
||||||
$(tab_notify_id).text(0);
|
$(tab_notify_id).text(0);
|
||||||
// Now update the path
|
// Now update the path
|
||||||
$('#pkt_path').val(callsign_list[callsign]);
|
// $('#pkt_path').val(callsign_list[callsign]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function call_callsign_location(callsign) {
|
function call_callsign_location(callsign) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user