From e9d9f8b24a3bf927040bd7f77227edcaafd631e8 Mon Sep 17 00:00:00 2001 From: Matthew Chambers Date: Sat, 19 Jun 2021 11:17:29 -0500 Subject: [PATCH] add functions to get acks json off website and overwrite file --- package.nw/lib/gt.js | 550 ++++++++++++++++++------------------------- 1 file changed, 229 insertions(+), 321 deletions(-) diff --git a/package.nw/lib/gt.js b/package.nw/lib/gt.js index 8a5d733..46a74db 100644 --- a/package.nw/lib/gt.js +++ b/package.nw/lib/gt.js @@ -7,8 +7,7 @@ var gtBeta = pjson.betaVersion; var g_startVersion = 0; -if (typeof localStorage.currentVersion != "undefined") -{ g_startVersion = localStorage.currentVersion; } +if (typeof localStorage.currentVersion != "undefined") { g_startVersion = localStorage.currentVersion; } if ( typeof localStorage.currentVersion == "undefined" || @@ -121,7 +120,7 @@ function loadAllSettings() // one-time override of oams pop-up messages: if pop-ups disabled // and new version, reset msgActionSelect to 1 (pop up) if (g_msgSettings.msgActionSelect == 0 && - String(gtVersion) != String(g_startVersion)) + String(gtVersion) != String(g_startVersion)) { g_msgSettings.msgActionSelect = 1; localStorage.msgSettings = JSON.stringify(g_msgSettings); @@ -331,7 +330,7 @@ function saveAndCloseApp() g_baWindowHandle.window.close(true); g_callRosterWindowHandle.window.close(true); } - catch (e) {} + catch (e) { } nw.App.quit(); } @@ -808,8 +807,7 @@ function toggleOffline() if (g_appSettings.gtShareEnable == true) { gtFlagButton.style.display = "inline-block"; - if (g_appSettings.gtMsgEnable == true) - { msgButton.style.display = "inline-block"; } + if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; } else msgButton.style.display = "none"; } else @@ -884,8 +882,7 @@ function toggleTime() function dateToString(dateTime) { - if (g_appSettings.useLocalTime == 1) - { return dateTime.toLocaleString().replace(/,/g, ""); } + if (g_appSettings.useLocalTime == 1) { return dateTime.toLocaleString().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))) { - while (prefixEnd + 1 != end && /\d/.test(callsign.charAt(prefixEnd + 1))) - { prefixEnd++; } + while (prefixEnd + 1 != end && /\d/.test(callsign.charAt(prefixEnd + 1))) { prefixEnd++; } foundPrefix = true; break; } @@ -970,8 +966,7 @@ function setState(details) { var isDigi = details.digital; - if (details.state.substr(0, 2) != "US") - { details.state = "US-" + details.state; } + if (details.state.substr(0, 2) != "US") { details.state = "US-" + details.state; } g_tracker.worked.state[details.state + details.band + details.mode] = true; g_tracker.worked.state[details.state] = true; @@ -1104,8 +1099,7 @@ function addDeDx( details.grid.length < 6 && (details.grid.substr(0, 4) == finalGrid.substr(0, 4) || details.grid.length == 0) - ) - { details.grid = finalGrid; } + ) { details.grid = finalGrid; } } if (finalRSTsent.length > 0) details.RSTsent = finalRSTsent; if (finalRSTrecv.length > 0) details.RSTrecv = finalRSTrecv; @@ -1157,8 +1151,7 @@ function addDeDx( if (details.dxcc > 0 && details.px == null) { details.px = getWpx(finalDXcall); - if (details.px) - { details.zone = Number(details.px.charAt(details.px.length - 1)); } + if (details.px) { details.zone = Number(details.px.charAt(details.px.length - 1)); } } if ( @@ -1530,8 +1523,7 @@ function addDeDx( if (newCallsign.cont == null) { newCallsign.cont = g_worldGeoData[g_dxccToGeoData[finalDxcc]].continent; - if (newCallsign.dxcc == 390 && newCallsign.zone == 1) - { newCallsign.cont = "EU"; } + if (newCallsign.dxcc == 390 && newCallsign.zone == 1) { newCallsign.cont = "EU"; } } } if (finalRSTsent != null) @@ -1602,8 +1594,7 @@ function addDeDx( if ( finalGrid.length == callsign.grid.length && finalGrid != callsign.grid - ) - { callsign.grid = finalGrid; } + ) { callsign.grid = finalGrid; } if (finalRSTsent != null) callsign.RSTsent = finalRSTsent; if (finalRSTrecv != null) callsign.RSTrecv = finalRSTrecv; callsign.vucc_grids = []; @@ -1625,8 +1616,7 @@ function timeoutSetUdpPort() function setUdpPort() { - if (g_setNewUdpPortTimeoutHandle != null) - { window.clearTimeout(g_setNewUdpPortTimeoutHandle); } + if (g_setNewUdpPortTimeoutHandle != null) { window.clearTimeout(g_setNewUdpPortTimeoutHandle); } lastMsgTimeDiv.innerHTML = "..setting.."; g_setNewUdpPortTimeoutHandle = window.setTimeout(timeoutSetUdpPort, 1000); } @@ -1713,8 +1703,7 @@ function changePathWidth() if (width == 0) { - if (typeof g_flightPaths[i].Arrow != "undefined") - { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); } + if (typeof g_flightPaths[i].Arrow != "undefined") { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); } g_layerSources.flight.removeFeature(g_flightPaths[i]); delete g_flightPaths[i]; g_flightPaths[i] = null; @@ -2125,8 +2114,7 @@ function createTooltTipTable(toolElement) added = true; } } - if (added == true) - { worker = worker.substr(0, worker.length - " / ".length); } + if (added == true) { worker = worker.substr(0, worker.length - " / ".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) { - if (KeyIsCall in g_liveCallsigns && g_appSettings.gridViewMode == 3) - { newCallList.push(g_liveCallsigns[KeyIsCall]); } + if (KeyIsCall in g_liveCallsigns && g_appSettings.gridViewMode == 3) { newCallList.push(g_liveCallsigns[KeyIsCall]); } } } } @@ -2180,8 +2167,7 @@ function createTooltTipTable(toolElement) } for (var KeyIsCall in toolElement.liveHash) { - if (KeyIsCall in g_liveCallsigns) - { newCallList.push(g_liveCallsigns[KeyIsCall]); } + if (KeyIsCall in g_liveCallsigns) { newCallList.push(g_liveCallsigns[KeyIsCall]); } } } newCallList.sort(compareCallsignTime).reverse(); @@ -2190,15 +2176,11 @@ function createTooltTipTable(toolElement) var callsign = newCallList[x]; var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDE = " style='font-weight:bold;color:yellow;' "; - if (callsign.DXcall == myDEcall) - { 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 (typeof callsign.msg == "undefined" || callsign.msg == "") - { callsign.msg = "-"; } + if (callsign.DXcall == myDEcall) { 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 (typeof callsign.msg == "undefined" || callsign.msg == "") { callsign.msg = "-"; } var ageString = ""; - if (timeNowSec() - callsign.time < 3601) - { ageString = (timeNowSec() - callsign.time).toDHMS(); } + if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); } else { ageString = userTimeString(callsign.time * 1000); @@ -2216,8 +2198,7 @@ function createTooltTipTable(toolElement) worker += "" + (callsign.delta > -1 ? callsign.delta : "-") + ""; worker += "" + callsign.RSTsent + ""; worker += "" + callsign.RSTrecv + "" + ""; - if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") - { worker += callsign.DXcall.formatCallsign(); } + if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") { worker += callsign.DXcall.formatCallsign(); } else { worker += @@ -2319,13 +2300,10 @@ function createTooltTipTableLogbook(toolElement) var callsign = newCallList[x]; var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDE = " style='font-weight:bold;color:yellow;' "; - if (callsign.DXcall == myDEcall) - { 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.DXcall == myDEcall) { bgDX = " style='background-color:cyan;color:#000;font-weight:bold' "; } + if (callsign.DEcall == myDEcall) { bgDE = " style='background-color:#FFFF00;color:#000;font-weight:bold' "; } var ageString = ""; - if (timeNowSec() - callsign.time < 3601) - { ageString = (timeNowSec() - callsign.time).toDHMS(); } + if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); } else { ageString = userTimeString(callsign.time * 1000); @@ -2343,8 +2321,7 @@ function createTooltTipTableLogbook(toolElement) worker += "" + (callsign.delta > -1 ? callsign.delta : "-") + ""; worker += "" + callsign.RSTsent + ""; worker += "" + callsign.RSTrecv + "" + ""; - if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") - { worker += callsign.DXcall.formatCallsign(); } + if (callsign.DXcall.indexOf("CQ") == 0 || callsign.DXcall == "-") { worker += callsign.DXcall.formatCallsign(); } else { worker += @@ -2390,15 +2367,15 @@ function createTooltTipTableLogbook(toolElement) if (callsign.DEcall in g_oqrsCallsigns) { worker += - "" + - "✔📬"; + "" + + "✔📬"; } else { worker += - ""; + ""; } } worker += ""; @@ -2428,7 +2405,7 @@ function renderTooltipWindow(feature) g_popupWindowHandle.width = parseInt(positionInfo.width) + 20; g_popupWindowHandle.height = parseInt(positionInfo.height) + 50; } - catch (e) {} + catch (e) { } } } @@ -2516,7 +2493,7 @@ function openConditionsWindow() g_conditionsWindowHandle.hide(); } } - catch (e) {} + catch (e) { } } } @@ -2607,7 +2584,7 @@ function openCallRosterWindow(show = true) g_callRosterWindowHandle.hide(); } } - catch (e) {} + catch (e) { } } } @@ -2619,7 +2596,7 @@ function updateRosterWorked() { g_callRosterWindowHandle.window.updateWorked(); } - catch (e) {} + catch (e) { } } } @@ -2631,7 +2608,7 @@ function updateRosterInstances() { g_callRosterWindowHandle.window.updateInstances(); } - catch (e) {} + catch (e) { } } } @@ -2688,7 +2665,7 @@ function openStatsWindow(show = true) g_statsWindowHandle.hide(); } } - catch (e) {} + catch (e) { } } } @@ -2733,7 +2710,7 @@ function showMessaging(show = true, cid) g_chatWindowHandle.focus(); if (typeof cid != "undefined") g_chatWindowHandle.window.openId(cid); } - catch (e) {} + catch (e) { } } } @@ -2787,7 +2764,7 @@ function onRightClickGridSquare(feature) { renderTooltipWindow(feature); } - catch (e) {} + catch (e) { } } mouseOutOfDataItem(); } @@ -2826,8 +2803,7 @@ function tempGridToBox(iQTH, oldGrid, borderColor, boxColor, layer) var LL = squareToLatLong(iQTH.substr(0, 4)); if (oldGrid) { - if (g_layerSources.temp.hasFeature(oldGrid)) - { g_layerSources.temp.removeFeature(oldGrid); } + if (g_layerSources.temp.hasFeature(oldGrid)) { g_layerSources.temp.removeFeature(oldGrid); } } var bounds = [ [LL.lo1, LL.la1], @@ -2919,8 +2895,7 @@ function onMyKeyDown(event) var param2 = null; if (typeof g_hotKeys[event.code].param2 != "undefined") { - if (typeof event[g_hotKeys[event.code].param2] != "undefined") - { param2 = event[g_hotKeys[event.code].param2]; } + if (typeof event[g_hotKeys[event.code].param2] != "undefined") { param2 = event[g_hotKeys[event.code].param2]; } } g_hotKeys[event.code].func(g_hotKeys[event.code].param1, param2); } @@ -2936,8 +2911,7 @@ function onMyKeyDown(event) var param2 = null; if (typeof g_hotKeys[event.key].param2 != "undefined") { - if (typeof event[g_hotKeys[event.key].param2] != "undefined") - { param2 = event[g_hotKeys[event.key].param2]; } + if (typeof event[g_hotKeys[event.key].param2] != "undefined") { param2 = event[g_hotKeys[event.key].param2]; } } g_hotKeys[event.key].func(g_hotKeys[event.key].param1, param2); } @@ -3098,7 +3072,7 @@ function toggleHelp() else helpDiv.style.display = "none"; } -function onMyKeyUp(event) {} +function onMyKeyUp(event) { } var g_currentOverlay = 0; @@ -3143,8 +3117,7 @@ function makeTitleInfo(mapWindow) news += " Layer: " + g_viewInfo[g_currentOverlay][1]; } - if (g_currentOverlay == 0 && g_appSettings.gridViewMode == 1) - { return news + end; } + if (g_currentOverlay == 0 && g_appSettings.gridViewMode == 1) { return news + end; } var workline = " - Worked " + @@ -3622,7 +3595,7 @@ function trophyOver(feature) { if ( g_gridToDXCC[name][x] == - g_StateData[g_gridToState[name][y]].dxcc && + g_StateData[g_gridToState[name][y]].dxcc && g_gridToDXCC[name][x] == 291 ) { @@ -3871,8 +3844,7 @@ function mouseUpGrid() if (g_tempGridBox) { - if (g_layerSources.temp.hasFeature(g_tempGridBox)) - { g_layerSources.temp.removeFeature(g_tempGridBox); } + if (g_layerSources.temp.hasFeature(g_tempGridBox)) { g_layerSources.temp.removeFeature(g_tempGridBox); } } g_tempGridBox = null; @@ -3963,8 +3935,7 @@ function mouseOverDataItem(mouseEvent, fromHover) if ( typeof mouseEvent.spot != "undefined" && g_receptionReports.spots[mouseEvent.spot].bearing > 180 - ) - { noRoomRight = true; } + ) { noRoomRight = true; } myTooltip.style.left = getMouseX() + 15 + "px"; top = parseInt(getMouseY() - 20 - (callListLength / 2) * 25); if (windowWidth - getMouseX() < positionInfo.width || noRoomRight == true) @@ -3999,8 +3970,7 @@ function mouseMoveDataItem(mouseEvent) if ( typeof mouseEvent.spot != "undefined" && g_receptionReports.spots[mouseEvent.spot].bearing > 180 - ) - { noRoomRight = true; } + ) { noRoomRight = true; } myTooltip.style.left = getMouseX() + 15 + "px"; top = Number(myTooltip.style.top); if (top > 20) top = getMouseY() - 20 + "px"; @@ -4040,7 +4010,7 @@ function reloadInfo(bandOrMode) { g_statsWindowHandle.window.reloadInfo(); } - catch (e) {} + catch (e) { } } } @@ -4290,8 +4260,7 @@ function qthToQsoBox( newRect.rectangle.qth = iQTH; - if (g_pushPinMode == false && entityVisibility == true) - { g_layerSources.qso.addFeature(newRect.rectangle); } + if (g_pushPinMode == false && entityVisibility == true) { g_layerSources.qso.addFeature(newRect.rectangle); } var newPin = g_colorLeafletQPins.worked[band]; if (confirmed) newPin = g_colorLeafletQPins.confirmed[band]; @@ -4306,8 +4275,7 @@ function qthToQsoBox( newRect.rectangle.pin.hashes[iHash] = 1; newRect.rectangle.pin.size = LL.size; - if (g_pushPinMode && entityVisibility == true) - { g_layerSources["qso-pins"].addFeature(newRect.rectangle.pin); } + if (g_pushPinMode && entityVisibility == true) { g_layerSources["qso-pins"].addFeature(newRect.rectangle.pin); } newRect.rectangle.locked = locked; newRect.rectangle.worked = worked; @@ -4335,8 +4303,7 @@ function qthToQsoBox( return rect.rectangle; } if (worked && !rect.rectangle.worked) rect.rectangle.worked = worked; - if (confirmed && !rect.rectangle.confirmed) - { rect.rectangle.confirmed = confirmed; } + if (confirmed && !rect.rectangle.confirmed) { rect.rectangle.confirmed = confirmed; } borderColor = g_mainBorderColor; if (myDEbox) borderWeight = 1; 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.size = LL.size; - if (g_pushPinMode && entityVisibility == true) - { g_layerSources["live-pins"].addFeature(newRect.rectangle.pin); } + if (g_pushPinMode && entityVisibility == true) { g_layerSources["live-pins"].addFeature(newRect.rectangle.pin); } newRect.rectangle.locked = locked; newRect.rectangle.size = LL.size; @@ -4819,8 +4785,7 @@ function animatePaths() { if (g_flightPaths[i].age < g_timeNow) { - if (typeof g_flightPaths[i].Arrow != "undefined") - { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); } + if (typeof g_flightPaths[i].Arrow != "undefined") { g_layerSources.flight.removeFeature(g_flightPaths[i].Arrow); } g_layerSources.flight.removeFeature(g_flightPaths[i]); delete g_flightPaths[i]; g_flightPaths[i] = null; @@ -5060,8 +5025,7 @@ function clearCalls() g_liveCallsigns[i].rect != null ) { - if (i in g_liveCallsigns[i].rect.liveHash) - { delete g_liveCallsigns[i].rect.liveHash[i]; } + if (i in g_liveCallsigns[i].rect.liveHash) { delete g_liveCallsigns[i].rect.liveHash[i]; } } } @@ -5251,8 +5215,7 @@ function displayTime() { if (now - time > 120000) { - if (g_layerSources.strikes.hasFeature(g_bolts[time])) - { g_layerSources.strikes.removeFeature(g_bolts[time]); } + if (g_layerSources.strikes.hasFeature(g_bolts[time])) { g_layerSources.strikes.removeFeature(g_bolts[time]); } delete g_bolts[time]; } } @@ -5432,8 +5395,7 @@ function toggleStrikeGlobal() var worker = "Strike Distance Changed
" + msg + "
"; - if (g_mapSettings.strikes == false) - { worker += "
Detection is not enabled!"; } + if (g_mapSettings.strikes == false) { worker += "
Detection is not enabled!"; } addLastTraffic(worker); g_layerSources.strikes.clear(); @@ -5458,8 +5420,7 @@ function setStrikeDistance() var send = "{\"west\":-180,\"east\":180,\"north\":-90,\"south\":-90}"; - if (g_strikeInterval == null) - { g_strikeInterval = setInterval(setStrikeDistance, 300000); } + if (g_strikeInterval == null) { g_strikeInterval = setInterval(setStrikeDistance, 300000); } try { @@ -5989,8 +5950,7 @@ function toggleNexrad() g_Nexrad = createNexRad(); g_map.addLayer(g_Nexrad); - if (g_nexradInterval == null) - { g_nexradInterval = setInterval(nexradRefresh, 600000); } + if (g_nexradInterval == null) { g_nexradInterval = setInterval(nexradRefresh, 600000); } } else { @@ -6355,8 +6315,7 @@ function setCallAndGrid(callsign, grid, instance = null) length = encodeQUTF8(responseArray, length, callsign); var hash = liveHash(callsign, thisInstance.Band, thisInstance.MO); - if (hash in g_liveCallsigns && g_liveCallsigns[hash].grid.length > 1) - { grid = g_liveCallsigns[hash].grid; } + if (hash in g_liveCallsigns && g_liveCallsigns[hash].grid.length > 1) { grid = g_liveCallsigns[hash].grid; } if (grid.length == 0) grid = " "; @@ -6422,7 +6381,7 @@ function handleWsjtxQSO(newMessage) g_oldQSOTimer = setTimeout(oldSendToLogger, 3000); } -function handleWsjtxNotSupported(newMessage) {} +function handleWsjtxNotSupported(newMessage) { } var g_gtShareCount = 0; var g_lastBand = ""; @@ -6506,7 +6465,7 @@ function handleWsjtxStatus(newMessage) { g_callRosterWindowHandle.window.processStatus(newMessage); } - catch (e) {} + catch (e) { } } if (g_activeInstance == "") @@ -6527,11 +6486,9 @@ function handleWsjtxStatus(newMessage) if (DXcall.length > 1) { - if (!(newMessage.instance in g_lastTransmitCallsign)) - { g_lastTransmitCallsign[newMessage.instance] = ""; } + if (!(newMessage.instance in g_lastTransmitCallsign)) { g_lastTransmitCallsign[newMessage.instance] = ""; } - if (!(newMessage.instance in g_lastStatusCallsign)) - { g_lastStatusCallsign[newMessage.instance] = ""; } + if (!(newMessage.instance in g_lastStatusCallsign)) { g_lastStatusCallsign[newMessage.instance] = ""; } if ( lookupOnTx.checked == true && @@ -6682,8 +6639,7 @@ function handleWsjtxStatus(newMessage) localDXReport.innerHTML = Number( newMessage.Report.trim() ).formatSignalReport(); - if (DXcall.length > 0) - { localDXCountry.innerHTML = g_dxccToAltName[callsignToDxcc(DXcall)]; } + if (DXcall.length > 0) { localDXCountry.innerHTML = g_dxccToAltName[callsignToDxcc(DXcall)]; } else localDXCountry.innerHTML = " "; } else @@ -7038,10 +6994,8 @@ function handleWsjtxDecode(newMessage) } if (validQTH) msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); - if (validQTH == false && decodeWords.length == 3) - { msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); } - if (validQTH == false && decodeWords.length == 2) - { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); } + if (validQTH == false && decodeWords.length == 3) { msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); } + if (validQTH == false && decodeWords.length == 2) { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); } if (decodeWords[0] == "CQ") { CQ = true; @@ -7057,8 +7011,7 @@ function handleWsjtxDecode(newMessage) } if (decodeWords.length >= 3 && CQ == true && validQTH == false) { - if (validateNumAndLetter(decodeWords[decodeWords.length - 1].trim())) - { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); } + if (validateNumAndLetter(decodeWords[decodeWords.length - 1].trim())) { msgDEcallsign = decodeWords[decodeWords.length - 1].trim(); } else msgDEcallsign = decodeWords[decodeWords.length - 2].trim(); } @@ -7075,8 +7028,7 @@ function handleWsjtxDecode(newMessage) if (validQTH == "" && msgDEcallsign in g_gtCallsigns) { - if (g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid.length > 0) - { validQTH = g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid; } + if (g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid.length > 0) { validQTH = g_gtFlagPins[g_gtCallsigns[msgDEcallsign]].grid; } } var canPath = false; @@ -7156,8 +7108,7 @@ function handleWsjtxDecode(newMessage) newCallsign.cont = g_worldGeoData[g_dxccToGeoData[newCallsign.dxcc]].continent; - if (newCallsign.dxcc == 390 && newCallsign.zone == 1) - { details.cont = "EU"; } + if (newCallsign.dxcc == 390 && newCallsign.zone == 1) { details.cont = "EU"; } } newCallsign.ituza = Array(); @@ -7320,8 +7271,7 @@ function handleWsjtxDecode(newMessage) if ( g_gtCallsigns[callsign.DEcall] in g_gtFlagPins && 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) { // maybe it's DEL, or WYO. check the first two letters - if (CCd.substr(0, 2) in g_shapeData) - { locality = g_shapeData[CCd.substr(0, 2)]; } + if (CCd.substr(0, 2) in g_shapeData) { locality = g_shapeData[CCd.substr(0, 2)]; } } if (locality == null) @@ -7554,24 +7503,24 @@ function handleWsjtxDecode(newMessage) g_lastMessages.unshift( "" + - userTimeString(theTimeStamp * 1000) + - "" + - newMessage.SR + - "" + - newMessage.DT.toFixed(1) + - "" + - newF + - "" + - newMessage.MO + - "" + - htmlEntities(newMessage.Msg) + - "" + - countryName + - "" + bgColor + + "'>" + + userTimeString(theTimeStamp * 1000) + + "" + + newMessage.SR + + "" + + newMessage.DT.toFixed(1) + + "" + + newF + + "" + + newMessage.MO + + "" + + htmlEntities(newMessage.Msg) + + "" + + countryName + + "" ); while (g_lastMessages.length > 100) g_lastMessages.pop(); @@ -7632,13 +7581,11 @@ function handleWsjtxClear(newMessage) if ( g_liveCallsigns[hash].instance == newMessage.instance || g_liveCallsigns[hash].mode == g_instances[newMessage.instance].status.MO - ) - { delete g_liveCallsigns[hash]; } + ) { delete g_liveCallsigns[hash]; } } for (var call in g_callRoster) { - if (g_callRoster[call].callObj.instance == newMessage.instance) - { delete g_callRoster[call]; } + if (g_callRoster[call].callObj.instance == newMessage.instance) { delete g_callRoster[call]; } } redrawGrids(); @@ -7667,12 +7614,11 @@ function goProcessRoster(isRealtime = false) { if (isRealtime == true) { - if (g_callRosterWindowHandle.window.g_rosterSettings.realtime == false) - { return; } + if (g_callRosterWindowHandle.window.g_rosterSettings.realtime == false) { return; } } g_callRosterWindowHandle.window.processRoster(g_callRoster); } - catch (e) {} + catch (e) { } } } @@ -7713,13 +7659,13 @@ function handleWsjtxWSPR(newMessage) Number(newMessage.SR), timeNowSec(), "Pwr:" + - newMessage.Power + - " Freq:" + - Number(newMessage.Frequency / 1000).formatMhz(3, 3) + - " Delta:" + - Number(newMessage.DT).toFixed(2) + - " Drift:" + - newMessage.Drift, + newMessage.Power + + " Freq:" + + Number(newMessage.Frequency / 1000).formatMhz(3, 3) + + " Delta:" + + Number(newMessage.DT).toFixed(2) + + " Drift:" + + newMessage.Drift, "WSPR", Number(newMessage.Frequency / 1000000).formatBand(), false, @@ -7935,8 +7881,7 @@ function showCallsignBox(redraw) (thisCall in g_tracker.confirmed.call ? "✔" : "") + ""; var ageString = ""; - if (timeNowSec() - newCallList[x].time < 3601) - { ageString = (timeNowSec() - newCallList[x].time).toDHMS(); } + if (timeNowSec() - newCallList[x].time < 3601) { ageString = (timeNowSec() - newCallList[x].time).toDHMS(); } else { ageString = userTimeString(newCallList[x].time * 1000); @@ -8113,8 +8058,7 @@ function myDxccCompare(a, b) function myDxccIntCompare(a, b) { if (!(a in g_dxccToAltName)) return 0; - if (!(b in g_dxccToAltName)) - { return g_dxccToAltName[a].localeCompare(g_dxccToAltName[b]); } + if (!(b in g_dxccToAltName)) { return g_dxccToAltName[a].localeCompare(g_dxccToAltName[b]); } } function myTimeCompare(a, b) @@ -8284,7 +8228,7 @@ function showWorkedBox(sortIndex, nextPage, redraw) var unconfirmedCallsKey = new UnconfirmedCallsKey(list[key].dxcc, list[key].band); if ( g_unconfirmedCalls.has(unconfirmedCallsKey.key) && - list[key].confirmed + list[key].confirmed ) { g_unconfirmedCalls.set(unconfirmedCallsKey.key, unconfirmedCallsSentinel); @@ -8332,14 +8276,12 @@ function showWorkedBox(sortIndex, nextPage, redraw) g_filterMode == "Phone" && value.mode in g_modes_phone && g_modes_phone[value.mode] - ) - { return true; } + ) { return true; } if ( g_filterMode == "Digital" && value.mode in g_modes && g_modes[value.mode] - ) - { return true; } + ) { return true; } return value.mode == g_filterMode; }); } @@ -8884,14 +8826,14 @@ function showDXCCsBox() Object.keys(List).forEach(function (key, i) { var band = - g_appSettings.gtBandFilter == "auto" - ? myBand - : g_appSettings.gtBandFilter.length == 0 - ? "" - : g_appSettings.gtBandFilter; + g_appSettings.gtBandFilter == "auto" + ? myBand + : g_appSettings.gtBandFilter.length == 0 + ? "" + : g_appSettings.gtBandFilter; var unconfirmedCallsKey = new UnconfirmedCallsKey(List[key].dxcc, band); if (g_unconfirmedCalls.has(unconfirmedCallsKey.key) && - g_unconfirmedCalls.get(unconfirmedCallsKey.key) != unconfirmedCallsSentinel + g_unconfirmedCalls.get(unconfirmedCallsKey.key) != unconfirmedCallsSentinel ) { var onMousedown = function (e) @@ -8931,8 +8873,7 @@ function showDXCCsBox() } }; var unconfirmedTd = g_statsWindowHandle.window.document.getElementById("unconfirmed" + List[key].dxcc + "Id"); - if (unconfirmedTd != null) - { unconfirmedTd.addEventListener("mousedown", onMousedown); } + if (unconfirmedTd != null) { unconfirmedTd.addEventListener("mousedown", onMousedown); } } }); } @@ -9241,7 +9182,7 @@ function openBaWindow(show = true) g_baWindowHandle.hide(); } } - catch (e) {} + catch (e) { } } } @@ -9293,7 +9234,7 @@ function openLookupWindow(show = false) g_lookupWindowHandle.window.saveScreenSettings(); } } - catch (e) {} + catch (e) { } } } @@ -9335,8 +9276,7 @@ function openInfoTab(evt, tabName, callFunc, callObj) } if (evt) { - if (typeof evt.currentTarget != "undefined") - { evt.currentTarget.className += " active"; } + if (typeof evt.currentTarget != "undefined") { evt.currentTarget.className += " active"; } else evt.className += " active"; } @@ -9370,8 +9310,7 @@ function openSettingsTab(evt, tabName) displayAlerts(); // Show the current tab, and add an "active" class to the button that opened the tab document.getElementById(tabName).style.display = "block"; - if (typeof evt.currentTarget != "undefined") - { evt.currentTarget.className += " active"; } + if (typeof evt.currentTarget != "undefined") { evt.currentTarget.className += " active"; } else evt.className += " active"; } @@ -9581,10 +9520,8 @@ function renderStatsBox() details.callsigns[call] = ~~details.callsigns[call] + 1; - if (g_QSOhash[i].time < details.oldest) - { 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.oldest) { details.oldest = 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); @@ -9679,12 +9616,9 @@ function renderStatsBox() long_distance.worked_hash = i; } - if (!(band in long_distance.band)) - { long_distance.band[band] = newDistanceObject(); } - if (!(mode in long_distance.mode)) - { long_distance.mode[mode] = newDistanceObject(); } - if (!(type in long_distance.type)) - { long_distance.type[type] = newDistanceObject(); } + if (!(band in long_distance.band)) { long_distance.band[band] = newDistanceObject(); } + if (!(mode in long_distance.mode)) { long_distance.mode[mode] = newDistanceObject(); } + if (!(type in long_distance.type)) { long_distance.type[type] = newDistanceObject(); } if (unit > long_distance.mode[mode].worked_unit) { @@ -9736,12 +9670,9 @@ function renderStatsBox() short_distance.worked_hash = i; } - if (!(band in short_distance.band)) - { short_distance.band[band] = newDistanceObject(100000); } - if (!(mode in short_distance.mode)) - { short_distance.mode[mode] = newDistanceObject(100000); } - if (!(type in short_distance.type)) - { short_distance.type[type] = newDistanceObject(100000); } + if (!(band in short_distance.band)) { short_distance.band[band] = newDistanceObject(100000); } + if (!(mode in short_distance.mode)) { 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) { @@ -9784,8 +9715,7 @@ function renderStatsBox() } } - if (!(g_dxccToAltName[finalDxcc] in worldGeoData)) - { worldGeoData[g_dxccToAltName[finalDxcc]] = newStatObject(); } + if (!(g_dxccToAltName[finalDxcc] in worldGeoData)) { worldGeoData[g_dxccToAltName[finalDxcc]] = newStatObject(); } workObject( worldGeoData[g_dxccToAltName[finalDxcc]], @@ -9828,8 +9758,7 @@ function renderStatsBox() { if (g_gridToITUZone[gridCheck].length == 1) { - if (!(g_gridToITUZone[gridCheck][0] in ituZones)) - { ituZones[g_gridToITUZone[gridCheck][0]] = newStatObject(); } + if (!(g_gridToITUZone[gridCheck][0] in ituZones)) { ituZones[g_gridToITUZone[gridCheck][0]] = newStatObject(); } workObject( ituZones[g_gridToITUZone[gridCheck][0]], @@ -10183,11 +10112,9 @@ function createGtStationsTable(obj) var bgDX = " style='font-weight:bold;color:cyan;' "; var bgDE = " style='font-weight:bold;color:yellow;' "; - if (typeof callsign.msg == "undefined" || callsign.msg == "") - { callsign.msg = "-"; } + if (typeof callsign.msg == "undefined" || callsign.msg == "") { callsign.msg = "-"; } var ageString = ""; - if (timeNowSec() - callsign.time < 3601) - { ageString = (timeNowSec() - callsign.time).toDHMS(); } + if (timeNowSec() - callsign.time < 3601) { ageString = (timeNowSec() - callsign.time).toDHMS(); } else { ageString = userTimeString(callsign.time * 1000); @@ -11104,8 +11031,7 @@ function setGtShareButtons() g_mapSettings.offlineMode == false ) { - if (g_appSettings.gtMsgEnable == true) - { msgButton.style.display = "inline-block"; } + if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; } else msgButton.style.display = "none"; gtFlagButton.style.display = "inline-block"; @@ -11132,7 +11058,7 @@ function setGtShareButtons() { g_chatWindowHandle.hide(); } - catch (e) {} + catch (e) { } } } @@ -11200,8 +11126,7 @@ function setMsgEnable(checkbox) g_appSettings.gtMsgEnable = checkbox.checked; if (g_appSettings.gtShareEnable == true) { - if (g_appSettings.gtMsgEnable == true) - { msgButton.style.display = "inline-block"; } + if (g_appSettings.gtMsgEnable == true) { msgButton.style.display = "inline-block"; } else { 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() { var buffer = ""; @@ -11395,9 +11331,9 @@ function pskGetBandActivity() { getBuffer( "https://pskreporter.info/cgi-bin/psk-freq.pl?mode=" + - myMode + - "&grid=" + - myDEGrid.substr(0, 4), + myMode + + "&grid=" + + myDEGrid.substr(0, 4), pskBandActivityCallback, null, "https", @@ -11625,7 +11561,7 @@ function updateBasedOnIni() localStorage.N1MMSettings = JSON.stringify(g_N1MMSettings); alert( which.appName + - " N1MM Logger+ is enabled with same settings, disabled GridTracker N1MM logger" + " N1MM Logger+ is enabled with same settings, disabled GridTracker N1MM logger" ); } } @@ -11674,8 +11610,7 @@ function CheckForwardPortIsNotReceivePort(value) udpForwardIpInput.value == "127.0.0.1" && udpPortInput.value == value && g_appSettings.wsjtIP == "" - ) - { return false; } + ) { return false; } return true; } @@ -12093,8 +12028,7 @@ function workingCallsignsChanged(ele) if (callsigns.length > 0) { g_appSettings.workingCallsigns = Object.assign({}, g_tempWorkingCallsigns); - if (g_appSettings.workingCallsignEnable) - { applyCallsignsAndDateDiv.style.display = ""; } + if (g_appSettings.workingCallsignEnable) { applyCallsignsAndDateDiv.style.display = ""; } } else applyCallsignsAndDateDiv.style.display = "none"; } @@ -12197,8 +12131,7 @@ function callsignToDxcc(insign) return -1; } - if (callsign in g_directCallToDXCC) - { return Number(g_directCallToDXCC[callsign]); } + if (callsign in g_directCallToDXCC) { return Number(g_directCallToDXCC[callsign]); } if (callsign.includes("/")) { @@ -12231,8 +12164,7 @@ function callsignToDxcc(insign) } else callsign = parts[0]; - if (callsign in g_directCallToDXCC) - { return Number(g_directCallToDXCC[callsign]); } + if (callsign in g_directCallToDXCC) { return Number(g_directCallToDXCC[callsign]); } } for (var x = callsign.length; x > 0; x--) @@ -12276,8 +12208,7 @@ function loadMaidenHeadData() delete g_worldGeoData[key].prefix; for (var x = 0; x < g_worldGeoData[key].mh.length; x++) { - if (!(g_worldGeoData[key].mh[x] in g_gridToDXCC)) - { g_gridToDXCC[g_worldGeoData[key].mh[x]] = Array(); } + if (!(g_worldGeoData[key].mh[x] in g_gridToDXCC)) { g_gridToDXCC[g_worldGeoData[key].mh[x]] = Array(); } 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 != 110 && g_worldGeoData[key].dxcc != 6 - ) - { delete g_worldGeoData[key].mh; } + ) { delete g_worldGeoData[key].mh; } } file = "./data/dxcc.json"; @@ -12304,16 +12234,14 @@ function loadMaidenHeadData() for (var id in countyData) { - if (!(countyData[id].properties.st in g_stateToCounty)) - { g_stateToCounty[countyData[id].properties.st] = Array(); } + if (!(countyData[id].properties.st in g_stateToCounty)) { g_stateToCounty[countyData[id].properties.st] = Array(); } g_stateToCounty[countyData[id].properties.st].push(id); var cnty = countyData[id].properties.st + "," + countyData[id].properties.n.toUpperCase().replaceAll(" ", ""); - if (!(cnty in g_cntyToCounty)) - { g_cntyToCounty[cnty] = countyData[id].properties.n.toProperCase(); } + if (!(cnty in g_cntyToCounty)) { g_cntyToCounty[cnty] = countyData[id].properties.n.toProperCase(); } g_countyData[cnty] = {}; g_countyData[cnty].geo = countyData[id]; @@ -12341,33 +12269,28 @@ function loadMaidenHeadData() g_shapeData = JSON.parse(fs.readFileSync(g_shapeFile)); for (var key in g_shapeData) { - if (g_shapeData[key].properties.alias == key) - { g_shapeData[key].properties.alias = null; } + if (g_shapeData[key].properties.alias == key) { g_shapeData[key].properties.alias = null; } else if ( g_shapeData[key].properties.alias && g_shapeData[key].properties.alias.length > 2 && (g_shapeData[key].properties.alias.indexOf("US") == 0 || g_shapeData[key].properties.alias.indexOf("CA") == 0) - ) - { g_shapeData[key].properties.alias = null; } + ) { g_shapeData[key].properties.alias = null; } if ( g_shapeData[key].properties.alias && 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 (key.indexOf("CN-") == 0) { - if (g_shapeData[key].properties.alias == key.replace("CN-", "")) - { g_shapeData[key].properties.alias = null; } + if (g_shapeData[key].properties.alias == key.replace("CN-", "")) { g_shapeData[key].properties.alias = null; } } } if ( g_shapeData[key].properties.alias != null && 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 @@ -12429,8 +12352,7 @@ function loadMaidenHeadData() { for (var x = 0; x < g_StateData[key].mh.length; x++) { - if (!(g_StateData[key].mh[x] in g_gridToState)) - { g_gridToState[g_StateData[key].mh[x]] = Array(); } + if (!(g_StateData[key].mh[x] in g_gridToState)) { g_gridToState[g_StateData[key].mh[x]] = Array(); } g_gridToState[g_StateData[key].mh[x]].push(g_StateData[key].postal); } g_StateData[key].worked_bands = {}; @@ -12480,8 +12402,7 @@ function loadMaidenHeadData() { for (var x = 0; x < g_cqZones[key].mh.length; x++) { - if (!(g_cqZones[key].mh[x] in g_gridToCQZone)) - { g_gridToCQZone[g_cqZones[key].mh[x]] = Array(); } + if (!(g_cqZones[key].mh[x] in g_gridToCQZone)) { g_gridToCQZone[g_cqZones[key].mh[x]] = Array(); } g_gridToCQZone[g_cqZones[key].mh[x]].push(String(key)); } delete g_cqZones[key].mh; @@ -12494,8 +12415,7 @@ function loadMaidenHeadData() { for (var x = 0; x < g_ituZones[key].mh.length; x++) { - if (!(g_ituZones[key].mh[x] in g_gridToITUZone)) - { g_gridToITUZone[g_ituZones[key].mh[x]] = Array(); } + if (!(g_ituZones[key].mh[x] in g_gridToITUZone)) { g_gridToITUZone[g_ituZones[key].mh[x]] = Array(); } g_gridToITUZone[g_ituZones[key].mh[x]].push(String(key)); } delete g_ituZones[key].mh; @@ -12670,9 +12590,9 @@ function drawAllGrids() { var LL = squareToLatLong( String.fromCharCode(x) + - String.fromCharCode(y) + - String(a) + - String(b) + String.fromCharCode(y) + + String(a) + + String(b) ); var Lat = LL.la2 - (LL.la2 - LL.la1) / 2; var Lon = LL.lo2 - (LL.lo2 - LL.lo1) / 2; @@ -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() { 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 cookies = null; - if (typeof res.headers["set-cookie"] != "undefined") - { cookies = res.headers["set-cookie"]; } + if (typeof res.headers["set-cookie"] != "undefined") { cookies = res.headers["set-cookie"]; } res .on("data", function (data) { @@ -12904,8 +12829,7 @@ function getPostBuffer( { var fsize = res.headers["content-length"]; var cookies = null; - if (typeof res.headers["set-cookie"] != "undefined") - { cookies = res.headers["set-cookie"]; } + if (typeof res.headers["set-cookie"] != "undefined") { cookies = res.headers["set-cookie"]; } res .on("data", function (data) { @@ -13138,8 +13062,7 @@ function changeMapValues() g_appSettings.gtFlagImgSrc > 0 && g_mapSettings.offlineMode == false && g_appSettings.gtShareEnable == true - ) - { g_layerVectors.gtflags.setVisible(true); } + ) { g_layerVectors.gtflags.setVisible(true); } else g_layerVectors.gtflags.setVisible(false); saveMapSettings(); @@ -13382,7 +13305,7 @@ function initSoundCards() .catch(errorCallback); } -function errorCallback(e) {} +function errorCallback(e) { } function gotAudioDevices(deviceInfos) { soundCardDiv.innerHTML = ""; @@ -13565,8 +13488,7 @@ function setMsgSettingsView() msgAlertMedia.style.display = "none"; } - if (g_msgSettings.msgAwaySelect > 0) - { msgAwayTextDiv.style.display = "inline-block"; } + if (g_msgSettings.msgAwaySelect > 0) { msgAwayTextDiv.style.display = "inline-block"; } else msgAwayTextDiv.style.display = "none"; } @@ -13606,8 +13528,7 @@ function loadAdifSettings() } for (var key in g_adifLogSettings.startup) { - if (document.getElementById(key) != null) - { document.getElementById(key).checked = g_adifLogSettings.startup[key]; } + if (document.getElementById(key) != null) { document.getElementById(key).checked = g_adifLogSettings.startup[key]; } } for (var key in g_adifLogSettings.nickname) { @@ -13755,7 +13676,7 @@ function startupButtonsAndInputs() setGtShareButtons(); } - catch (e) {} + catch (e) { } } function startupEventsAndTimers() @@ -14042,7 +13963,7 @@ function updateForwardListener() reuseAddr: true }); - g_forwardUdpServer.on("listening", function () {}); + g_forwardUdpServer.on("listening", function () { }); g_forwardUdpServer.on("error", function () { g_forwardUdpServer.close(); @@ -14118,8 +14039,7 @@ var g_currentID = null; function updateWsjtxListener(port) { - if (port == g_wsjtCurrentPort && g_appSettings.wsjtIP == g_wsjtCurrentIP) - { return; } + if (port == g_wsjtCurrentPort && g_appSettings.wsjtIP == g_wsjtCurrentIP) { return; } if (g_wsjtUdpServer != null) { if (multicastEnable.checked == true && g_appSettings.wsjtIP != "") @@ -14128,7 +14048,7 @@ function updateWsjtxListener(port) { g_wsjtUdpServer.dropMembership(g_appSettings.wsjtIP); } - catch (e) {} + catch (e) { } } g_wsjtUdpServer.close(); g_wsjtUdpServer = null; @@ -14486,8 +14406,7 @@ function loadLookupDetails() } ValidateText(lookupLogin); ValidateText(lookupPassword); - if (lookupService.value == "CALLOOK") - { lookupCredentials.style.display = "none"; } + if (lookupService.value == "CALLOOK") { lookupCredentials.style.display = "none"; } else lookupCredentials.style.display = "block"; } @@ -14516,8 +14435,7 @@ function lookupValueChanged(what) g_appSettings.lookupCallookPreferred = lookupCallookPreferred.checked; lookupQrzTestResult.innerHTML = ""; g_qrzLookupSessionId = null; - if (lookupService.value == "CALLOOK") - { lookupCredentials.style.display = "none"; } + if (lookupService.value == "CALLOOK") { lookupCredentials.style.display = "none"; } else lookupCredentials.style.display = "block"; if (ValidateText(lookupLogin) && ValidateText(lookupPassword)) { @@ -14724,10 +14642,10 @@ function GetSessionID(resultTd, useCache) { getBuffer( "https://ssl.qrzcq.com/xml?username=" + - g_appSettings.lookupLoginCq + - "&password=" + - encodeURIComponent(g_appSettings.lookupPasswordCq) + - "&agent=GridTracker1.18", + g_appSettings.lookupLoginCq + + "&password=" + + encodeURIComponent(g_appSettings.lookupPasswordCq) + + "&agent=GridTracker1.18", qrzGetSessionCallback, resultTd, "https", @@ -14739,9 +14657,9 @@ function GetSessionID(resultTd, useCache) { getBuffer( "https://xmldata.qrz.com/xml/current/?username=" + - g_appSettings.lookupLoginQrz + - ";password=" + - encodeURIComponent(g_appSettings.lookupPasswordQrz), + g_appSettings.lookupLoginQrz + + ";password=" + + encodeURIComponent(g_appSettings.lookupPasswordQrz), qrzGetSessionCallback, resultTd, "https", @@ -14753,9 +14671,9 @@ function GetSessionID(resultTd, useCache) { getBuffer( "https://www.hamqth.com/xml.php?u=" + - g_appSettings.lookupLoginQth + - "&p=" + - encodeURIComponent(g_appSettings.lookupPasswordQth), + g_appSettings.lookupLoginQth + + "&p=" + + encodeURIComponent(g_appSettings.lookupPasswordQth), hamQthGetSessionCallback, resultTd, "https", @@ -14868,10 +14786,10 @@ function GetLookup(useCache) { getBuffer( "https://ssl.qrzcq.com/xml?s=" + - g_qrzLookupSessionId + - "&callsign=" + - g_qrzLookupCallsign + - "&agent=GridTracker", + g_qrzLookupSessionId + + "&callsign=" + + g_qrzLookupCallsign + + "&agent=GridTracker", qrzLookupResults, g_qrzLookupGrid, "https", @@ -14883,9 +14801,9 @@ function GetLookup(useCache) { getBuffer( "http://xmldata.qrz.com/xml/current/?s=" + - g_qrzLookupSessionId + - ";callsign=" + - g_qrzLookupCallsign, + g_qrzLookupSessionId + + ";callsign=" + + g_qrzLookupCallsign, qrzLookupResults, g_qrzLookupGrid, "http", @@ -14897,10 +14815,10 @@ function GetLookup(useCache) { getBuffer( "https://www.hamqth.com/xml.php?id=" + - g_qrzLookupSessionId + - "&callsign=" + - g_qrzLookupCallsign + - "&prg=GridTracker", + g_qrzLookupSessionId + + "&callsign=" + + g_qrzLookupCallsign + + "&prg=GridTracker", qthHamLookupResults, g_qrzLookupGrid, "https", @@ -15007,8 +14925,8 @@ function initialDatabases() { alert( "Database error: " + - event.target.errorCode + - " : GridTracker will have issues" + event.target.errorCode + + " : GridTracker will have issues" ); }; @@ -15089,8 +15007,7 @@ function getLookupCachedObject( } return; } - if (request.result != null && resultFunction) - { resultFunction(request.result, gridPass, false); } + if (request.result != null && resultFunction) { resultFunction(request.result, gridPass, false); } else if (noResultFunction) noResultFunction(call, gridPass); }; @@ -15477,7 +15394,7 @@ function displayLookupObject(lookup, gridPass, fromCache = false) if ( getLookProp(lookup, "gtGrid").length > 0 && getLookProp(lookup, "gtGrid").toUpperCase() != - getLookProp(lookup, "grid").toUpperCase() + getLookProp(lookup, "grid").toUpperCase() ) { worker += makeRow("GT Grid", lookup, "gtGrid"); @@ -15536,12 +15453,12 @@ function displayLookupObject(lookup, gridPass, fromCache = false) setLookupDiv( "lookupInfoDiv", "" + - genMessage + - "
" + - card + - "" + - details + - "
" + card + + "" + + details + + "" + + genMessage + + "" ); setLookupDivHeight("lookupBoxDiv", getLookupWindowHeight() + "px"); } @@ -15582,8 +15499,7 @@ function saveToCsv(lookup) if ( getLookProp(lookup, "land").length > 0 && country != getLookProp(lookup, "land") - ) - { country = getLookProp(lookup, "land"); } + ) { country = getLookProp(lookup, "land"); } if (country == "United States") country = ""; tryToWriteAdifToDocFolder( @@ -15671,8 +15587,7 @@ function joinCommaIf(camera1, camera2) function joinIfBothWithDash(camera1, camera2) { - if (camera1.length > 0 && camera2.length > 0) - { return camera1 + " / " + camera2; } + if (camera1.length > 0 && camera2.length > 0) { return camera1 + " / " + camera2; } return ""; } @@ -15775,8 +15690,7 @@ function searchLogForCallsign(call) if (String(dxcc) + g_colorBands[band] in g_tracker.worked.dxcc) { var strike = ""; - if (String(dxcc) + g_colorBands[band] in g_tracker.confirmed.dxcc) - { strike = "text-decoration: underline overline;"; } + if (String(dxcc) + g_colorBands[band] in g_tracker.confirmed.dxcc) { strike = "text-decoration: underline overline;"; } worker += "
Saved Screenshot" + encodeURI(fn).trim() + + "\");''>Saved Screenshot" ); } catch (e)