add functions to get acks json off website and overwrite file

merge-requests/150/merge
Matthew Chambers 2021-06-19 11:17:29 -05:00 zatwierdzone przez nr0q
rodzic 56e4d58169
commit e9d9f8b24a
1 zmienionych plików z 229 dodań i 321 usunięć

Wyświetl plik

@ -7,8 +7,7 @@ var gtBeta = pjson.betaVersion;
var g_startVersion = 0; var g_startVersion = 0;
if (typeof localStorage.currentVersion != "undefined") if (typeof localStorage.currentVersion != "undefined") { g_startVersion = localStorage.currentVersion; }
{ g_startVersion = localStorage.currentVersion; }
if ( if (
typeof localStorage.currentVersion == "undefined" || typeof localStorage.currentVersion == "undefined" ||
@ -808,8 +807,7 @@ function toggleOffline()
if (g_appSettings.gtShareEnable == true) if (g_appSettings.gtShareEnable == true)
{ {
gtFlagButton.style.display = "inline-block"; gtFlagButton.style.display = "inline-block";
if (g_appSettings.gtMsgEnable == true) if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; }
{ msgButton.style.display = "inline-block"; }
else msgButton.style.display = "none"; else msgButton.style.display = "none";
} }
else else
@ -884,8 +882,7 @@ function toggleTime()
function dateToString(dateTime) function dateToString(dateTime)
{ {
if (g_appSettings.useLocalTime == 1) if (g_appSettings.useLocalTime == 1) { return dateTime.toLocaleString().replace(/,/g, ""); }
{ return dateTime.toLocaleString().replace(/,/g, ""); }
else return dateTime.toUTCString().replace(/GMT/g, "UTC").replace(/,/g, ""); else return dateTime.toUTCString().replace(/GMT/g, "UTC").replace(/,/g, "");
} }
@ -951,8 +948,7 @@ function getWpx(callsign)
{ {
if (/\d/.test(callsign.charAt(prefixEnd))) if (/\d/.test(callsign.charAt(prefixEnd)))
{ {
while (prefixEnd + 1 != end && /\d/.test(callsign.charAt(prefixEnd + 1))) while (prefixEnd + 1 != end && /\d/.test(callsign.charAt(prefixEnd + 1))) { prefixEnd++; }
{ prefixEnd++; }
foundPrefix = true; foundPrefix = true;
break; break;
} }
@ -970,8 +966,7 @@ function setState(details)
{ {
var isDigi = details.digital; var isDigi = details.digital;
if (details.state.substr(0, 2) != "US") if (details.state.substr(0, 2) != "US") { details.state = "US-" + details.state; }
{ details.state = "US-" + details.state; }
g_tracker.worked.state[details.state + details.band + details.mode] = true; g_tracker.worked.state[details.state + details.band + details.mode] = true;
g_tracker.worked.state[details.state] = true; g_tracker.worked.state[details.state] = true;
@ -1104,8 +1099,7 @@ function addDeDx(
details.grid.length < 6 && details.grid.length < 6 &&
(details.grid.substr(0, 4) == finalGrid.substr(0, 4) || (details.grid.substr(0, 4) == finalGrid.substr(0, 4) ||
details.grid.length == 0) details.grid.length == 0)
) ) { details.grid = finalGrid; }
{ details.grid = finalGrid; }
} }
if (finalRSTsent.length > 0) details.RSTsent = finalRSTsent; if (finalRSTsent.length > 0) details.RSTsent = finalRSTsent;
if (finalRSTrecv.length > 0) details.RSTrecv = finalRSTrecv; if (finalRSTrecv.length > 0) details.RSTrecv = finalRSTrecv;
@ -1157,8 +1151,7 @@ function addDeDx(
if (details.dxcc > 0 && details.px == null) if (details.dxcc > 0 && details.px == null)
{ {
details.px = getWpx(finalDXcall); details.px = getWpx(finalDXcall);
if (details.px) if (details.px) { details.zone = Number(details.px.charAt(details.px.length - 1)); }
{ details.zone = Number(details.px.charAt(details.px.length - 1)); }
} }
if ( if (
@ -1530,8 +1523,7 @@ function addDeDx(
if (newCallsign.cont == null) if (newCallsign.cont == null)
{ {
newCallsign.cont = g_worldGeoData[g_dxccToGeoData[finalDxcc]].continent; newCallsign.cont = g_worldGeoData[g_dxccToGeoData[finalDxcc]].continent;
if (newCallsign.dxcc == 390 && newCallsign.zone == 1) if (newCallsign.dxcc == 390 && newCallsign.zone == 1) { newCallsign.cont = "EU"; }
{ newCallsign.cont = "EU"; }
} }
} }
if (finalRSTsent != null) if (finalRSTsent != null)
@ -1602,8 +1594,7 @@ function addDeDx(
if ( if (
finalGrid.length == callsign.grid.length && finalGrid.length == callsign.grid.length &&
finalGrid != callsign.grid finalGrid != callsign.grid
) ) { callsign.grid = finalGrid; }
{ callsign.grid = finalGrid; }
if (finalRSTsent != null) callsign.RSTsent = finalRSTsent; if (finalRSTsent != null) callsign.RSTsent = finalRSTsent;
if (finalRSTrecv != null) callsign.RSTrecv = finalRSTrecv; if (finalRSTrecv != null) callsign.RSTrecv = finalRSTrecv;
callsign.vucc_grids = []; callsign.vucc_grids = [];
@ -1625,8 +1616,7 @@ function timeoutSetUdpPort()
function setUdpPort() function setUdpPort()
{ {
if (g_setNewUdpPortTimeoutHandle != null) if (g_setNewUdpPortTimeoutHandle != null) { window.clearTimeout(g_setNewUdpPortTimeoutHandle); }
{ window.clearTimeout(g_setNewUdpPortTimeoutHandle); }
lastMsgTimeDiv.innerHTML = "..setting.."; lastMsgTimeDiv.innerHTML = "..setting..";
g_setNewUdpPortTimeoutHandle = window.setTimeout(timeoutSetUdpPort, 1000); g_setNewUdpPortTimeoutHandle = window.setTimeout(timeoutSetUdpPort, 1000);
} }
@ -1713,8 +1703,7 @@ function changePathWidth()
if (width == 0) if (width == 0)
{ {
if (typeof g_flightPaths[i].Arrow != "undefined") if (typeof g_flightPaths[i].Arrow != "undefined") { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); }
{ g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); }
g_layerSources.flight.removeFeature(g_flightPaths[i]); g_layerSources.flight.removeFeature(g_flightPaths[i]);
delete g_flightPaths[i]; delete g_flightPaths[i];
g_flightPaths[i] = null; g_flightPaths[i] = null;
@ -2125,8 +2114,7 @@ function createTooltTipTable(toolElement)
added = true; added = true;
} }
} }
if (added == true) if (added == true) { worker = worker.substr(0, worker.length - " / ".length); }
{ worker = worker.substr(0, worker.length - " / ".length); }
worker += "</font>)"; worker += "</font>)";
} }
if (x + 1 < g_gridToDXCC[toolElement.qth].length) worker += ", "; if (x + 1 < g_gridToDXCC[toolElement.qth].length) worker += ", ";
@ -2161,8 +2149,7 @@ function createTooltTipTable(toolElement)
{ {
for (var KeyIsCall in g_liveGrids[toolElement.qth].rectangle.liveHash) for (var KeyIsCall in g_liveGrids[toolElement.qth].rectangle.liveHash)
{ {
if (KeyIsCall in g_liveCallsigns && g_appSettings.gridViewMode == 3) if (KeyIsCall in g_liveCallsigns && g_appSettings.gridViewMode == 3) { newCallList.push(g_liveCallsigns[KeyIsCall]); }
{ newCallList.push(g_liveCallsigns[KeyIsCall]); }
} }
} }
} }
@ -2180,8 +2167,7 @@ function createTooltTipTable(toolElement)
} }
for (var KeyIsCall in toolElement.liveHash) for (var KeyIsCall in toolElement.liveHash)
{ {
if (KeyIsCall in g_liveCallsigns) if (KeyIsCall in g_liveCallsigns) { newCallList.push(g_liveCallsigns[KeyIsCall]); }
{ newCallList.push(g_liveCallsigns[KeyIsCall]); }
} }
} }
newCallList.sort(compareCallsignTime).reverse(); newCallList.sort(compareCallsignTime).reverse();
@ -2190,15 +2176,11 @@ function createTooltTipTable(toolElement)
var callsign = newCallList[x]; var callsign = newCallList[x];
var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDX = " style='font-weight:bold;color:cyan;' ";
var bgDE = " style='font-weight:bold;color:yellow;' "; var bgDE = " style='font-weight:bold;color:yellow;' ";
if (callsign.DXcall == myDEcall) if (callsign.DXcall == myDEcall) { bgDX = " style='background-color:cyan;color:#000;font-weight:bold' "; }
{ bgDX = " style='background-color:cyan;color:#000;font-weight:bold' "; } if (callsign.DEcall == myDEcall) { bgDE = " style='background-color:#FFFF00;color:#000;font-weight:bold' "; }
if (callsign.DEcall == myDEcall) if (typeof callsign.msg == "undefined" || callsign.msg == "") { callsign.msg = "-"; }
{ bgDE = " style='background-color:#FFFF00;color:#000;font-weight:bold' "; }
if (typeof callsign.msg == "undefined" || callsign.msg == "")
{ callsign.msg = "-"; }
var ageString = ""; var ageString = "";
if (timeNowSec() - callsign.time < 3601) if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); }
{ ageString = (timeNowSec() - callsign.time).toDHMS(); }
else else
{ {
ageString = userTimeString(callsign.time * 1000); ageString = userTimeString(callsign.time * 1000);
@ -2216,8 +2198,7 @@ function createTooltTipTable(toolElement)
worker += "<td>" + (callsign.delta > -1 ? callsign.delta : "-") + "</td>"; worker += "<td>" + (callsign.delta > -1 ? callsign.delta : "-") + "</td>";
worker += "<td>" + callsign.RSTsent + "</td>"; worker += "<td>" + callsign.RSTsent + "</td>";
worker += "<td>" + callsign.RSTrecv + "</td>" + "<td" + bgDX + ">"; worker += "<td>" + callsign.RSTrecv + "</td>" + "<td" + bgDX + ">";
if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") { worker += callsign.DXcall.formatCallsign(); }
{ worker += callsign.DXcall.formatCallsign(); }
else else
{ {
worker += worker +=
@ -2319,13 +2300,10 @@ function createTooltTipTableLogbook(toolElement)
var callsign = newCallList[x]; var callsign = newCallList[x];
var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDX = " style='font-weight:bold;color:cyan;' ";
var bgDE = " style='font-weight:bold;color:yellow;' "; var bgDE = " style='font-weight:bold;color:yellow;' ";
if (callsign.DXcall == myDEcall) if (callsign.DXcall == myDEcall) { bgDX = " style='background-color:cyan;color:#000;font-weight:bold' "; }
{ bgDX = " style='background-color:cyan;color:#000;font-weight:bold' "; } if (callsign.DEcall == myDEcall) { bgDE = " style='background-color:#FFFF00;color:#000;font-weight:bold' "; }
if (callsign.DEcall == myDEcall)
{ bgDE = " style='background-color:#FFFF00;color:#000;font-weight:bold' "; }
var ageString = ""; var ageString = "";
if (timeNowSec() - callsign.time < 3601) if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); }
{ ageString = (timeNowSec() - callsign.time).toDHMS(); }
else else
{ {
ageString = userTimeString(callsign.time * 1000); ageString = userTimeString(callsign.time * 1000);
@ -2343,8 +2321,7 @@ function createTooltTipTableLogbook(toolElement)
worker += "<td>" + (callsign.delta > -1 ? callsign.delta : "-") + "</td>"; worker += "<td>" + (callsign.delta > -1 ? callsign.delta : "-") + "</td>";
worker += "<td>" + callsign.RSTsent + "</td>"; worker += "<td>" + callsign.RSTsent + "</td>";
worker += "<td>" + callsign.RSTrecv + "</td>" + "<td" + bgDX + ">"; worker += "<td>" + callsign.RSTrecv + "</td>" + "<td" + bgDX + ">";
if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") { worker += callsign.DXcall.formatCallsign(); }
{ worker += callsign.DXcall.formatCallsign(); }
else else
{ {
worker += worker +=
@ -2826,8 +2803,7 @@ function tempGridToBox(iQTH, oldGrid, borderColor, boxColor, layer)
var LL = squareToLatLong(iQTH.substr(0, 4)); var LL = squareToLatLong(iQTH.substr(0, 4));
if (oldGrid) if (oldGrid)
{ {
if (g_layerSources.temp.hasFeature(oldGrid)) if (g_layerSources.temp.hasFeature(oldGrid)) { g_layerSources.temp.removeFeature(oldGrid); }
{ g_layerSources.temp.removeFeature(oldGrid); }
} }
var bounds = [ var bounds = [
[LL.lo1, LL.la1], [LL.lo1, LL.la1],
@ -2919,8 +2895,7 @@ function onMyKeyDown(event)
var param2 = null; var param2 = null;
if (typeof g_hotKeys[event.code].param2 != "undefined") if (typeof g_hotKeys[event.code].param2 != "undefined")
{ {
if (typeof event[g_hotKeys[event.code].param2] != "undefined") if (typeof event[g_hotKeys[event.code].param2] != "undefined") { param2 = event[g_hotKeys[event.code].param2]; }
{ param2 = event[g_hotKeys[event.code].param2]; }
} }
g_hotKeys[event.code].func(g_hotKeys[event.code].param1, param2); g_hotKeys[event.code].func(g_hotKeys[event.code].param1, param2);
} }
@ -2936,8 +2911,7 @@ function onMyKeyDown(event)
var param2 = null; var param2 = null;
if (typeof g_hotKeys[event.key].param2 != "undefined") if (typeof g_hotKeys[event.key].param2 != "undefined")
{ {
if (typeof event[g_hotKeys[event.key].param2] != "undefined") if (typeof event[g_hotKeys[event.key].param2] != "undefined") { param2 = event[g_hotKeys[event.key].param2]; }
{ param2 = event[g_hotKeys[event.key].param2]; }
} }
g_hotKeys[event.key].func(g_hotKeys[event.key].param1, param2); g_hotKeys[event.key].func(g_hotKeys[event.key].param1, param2);
} }
@ -3143,8 +3117,7 @@ function makeTitleInfo(mapWindow)
news += " Layer: " + g_viewInfo[g_currentOverlay][1]; news += " Layer: " + g_viewInfo[g_currentOverlay][1];
} }
if (g_currentOverlay == 0 && g_appSettings.gridViewMode == 1) if (g_currentOverlay == 0 && g_appSettings.gridViewMode == 1) { return news + end; }
{ return news + end; }
var workline = var workline =
" - Worked " + " - Worked " +
@ -3871,8 +3844,7 @@ function mouseUpGrid()
if (g_tempGridBox) if (g_tempGridBox)
{ {
if (g_layerSources.temp.hasFeature(g_tempGridBox)) if (g_layerSources.temp.hasFeature(g_tempGridBox)) { g_layerSources.temp.removeFeature(g_tempGridBox); }
{ g_layerSources.temp.removeFeature(g_tempGridBox); }
} }
g_tempGridBox = null; g_tempGridBox = null;
@ -3963,8 +3935,7 @@ function mouseOverDataItem(mouseEvent, fromHover)
if ( if (
typeof mouseEvent.spot != "undefined" && typeof mouseEvent.spot != "undefined" &&
g_receptionReports.spots[mouseEvent.spot].bearing > 180 g_receptionReports.spots[mouseEvent.spot].bearing > 180
) ) { noRoomRight = true; }
{ noRoomRight = true; }
myTooltip.style.left = getMouseX() + 15 + "px"; myTooltip.style.left = getMouseX() + 15 + "px";
top = parseInt(getMouseY() - 20 - (callListLength / 2) * 25); top = parseInt(getMouseY() - 20 - (callListLength / 2) * 25);
if (windowWidth - getMouseX() < positionInfo.width || noRoomRight == true) if (windowWidth - getMouseX() < positionInfo.width || noRoomRight == true)
@ -3999,8 +3970,7 @@ function mouseMoveDataItem(mouseEvent)
if ( if (
typeof mouseEvent.spot != "undefined" && typeof mouseEvent.spot != "undefined" &&
g_receptionReports.spots[mouseEvent.spot].bearing > 180 g_receptionReports.spots[mouseEvent.spot].bearing > 180
) ) { noRoomRight = true; }
{ noRoomRight = true; }
myTooltip.style.left = getMouseX() + 15 + "px"; myTooltip.style.left = getMouseX() + 15 + "px";
top = Number(myTooltip.style.top); top = Number(myTooltip.style.top);
if (top > 20) top = getMouseY() - 20 + "px"; if (top > 20) top = getMouseY() - 20 + "px";
@ -4290,8 +4260,7 @@ function qthToQsoBox(
newRect.rectangle.qth = iQTH; newRect.rectangle.qth = iQTH;
if (g_pushPinMode == false && entityVisibility == true) if (g_pushPinMode == false && entityVisibility == true) { g_layerSources.qso.addFeature(newRect.rectangle); }
{ g_layerSources.qso.addFeature(newRect.rectangle); }
var newPin = g_colorLeafletQPins.worked[band]; var newPin = g_colorLeafletQPins.worked[band];
if (confirmed) newPin = g_colorLeafletQPins.confirmed[band]; if (confirmed) newPin = g_colorLeafletQPins.confirmed[band];
@ -4306,8 +4275,7 @@ function qthToQsoBox(
newRect.rectangle.pin.hashes[iHash] = 1; newRect.rectangle.pin.hashes[iHash] = 1;
newRect.rectangle.pin.size = LL.size; newRect.rectangle.pin.size = LL.size;
if (g_pushPinMode && entityVisibility == true) if (g_pushPinMode && entityVisibility == true) { g_layerSources["qso-pins"].addFeature(newRect.rectangle.pin); }
{ g_layerSources["qso-pins"].addFeature(newRect.rectangle.pin); }
newRect.rectangle.locked = locked; newRect.rectangle.locked = locked;
newRect.rectangle.worked = worked; newRect.rectangle.worked = worked;
@ -4335,8 +4303,7 @@ function qthToQsoBox(
return rect.rectangle; return rect.rectangle;
} }
if (worked && !rect.rectangle.worked) rect.rectangle.worked = worked; if (worked && !rect.rectangle.worked) rect.rectangle.worked = worked;
if (confirmed && !rect.rectangle.confirmed) if (confirmed && !rect.rectangle.confirmed) { rect.rectangle.confirmed = confirmed; }
{ rect.rectangle.confirmed = confirmed; }
borderColor = g_mainBorderColor; borderColor = g_mainBorderColor;
if (myDEbox) borderWeight = 1; if (myDEbox) borderWeight = 1;
zIndex = 2; zIndex = 2;
@ -4501,8 +4468,7 @@ function qthToBox(iQTH, iDEcallsign, iCQ, iNew, locked, DE, band, wspr, hash)
newRect.rectangle.pin.liveHash[hash] = 1; newRect.rectangle.pin.liveHash[hash] = 1;
newRect.rectangle.pin.size = LL.size; newRect.rectangle.pin.size = LL.size;
if (g_pushPinMode && entityVisibility == true) if (g_pushPinMode && entityVisibility == true) { g_layerSources["live-pins"].addFeature(newRect.rectangle.pin); }
{ g_layerSources["live-pins"].addFeature(newRect.rectangle.pin); }
newRect.rectangle.locked = locked; newRect.rectangle.locked = locked;
newRect.rectangle.size = LL.size; newRect.rectangle.size = LL.size;
@ -4819,8 +4785,7 @@ function animatePaths()
{ {
if (g_flightPaths[i].age < g_timeNow) if (g_flightPaths[i].age < g_timeNow)
{ {
if (typeof g_flightPaths[i].Arrow != "undefined") if (typeof g_flightPaths[i].Arrow != "undefined") { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); }
{ g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); }
g_layerSources.flight.removeFeature(g_flightPaths[i]); g_layerSources.flight.removeFeature(g_flightPaths[i]);
delete g_flightPaths[i]; delete g_flightPaths[i];
g_flightPaths[i] = null; g_flightPaths[i] = null;
@ -5060,8 +5025,7 @@ function clearCalls()
g_liveCallsigns[i].rect != null g_liveCallsigns[i].rect != null
) )
{ {
if (i in g_liveCallsigns[i].rect.liveHash) if (i in g_liveCallsigns[i].rect.liveHash) { delete g_liveCallsigns[i].rect.liveHash[i]; }
{ delete g_liveCallsigns[i].rect.liveHash[i]; }
} }
} }
@ -5251,8 +5215,7 @@ function displayTime()
{ {
if (now - time > 120000) if (now - time > 120000)
{ {
if (g_layerSources.strikes.hasFeature(g_bolts[time])) if (g_layerSources.strikes.hasFeature(g_bolts[time])) { g_layerSources.strikes.removeFeature(g_bolts[time]); }
{ g_layerSources.strikes.removeFeature(g_bolts[time]); }
delete g_bolts[time]; delete g_bolts[time];
} }
} }
@ -5432,8 +5395,7 @@ function toggleStrikeGlobal()
var worker = var worker =
"<font color='yellow'>Strike Distance Changed<br/>" + msg + "</font>"; "<font color='yellow'>Strike Distance Changed<br/>" + msg + "</font>";
if (g_mapSettings.strikes == false) if (g_mapSettings.strikes == false) { worker += "<br/><font color='red'>Detection is not enabled!</font>"; }
{ worker += "<br/><font color='red'>Detection is not enabled!</font>"; }
addLastTraffic(worker); addLastTraffic(worker);
g_layerSources.strikes.clear(); g_layerSources.strikes.clear();
@ -5458,8 +5420,7 @@ function setStrikeDistance()
var send = "{\"west\":-180,\"east\":180,\"north\":-90,\"south\":-90}"; var send = "{\"west\":-180,\"east\":180,\"north\":-90,\"south\":-90}";
if (g_strikeInterval == null) if (g_strikeInterval == null) { g_strikeInterval = setInterval(setStrikeDistance, 300000); }
{ g_strikeInterval = setInterval(setStrikeDistance, 300000); }
try try
{ {
@ -5989,8 +5950,7 @@ function toggleNexrad()
g_Nexrad = createNexRad(); g_Nexrad = createNexRad();
g_map.addLayer(g_Nexrad); g_map.addLayer(g_Nexrad);
if (g_nexradInterval == null) if (g_nexradInterval == null) { g_nexradInterval = setInterval(nexradRefresh, 600000); }
{ g_nexradInterval = setInterval(nexradRefresh, 600000); }
} }
else else
{ {
@ -6355,8 +6315,7 @@ function setCallAndGrid(callsign, grid, instance = null)
length = encodeQUTF8(responseArray, length, callsign); length = encodeQUTF8(responseArray, length, callsign);
var hash = liveHash(callsign, thisInstance.Band, thisInstance.MO); var hash = liveHash(callsign, thisInstance.Band, thisInstance.MO);
if (hash in g_liveCallsigns && g_liveCallsigns[hash].grid.length > 1) if (hash in g_liveCallsigns && g_liveCallsigns[hash].grid.length > 1) { grid = g_liveCallsigns[hash].grid; }
{ grid = g_liveCallsigns[hash].grid; }
if (grid.length == 0) grid = " "; if (grid.length == 0) grid = " ";
@ -6527,11 +6486,9 @@ function handleWsjtxStatus(newMessage)
if (DXcall.length > 1) if (DXcall.length > 1)
{ {
if (!(newMessage.instance in g_lastTransmitCallsign)) if (!(newMessage.instance in g_lastTransmitCallsign)) { g_lastTransmitCallsign[newMessage.instance] = ""; }
{ g_lastTransmitCallsign[newMessage.instance] = ""; }
if (!(newMessage.instance in g_lastStatusCallsign)) if (!(newMessage.instance in g_lastStatusCallsign)) { g_lastStatusCallsign[newMessage.instance] = ""; }
{ g_lastStatusCallsign[newMessage.instance] = ""; }
if ( if (
lookupOnTx.checked == true && lookupOnTx.checked == true &&
@ -6682,8 +6639,7 @@ function handleWsjtxStatus(newMessage)
localDXReport.innerHTML = Number( localDXReport.innerHTML = Number(
newMessage.Report.trim() newMessage.Report.trim()
).formatSignalReport(); ).formatSignalReport();
if (DXcall.length > 0) if (DXcall.length > 0) { localDXCountry.innerHTML = g_dxccToAltName[callsignToDxcc(DXcall)]; }
{ localDXCountry.innerHTML = g_dxccToAltName[callsignToDxcc(DXcall)]; }
else localDXCountry.innerHTML = "&nbsp;"; else localDXCountry.innerHTML = "&nbsp;";
} }
else else
@ -7038,10 +6994,8 @@ function handleWsjtxDecode(newMessage)
} }
if (validQTH) msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); if (validQTH) msgDEcallsign = decodeWords[decodeWords.length - 2].trim();
if (validQTH == false && decodeWords.length == 3) if (validQTH == false && decodeWords.length == 3) { msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); }
{ msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); } if (validQTH == false && decodeWords.length == 2) { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); }
if (validQTH == false && decodeWords.length == 2)
{ msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); }
if (decodeWords[0] == "CQ") if (decodeWords[0] == "CQ")
{ {
CQ = true; CQ = true;
@ -7057,8 +7011,7 @@ function handleWsjtxDecode(newMessage)
} }
if (decodeWords.length >= 3 && CQ == true && validQTH == false) if (decodeWords.length >= 3 && CQ == true && validQTH == false)
{ {
if (validateNumAndLetter(decodeWords[decodeWords.length - 1].trim())) if (validateNumAndLetter(decodeWords[decodeWords.length - 1].trim())) { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); }
{ msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); }
else msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); else msgDEcallsign = decodeWords[decodeWords.length - 2].trim();
} }
@ -7075,8 +7028,7 @@ function handleWsjtxDecode(newMessage)
if (validQTH == "" && msgDEcallsign in g_gtCallsigns) if (validQTH == "" && msgDEcallsign in g_gtCallsigns)
{ {
if (g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid.length > 0) if (g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid.length > 0) { validQTH = g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid; }
{ validQTH = g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid; }
} }
var canPath = false; var canPath = false;
@ -7156,8 +7108,7 @@ function handleWsjtxDecode(newMessage)
newCallsign.cont = newCallsign.cont =
g_worldGeoData[g_dxccToGeoData[newCallsign.dxcc]].continent; g_worldGeoData[g_dxccToGeoData[newCallsign.dxcc]].continent;
if (newCallsign.dxcc == 390 && newCallsign.zone == 1) if (newCallsign.dxcc == 390 && newCallsign.zone == 1) { details.cont = "EU"; }
{ details.cont = "EU"; }
} }
newCallsign.ituza = Array(); newCallsign.ituza = Array();
@ -7320,8 +7271,7 @@ function handleWsjtxDecode(newMessage)
if ( if (
g_gtCallsigns[callsign.DEcall] in g_gtFlagPins && g_gtCallsigns[callsign.DEcall] in g_gtFlagPins &&
g_gtFlagPins[g_gtCallsigns[callsign.DEcall]].o == 1 g_gtFlagPins[g_gtCallsigns[callsign.DEcall]].o == 1
) ) { g_spotCollector[g_gtCallsigns[callsign.DEcall]] = callsign.RSTsent; }
{ g_spotCollector[g_gtCallsigns[callsign.DEcall]] = callsign.RSTsent; }
} }
} }
@ -7481,8 +7431,7 @@ function handleWsjtxDecode(newMessage)
else if (CCd.length == 3) else if (CCd.length == 3)
{ {
// maybe it's DEL, or WYO. check the first two letters // maybe it's DEL, or WYO. check the first two letters
if (CCd.substr(0, 2) in g_shapeData) if (CCd.substr(0, 2) in g_shapeData) { locality = g_shapeData[CCd.substr(0, 2)]; }
{ locality = g_shapeData[CCd.substr(0, 2)]; }
} }
if (locality == null) if (locality == null)
@ -7632,13 +7581,11 @@ function handleWsjtxClear(newMessage)
if ( if (
g_liveCallsigns[hash].instance == newMessage.instance || g_liveCallsigns[hash].instance == newMessage.instance ||
g_liveCallsigns[hash].mode == g_instances[newMessage.instance].status.MO g_liveCallsigns[hash].mode == g_instances[newMessage.instance].status.MO
) ) { delete g_liveCallsigns[hash]; }
{ delete g_liveCallsigns[hash]; }
} }
for (var call in g_callRoster) for (var call in g_callRoster)
{ {
if (g_callRoster[call].callObj.instance == newMessage.instance) if (g_callRoster[call].callObj.instance == newMessage.instance) { delete g_callRoster[call]; }
{ delete g_callRoster[call]; }
} }
redrawGrids(); redrawGrids();
@ -7667,8 +7614,7 @@ function goProcessRoster(isRealtime = false)
{ {
if (isRealtime == true) if (isRealtime == true)
{ {
if (g_callRosterWindowHandle.window.g_rosterSettings.realtime == false) if (g_callRosterWindowHandle.window.g_rosterSettings.realtime == false) { return; }
{ return; }
} }
g_callRosterWindowHandle.window.processRoster(g_callRoster); g_callRosterWindowHandle.window.processRoster(g_callRoster);
} }
@ -7935,8 +7881,7 @@ function showCallsignBox(redraw)
(thisCall in g_tracker.confirmed.call ? "&#10004;" : "") + (thisCall in g_tracker.confirmed.call ? "&#10004;" : "") +
"</td>"; "</td>";
var ageString = ""; var ageString = "";
if (timeNowSec() - newCallList[x].time < 3601) if (timeNowSec() - newCallList[x].time < 3601) { ageString = (timeNowSec() - newCallList[x].time).toDHMS(); }
{ ageString = (timeNowSec() - newCallList[x].time).toDHMS(); }
else else
{ {
ageString = userTimeString(newCallList[x].time * 1000); ageString = userTimeString(newCallList[x].time * 1000);
@ -8113,8 +8058,7 @@ function myDxccCompare(a, b)
function myDxccIntCompare(a, b) function myDxccIntCompare(a, b)
{ {
if (!(a in g_dxccToAltName)) return 0; if (!(a in g_dxccToAltName)) return 0;
if (!(b in g_dxccToAltName)) if (!(b in g_dxccToAltName)) { return g_dxccToAltName[a].localeCompare(g_dxccToAltName[b]); }
{ return g_dxccToAltName[a].localeCompare(g_dxccToAltName[b]); }
} }
function myTimeCompare(a, b) function myTimeCompare(a, b)
@ -8332,14 +8276,12 @@ function showWorkedBox(sortIndex, nextPage, redraw)
g_filterMode == "Phone" && g_filterMode == "Phone" &&
value.mode in g_modes_phone && value.mode in g_modes_phone &&
g_modes_phone[value.mode] g_modes_phone[value.mode]
) ) { return true; }
{ return true; }
if ( if (
g_filterMode == "Digital" && g_filterMode == "Digital" &&
value.mode in g_modes && value.mode in g_modes &&
g_modes[value.mode] g_modes[value.mode]
) ) { return true; }
{ return true; }
return value.mode == g_filterMode; return value.mode == g_filterMode;
}); });
} }
@ -8931,8 +8873,7 @@ function showDXCCsBox()
} }
}; };
var unconfirmedTd = g_statsWindowHandle.window.document.getElementById("unconfirmed" + List[key].dxcc + "Id"); var unconfirmedTd = g_statsWindowHandle.window.document.getElementById("unconfirmed" + List[key].dxcc + "Id");
if (unconfirmedTd != null) if (unconfirmedTd != null) { unconfirmedTd.addEventListener("mousedown", onMousedown); }
{ unconfirmedTd.addEventListener("mousedown", onMousedown); }
} }
}); });
} }
@ -9335,8 +9276,7 @@ function openInfoTab(evt, tabName, callFunc, callObj)
} }
if (evt) if (evt)
{ {
if (typeof evt.currentTarget != "undefined") if (typeof evt.currentTarget != "undefined") { evt.currentTarget.className += " active"; }
{ evt.currentTarget.className += " active"; }
else evt.className += " active"; else evt.className += " active";
} }
@ -9370,8 +9310,7 @@ function openSettingsTab(evt, tabName)
displayAlerts(); displayAlerts();
// Show the current tab, and add an "active" class to the button that opened the tab // Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(tabName).style.display = "block"; document.getElementById(tabName).style.display = "block";
if (typeof evt.currentTarget != "undefined") if (typeof evt.currentTarget != "undefined") { evt.currentTarget.className += " active"; }
{ evt.currentTarget.className += " active"; }
else evt.className += " active"; else evt.className += " active";
} }
@ -9581,10 +9520,8 @@ function renderStatsBox()
details.callsigns[call] = ~~details.callsigns[call] + 1; details.callsigns[call] = ~~details.callsigns[call] + 1;
if (g_QSOhash[i].time < details.oldest) if (g_QSOhash[i].time < details.oldest) { details.oldest = g_QSOhash[i].time; }
{ details.oldest = g_QSOhash[i].time; } if (g_QSOhash[i].time > details.newest) { details.newest = g_QSOhash[i].time; }
if (g_QSOhash[i].time > details.newest)
{ details.newest = g_QSOhash[i].time; }
workObject(modet.Mixed, true, band, mode, type, didConfirm); workObject(modet.Mixed, true, band, mode, type, didConfirm);
@ -9679,12 +9616,9 @@ function renderStatsBox()
long_distance.worked_hash = i; long_distance.worked_hash = i;
} }
if (!(band in long_distance.band)) if (!(band in long_distance.band)) { long_distance.band[band] = newDistanceObject(); }
{ long_distance.band[band] = newDistanceObject(); } if (!(mode in long_distance.mode)) { long_distance.mode[mode] = newDistanceObject(); }
if (!(mode in long_distance.mode)) if (!(type in long_distance.type)) { long_distance.type[type] = newDistanceObject(); }
{ long_distance.mode[mode] = newDistanceObject(); }
if (!(type in long_distance.type))
{ long_distance.type[type] = newDistanceObject(); }
if (unit > long_distance.mode[mode].worked_unit) if (unit > long_distance.mode[mode].worked_unit)
{ {
@ -9736,12 +9670,9 @@ function renderStatsBox()
short_distance.worked_hash = i; short_distance.worked_hash = i;
} }
if (!(band in short_distance.band)) if (!(band in short_distance.band)) { short_distance.band[band] = newDistanceObject(100000); }
{ short_distance.band[band] = newDistanceObject(100000); } if (!(mode in short_distance.mode)) { short_distance.mode[mode] = newDistanceObject(100000); }
if (!(mode in short_distance.mode)) if (!(type in short_distance.type)) { short_distance.type[type] = newDistanceObject(100000); }
{ short_distance.mode[mode] = newDistanceObject(100000); }
if (!(type in short_distance.type))
{ short_distance.type[type] = newDistanceObject(100000); }
if (unit < short_distance.mode[mode].worked_unit) if (unit < short_distance.mode[mode].worked_unit)
{ {
@ -9784,8 +9715,7 @@ function renderStatsBox()
} }
} }
if (!(g_dxccToAltName[finalDxcc] in worldGeoData)) if (!(g_dxccToAltName[finalDxcc] in worldGeoData)) { worldGeoData[g_dxccToAltName[finalDxcc]] = newStatObject(); }
{ worldGeoData[g_dxccToAltName[finalDxcc]] = newStatObject(); }
workObject( workObject(
worldGeoData[g_dxccToAltName[finalDxcc]], worldGeoData[g_dxccToAltName[finalDxcc]],
@ -9828,8 +9758,7 @@ function renderStatsBox()
{ {
if (g_gridToITUZone[gridCheck].length == 1) if (g_gridToITUZone[gridCheck].length == 1)
{ {
if (!(g_gridToITUZone[gridCheck][0] in ituZones)) if (!(g_gridToITUZone[gridCheck][0] in ituZones)) { ituZones[g_gridToITUZone[gridCheck][0]] = newStatObject(); }
{ ituZones[g_gridToITUZone[gridCheck][0]] = newStatObject(); }
workObject( workObject(
ituZones[g_gridToITUZone[gridCheck][0]], ituZones[g_gridToITUZone[gridCheck][0]],
@ -10183,11 +10112,9 @@ function createGtStationsTable(obj)
var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDX = " style='font-weight:bold;color:cyan;' ";
var bgDE = " style='font-weight:bold;color:yellow;' "; var bgDE = " style='font-weight:bold;color:yellow;' ";
if (typeof callsign.msg == "undefined" || callsign.msg == "") if (typeof callsign.msg == "undefined" || callsign.msg == "") { callsign.msg = "-"; }
{ callsign.msg = "-"; }
var ageString = ""; var ageString = "";
if (timeNowSec() - callsign.time < 3601) if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); }
{ ageString = (timeNowSec() - callsign.time).toDHMS(); }
else else
{ {
ageString = userTimeString(callsign.time * 1000); ageString = userTimeString(callsign.time * 1000);
@ -11104,8 +11031,7 @@ function setGtShareButtons()
g_mapSettings.offlineMode == false g_mapSettings.offlineMode == false
) )
{ {
if (g_appSettings.gtMsgEnable == true) if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; }
{ msgButton.style.display = "inline-block"; }
else msgButton.style.display = "none"; else msgButton.style.display = "none";
gtFlagButton.style.display = "inline-block"; gtFlagButton.style.display = "inline-block";
@ -11200,8 +11126,7 @@ function setMsgEnable(checkbox)
g_appSettings.gtMsgEnable = checkbox.checked; g_appSettings.gtMsgEnable = checkbox.checked;
if (g_appSettings.gtShareEnable == true) if (g_appSettings.gtShareEnable == true)
{ {
if (g_appSettings.gtMsgEnable == true) if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; }
{ msgButton.style.display = "inline-block"; }
else else
{ {
msgButton.style.display = "none"; msgButton.style.display = "none";
@ -11239,6 +11164,17 @@ function checkForNewVersion(showUptoDate)
} }
} }
function checkForNewAcks()
{
getBuffer(
"http://app.gridtracker.org/acknowledgements.json?lang=" + g_localeString,
updateAcks,
null,
http,
80
);
}
function renderBandActivity() function renderBandActivity()
{ {
var buffer = ""; var buffer = "";
@ -11674,8 +11610,7 @@ function CheckForwardPortIsNotReceivePort(value)
udpForwardIpInput.value == "127.0.0.1" && udpForwardIpInput.value == "127.0.0.1" &&
udpPortInput.value == value && udpPortInput.value == value &&
g_appSettings.wsjtIP == "" g_appSettings.wsjtIP == ""
) ) { return false; }
{ return false; }
return true; return true;
} }
@ -12093,8 +12028,7 @@ function workingCallsignsChanged(ele)
if (callsigns.length > 0) if (callsigns.length > 0)
{ {
g_appSettings.workingCallsigns = Object.assign({}, g_tempWorkingCallsigns); g_appSettings.workingCallsigns = Object.assign({}, g_tempWorkingCallsigns);
if (g_appSettings.workingCallsignEnable) if (g_appSettings.workingCallsignEnable) { applyCallsignsAndDateDiv.style.display = ""; }
{ applyCallsignsAndDateDiv.style.display = ""; }
} }
else applyCallsignsAndDateDiv.style.display = "none"; else applyCallsignsAndDateDiv.style.display = "none";
} }
@ -12197,8 +12131,7 @@ function callsignToDxcc(insign)
return -1; return -1;
} }
if (callsign in g_directCallToDXCC) if (callsign in g_directCallToDXCC) { return Number(g_directCallToDXCC[callsign]); }
{ return Number(g_directCallToDXCC[callsign]); }
if (callsign.includes("/")) if (callsign.includes("/"))
{ {
@ -12231,8 +12164,7 @@ function callsignToDxcc(insign)
} }
else callsign = parts[0]; else callsign = parts[0];
if (callsign in g_directCallToDXCC) if (callsign in g_directCallToDXCC) { return Number(g_directCallToDXCC[callsign]); }
{ return Number(g_directCallToDXCC[callsign]); }
} }
for (var x = callsign.length; x > 0; x--) for (var x = callsign.length; x > 0; x--)
@ -12276,8 +12208,7 @@ function loadMaidenHeadData()
delete g_worldGeoData[key].prefix; delete g_worldGeoData[key].prefix;
for (var x = 0; x < g_worldGeoData[key].mh.length; x++) for (var x = 0; x < g_worldGeoData[key].mh.length; x++)
{ {
if (!(g_worldGeoData[key].mh[x] in g_gridToDXCC)) if (!(g_worldGeoData[key].mh[x] in g_gridToDXCC)) { g_gridToDXCC[g_worldGeoData[key].mh[x]] = Array(); }
{ g_gridToDXCC[g_worldGeoData[key].mh[x]] = Array(); }
g_gridToDXCC[g_worldGeoData[key].mh[x]].push(g_worldGeoData[key].dxcc); g_gridToDXCC[g_worldGeoData[key].mh[x]].push(g_worldGeoData[key].dxcc);
} }
@ -12285,8 +12216,7 @@ function loadMaidenHeadData()
g_worldGeoData[key].dxcc != 291 && g_worldGeoData[key].dxcc != 291 &&
g_worldGeoData[key].dxcc != 110 && g_worldGeoData[key].dxcc != 110 &&
g_worldGeoData[key].dxcc != 6 g_worldGeoData[key].dxcc != 6
) ) { delete g_worldGeoData[key].mh; }
{ delete g_worldGeoData[key].mh; }
} }
file = "./data/dxcc.json"; file = "./data/dxcc.json";
@ -12304,16 +12234,14 @@ function loadMaidenHeadData()
for (var id in countyData) for (var id in countyData)
{ {
if (!(countyData[id].properties.st in g_stateToCounty)) if (!(countyData[id].properties.st in g_stateToCounty)) { g_stateToCounty[countyData[id].properties.st] = Array(); }
{ g_stateToCounty[countyData[id].properties.st] = Array(); }
g_stateToCounty[countyData[id].properties.st].push(id); g_stateToCounty[countyData[id].properties.st].push(id);
var cnty = var cnty =
countyData[id].properties.st + countyData[id].properties.st +
"," + "," +
countyData[id].properties.n.toUpperCase().replaceAll(" ", ""); countyData[id].properties.n.toUpperCase().replaceAll(" ", "");
if (!(cnty in g_cntyToCounty)) if (!(cnty in g_cntyToCounty)) { g_cntyToCounty[cnty] = countyData[id].properties.n.toProperCase(); }
{ g_cntyToCounty[cnty] = countyData[id].properties.n.toProperCase(); }
g_countyData[cnty] = {}; g_countyData[cnty] = {};
g_countyData[cnty].geo = countyData[id]; g_countyData[cnty].geo = countyData[id];
@ -12341,33 +12269,28 @@ function loadMaidenHeadData()
g_shapeData = JSON.parse(fs.readFileSync(g_shapeFile)); g_shapeData = JSON.parse(fs.readFileSync(g_shapeFile));
for (var key in g_shapeData) for (var key in g_shapeData)
{ {
if (g_shapeData[key].properties.alias == key) if (g_shapeData[key].properties.alias == key) { g_shapeData[key].properties.alias = null; }
{ g_shapeData[key].properties.alias = null; }
else if ( else if (
g_shapeData[key].properties.alias && g_shapeData[key].properties.alias &&
g_shapeData[key].properties.alias.length > 2 && g_shapeData[key].properties.alias.length > 2 &&
(g_shapeData[key].properties.alias.indexOf("US") == 0 || (g_shapeData[key].properties.alias.indexOf("US") == 0 ||
g_shapeData[key].properties.alias.indexOf("CA") == 0) g_shapeData[key].properties.alias.indexOf("CA") == 0)
) ) { g_shapeData[key].properties.alias = null; }
{ g_shapeData[key].properties.alias = null; }
if ( if (
g_shapeData[key].properties.alias && g_shapeData[key].properties.alias &&
g_shapeData[key].properties.alias.length < 2 g_shapeData[key].properties.alias.length < 2
) ) { g_shapeData[key].properties.alias = null; }
{ g_shapeData[key].properties.alias = null; }
if (g_shapeData[key].properties.alias != null) if (g_shapeData[key].properties.alias != null)
{ {
if (key.indexOf("CN-") == 0) if (key.indexOf("CN-") == 0)
{ {
if (g_shapeData[key].properties.alias == key.replace("CN-", "")) if (g_shapeData[key].properties.alias == key.replace("CN-", "")) { g_shapeData[key].properties.alias = null; }
{ g_shapeData[key].properties.alias = null; }
} }
} }
if ( if (
g_shapeData[key].properties.alias != null && g_shapeData[key].properties.alias != null &&
g_shapeData[key].properties.alias.length != 2 g_shapeData[key].properties.alias.length != 2
) ) { g_shapeData[key].properties.alias = null; }
{ g_shapeData[key].properties.alias = null; }
} }
// finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6 // finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6
@ -12429,8 +12352,7 @@ function loadMaidenHeadData()
{ {
for (var x = 0; x < g_StateData[key].mh.length; x++) for (var x = 0; x < g_StateData[key].mh.length; x++)
{ {
if (!(g_StateData[key].mh[x] in g_gridToState)) if (!(g_StateData[key].mh[x] in g_gridToState)) { g_gridToState[g_StateData[key].mh[x]] = Array(); }
{ g_gridToState[g_StateData[key].mh[x]] = Array(); }
g_gridToState[g_StateData[key].mh[x]].push(g_StateData[key].postal); g_gridToState[g_StateData[key].mh[x]].push(g_StateData[key].postal);
} }
g_StateData[key].worked_bands = {}; g_StateData[key].worked_bands = {};
@ -12480,8 +12402,7 @@ function loadMaidenHeadData()
{ {
for (var x = 0; x < g_cqZones[key].mh.length; x++) for (var x = 0; x < g_cqZones[key].mh.length; x++)
{ {
if (!(g_cqZones[key].mh[x] in g_gridToCQZone)) if (!(g_cqZones[key].mh[x] in g_gridToCQZone)) { g_gridToCQZone[g_cqZones[key].mh[x]] = Array(); }
{ g_gridToCQZone[g_cqZones[key].mh[x]] = Array(); }
g_gridToCQZone[g_cqZones[key].mh[x]].push(String(key)); g_gridToCQZone[g_cqZones[key].mh[x]].push(String(key));
} }
delete g_cqZones[key].mh; delete g_cqZones[key].mh;
@ -12494,8 +12415,7 @@ function loadMaidenHeadData()
{ {
for (var x = 0; x < g_ituZones[key].mh.length; x++) for (var x = 0; x < g_ituZones[key].mh.length; x++)
{ {
if (!(g_ituZones[key].mh[x] in g_gridToITUZone)) if (!(g_ituZones[key].mh[x] in g_gridToITUZone)) { g_gridToITUZone[g_ituZones[key].mh[x]] = Array(); }
{ g_gridToITUZone[g_ituZones[key].mh[x]] = Array(); }
g_gridToITUZone[g_ituZones[key].mh[x]].push(String(key)); g_gridToITUZone[g_ituZones[key].mh[x]].push(String(key));
} }
delete g_ituZones[key].mh; delete g_ituZones[key].mh;
@ -12804,6 +12724,12 @@ function versionCheck(buffer, flag)
} }
} }
function updateAcks(buffer)
{
g_acks = JSON.parse(buffer);
fs.writeFileSync("./data/acknowledgements.json", JSON.stringify(g_acks));
}
function onExitAppToGoWebsite() function onExitAppToGoWebsite()
{ {
require("nw.gui").Shell.openExternal("https://gridtracker.org/"); require("nw.gui").Shell.openExternal("https://gridtracker.org/");
@ -12850,8 +12776,7 @@ function getBuffer(file_url, callback, flag, mode, port, cache = null)
{ {
var fsize = res.headers["content-length"]; var fsize = res.headers["content-length"];
var cookies = null; var cookies = null;
if (typeof res.headers["set-cookie"] != "undefined") if (typeof res.headers["set-cookie"] != "undefined") { cookies = res.headers["set-cookie"]; }
{ cookies = res.headers["set-cookie"]; }
res res
.on("data", function (data) .on("data", function (data)
{ {
@ -12904,8 +12829,7 @@ function getPostBuffer(
{ {
var fsize = res.headers["content-length"]; var fsize = res.headers["content-length"];
var cookies = null; var cookies = null;
if (typeof res.headers["set-cookie"] != "undefined") if (typeof res.headers["set-cookie"] != "undefined") { cookies = res.headers["set-cookie"]; }
{ cookies = res.headers["set-cookie"]; }
res res
.on("data", function (data) .on("data", function (data)
{ {
@ -13138,8 +13062,7 @@ function changeMapValues()
g_appSettings.gtFlagImgSrc > 0 && g_appSettings.gtFlagImgSrc > 0 &&
g_mapSettings.offlineMode == false && g_mapSettings.offlineMode == false &&
g_appSettings.gtShareEnable == true g_appSettings.gtShareEnable == true
) ) { g_layerVectors.gtflags.setVisible(true); }
{ g_layerVectors.gtflags.setVisible(true); }
else g_layerVectors.gtflags.setVisible(false); else g_layerVectors.gtflags.setVisible(false);
saveMapSettings(); saveMapSettings();
@ -13565,8 +13488,7 @@ function setMsgSettingsView()
msgAlertMedia.style.display = "none"; msgAlertMedia.style.display = "none";
} }
if (g_msgSettings.msgAwaySelect > 0) if (g_msgSettings.msgAwaySelect > 0) { msgAwayTextDiv.style.display = "inline-block"; }
{ msgAwayTextDiv.style.display = "inline-block"; }
else msgAwayTextDiv.style.display = "none"; else msgAwayTextDiv.style.display = "none";
} }
@ -13606,8 +13528,7 @@ function loadAdifSettings()
} }
for (var key in g_adifLogSettings.startup) for (var key in g_adifLogSettings.startup)
{ {
if (document.getElementById(key) != null) if (document.getElementById(key) != null) { document.getElementById(key).checked = g_adifLogSettings.startup[key]; }
{ document.getElementById(key).checked = g_adifLogSettings.startup[key]; }
} }
for (var key in g_adifLogSettings.nickname) for (var key in g_adifLogSettings.nickname)
{ {
@ -14118,8 +14039,7 @@ var g_currentID = null;
function updateWsjtxListener(port) function updateWsjtxListener(port)
{ {
if (port == g_wsjtCurrentPort && g_appSettings.wsjtIP == g_wsjtCurrentIP) if (port == g_wsjtCurrentPort && g_appSettings.wsjtIP == g_wsjtCurrentIP) { return; }
{ return; }
if (g_wsjtUdpServer != null) if (g_wsjtUdpServer != null)
{ {
if (multicastEnable.checked == true && g_appSettings.wsjtIP != "") if (multicastEnable.checked == true && g_appSettings.wsjtIP != "")
@ -14486,8 +14406,7 @@ function loadLookupDetails()
} }
ValidateText(lookupLogin); ValidateText(lookupLogin);
ValidateText(lookupPassword); ValidateText(lookupPassword);
if (lookupService.value == "CALLOOK") if (lookupService.value == "CALLOOK") { lookupCredentials.style.display = "none"; }
{ lookupCredentials.style.display = "none"; }
else lookupCredentials.style.display = "block"; else lookupCredentials.style.display = "block";
} }
@ -14516,8 +14435,7 @@ function lookupValueChanged(what)
g_appSettings.lookupCallookPreferred = lookupCallookPreferred.checked; g_appSettings.lookupCallookPreferred = lookupCallookPreferred.checked;
lookupQrzTestResult.innerHTML = ""; lookupQrzTestResult.innerHTML = "";
g_qrzLookupSessionId = null; g_qrzLookupSessionId = null;
if (lookupService.value == "CALLOOK") if (lookupService.value == "CALLOOK") { lookupCredentials.style.display = "none"; }
{ lookupCredentials.style.display = "none"; }
else lookupCredentials.style.display = "block"; else lookupCredentials.style.display = "block";
if (ValidateText(lookupLogin) && ValidateText(lookupPassword)) if (ValidateText(lookupLogin) && ValidateText(lookupPassword))
{ {
@ -15089,8 +15007,7 @@ function getLookupCachedObject(
} }
return; return;
} }
if (request.result != null && resultFunction) if (request.result != null && resultFunction) { resultFunction(request.result, gridPass, false); }
{ resultFunction(request.result, gridPass, false); }
else if (noResultFunction) noResultFunction(call, gridPass); else if (noResultFunction) noResultFunction(call, gridPass);
}; };
@ -15582,8 +15499,7 @@ function saveToCsv(lookup)
if ( if (
getLookProp(lookup, "land").length > 0 && getLookProp(lookup, "land").length > 0 &&
country != getLookProp(lookup, "land") country != getLookProp(lookup, "land")
) ) { country = getLookProp(lookup, "land"); }
{ country = getLookProp(lookup, "land"); }
if (country == "United States") country = ""; if (country == "United States") country = "";
tryToWriteAdifToDocFolder( tryToWriteAdifToDocFolder(
@ -15671,8 +15587,7 @@ function joinCommaIf(camera1, camera2)
function joinIfBothWithDash(camera1, camera2) function joinIfBothWithDash(camera1, camera2)
{ {
if (camera1.length > 0 && camera2.length > 0) if (camera1.length > 0 && camera2.length > 0) { return camera1 + " / " + camera2; }
{ return camera1 + " / " + camera2; }
return ""; return "";
} }
@ -15775,8 +15690,7 @@ function searchLogForCallsign(call)
if (String(dxcc) + g_colorBands[band] in g_tracker.worked.dxcc) if (String(dxcc) + g_colorBands[band] in g_tracker.worked.dxcc)
{ {
var strike = ""; var strike = "";
if (String(dxcc) + g_colorBands[band] in g_tracker.confirmed.dxcc) if (String(dxcc) + g_colorBands[band] in g_tracker.confirmed.dxcc) { strike = "text-decoration: underline overline;"; }
{ strike = "text-decoration: underline overline;"; }
worker += worker +=
"<div style='" + "<div style='" +
strike + strike +
@ -15999,8 +15913,7 @@ function mediaCheck()
g_QSOhash[i].px == null g_QSOhash[i].px == null
) )
{ {
if (g_QSOhash[i].dxcc != -1) if (g_QSOhash[i].dxcc != -1) { g_QSOhash[i].px = getWpx(g_QSOhash[i].DEcall); }
{ g_QSOhash[i].px = getWpx(g_QSOhash[i].DEcall); }
else g_QSOhash[i].px = null; else g_QSOhash[i].px = null;
} }
g_QSOcount++; g_QSOcount++;
@ -16056,8 +15969,7 @@ function loadReceptionReports()
g_receptionReports = JSON.parse( g_receptionReports = JSON.parse(
fs.readFileSync(g_NWappData + "spots.json") fs.readFileSync(g_NWappData + "spots.json")
); );
if (timeNowSec() - g_receptionReports.lastDownloadTimeSec <= 86400) if (timeNowSec() - g_receptionReports.lastDownloadTimeSec <= 86400) { clear = false; }
{ clear = false; }
} }
if (clear == true) if (clear == true)
@ -16165,8 +16077,7 @@ function pskSpotResults(buffer, flag)
if ( if (
parseInt(json.receptionReport[key].flowStartSeconds) < parseInt(json.receptionReport[key].flowStartSeconds) <
report.when report.when
) ) { continue; }
{ continue; }
} }
else else
{ {
@ -16298,8 +16209,7 @@ function createSpot(report, key, fromPoint, addToLayer = true)
: workingColor == 361 : workingColor == 361
? "#FFFFFF" ? "#FFFFFF"
: "hsla(" + workingColor + ", 100%, 50%," + report.color / 255 + ")"; : "hsla(" + workingColor + ", 100%, 50%," + report.color / 255 + ")";
if (workingColor < 1 || workingColor == 361) if (workingColor < 1 || workingColor == 361) { spotColor = intAlphaToRGB(testColor.substr(0, 7), report.color); }
{ spotColor = intAlphaToRGB(testColor.substr(0, 7), report.color); }
else spotColor = testColor; else spotColor = testColor;
} }
@ -16469,8 +16379,7 @@ function spotPathChange()
spotPathColorDiv.style.color = "#FFF"; spotPathColorDiv.style.color = "#FFF";
spotPathColorDiv.style.backgroundColor = pathColor; spotPathColorDiv.style.backgroundColor = pathColor;
} }
if (g_receptionSettings.pathColor == -1) if (g_receptionSettings.pathColor == -1) { spotPathInfoTd.innerHTML = "PSK-Reporter Palette"; }
{ spotPathInfoTd.innerHTML = "PSK-Reporter Palette"; }
else spotPathInfoTd.innerHTML = ""; else spotPathInfoTd.innerHTML = "";
g_spotFlightColor = g_spotFlightColor =
@ -16497,8 +16406,7 @@ function spotPathChange()
spotNightPathColorDiv.style.color = "#FFF"; spotNightPathColorDiv.style.color = "#FFF";
spotNightPathColorDiv.style.backgroundColor = pathNightColor; spotNightPathColorDiv.style.backgroundColor = pathNightColor;
} }
if (g_receptionSettings.pathNightColor == -1) if (g_receptionSettings.pathNightColor == -1) { spotNightPathInfoTd.innerHTML = "PSK-Reporter Palette"; }
{ spotNightPathInfoTd.innerHTML = "PSK-Reporter Palette"; }
else spotNightPathInfoTd.innerHTML = ""; else spotNightPathInfoTd.innerHTML = "";
g_spotNightFlightColor = g_spotNightFlightColor =