merge-requests/237/merge test_1.22.1129-1
Tag 2022-11-30 17:36:14 -08:00
rodzic d92ea914c4
commit 6f33625650
3 zmienionych plików z 57 dodań i 40 usunięć

Wyświetl plik

@ -267,7 +267,6 @@
function updateCallsign(id) function updateCallsign(id)
{ {
var count = parseInt(userCount.innerHTML);
if (id in window.opener.g_gtFlagPins) if (id in window.opener.g_gtFlagPins)
{ {
var obj = window.opener.g_gtFlagPins[id]; var obj = window.opener.g_gtFlagPins[id];
@ -288,10 +287,7 @@
if (obj.canmsg == false) show = false; if (obj.canmsg == false) show = false;
if (makeCallsignRow(obj, show) && show) makeCallsignRow(obj, show);
{
count++;
}
if (obj.cid == g_currentId && messageInput.disabled == true && obj.live == true) if (obj.cid == g_currentId && messageInput.disabled == true && obj.live == true)
{ {
@ -312,19 +308,44 @@
var obj = document.getElementById(id); var obj = document.getElementById(id);
if (obj) if (obj)
{ {
if (obj.style.display == "")
{
count--;
}
allCallDiv.removeChild(obj); allCallDiv.removeChild(obj);
} }
} }
updateCount();
}
function updateCount()
{
var count = 0;
if(allCallDiv.childElementCount > 0)
{
for (var x = allCallDiv.childNodes.length-1; x > -1; x--)
{
if (allCallDiv.childNodes[x].style.display != "none")
{
count++;
}
}
}
userCount.innerHTML = count; userCount.innerHTML = count;
} }
function showAllCallsigns() function removeAllChildNodes(parent)
{ {
var count = 0; while (parent.firstChild)
{
parent.removeChild(parent.firstChild);
}
}
function showAllCallsigns(justSearching = false)
{
allCallDiv.style.display = "none";
if (justSearching == false)
{
removeAllChildNodes(allCallDiv);
}
for (const x in window.opener.g_gtFlagPins) for (const x in window.opener.g_gtFlagPins)
{ {
var obj = window.opener.g_gtFlagPins[x]; var obj = window.opener.g_gtFlagPins[x];
@ -345,11 +366,6 @@
if (obj.canmsg == false) show = false; if (obj.canmsg == false) show = false;
if (show)
{
count++;
}
makeCallsignRow(obj, show); makeCallsignRow(obj, show);
if (obj.cid == g_currentId && messageInput.disabled == true && obj.live == true) if (obj.cid == g_currentId && messageInput.disabled == true && obj.live == true)
@ -362,19 +378,8 @@
} }
} }
if(allCallDiv.childElementCount > 0)
{
for (var x = allCallDiv.childNodes.length-1; x > -1; x--)
{
if (!(allCallDiv.childNodes[x].id in window.opener.g_gtFlagPins))
{
allCallDiv.removeChild(allCallDiv.childNodes[x]);
}
}
}
updateBar(g_currentId); updateBar(g_currentId);
userCount.innerHTML = count; updateCount();
if (g_viewBand) if (g_viewBand)
{ {
@ -394,6 +399,13 @@
viewMode.innerHTML = "All"; viewMode.innerHTML = "All";
} }
allCallDiv.style.display = "";
messagesRedraw();
}
function messagesRedraw()
{
showAllMessages(); showAllMessages();
Resize(); Resize();
} }
@ -443,8 +455,7 @@
g_currentId = ""; g_currentId = "";
openId(what); openId(what);
} }
showAllMessages(); messagesRedraw();
Resize();
} }
function updateEverything() function updateEverything()
@ -548,7 +559,8 @@
if (id in window.opener.g_gtUnread) if (id in window.opener.g_gtUnread)
{ {
delete window.opener.g_gtUnread[id]; delete window.opener.g_gtUnread[id];
showAllCallsigns(); updateCallsign(id);
showAllMessages();
} }
} }
messageTextDiv.innerHTML = worker; messageTextDiv.innerHTML = worker;
@ -613,7 +625,7 @@
} else { } else {
clearSearch.style.display = "none"; clearSearch.style.display = "none";
} }
showAllCallsigns(); showAllCallsigns(true);
} }
function doLookup(what) function doLookup(what)

Wyświetl plik

@ -10638,22 +10638,30 @@ function setGtShareButtons()
g_layerVectors.gtflags.setVisible(false); g_layerVectors.gtflags.setVisible(false);
clearGtFlags(); clearGtFlags();
// Clear list // Clear list
g_gtFlagPins = {}; g_gtFlagPins = Object()
g_gtMessages = Object();
g_gtUnread = Object();
g_gtIdToCid = Object();
g_gtCallsigns = Object();
g_gtSentAwayToCid = Object();
if (g_chatWindowHandle != null) if (g_chatWindowHandle != null)
{ {
try try
{ {
g_chatWindowHandle.hide(); g_chatWindowHandle.hide();
g_chatWindowHandle.window.allCallDiv.innerHTML = "";
g_chatWindowHandle.window.updateCount();
} }
catch (e) catch (e)
{ {
console.error(e); console.error(e);
} }
} }
goProcessRoster();
} }
gtShareFlagImg.src = gtShareFlagImg.src = g_gtShareFlagImageArray[g_appSettings.gtShareEnable == false ? 0 : 1];
g_gtShareFlagImageArray[g_appSettings.gtShareEnable == false ? 0 : 1];
} }
function setMulticastIp() function setMulticastIp()

Wyświetl plik

@ -54,7 +54,7 @@ var g_gtLiveStatusUpdate = false;
var myChatId = 0; var myChatId = 0;
var myRoom = 0; var myRoom = 0;
var g_gtChatlistChangeCount = 0;
var g_gtCurrentMessageCount = 0; var g_gtCurrentMessageCount = 0;
function gtConnectChat() function gtConnectChat()
@ -352,7 +352,6 @@ function gtChatUpdateCall(jsmesg)
g_layerSources.gtflags.addFeature(g_gtFlagPins[cid].pin); g_layerSources.gtflags.addFeature(g_gtFlagPins[cid].pin);
} }
} }
g_gtChatlistChangeCount++;
g_gtCallsigns[g_gtFlagPins[cid].call] = cid; g_gtCallsigns[g_gtFlagPins[cid].call] = cid;
updateChatWindow(cid); updateChatWindow(cid);
} }
@ -476,7 +475,6 @@ function gtChatNewList(jsmesg)
} }
} }
} }
g_gtChatlistChangeCount++;
updateChatWindow(); updateChatWindow();
} }
@ -608,7 +606,6 @@ function gtChatStateMachine()
{ {
g_getEngineWasRunning = false; g_getEngineWasRunning = false;
closeGtSocket(); closeGtSocket();
g_gtChatlistChangeCount = 0;
g_lastGtStatus = ""; g_lastGtStatus = "";
} }
} }
@ -730,9 +727,9 @@ function newChatMessage(id, jsmesg)
try try
{ {
hasFocus = g_chatWindowHandle.window.newChatMessage(id, jsmesg); hasFocus = g_chatWindowHandle.window.newChatMessage(id, jsmesg);
g_chatWindowHandle.window.messagesRedraw();
} }
catch (e) {} catch (e) {}
updateChatWindow();
} }
return hasFocus; return hasFocus;
} }