Award layer drop down and layout update

POTA now tracks offline mode as it should

timezone and all grids state saved

Move nexrad to after offline mode button

trophy layer saved/restored

some cleaning

Lint
master
Tag Loomis 2024-02-18 14:22:41 -08:00
rodzic 02eac05181
commit 2d3302bb20
6 zmienionych plików z 161 dodań i 196 usunięć

Wyświetl plik

@ -389,9 +389,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</tr> </tr>
<tr title="Select Band&#10;(Auto tracks WSJT-X)"> <tr title="Select Band&#10;(Auto tracks WSJT-X)">
<td data-i18n="mapFilter.band.label"> <td data-i18n="mapFilter.band.label">Band</td>
<font color="lightgreen">Band</font>
</td>
<td> <td>
<select id="gtBandFilter" onkeypress="return false;" onchange="gtBandFilterChanged(this);"> <select id="gtBandFilter" onkeypress="return false;" onchange="gtBandFilterChanged(this);">
<option data-i18n="mapFilter.band.Auto" value="auto">Auto</option> <option data-i18n="mapFilter.band.Auto" value="auto">Auto</option>
@ -433,9 +431,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td> </td>
</tr> </tr>
<tr title="Select Mode"> <tr title="Select Mode">
<td data-i18n="mapFilter.mode.label"> <td data-i18n="mapFilter.mode.label">Mode</td>
<font color="orange">Mode</font>
</td>
<td> <td>
<select id="gtModeFilter" onkeypress="return false;" onchange="gtModeFilterChanged(this);"> <select id="gtModeFilter" onkeypress="return false;" onchange="gtModeFilterChanged(this);">
<option data-i18n="mapFilter.mode.Auto" value="auto">Auto</option> <option data-i18n="mapFilter.mode.Auto" value="auto">Auto</option>
@ -447,9 +443,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td> </td>
</tr> </tr>
<tr title="Select Propagation Mode"> <tr title="Select Propagation Mode">
<td data-i18n="mapFilter.prop.label"> <td data-i18n="mapFilter.prop.label">Prop</td>
<font color="yellow">Prop</font>
</td>
<td> <td>
<select id="gtPropFilter" onkeypress="return false;" onchange="gtPropFilterChanged(this);"> <select id="gtPropFilter" onkeypress="return false;" onchange="gtPropFilterChanged(this);">
<option data-i18n="mapFilter.prop.Mixed" value="mixed">Mixed</option> <option data-i18n="mapFilter.prop.Mixed" value="mixed">Mixed</option>
@ -478,9 +472,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td> </td>
</tr> </tr>
<tr> <tr>
<td data-i18n="mapFilter.data.label"> <td data-i18n="mapFilter.data.label">Data</td>
<font color="cyan">Data</font>
</td>
<td> <td>
<div data-i18n="mapFilter.data.LogLive" id="gridViewButton" onclick="cycleGridView()" class="button" <div data-i18n="mapFilter.data.LogLive" id="gridViewButton" onclick="cycleGridView()" class="button"
title="Cycle Grid View" style=" title="Cycle Grid View" style="
@ -495,46 +487,51 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td data-i18n="roster.award.Award">Award</td>
<td>
<select id="gtTrophyLayer" onkeypress="return false;" onchange="gtTrophyLayerChanged(this);">
<option data-i18n="settings.OAMS.message.newAlert.none" value="0">None</option>
<option value="1">CQ</option>
<option value="2">ITU</option>
<option value="3">WAC</option>
<option value="4">WAS</option>
<option value="5">DXCC</option>
<option value="6">USC</option>
<option value="7">US48</option>
<option value="8">WACP</option>
</select>
</td>
</tr>
</table> </table>
</div> </div>
<div id="buttonsDiv" style="margin-left: 0px; white-space: normal"> <div id="buttonsDiv" style="margin-left: 0px; white-space: normal">
<div id="callRosterButton" class="iconButton" style="padding: 0px" onclick="openCallRosterWindow();" <div id="callRosterButton" class="iconButton" onclick="openCallRosterWindow();" title="Open Call Roster">
title="Open Call Roster"> <img src="./img/roster-icon.png" class="buttonImg" />
<img src="./img/roster-button.png" class="buttonImgWide" />
</div>
<div id="pushPinButton" onclick="togglePushPinMode();" class="iconButton" title="Toggle Push-Pin Mode">
<img id="pinImg" src="" class="buttonImg" />
</div>
<div id="lookupButton" onclick="openLookupWindow(true)" class="iconButton" title="Open Lookup Window">
<img src="./img/lookup.png" class="buttonImg" />
</div>
<div id="statsDiv" onclick="showRootInfoBox();" class="iconButton" title="Show Stats">
<img src="./img/stats-button.png" class="buttonImg" />
</div>
<div id="modeModeDiv" onclick="toggleOffline()" class="iconButton" title="Toggle Online/Offline Mode">
<img id="offlineImg" src="" class="buttonImg" />
</div>
<div id="earthShadow" onclick="toggleEarth()" class="iconButton" title="Toggle Grayline">
<img id="earthImg" src="" class="buttonImg" />
</div> </div>
<div id="legendToggleDiv" onclick="toggleLegend()" class="iconButton" title="Toggle Map Legend"> <div id="legendToggleDiv" onclick="toggleLegend()" class="iconButton" title="Toggle Map Legend">
<img id="legendImg" src="./img/gt_key.png" class="buttonImg" /> <img id="legendImg" src="./img/gt_key.png" class="buttonImg" />
</div> </div>
<div id="gtShareButton" onclick="toggleGtShareEnable();" class="iconButton" <div id="pushPinButton" onclick="togglePushPinMode();" class="iconButton" title="Toggle Push-Pin Mode">
title="Share your On-Air Status with other GridTracker users"> <img id="pinImg" src="" class="buttonImg" />
<img id="gtShareFlagImg" src="./img/share-off.png" class="buttonImg" />
</div> </div>
<div id="helpButton" onclick="toggleHelp();" class="iconButton" title="Toggle Hotkey List"> <div id="gridModeDiv" onclick="toggleGridMode()" class="iconButton" title="Toggle Maidenhead Width">
<img src="./img/help.png" class="buttonImg" /> <img id="modeImg" src="" class="buttonImg" />
</div> </div>
<div id="trophyButton" onclick="cycleTrophyOverlay();" class="iconButton" title="Cycle Award Overlays"> <div id="statsDiv" onclick="showRootInfoBox();" class="iconButton" title="Show Stats">
<img id="trophyImg" src="./img/blank_trophy.png" class="buttonImg" /> <img src="./img/stats-button.png" class="buttonImg" />
</div>
<div id="earthShadow" onclick="toggleEarth()" class="iconButton" title="Toggle Grayline">
<img id="earthImg" src="" class="buttonImg" />
</div> </div>
<div id="lunaButton" onclick="toggleMoon();" class="iconButton" title="Toggle Moon"> <div id="lunaButton" onclick="toggleMoon();" class="iconButton" title="Toggle Moon">
<img id="lunaButonImg" src="./img/luna.png" class="buttonImg" /> <img id="lunaButonImg" src="./img/luna.png" class="buttonImg" />
</div> </div>
<div id="gridModeDiv" onclick="toggleGridMode()" class="iconButton" title="Toggle Maidenhead Width"> <!--div id="trophyButton" onclick="cycleTrophyOverlay();" class="iconButton" title="Cycle Award Overlays">
<img id="modeImg" src="" class="buttonImg" /> <img id="trophyImg" src="./img/blank_trophy.png" class="buttonImg" />
</div-->
<div id="helpButton" onclick="toggleHelp();" class="iconButton" title="Toggle Hotkey List">
<img src="./img/help.png" class="buttonImg" />
</div> </div>
<div id="alterMuteDiv" onclick="toggleAlertMute()" class="iconButton" title="Toggle Audio Mute"> <div id="alterMuteDiv" onclick="toggleAlertMute()" class="iconButton" title="Toggle Audio Mute">
<img id="alertMuteImg" src="" class="buttonImg" /> <img id="alertMuteImg" src="" class="buttonImg" />
@ -544,25 +541,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div> </div>
<div id="adifLoadDiv" onclick="adifLoadDialog()" class="iconButton" title="Load ADIF Log"> <div id="adifLoadDiv" onclick="adifLoadDialog()" class="iconButton" title="Load ADIF Log">
<img src="./img/adif.png" class="buttonImg" /> <img src="./img/adif.png" class="buttonImg" />
</div>
<div id="buttonAdifCheckBoxDiv" onclick="startupAdifLoadFunction()" class="iconButton"
title="Reload Local ADIF Files">
<img src="./img/log_local.png" class="buttonImg" />
</div>
<div id="timezoneButton" onclick="toggleTimezones()" class="iconButton" title="Toggle Timezone Layer">
<img id="timezoneImg" src="./img/timezone-button.png" class="buttonImg" />
</div>
<div id="gridOverlayButton" onclick="toggleAllGrids()" class="iconButton" title="Toggle All Grid Overlay">
<img id="gridOverlayImg" src="./img/grid-overlay.png" class="buttonImg" />
</div>
<div id="modeModeDiv" onclick="toggleOffline()" class="iconButton" title="Toggle Online/Offline Mode">
<img id="offlineImg" src="" class="buttonImg" />
</div>
<div id="radarButton" onclick="toggleNexrad()" class="iconButton" title="Toggle US Nexrad">
<img id="radarImg" src="./img/radar-button.png" class="buttonImg" />
</div> </div>
<div id="conditionsButton" onclick="showConditionsBox();" class="iconButton" title="View Current Conditions"> <div id="conditionsButton" onclick="showConditionsBox();" class="iconButton" title="View Current Conditions">
<img src="./img/conditions.png" class="buttonImg" /> <img src="./img/conditions.png" class="buttonImg" />
</div> </div>
<div id="buttonSpotsBoxDiv" onclick="cycleSpotsView()" class="iconButton" title="View Spot Reports">
<img id="spotsButtonImg" src="./img/spots.png" class="buttonImg" />
</div>
<div id="donateButton" onclick="gotoDonate();" class="iconButton" title="Donate with PayPal"> <div id="donateButton" onclick="gotoDonate();" class="iconButton" title="Donate with PayPal">
<img style="-webkit-filter: brightness(50%); filter: brightness(50%)" src="./img/donate.png" <img style="-webkit-filter: brightness(50%); filter: brightness(50%)" src="./img/donate.png"
class="buttonImg" /> class="buttonImg" />
</div> </div>
<div id="timezoneButton" onclick="toggleTimezones()" class="iconButton" title="Toggle Timezone Layer"> <div id="lookupButton" onclick="openLookupWindow(true)" class="iconButton" title="Open Lookup Window">
<img id="timezoneImg" src="./img/timezone-button.png" class="buttonImg" /> <img src="./img/lookup.png" class="buttonImg" />
</div>
<div id="radarButton" onclick="toggleNexrad()" class="iconButton" title="Toggle US Nexrad">
<img id="radarImg" src="./img/radar-button.png" class="buttonImg" />
</div>
<div id="gridOverlayButton" onclick="toggleAllGrids()" class="iconButton" title="Toggle All Grid Overlay">
<img id="gridOverlayImg" src="./img/grid-overlay.png" class="buttonImg" />
</div>
<div id="buttonSpotsBoxDiv" onClick="cycleSpotsView();" class="iconButton" title="View Spot Reports">
<img id="spotsButtonImg" src="./img/spots.png" class="buttonImg" />
</div> </div>
<div id="buttonQRZCheckBoxDiv" onclick="if ( ValidateQrzApi(qrzApiKey ) ) grabQrzComLog()" class="iconButton" <div id="buttonQRZCheckBoxDiv" onclick="if ( ValidateQrzApi(qrzApiKey ) ) grabQrzComLog()" class="iconButton"
title="Download log from QRZ.com"> title="Download log from QRZ.com">
@ -578,12 +585,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
title="Download log from ClubLog"> title="Download log from ClubLog">
<img id="ClubLogImg" src="./img/log_club.png" class="buttonImg" /> <img id="ClubLogImg" src="./img/log_club.png" class="buttonImg" />
</div> </div>
<div id="buttonAdifCheckBoxDiv" onclick="startupAdifLoadFunction()" class="iconButton"
title="Reload Local ADIF Files">
<img src="./img/log_local.png" class="buttonImg" />
</div>
<div id="potaButton" onClick="togglePotaMap();" class="iconButton" title="Parks On The Air"> <div id="potaButton" onClick="togglePotaMap();" class="iconButton" title="Parks On The Air">
<img id="potaImg" src="./img/pota.png" class="buttonImg" /> <img id="potaImg" src="./img/pota.png" class="buttonImg" />
</div>
<div id="gtShareButton" onclick="toggleGtShareEnable();" class="iconButton"
title="Share your On-Air Status with other GridTracker users">
<img id="gtShareFlagImg" src="./img/share-off.png" class="buttonImg" />
</div> </div>
<div id="gtFlagButton" onclick="toggleGtMap();" class="iconButton" title="Toggle View GridTracker Users"> <div id="gtFlagButton" onclick="toggleGtMap();" class="iconButton" title="Toggle View GridTracker Users">
<img id="gtFlagImg" src="" class="buttonImg" /> <img id="gtFlagImg" src="" class="buttonImg" />

Wyświetl plik

@ -134,6 +134,9 @@ var def_mapSettings = {
splitQSL: true, splitQSL: true,
trafficDecode: true, trafficDecode: true,
usNexrad: false, usNexrad: false,
timezonesEnable: 0,
showAllGrids: false,
trophyOverlay: 0,
zoom: 4, zoom: 4,
mapTrans: 0.5 mapTrans: 0.5
}; };

Wyświetl plik

@ -133,10 +133,7 @@ function loadAllSettings()
GT.appSettings = loadDefaultsAndMerge("appSettings", def_appSettings); GT.appSettings = loadDefaultsAndMerge("appSettings", def_appSettings);
GT.mapSettings = loadDefaultsAndMerge("mapSettings", def_mapSettings); GT.mapSettings = loadDefaultsAndMerge("mapSettings", def_mapSettings);
GT.legendColors = loadDefaultsAndMerge("legendColors", def_legendColors); GT.legendColors = loadDefaultsAndMerge("legendColors", def_legendColors);
GT.adifLogSettings = loadDefaultsAndMerge( GT.adifLogSettings = loadDefaultsAndMerge("adifLogSettings", def_adifLogSettings);
"adifLogSettings",
def_adifLogSettings
);
if (typeof GT.adifLogSettings.lastFetch.lotw_qso == "string") if (typeof GT.adifLogSettings.lastFetch.lotw_qso == "string")
{ {
// covnert to int! // covnert to int!
@ -145,31 +142,15 @@ function loadAllSettings()
saveAdifSettings(); saveAdifSettings();
} }
GT.msgSettings = loadDefaultsAndMerge("msgSettings", def_msgSettings); GT.msgSettings = loadDefaultsAndMerge("msgSettings", def_msgSettings);
GT.receptionSettings = loadDefaultsAndMerge( GT.receptionSettings = loadDefaultsAndMerge("receptionSettings", def_receptionSettings);
"receptionSettings",
def_receptionSettings
);
GT.N1MMSettings = loadDefaultsAndMerge("N1MMSettings", def_N1MMSettings); GT.N1MMSettings = loadDefaultsAndMerge("N1MMSettings", def_N1MMSettings);
GT.log4OMSettings = loadDefaultsAndMerge("log4OMSettings", def_log4OMSettings); GT.log4OMSettings = loadDefaultsAndMerge("log4OMSettings", def_log4OMSettings);
GT.dxkLogSettings = loadDefaultsAndMerge("dxkLogSettings", def_dxkLogSettings); GT.dxkLogSettings = loadDefaultsAndMerge("dxkLogSettings", def_dxkLogSettings);
GT.HRDLogbookLogSettings = loadDefaultsAndMerge( GT.HRDLogbookLogSettings = loadDefaultsAndMerge("HRDLogbookLogSettings", def_HRDLogbookLogSettings);
"HRDLogbookLogSettings", GT.pstrotatorSettings = loadDefaultsAndMerge("pstrotatorSettings", def_pstrotatorSettings);
def_HRDLogbookLogSettings
);
GT.pstrotatorSettings = loadDefaultsAndMerge(
"pstrotatorSettings",
def_pstrotatorSettings
);
GT.acLogSettings = loadDefaultsAndMerge("acLogSettings", def_acLogSettings); GT.acLogSettings = loadDefaultsAndMerge("acLogSettings", def_acLogSettings);
GT.trustedQslSettings = loadDefaultsAndMerge( GT.trustedQslSettings = loadDefaultsAndMerge("trustedQslSettings", def_trustedQslSettings);
"trustedQslSettings", GT.callsignLookups = loadDefaultsAndMerge("callsignLookups", def_callsignLookups);
def_trustedQslSettings
);
GT.callsignLookups = loadDefaultsAndMerge(
"callsignLookups",
def_callsignLookups
);
GT.bandActivity = loadDefaultsAndMerge("bandActivity", def_bandActivity); GT.bandActivity = loadDefaultsAndMerge("bandActivity", def_bandActivity);
GT.startupLogs = loadArrayIfExists("startupLogs"); GT.startupLogs = loadArrayIfExists("startupLogs");
@ -197,6 +178,7 @@ GT.crScript = GT.appSettings.crScript;
GT.spotView = GT.appSettings.spotView; GT.spotView = GT.appSettings.spotView;
GT.myLat = GT.mapSettings.latitude; GT.myLat = GT.mapSettings.latitude;
GT.myLon = GT.mapSettings.longitude; GT.myLon = GT.mapSettings.longitude;
GT.currentOverlay = GT.mapSettings.trophyOverlay;
function loadDefaultsAndMerge(key, def) function loadDefaultsAndMerge(key, def)
{ {
@ -413,7 +395,7 @@ GT.flightPathTotal = (9 + 3 + 3) * 2;
GT.lastMessages = Array(); GT.lastMessages = Array();
GT.lastTraffic = Array(); GT.lastTraffic = Array();
GT.showAllGrids = false;
GT.maps = Array(); GT.maps = Array();
GT.modes = {}; GT.modes = {};
GT.modes_phone = {}; GT.modes_phone = {};
@ -646,7 +628,7 @@ GT.gridViewArray[1] = "Live";
GT.gridViewArray[2] = "Logbook"; GT.gridViewArray[2] = "Logbook";
GT.gridViewArray[3] = "Logbook &amp; Live"; GT.gridViewArray[3] = "Logbook &amp; Live";
GT.trophyImageArray = Array(); /* GT.trophyImageArray = Array();
GT.trophyImageArray[0] = "./img/blank_trophy.png"; GT.trophyImageArray[0] = "./img/blank_trophy.png";
GT.trophyImageArray[1] = "./img/cq_trophy.png"; GT.trophyImageArray[1] = "./img/cq_trophy.png";
GT.trophyImageArray[2] = "./img/itu_trophy.png"; GT.trophyImageArray[2] = "./img/itu_trophy.png";
@ -655,7 +637,7 @@ GT.trophyImageArray[4] = "./img/was_trophy.png";
GT.trophyImageArray[5] = "./img/dxcc_trophy.png"; GT.trophyImageArray[5] = "./img/dxcc_trophy.png";
GT.trophyImageArray[6] = "./img/usc_trophy.png"; GT.trophyImageArray[6] = "./img/usc_trophy.png";
GT.trophyImageArray[7] = "./img/us48_trophy.png"; GT.trophyImageArray[7] = "./img/us48_trophy.png";
GT.trophyImageArray[8] = "./img/wacp_trophy.png"; GT.trophyImageArray[8] = "./img/wacp_trophy.png"; */
GT.viewInfo = {}; GT.viewInfo = {};
GT.viewInfo[0] = ["qsoGrids", "Grids", 0, 0, 0]; GT.viewInfo[0] = ["qsoGrids", "Grids", 0, 0, 0];
@ -712,8 +694,7 @@ function gtPropFilterChanged(selector)
function setBandAndModeToAuto() function setBandAndModeToAuto()
{ {
GT.appSettings.gtModeFilter = GT.appSettings.gtBandFilter = gtBandFilter.value = gtModeFilter.value = GT.appSettings.gtModeFilter = GT.appSettings.gtBandFilter = gtBandFilter.value = gtModeFilter.value = "auto";
"auto";
redrawGrids(); redrawGrids();
redrawPins(); redrawPins();
redrawSpots(); redrawSpots();
@ -807,9 +788,10 @@ function toggleOffline()
conditionsButton.style.display = "inline-block"; conditionsButton.style.display = "inline-block";
gtFlagButton.style.display = "inline-block"; gtFlagButton.style.display = "inline-block";
gtShareButton.style.display = "inline-block"; gtShareButton.style.display = "inline-block";
lookupButton.style.display = "inline-block";
buttonSpotsBoxDiv.style.display = "inline-block"; buttonSpotsBoxDiv.style.display = "inline-block";
donateButton.style.display = "inline-block"; donateButton.style.display = "inline-block";
radarButton.style.display = "inline-block";
potaButton.style.display = (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaShowMenu) ? "inline-block" : "none"; potaButton.style.display = (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaShowMenu) ? "inline-block" : "none";
@ -840,9 +822,14 @@ function toggleOffline()
} }
} }
bandActivityDiv.style.display = "block"; bandActivityDiv.style.display = "block";
if (GT.lookupWindowInitialized == false)
{
openLookupWindow(false);
}
} }
else else
{ {
openLookupWindow(false);
GT.mapSettings.offlineMode = true; GT.mapSettings.offlineMode = true;
offlineImg.src = GT.mapImageArray[0]; offlineImg.src = GT.mapImageArray[0];
conditionsButton.style.display = "none"; conditionsButton.style.display = "none";
@ -857,10 +844,14 @@ function toggleOffline()
donateButton.style.display = "none"; donateButton.style.display = "none";
potaButton.style.display = "none"; potaButton.style.display = "none";
buttonSpotsBoxDiv.style.display = "none"; buttonSpotsBoxDiv.style.display = "none";
lookupButton.style.display = "none";
radarButton.style.display = "none";
setGtShareButtons(); setGtShareButtons();
} }
displayNexrad();
loadMapSettings(); loadMapSettings();
changeMapValues(); changeMapValues();
goProcessRoster();
} }
// from GridTracker.html // from GridTracker.html
@ -1250,9 +1241,7 @@ function changePathWidth()
var featureStroke = featureStyle.getStroke(); var featureStroke = featureStyle.getStroke();
var color = GT.flightPaths[i].isQRZ ? getQrzPathColor() : getPathColor(); var color = GT.flightPaths[i].isQRZ ? getQrzPathColor() : getPathColor();
var width = GT.flightPaths[i].isQRZ var width = GT.flightPaths[i].isQRZ ? qrzPathWidthValue.value : pathWidthValue.value;
? qrzPathWidthValue.value
: pathWidthValue.value;
if (width == 0) if (width == 0)
{ {
@ -1525,11 +1514,7 @@ function createTooltTipTable(toolElement)
newCallList.push(GT.QSOhash[KeyIsHash]); newCallList.push(GT.QSOhash[KeyIsHash]);
} }
} }
if ( if (toolElement.qth in GT.liveGrids && GT.liveGrids[toolElement.qth].rectangle != null && GT.liveGrids[toolElement.qth].isTriangle == false)
toolElement.qth in GT.liveGrids &&
GT.liveGrids[toolElement.qth].rectangle != null &&
GT.liveGrids[toolElement.qth].isTriangle == false
)
{ {
for (var KeyIsCall in GT.liveGrids[toolElement.qth].rectangle.liveHash) for (var KeyIsCall in GT.liveGrids[toolElement.qth].rectangle.liveHash)
{ {
@ -1666,9 +1651,7 @@ function renderTooltipWindow(feature)
try try
{ {
createTooltTipTable(feature); createTooltTipTable(feature);
var adif = GT.popupWindowHandle.window.document.getElementById( var adif = GT.popupWindowHandle.window.document.getElementById("adifTable");
"adifTable"
);
adif.innerHTML = GT.passingToolTipTableString; adif.innerHTML = GT.passingToolTipTableString;
var positionInfo = myTooltip.getBoundingClientRect(); var positionInfo = myTooltip.getBoundingClientRect();
GT.popupWindowHandle.show(); GT.popupWindowHandle.show();
@ -2355,8 +2338,6 @@ function toggleHelp()
function onMyKeyUp(event) { } function onMyKeyUp(event) { }
GT.currentOverlay = 0;
function cycleTrophyOverlay() function cycleTrophyOverlay()
{ {
GT.currentOverlay++; GT.currentOverlay++;
@ -2377,18 +2358,8 @@ function didConfirm(testObj)
function makeTitleInfo(mapWindow) function makeTitleInfo(mapWindow)
{ {
var band = var band = GT.appSettings.gtBandFilter.length == 0 ? "Mixed" : GT.appSettings.gtBandFilter == "auto" ? GT.appSettings.myBand : GT.appSettings.gtBandFilter;
GT.appSettings.gtBandFilter.length == 0 var mode = GT.appSettings.gtModeFilter.length == 0 ? "Mixed" : GT.appSettings.gtModeFilter == "auto" ? GT.appSettings.myMode : GT.appSettings.gtModeFilter;
? "Mixed"
: GT.appSettings.gtBandFilter == "auto"
? GT.appSettings.myBand
: GT.appSettings.gtBandFilter;
var mode =
GT.appSettings.gtModeFilter.length == 0
? "Mixed"
: GT.appSettings.gtModeFilter == "auto"
? GT.appSettings.myMode
: GT.appSettings.gtModeFilter;
var news = `GridTracker ${gtVersionStr} [Band: ${band} Mode: ${mode}`; var news = `GridTracker ${gtVersionStr} [Band: ${band} Mode: ${mode}`;
var end = "]"; var end = "]";
@ -2400,22 +2371,25 @@ function makeTitleInfo(mapWindow)
if (GT.currentOverlay == 0 && GT.appSettings.gridViewMode == 1) { return news + end; } if (GT.currentOverlay == 0 && GT.appSettings.gridViewMode == 1) { return news + end; }
var workline = ` - Worked ${GT.viewInfo[GT.currentOverlay][2]} Confirmed ${GT.viewInfo[GT.currentOverlay][3]}` var workline = ` - Worked ${GT.viewInfo[GT.currentOverlay][2]} Confirmed ${GT.viewInfo[GT.currentOverlay][3]}`;
if ( if (GT.viewInfo[GT.currentOverlay][2] <= GT.viewInfo[GT.currentOverlay][4] && GT.viewInfo[GT.currentOverlay][4] > 0)
GT.viewInfo[GT.currentOverlay][2] <= GT.viewInfo[GT.currentOverlay][4] &&
GT.viewInfo[GT.currentOverlay][4] > 0
)
{ {
end = ` Needed ${(GT.viewInfo[GT.currentOverlay][4] - GT.viewInfo[GT.currentOverlay][2])}]`; end = ` Needed ${(GT.viewInfo[GT.currentOverlay][4] - GT.viewInfo[GT.currentOverlay][2])}]`;
} }
return news + workline + end; return news + workline + end;
} }
function gtTrophyLayerChanged(element)
{
setTrophyOverlay(element.value);
saveMapSettings();
}
function setTrophyOverlay(which) function setTrophyOverlay(which)
{ {
GT.currentOverlay = which; gtTrophyLayer.value = GT.currentOverlay = GT.mapSettings.trophyOverlay = which;
window.document.title = makeTitleInfo(true); window.document.title = makeTitleInfo(true);
trophyImg.src = GT.trophyImageArray[which]; // trophyImg.src = GT.trophyImageArray[which];
myTrophyTooltip.style.zIndex = -1; myTrophyTooltip.style.zIndex = -1;
clearCurrentShapes(); clearCurrentShapes();
// set the scope of key // set the scope of key
@ -2427,11 +2401,7 @@ function setTrophyOverlay(which)
{ {
GT.layerVectors[key].setVisible(true); GT.layerVectors[key].setVisible(true);
} }
if ( if (GT.appSettings.gtFlagImgSrc > 0 && GT.appSettings.gtShareEnable == true && GT.mapSettings.offlineMode == false)
GT.appSettings.gtFlagImgSrc > 0 &&
GT.appSettings.gtShareEnable == true &&
GT.mapSettings.offlineMode == false
)
{ {
GT.layerVectors.gtflags.setVisible(true); GT.layerVectors.gtflags.setVisible(true);
} }
@ -2440,23 +2410,16 @@ function setTrophyOverlay(which)
GT.layerVectors.gtflags.setVisible(false); GT.layerVectors.gtflags.setVisible(false);
} }
GT.layerVectors.award.setVisible(false); GT.layerVectors.award.setVisible(false);
if (GT.showAllGrids == false) if (GT.mapSettings.showAllGrids == false)
{ {
GT.layerVectors.lineGrids.setVisible(false); GT.layerVectors.lineGrids.setVisible(false);
GT.layerVectors.bigGrids.setVisible(false); GT.layerVectors.bigGrids.setVisible(false);
GT.layerVectors.longGrids.setVisible(false); GT.layerVectors.longGrids.setVisible(false);
} }
if (GT.timezoneLayer) if (GT.timezoneLayer)
{
if (GT.timezonesEnable == 1)
{ {
GT.timezoneLayer.setVisible(true); GT.timezoneLayer.setVisible(true);
} }
else
{
GT.timezoneLayer.setVisible(false);
}
}
} }
else else
{ {
@ -2473,11 +2436,7 @@ function setTrophyOverlay(which)
{ {
GT.layerVectors[key].setVisible(true); GT.layerVectors[key].setVisible(true);
} }
if ( if (GT.appSettings.gtFlagImgSrc > 0 && GT.appSettings.gtShareEnable == true && GT.mapSettings.offlineMode == false)
GT.appSettings.gtFlagImgSrc > 0 &&
GT.appSettings.gtShareEnable == true &&
GT.mapSettings.offlineMode == false
)
{ {
GT.layerVectors.gtflags.setVisible(true); GT.layerVectors.gtflags.setVisible(true);
} }
@ -2736,14 +2695,7 @@ function setTrophyOverlay(which)
updateSpotView(true); updateSpotView(true);
} }
function gridFeature( function gridFeature(key, objectData, propname, fillColor, borderColor, borderWidth)
key,
objectData,
propname,
fillColor,
borderColor,
borderWidth
)
{ {
var style = new ol.style.Style({ var style = new ol.style.Style({
stroke: new ol.style.Stroke({ stroke: new ol.style.Stroke({
@ -2978,9 +2930,7 @@ function mouseDownGrid(longlat)
GT.MyCurrentGrid = grid.substr(0, 4); GT.MyCurrentGrid = grid.substr(0, 4);
var worker = ""; var worker = "";
worker += "<table align='center' class='darkTable'><tr style='color:white;'>"; worker += "<table align='center' class='darkTable'><tr style='color:white;'>";
var bearing = parseInt( var bearing = parseInt(MyCircle.bearing(GT.myLat, GT.myLon, longlat[1], longlat[0]));
MyCircle.bearing(GT.myLat, GT.myLon, longlat[1], longlat[0])
);
worker += "<tr><td>Dist</td><td style='color:lightgreen'>" + worker += "<tr><td>Dist</td><td style='color:lightgreen'>" +
parseInt( parseInt(
MyCircle.distance( MyCircle.distance(
@ -3799,7 +3749,7 @@ function trafficDecodeView()
if (GT.mapSettings.trafficDecode == false) if (GT.mapSettings.trafficDecode == false)
{ {
trafficDiv.innerHTML = ""; trafficDiv.innerHTML = "";
GT.lastTraffic = Array(); GT.lastTraffic = [];
} }
} }
@ -3855,15 +3805,15 @@ function setAnimateView()
function toggleAnimate() function toggleAnimate()
{ {
animateValue.checked = animateValue.checked != true; animateValue.checked = !animateValue.checked;
changeAnimate(); changeAnimate();
} }
function toggleAllGrids() function toggleAllGrids()
{ {
GT.showAllGrids = !GT.showAllGrids; GT.mapSettings.showAllGrids = !GT.mapSettings.showAllGrids;
setTrophyOverlay(GT.currentOverlay); setTrophyOverlay(GT.currentOverlay);
gridOverlayImg.style.filter = GT.showAllGrids ? "" : "grayscale(1)"; gridOverlayImg.style.filter = GT.mapSettings.showAllGrids ? "" : "grayscale(1)";
} }
function changeAnimate() function changeAnimate()
@ -4777,8 +4727,6 @@ GT.lasttimezone = null;
GT.nexradInterval = null; GT.nexradInterval = null;
GT.nexradEnable = 0;
function createNexRad() function createNexRad()
{ {
var layerSource = new ol.source.TileWMS({ var layerSource = new ol.source.TileWMS({
@ -4799,16 +4747,20 @@ function createNexRad()
function toggleNexrad() function toggleNexrad()
{ {
GT.nexradEnable ^= 1; GT.mapSettings.usNexrad = !GT.mapSettings.usNexrad;
if (GT.nexradEnable == 1) displayNexrad();
{ saveMapSettings();
if (GT.Nexrad != null) }
{
GT.map.removeLayer(GT.Nexrad);
}
function displayNexrad()
{
if (GT.mapSettings.usNexrad && GT.mapSettings.offlineMode == false)
{
if (GT.Nexrad == null)
{
GT.Nexrad = createNexRad(); GT.Nexrad = createNexRad();
GT.map.addLayer(GT.Nexrad); GT.map.addLayer(GT.Nexrad);
}
if (GT.nexradInterval == null) { GT.nexradInterval = nodeTimers.setInterval(nexradRefresh, 600000); } if (GT.nexradInterval == null) { GT.nexradInterval = nodeTimers.setInterval(nexradRefresh, 600000); }
} }
@ -4826,14 +4778,12 @@ function toggleNexrad()
} }
} }
GT.mapSettings.usNexrad = GT.nexradEnable == 1;
radarImg.style.filter = GT.mapSettings.usNexrad ? "" : "grayscale(1)"; radarImg.style.filter = GT.mapSettings.usNexrad ? "" : "grayscale(1)";
saveMapSettings();
} }
function nexradRefresh() function nexradRefresh()
{ {
if (GT.Nexrad != null) if (GT.Nexrad != null && GT.mapSettings.offlineMode == false)
{ {
GT.Nexrad.getSource().updateParams({ ol3_salt: Math.random() }); GT.Nexrad.getSource().updateParams({ ol3_salt: Math.random() });
GT.Nexrad.getSource().refresh(); GT.Nexrad.getSource().refresh();
@ -8064,6 +8014,8 @@ function openAlertWindow(show = true)
function openLookupWindow(show = false) function openLookupWindow(show = false)
{ {
if (GT.mapSettings.offlineMode == true) return;
if (GT.lookupWindowHandle == null) if (GT.lookupWindowHandle == null)
{ {
popupNewWindows(); popupNewWindows();
@ -11137,11 +11089,22 @@ function loadMaidenHeadData()
initAdifWorker(); initAdifWorker();
} }
GT.timezonesEnable = 0;
GT.timezoneLayer = null; GT.timezoneLayer = null;
function createZoneLayer() function toggleTimezones()
{ {
GT.mapSettings.timezonesEnable ^= 1;
displayTimezones();
}
function displayTimezones()
{
timezoneImg.style.filter = GT.mapSettings.timezonesEnable == 1 ? "" : "grayscale(1)";
if (GT.mapSettings.timezonesEnable == 1)
{
if (GT.timezoneLayer == null)
{
GT.timezoneLayer = createGeoJsonLayer( GT.timezoneLayer = createGeoJsonLayer(
"tz", "tz",
"./data/combined-with-oceans.json", "./data/combined-with-oceans.json",
@ -11150,22 +11113,12 @@ function createZoneLayer()
); );
GT.map.addLayer(GT.timezoneLayer); GT.map.addLayer(GT.timezoneLayer);
GT.timezoneLayer.setVisible(false); GT.timezoneLayer.setVisible(false);
}
function toggleTimezones()
{
if (GT.currentOverlay != 0) return;
GT.timezonesEnable ^= 1;
if (GT.timezonesEnable == 1)
{
if (GT.timezoneLayer == null)
{
createZoneLayer();
} }
if (GT.currentOverlay == 0)
{
GT.timezoneLayer.setVisible(true); GT.timezoneLayer.setVisible(true);
} }
}
else else
{ {
if (GT.timezoneLayer != null) if (GT.timezoneLayer != null)
@ -11174,8 +11127,6 @@ function toggleTimezones()
GT.timezoneLayer = null; GT.timezoneLayer = null;
} }
} }
timezoneImg.style.filter = GT.timezonesEnable == 1 ? "" : "grayscale(1)";
} }
function drawAllGrids() function drawAllGrids()
@ -11577,9 +11528,9 @@ function loadMapSettings()
setSpotImage(); setSpotImage();
timezoneImg.style.filter = GT.timezonesEnable == 1 ? "" : "grayscale(1)"; timezoneImg.style.filter = GT.mapSettings.timezonesEnable == 1 ? "" : "grayscale(1)";
radarImg.style.filter = GT.mapSettings.usNexrad ? "" : "grayscale(1)"; radarImg.style.filter = GT.mapSettings.usNexrad ? "" : "grayscale(1)";
gridOverlayImg.style.filter = GT.showAllGrids ? "" : "grayscale(1)"; gridOverlayImg.style.filter = GT.mapSettings.showAllGrids ? "" : "grayscale(1)";
GT.bandToColor = JSON.parse(JSON.stringify(GT.pskColors)); GT.bandToColor = JSON.parse(JSON.stringify(GT.pskColors));
@ -12187,6 +12138,10 @@ function loadAdifSettings()
document.getElementById(where).style.display = "none"; document.getElementById(where).style.display = "none";
} }
} }
else
{
delete GT.adifLogSettings.menu[key];
}
} }
for (var key in GT.adifLogSettings.startup) for (var key in GT.adifLogSettings.startup)
{ {
@ -12318,6 +12273,8 @@ function startupButtonsAndInputs()
bandActivityDiv.style.display = "none"; bandActivityDiv.style.display = "none";
buttonSpotsBoxDiv.style.display = "none"; buttonSpotsBoxDiv.style.display = "none";
potaButton.style.display = "none"; potaButton.style.display = "none";
lookupButton.style.display = "none";
radarButton.style.display = "none";
} }
setGtShareButtons(); setGtShareButtons();
@ -12348,18 +12305,16 @@ function postInit()
updateForwardListener(); updateForwardListener();
addLastTraffic("GridTracker</br>" + gtShortVersion); addLastTraffic("GridTracker</br>" + gtShortVersion);
GT.nexradEnable = GT.mapSettings.usNexrad ? 0 : 1; displayNexrad();
toggleNexrad(); displayTimezones();
if (String(gtVersion) != String(GT.startVersion)) if (String(gtVersion) != String(GT.startVersion))
{ {
// generalbut.className = "settingsTablinks";
showSettingsBox(); showSettingsBox();
openSettingsTab(updatebut, "updateSettingsDiv"); openSettingsTab(updatebut, "updateSettingsDiv");
} }
GT.finishedLoading = true; GT.finishedLoading = true;
// tagme
var x = document.querySelectorAll("input[type='range']"); var x = document.querySelectorAll("input[type='range']");
for (var i = 0; i < x.length; i++) for (var i = 0; i < x.length; i++)
{ {

Wyświetl plik

@ -143,7 +143,7 @@ function redrawParks()
{ {
GT.layerSources.pota.clear(); GT.layerSources.pota.clear();
if (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaMapEnabled) if (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaMapEnabled && GT.mapSettings.offlineMode == false)
{ {
GT.pota.mapParks = {}; GT.pota.mapParks = {};
makeParkFeatures(); makeParkFeatures();

Wyświetl plik

@ -14,7 +14,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const currentYearSuffix = `&rsquo;${currentYear - 2000}`; const currentYearSuffix = `&rsquo;${currentYear - 2000}`;
const potaEnabled = (window.opener.GT.appSettings.potaEnabled == 1); const potaEnabled = (window.opener.GT.appSettings.potaEnabled == 1 && window.opener.GT.mapSettings.offlineMode == false);
// TODO: Hunting results might be used to filter, based on the "Callsigns: Only Wanted" option, // TODO: Hunting results might be used to filter, based on the "Callsigns: Only Wanted" option,
// so maybe we can move this loop first, and add a check to the filtering loop? // so maybe we can move this loop first, and add a check to the filtering loop?

Wyświetl plik

@ -44,7 +44,7 @@ function renderRoster(callRoster, rosterSettings)
columnOverrides.OAMS = false; columnOverrides.OAMS = false;
} }
if (window.opener.GT.appSettings.potaEnabled == 1) if (window.opener.GT.appSettings.potaEnabled == 1 && window.opener.GT.mapSettings.offlineMode == false)
{ {
huntingMatrixPotaDiv.style.display = ""; huntingMatrixPotaDiv.style.display = "";
} }