2021-06-28 22:26:44 +00:00
|
|
|
function renderRoster(callRoster, rosterSettings)
|
|
|
|
{
|
|
|
|
// eQSL - function
|
|
|
|
if (window.opener.g_callsignLookups.eqslUseEnable == true) useseQSLDiv.style.display = "";
|
|
|
|
else useseQSLDiv.style.display = "none";
|
|
|
|
|
|
|
|
// OQRS - function
|
|
|
|
if (window.opener.g_callsignLookups.oqrsUseEnable == true) usesOQRSDiv.style.display = "";
|
|
|
|
else usesOQRSDiv.style.display = "none";
|
|
|
|
|
|
|
|
// dealing with spots
|
|
|
|
if (g_rosterSettings.columns.Spot == true) onlySpotDiv.style.display = "";
|
|
|
|
else onlySpotDiv.style.display = "none";
|
|
|
|
|
|
|
|
// callmode (all or only new)
|
|
|
|
if (rosterSettings.callMode == "all") allOnlyNewDiv.style.display = "";
|
|
|
|
else allOnlyNewDiv.style.display = "none";
|
|
|
|
|
|
|
|
// Show the roster count in the window title
|
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
// let visibleCallList = callRoster.filter(entry => entry.tx);
|
2021-06-29 02:58:05 +00:00
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
let visibleCallList = [];
|
|
|
|
let band =
|
2021-07-07 19:08:03 +00:00
|
|
|
window.opener.g_appSettings.gtBandFilter == "auto"
|
|
|
|
? window.opener.g_appSettings.myBand
|
|
|
|
: window.opener.g_appSettings.gtBandFilter.length == 0
|
|
|
|
? ""
|
|
|
|
: window.opener.g_appSettings.gtBandFilter;
|
2021-06-29 02:58:05 +00:00
|
|
|
for (entry in callRoster)
|
|
|
|
{
|
2021-07-07 19:08:03 +00:00
|
|
|
// entry should populate in general
|
2021-06-29 03:18:32 +00:00
|
|
|
if (callRoster[entry].tx)
|
2021-06-29 02:58:05 +00:00
|
|
|
{
|
2021-07-07 19:08:03 +00:00
|
|
|
// check setting for call roster clear on band change.
|
|
|
|
// if true and band is current band, populate
|
|
|
|
if (window.opener.g_appSettings.clearRosterOnBandChange)
|
|
|
|
{
|
|
|
|
if (callRoster[entry].callObj.band == band)
|
|
|
|
{
|
|
|
|
visibleCallList.push(callRoster[entry]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!window.opener.g_appSettings.clearRosterOnBandChange)
|
|
|
|
{
|
|
|
|
visibleCallList.push(callRoster[entry]);
|
|
|
|
}
|
2021-06-29 02:58:05 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-28 22:26:44 +00:00
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
let totalCount = Object.keys(callRoster).length;
|
|
|
|
let visibleCount = visibleCallList.length;
|
2021-12-13 16:54:19 +00:00
|
|
|
let huntedCount = visibleCallList.filter(obj => Object.keys().length > 0).length
|
2021-12-12 21:56:58 +00:00
|
|
|
let countParts = [];
|
2021-06-28 22:26:44 +00:00
|
|
|
|
|
|
|
if (totalCount != visibleCount)
|
|
|
|
{
|
|
|
|
countParts.push(`${totalCount} heard`);
|
|
|
|
}
|
|
|
|
|
|
|
|
countParts.push(`${visibleCount} in roster`);
|
|
|
|
|
|
|
|
if (huntedCount != visibleCount)
|
|
|
|
{
|
|
|
|
countParts.push(`${huntedCount} wanted`);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.document.title = `Call Roster: ${countParts.join(" • ")}`;
|
|
|
|
|
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
|
|
|
visibleCallList.sort(r_sortFunction[g_rosterSettings.lastSortIndex]);
|
|
|
|
if (g_rosterSettings.lastSortReverse == 1)
|
|
|
|
{
|
|
|
|
visibleCallList.reverse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Age sort for now... make this happen Tag
|
|
|
|
visibleCallList.sort(r_sortFunction[6]).reverse();
|
|
|
|
}
|
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
let showBands = (Object.keys(rosterSettings.bands).length > 1) || g_rosterSettings.columns.Band;
|
|
|
|
let showModes = (Object.keys(rosterSettings.modes).length > 1) || g_rosterSettings.columns.Mode;
|
2021-06-28 22:26:44 +00:00
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
let worker = g_rosterSettings.compact ? renderCompactRosterHeaders() : renderNormalRosterHeaders(showBands, showModes)
|
2021-06-28 22:26:44 +00:00
|
|
|
|
|
|
|
// Third loop: render all rows
|
2021-12-12 21:56:58 +00:00
|
|
|
for (let x in visibleCallList)
|
2021-06-28 22:26:44 +00:00
|
|
|
{
|
2021-12-12 21:56:58 +00:00
|
|
|
let callObj = visibleCallList[x].callObj;
|
2021-06-28 22:26:44 +00:00
|
|
|
|
|
|
|
// TODO: This is filtering
|
2021-06-29 03:37:49 +00:00
|
|
|
if (callObj.shouldAlert == false && rosterSettings.onlyHits == true && callObj.qrz == false)
|
2021-06-28 22:26:44 +00:00
|
|
|
{ continue; }
|
|
|
|
|
2021-12-12 21:56:58 +00:00
|
|
|
let thisCall = callObj.DEcall;
|
2021-06-28 22:26:44 +00:00
|
|
|
|
|
|
|
if (thisCall.match("^[A-Z][0-9][A-Z](/w+)?$"))
|
|
|
|
{ callObj.style.call = "class='oneByOne'"; }
|
|
|
|
if (thisCall == window.opener.g_instances[callObj.instance].status.DXcall)
|
|
|
|
{
|
|
|
|
if (window.opener.g_instances[callObj.instance].status.TxEnabled == 1)
|
|
|
|
{
|
|
|
|
callObj.style.call = "class='dxCalling'";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.style.call = "class='dxCaller'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-29 03:50:49 +00:00
|
|
|
worker += g_rosterSettings.compact ? renderCompactRosterRow(callObj) : renderNormalRosterRow(callObj, showBands, showModes)
|
2021-06-28 22:26:44 +00:00
|
|
|
}
|
|
|
|
|
2021-06-29 04:08:13 +00:00
|
|
|
worker += g_rosterSettings.compact ? renderCompactRosterFooter() : renderNormalRosterFooter()
|
|
|
|
RosterTable.innerHTML = worker;
|
2021-06-28 22:26:44 +00:00
|
|
|
}
|