Merge branch 'march_release' into 'master'

Many globals vars removed

See merge request gridtracker.org/gridtracker!272

If this is changing anything in the UI or operational behavior, please prepare to update the wiki!
merge-requests/237/merge
T Loomis 2023-03-27 04:36:26 +00:00
commit 28ccdf907a
47 zmienionych plików z 7538 dodań i 6555 usunięć

Wyświetl plik

@ -6,7 +6,7 @@ pkgver=REPLACE_WITH_VERSION
pkgrel=1
pkgdesc="Companion program for WSJT-X for mapping contacts"
arch=('x86_64')
url="https://gridtracker.org/grid-tracker/"
url="https://gridtracker.org/"
license=('BSD')
depends=('nwjs-bin>=0.54.0')
replaces=('gridtracker-bin')

16
debian/changelog vendored
Wyświetl plik

@ -1,3 +1,19 @@
gridtracker (1.23.0326) unstable; urgency=low
- POTA – fixed disappearing parks, removed auto RBNs
- Pin mode – added missing band pins
- Call Roster - added UTC column for easier even/odd spotting
- Call Roster – fixed “Spotted Me” exception
- Call Roster – “Uses LoTW” “Uses eQSL” “Uses OQRS” now inclusive
- Loggers – added HamZone.cn service
- OAMS – band activity sums neighboring grids correctly
- Logbook – “Working Date” now accepts time of day
- Visual Alerts – in own movable window
- Map – upgraded to OpenLayers 6.15.1, Heatmap now world-wraps
- Mac – “Full Stop” no longer spoken at startup
- Satellite – framework started for satellite tracking
- BIGCTY – update from March 19th
-- Tag Loomis <n0ttl@gridtracker.org> Sun, 26 Mar 2023 00:00:00 -0000
gridtracker (1.23.0206) unstable; urgency=low
- Bugfix for Turkey zone 1 decodes
- Heatmap part of “Spots” button, Hotkey H removed

23
debian/copyright vendored
Wyświetl plik

@ -86,26 +86,3 @@ License: BSD-2-clause
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Files: package.nw/lib/datepicker package.nw/lib/dp-dark.css
Source: https://code-boxx.com/simple-datepicker-pure-javascript-css/,
https://code-boxx.com/wp-content/uploads/2020/06/datepicker-js.zip
Copyright: Copyright (c) Code Boxx
License: MIT-b
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Wyświetl plik

@ -40,6 +40,20 @@ DESTDIR=${RPM_BUILD_ROOT} make clean
%license %{_docdir}/%{name}/
%changelog
* Sun Mar 26 2023 Tag Loomis <n0ttl@gridtracker.org> - 1.23.0326-1
- POTA – fixed disappearing parks, removed auto RBNs
- Pin mode – added missing band pins
- Call Roster - added UTC column for easier even/odd spotting
- Call Roster – fixed “Spotted Me” exception
- Call Roster – “Uses LoTW” “Uses eQSL” “Uses OQRS” now inclusive
- Loggers – added HamZone.cn service
- OAMS – band activity sums neighboring grids correctly
- Logbook – “Working Date” now accepts time of day
- Visual Alerts – in own movable window
- Map – upgraded to OpenLayers 6.15.1, Heatmap now world-wraps
- Mac – “Full Stop” no longer spoken at startup
- Satellite – framework started for satellite tracking
- BIGCTY – update from March 19th
* Mon Feb 06 2023 Tag Loomis <n0ttl@gridtracker.org> - 1.23.0206-1
- Removed lightning strike detection
- Bugfix for Turkey zone 1 decodes

Wyświetl plik

@ -34,7 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GridTracker</title>
<link rel="stylesheet" href="./lib/dp-dark.css" />
<link rel="stylesheet" href="./lib/ol.css" />
<link rel="stylesheet" href="./lib/style.css" />
<script src="./lib/defaults.js" type="text/javascript"></script>
@ -48,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script src="./lib/arc.js" type="text/javascript"></script>
<script src="./lib/moment-with-locales.js" type="text/javascript"></script>
<script src="./lib/moment-timezone-with-data.js" type="text/javascript"></script>
<script src="./lib/datepicker.js"></script>
<script src="./lib/callsigns.js" type="text/javascript"></script>
<script src="./lib/jquery-3.6.1.min.js"></script>
<script src="./lib/i18n.js"></script>
@ -244,8 +242,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<tr id="dxCallBoxDiv" class="DXCallBox">
<td>
<div id="localDXcall" style="cursor: pointer" title="Who you're calling or last called"
onclick="startLookup(g_localDXcall,localDXGrid.innerHTML);"
oncontextmenu="showWorkedByCall(g_localDXcall, event);">
onclick="startLookup(GT.localDXcall,localDXGrid.innerHTML);"
oncontextmenu="showWorkedByCall(GT.localDXcall, event);">
-
</div>
</td>
@ -352,12 +350,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="countryCount">0</div>
</td>
<td data-i18n="quickStats.QSL.label" style="cursor: pointer"
onclick="resetSearch(); g_filterQSL = 'true'; openInfoTab('qsobox', 'workedBoxDiv', showWorkedBox)"
onclick="resetSearch(); GT.filterQSL = 'true'; openInfoTab('qsobox', 'workedBoxDiv', showWorkedBox)"
title="Show Confirmed List" align="right">
QSL
</td>
<td style="cursor: pointer" class="roundBorderValue"
onclick="resetSearch(); g_filterQSL = 'true'; openInfoTab('qsobox', 'workedBoxDiv', showWorkedBox)"
onclick="resetSearch(); GT.filterQSL = 'true'; openInfoTab('qsobox', 'workedBoxDiv', showWorkedBox)"
title="Show Confirmed List" align="center">
<div id="qslCount">0</div>
</td>
@ -949,7 +947,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
<div style="top: 6px; right: 6px; position: absolute">
<button class="Xbutton" onclick="g_helpShow=false;helpDiv.style.display='none';">X</button>
<button class="Xbutton" onclick="GT.helpShow=false;helpDiv.style.display='none';">X</button>
</div>
</div>
@ -1584,7 +1582,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</tr>
<tr>
<td>
<div class="roundBorderValue" style="width: auto; font-size: larger; font-weight: bold"
<div class="roundBorderValue" style="margin-bottom:10px; width: auto; font-size: larger; font-weight: bold"
id="workingDateString">
No Date
</div>
@ -1593,9 +1591,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</tr>
<tr>
<td id="workingDateTd" title="Date is UTC">
<input style="display: none" type="text" id="workingDateValue" />
<div id="pick-inline"></div>
<td id="workingDateTd" title="Date/Time is UTC">
Date <input type="date" id="workingDateValue" value="1970-01-01" style="background-color: green; color: yellow;" onchange="workingDateChanged()" />
Time <input type="time" id="workingTimeValue" value="00:00" style="background-color: green; color: yellow;" onchange="workingDateChanged()" />
</td>
</tr>
</table>
@ -2561,7 +2559,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntCallsignNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value); }"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value); }"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntCallsignNotifyMedia" onchange="wantedChanged(this);"></select>
</td>
@ -2585,7 +2583,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntGridNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntGridNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2609,7 +2607,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntDXCCNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntDXCCNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2633,7 +2631,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntCQzNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntCQzNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2657,7 +2655,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntITUzNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntITUzNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2681,7 +2679,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntStatesNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntStatesNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2706,7 +2704,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</td>
<td>
<input id="huntRosterNotifyWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) { speakAlertString(this.value);}"
onkeyup="if (event.keyCode == 13) { speakAlertString(this.value);}"
oninput="ValidateText(this);wantedChanged(this);" />
<select id="huntRosterNotifyMedia" style="display: block" onchange="wantedChanged(this);"></select>
</td>
@ -2972,7 +2970,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<tr>
<td>
<input id="msgAlertWord" type="text" class="inputTextValue" size="14"
onkeyup="if (event.keyCode === 13) {newMessageSetting(this); alertChatMessage(); }"
onkeyup="if (event.keyCode == 13) {newMessageSetting(this); alertChatMessage(); }"
oninput="ValidateText(this);newMessageSetting(this);" />
<select id="msgAlertMedia" onchange="newMessageSetting(this); alertChatMessage();"></select>
</td>
@ -3064,7 +3062,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Current Solar Conditions and More!<br />
Learn more at
<a href="#" style="cursor: pointer"
onclick="require('nw.gui').Shell.openExternal('https://gridtracker.org/grid-tracker/');">GridTracker.org!</a>
onclick="require('nw.gui').Shell.openExternal('https://gridtracker.org/');">GridTracker.org!</a>
</p>
<p>Copyright &copy; 2023 GridTracker.org</p>
<img src="./gridview.png" /> <br />
@ -3080,26 +3078,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
</div>
<div id="alertsPopDiv" style="
margin: 0 auto;
top: 2px;
min-height: 80px;
max-height: 80%;
left: 2px;
display: none;
background-color: white;
padding: 0px;
text-align: center;
vertical-align: middle;
position: absolute;
z-index: 650;
border: 3px groove red;
white-space: nowrap;
overflow: hidden;" class="roundBorder">
<div data-i18n="alertPopup.title" id="alertPopTextDiv"><b></b>New Alerts!!!</b></div>
<div id="alertPopListDiv" style="margin: 2px; padding: 2px"></div>
<div data-i18n="alertPopup.dismiss" class="button" onclick="ackAlerts();">DISMISS</div>
</div>
<div id="versionDiv" style="
margin: 0 auto;
left: 0;

Wyświetl plik

@ -0,0 +1,78 @@
<!--
This file is part of GridTracker.
GridTracker is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
GridTracker is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GridTracker. If not, see <https://www.gnu.org/licenses/>.
-->
<html lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alerts</title>
<link rel="stylesheet" href="./lib/style.css" />
<style type="text/css">
body {
-webkit-appearance: none;
-webkit-user-select: none;
height: 98%;
overflow: auto;
}
table,
th,
td,
body {
color: #fff;
white-space: nowrap;
font-family: Sans-Serif;
font-size: 12px;
text-align: auto;
}
</style>
<script src="./lib/protos.js" type="text/javascript"></script>
<script src="./lib/screens.js" type="text/javascript"></script>
<script>
document.addEventListener("contextmenu", function (ev) {
if (process.versions["nw-flavor"] != "sdk") {
ev.preventDefault();
}
});
</script>
</head>
<body id="mainBody" onload="window.opener.GT.alertWindowInitialized = true">
<div
id="main"
style="
margin: 0;
top: 0;
min-height: 60px;
width: auto;
background-color: black;
padding: 2px;
text-align: center;
vertical-align: middle;
position: absolute;
white-space: nowrap;
overflow: hidden;
"
>
<div id="alertsPopDiv" style="
background-color: rgb(0, 0, 0);
padding: 0px;
text-align: center;
vertical-align: middle;
border: 3px groove red;"
class="roundBorder">
<div id="alertPopListDiv" style="margin: 2px; padding: 2px"></div>
</div>
</div>
</body>
</html>

Wyświetl plik

@ -40,7 +40,7 @@
<body
id="mainBody"
onload="window.opener.g_baWindowInitialized = true"
onload="window.opener.GT.baWindowInitialized = true"
style="
-webkit-app-region: drag;
margin: 0px;

Wyświetl plik

@ -71,7 +71,7 @@
function userAgrees()
{
window.opener.g_appSettings.gtAgree = "user agrees to messaging";
window.opener.GT.appSettings.gtAgree = "user agrees to messaging";
noticeDiv.style.display = "none";
wrapperDiv.style.display = "block";
}
@ -80,31 +80,31 @@
function handleKey(event)
{
if (event.key === "Enter")
if (event.key == "Enter")
{
// Do work
var msg = messageInput.value.replace(/[\n\r]/g, '');
if (msg.length > 0 && g_currentId != 0 && g_currentId in window.opener.g_gtFlagPins && window.opener.g_gtFlagPins[g_currentId].canmsg == true)
if (msg.length > 0 && g_currentId != 0 && g_currentId in window.opener.GT.gtFlagPins && window.opener.GT.gtFlagPins[g_currentId].canmsg == true)
{
var worker = "";
// No message history, so lets clear the div
if (!(g_currentId in window.opener.g_gtMessages)) messageTextDiv.innerHTML = "";
if (!(g_currentId in window.opener.GT.gtMessages)) messageTextDiv.innerHTML = "";
if (g_currentId in window.opener.g_gtSentAwayToCid)
if (g_currentId in window.opener.GT.gtSentAwayToCid)
{
var thisMsg = "Returned from away.";
window.opener.gtSendMessage(thisMsg, g_currentId);
worker = makeViewMessage("self", window.opener.myDEcall, thisMsg);
worker = makeViewMessage("self", window.opener.GT.appSettings.myCall, thisMsg);
messageTextDiv.innerHTML += worker;
delete window.opener.g_gtSentAwayToCid[g_currentId];
delete window.opener.GT.gtSentAwayToCid[g_currentId];
}
if (window.opener.g_msgSettings.msgAwaySelect == 1)
if (window.opener.GT.msgSettings.msgAwaySelect == 1)
{
window.opener.msgAwaySelect.value = 0;
window.opener.newMessageSetting(window.opener.msgAwaySelect);
}
window.opener.gtSendMessage(msg, g_currentId);
worker = makeViewMessage("self", window.opener.myDEcall, htmlEntities(msg));
worker = makeViewMessage("self", window.opener.GT.appSettings.myCall, htmlEntities(msg));
messageTextDiv.innerHTML += worker;
scrollDown(messageTextDiv);
}
@ -116,7 +116,7 @@
{
lockNewWindows();
if (window.opener.g_appSettings.gtAgree != "user agrees to messaging")
if (window.opener.GT.appSettings.gtAgree != "user agrees to messaging")
{
noticeDiv.style.display = "block";
wrapperDiv.style.display = "none";
@ -148,7 +148,7 @@
function openIdCid(from)
{
if (from.currentTarget.id in window.opener.g_gtFlagPins)
if (from.currentTarget.id in window.opener.GT.gtFlagPins)
{
openId(from.currentTarget.id);
}
@ -166,9 +166,9 @@
{
from.preventDefault();
if (from.currentTarget.id in window.opener.g_gtFlagPins)
if (from.currentTarget.id in window.opener.GT.gtFlagPins)
{
doLookup(window.opener.g_gtFlagPins[from.currentTarget.id].call);
doLookup(window.opener.GT.gtFlagPins[from.currentTarget.id].call);
}
else
{
@ -183,9 +183,9 @@
function onHoverCid(from)
{
var cid = from.currentTarget.id;
if (cid in window.opener.g_gtFlagPins)
if (cid in window.opener.GT.gtFlagPins)
{
from.currentTarget.title = window.opener.g_gtFlagPins[cid].band + " , " + window.opener.g_gtFlagPins[cid].mode + " , " + window.opener.g_dxccToAltName[window.opener.g_gtFlagPins[cid].dxcc];
from.currentTarget.title = window.opener.GT.gtFlagPins[cid].band + " , " + window.opener.GT.gtFlagPins[cid].mode + " , " + window.opener.GT.dxccToAltName[window.opener.GT.gtFlagPins[cid].dxcc];
}
else
{
@ -230,9 +230,9 @@
newDiv.oncontextmenu = openLookupCid;
var worker = "<div id='"+callObj.cid +"CALL' style='clear:both;' class='"+ (callObj.live == false ? "rosterOff" : "rosterOn") + "'>" + callObj.fCall;
if (callObj.dxcc > 0 && callObj.dxcc in window.opener.g_dxccInfo)
if (callObj.dxcc > 0 && callObj.dxcc in window.opener.GT.dxccInfo)
{
worker += "<img src='./img/flags/16/" + window.opener.g_dxccInfo[callObj.dxcc].flag +"' style='float:right;'>";
worker += "<img src='./img/flags/16/" + window.opener.GT.dxccInfo[callObj.dxcc].flag +"' style='float:right;'>";
}
worker += "</div>";
newDiv.innerHTML = worker;
@ -267,9 +267,9 @@
function updateCallsign(id)
{
if (id in window.opener.g_gtFlagPins)
if (id in window.opener.GT.gtFlagPins)
{
var obj = window.opener.g_gtFlagPins[id];
var obj = window.opener.GT.gtFlagPins[id];
if (obj.call != "" && obj.call != "NOCALL")
{
var show = true;
@ -281,9 +281,9 @@
}
catch (e) {}
if (g_viewBand > 0 && window.opener.myBand != obj.band) show = false;
if (g_viewBand > 0 && window.opener.GT.appSettings.myBand != obj.band) show = false;
if (g_viewMode > 0 && window.opener.myMode != obj.mode) show = false;
if (g_viewMode > 0 && window.opener.GT.appSettings.myMode != obj.mode) show = false;
if (obj.canmsg == false) show = false;
@ -346,9 +346,9 @@
removeAllChildNodes(allCallDiv);
}
for (const x in window.opener.g_gtFlagPins)
for (const x in window.opener.GT.gtFlagPins)
{
var obj = window.opener.g_gtFlagPins[x];
var obj = window.opener.GT.gtFlagPins[x];
if (obj.call != "" && obj.call != "NOCALL")
{
var show = true;
@ -360,9 +360,9 @@
}
catch (e) {}
if (g_viewBand > 0 && window.opener.myBand != obj.band) show = false;
if (g_viewBand > 0 && window.opener.GT.appSettings.myBand != obj.band) show = false;
if (g_viewMode > 0 && window.opener.myMode != obj.mode) show = false;
if (g_viewMode > 0 && window.opener.GT.appSettings.myMode != obj.mode) show = false;
if (obj.canmsg == false) show = false;
@ -383,7 +383,7 @@
if (g_viewBand)
{
viewBand.innerHTML = window.opener.myBand;
viewBand.innerHTML = window.opener.GT.appSettings.myBand;
}
else
{
@ -392,7 +392,7 @@
if (g_viewMode)
{
viewMode.innerHTML = window.opener.myMode;
viewMode.innerHTML = window.opener.GT.appSettings.myMode;
}
else
{
@ -413,15 +413,15 @@
function showAllMessages()
{
activeCallsignsDiv.innerHTML = "<font color='gray'>no message history</font>";
if (Object.keys(window.opener.g_gtMessages).length > 0)
if (Object.keys(window.opener.GT.gtMessages).length > 0)
{
var worker = "";
for (const key in window.opener.g_gtMessages)
for (const key in window.opener.GT.gtMessages)
{
if (key in window.opener.g_gtFlagPins)
if (key in window.opener.GT.gtFlagPins)
{
worker += "<tr style='cursor:pointer;vertical-align:bottom;'><td align=left onclick=\"openId('" + key + "');\">";
if (key in window.opener.g_gtUnread)
if (key in window.opener.GT.gtUnread)
{
worker += "🔥";
}
@ -430,7 +430,7 @@
worker += "💬";
}
worker += "</td><td align=left style='color:cyan;' onclick=\"openId('" + key + "');\" >" + window.opener.g_gtFlagPins[key].call.formatCallsign() + "</td>";
worker += "</td><td align=left style='color:cyan;' onclick=\"openId('" + key + "');\" >" + formatCallsign(window.opener.GT.gtFlagPins[key].call) + "</td>";
worker += "<td align=right title='Clear Messages' style='padding-bottom:2px' onclick=\"clearMessage('" + key + "');\" ></td></tr>";
}
}
@ -445,8 +445,8 @@
{
try
{
if (what in window.opener.g_gtMessages) delete window.opener.g_gtMessages[what];
if (what in window.opener.g_gtUnread) delete window.opener.g_gtUnread[what];
if (what in window.opener.GT.gtMessages) delete window.opener.GT.gtMessages[what];
if (what in window.opener.GT.gtUnread) delete window.opener.GT.gtUnread[what];
}
catch (e) {}
@ -475,7 +475,7 @@
function makeViewMessage(className, who, msg, when)
{
var who = "<text class='" + className + "'>" + who.formatCallsign() + "</text>";
var who = "<text class='" + className + "'>" + formatCallsign(who) + "</text>";
var time = "<text class='when'>" + window.opener.userTimeString(when) + "</text>";
var worker = who + " " + time + "</br>";
var msgTextClass = containsDoubleByte(msg) ? "msgTextUnicode" : "msgText";
@ -486,8 +486,8 @@
function newChatMessage(id, jsmesg)
{
if (id == g_currentId) {
var worker = makeViewMessage("them", window.opener.g_gtFlagPins[id].call, jsmesg.msg, jsmesg.when);
if (id in window.opener.g_gtUnread) delete window.opener.g_gtUnread[id];
var worker = makeViewMessage("them", window.opener.GT.gtFlagPins[id].call, jsmesg.msg, jsmesg.when);
if (id in window.opener.GT.gtUnread) delete window.opener.GT.gtUnread[id];
messageTextDiv.innerHTML += worker;
scrollDown(messageTextDiv);
return document.hasFocus();
@ -516,14 +516,14 @@
{
if (id == 0) return;
if (id in window.opener.g_gtFlagPins)
if (id in window.opener.GT.gtFlagPins)
{
callsign.innerHTML = window.opener.g_gtFlagPins[id].call.formatCallsign();
country.innerHTML = window.opener.g_dxccToAltName[window.opener.g_gtFlagPins[id].dxcc];
grid.innerHTML = window.opener.g_gtFlagPins[id].grid;
band.innerHTML = window.opener.g_gtFlagPins[id].band;
mode.innerHTML = window.opener.g_gtFlagPins[id].mode;
appSource.innerHTML = window.opener.g_gtFlagPins[id].src in g_knownSources ? g_knownSources[window.opener.g_gtFlagPins[id].src] : window.opener.g_gtFlagPins[id].src;
callsign.innerHTML = formatCallsign(window.opener.GT.gtFlagPins[id].call);
country.innerHTML = window.opener.GT.dxccToAltName[window.opener.GT.gtFlagPins[id].dxcc];
grid.innerHTML = window.opener.GT.gtFlagPins[id].grid;
band.innerHTML = window.opener.GT.gtFlagPins[id].band;
mode.innerHTML = window.opener.GT.gtFlagPins[id].mode;
appSource.innerHTML = window.opener.GT.gtFlagPins[id].src in g_knownSources ? g_knownSources[window.opener.GT.gtFlagPins[id].src] : window.opener.GT.gtFlagPins[id].src;
}
}
@ -533,31 +533,31 @@
// already displayed?
if (id == g_currentId && messageAreaDiv.style.display == "inline-block") return;
if (!(id in window.opener.g_gtFlagPins)) return;
if (!(id in window.opener.GT.gtFlagPins)) return;
var worker = "";
if (id in window.opener.g_gtMessages && window.opener.g_gtMessages[id].history.length > 0)
if (id in window.opener.GT.gtMessages && window.opener.GT.gtMessages[id].history.length > 0)
{
for (msg in window.opener.g_gtMessages[id].history)
for (msg in window.opener.GT.gtMessages[id].history)
{
if (window.opener.g_gtMessages[id].history[msg].id != 0)
if (window.opener.GT.gtMessages[id].history[msg].id != 0)
worker += makeViewMessage(
"them",
window.opener.g_gtFlagPins[id].call,
window.opener.g_gtMessages[id].history[msg].msg,
window.opener.g_gtMessages[id].history[msg].when
window.opener.GT.gtFlagPins[id].call,
window.opener.GT.gtMessages[id].history[msg].msg,
window.opener.GT.gtMessages[id].history[msg].when
);
else
worker += makeViewMessage(
"self",
window.opener.myDEcall,
window.opener.g_gtMessages[id].history[msg].msg,
window.opener.g_gtMessages[id].history[msg].when
window.opener.GT.appSettings.myCall,
window.opener.GT.gtMessages[id].history[msg].msg,
window.opener.GT.gtMessages[id].history[msg].when
);
}
if (id in window.opener.g_gtUnread)
if (id in window.opener.GT.gtUnread)
{
delete window.opener.g_gtUnread[id];
delete window.opener.GT.gtUnread[id];
updateCallsign(id);
showAllMessages();
}
@ -566,7 +566,7 @@
g_currentId = id;
messageAreaDiv.style.display = "inline-block";
if (window.opener.g_gtFlagPins[id].live == false)
if (window.opener.GT.gtFlagPins[id].live == false)
{
notifyNoChat(id);
} else {

Wyświetl plik

@ -39,7 +39,7 @@
}
function statsFocus(selection) {
var which = document.getElementById(selection);
let which = document.getElementById(selection);
if (which != null) {
which.focus();
which.selectionStart = which.selectionEnd = which.value.length;
@ -48,7 +48,7 @@
function ValidateCallsign(inputText, validDiv) {
if (inputText.value.length > 0) {
var passed = false;
let passed = false;
inputText.value = inputText.value.toUpperCase();
if (/\d/.test(inputText.value) || /[A-Z]/.test(inputText.value)) {
passed = true;
@ -78,7 +78,7 @@
function init() {
ValidateCallsign(lookupCallsignInput, null);
window.opener.g_lookupWindowInitialized = true;
window.opener.GT.lookupWindowInitialized = true;
}
function addTextToClipboard(data) {
@ -86,8 +86,8 @@
}
function setClipboardFromLookup() {
if (window.opener.g_lastLookupAddress) {
addTextToClipboard(window.opener.g_lastLookupAddress);
if (window.opener.GT.lastLookupAddress) {
addTextToClipboard(window.opener.GT.lastLookupAddress);
}
}
@ -120,7 +120,7 @@
<div>
<label data-i18n="lookup.callsign.label" for="lookupCallsignInput">Callsign</label>
<input
id="lookupCallsignInput" type="text" class="inputTextValue" size="12" onkeyup="if (event.keyCode === 13) lookupButtonID.click();" oninput="ValidateCallsign(this,null);"/>
id="lookupCallsignInput" type="text" class="inputTextValue" size="12" onkeyup="if (event.keyCode == 13) lookupButtonID.click();" oninput="ValidateCallsign(this,null);"/>
<div
data-i18n="lookup.callsign.button"
id="lookupButtonID"

Wyświetl plik

@ -21,6 +21,7 @@
<link rel="stylesheet" href="./lib/style.css" />
<link id="roster" rel="stylesheet" href="./lib/style_roster.css" />
<script src="./lib/protos.js" type="text/javascript"></script>
<script src="./lib/screens.js" type="text/javascript"></script>
<script src="./lib/third-party.js" type="text/javascript"></script>
<script src="./lib/jquery-3.6.1.min.js"></script>
<script src="./lib/CLDRPluralRuleParser.js" type="text/javascript"></script>
@ -41,7 +42,6 @@
<script src="./lib/roster/rosterColumns.js" type="text/javascript"></script>
<script src="./lib/roster/rosterColumnFunctions.js" type="text/javascript"></script>
<script src="./lib/roster/sendAlerts.js" type="text/javascript"></script>
<script src="./lib/screens.js" type="text/javascript"></script>
</head>
<body id="rosterBody" onload="init()" onresize="resize()" style="display:none;" class="roster" oncontextmenu="return handleContextMenu(event);">
<div id="MainCallRoster" style="display:block;";>
@ -215,8 +215,8 @@
class="inputTextValue"
size="12"
id="huntRegexValue"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
onfocus="CR.typingInRoster=true;"
onblur="CR.typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="blurOnEnter(this);"
/>
@ -365,8 +365,8 @@
class="inputTextValue"
size="8"
id="noMsgValue"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
onfocus="CR.typingInRoster=true;"
onblur="CR.typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="blurOnEnter(this);"
/>
@ -382,8 +382,8 @@
class="inputTextValue"
size="8"
id="onlyMsgValue"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
onfocus="CR.typingInRoster=true;"
onblur="CR.typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="blurOnEnter(this);"
/>
@ -400,8 +400,8 @@
class="inputTextValue"
size="12"
id="callsignRegex"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
onfocus="CR.typingInRoster=true;"
onblur="CR.typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="blurOnEnter(this);"
/>

Wyświetl plik

@ -20,6 +20,7 @@
<title>Statistics</title>
<link rel="stylesheet" href="./lib/style.css" />
<script src="./lib/protos.js" type="text/javascript"></script>
<script src="./lib/screens.js"></script>
<script src="./lib/jquery-3.6.1.min.js"></script>
<script src="./lib/jquery.i18n.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.messagestore.js" type="text/javascript"></script>
@ -29,7 +30,6 @@
<script src="./lib/jquery.i18n.language.js" type="text/javascript"></script>
<script src="./lib/i18n.js" type="text/javascript"></script>
<script src="./lib/stats.js"></script>
<script src="./lib/screens.js"></script>
</head>
<body id="mainBody" onresize="Resize();" onload="init();">

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -692,26 +692,6 @@
"callsigns.Downloading": "下載中...",
"callsigns.never": "從不",
"callsigns.processing": "處理中...",
"COMMENT_datepicker.js": "",
"datepicker.month.Jan": "一月",
"datepicker.month.Feb": "二月",
"datepicker.month.Mar": "三月",
"datepicker.month.Apr": "四月",
"datepicker.month.May": "五月",
"datepicker.month.Jun": "六月",
"datepicker.month.Jul": "七月",
"datepicker.month.Aug": "八月",
"datepicker.month.Sep": "九月",
"datepicker.month.Oct": "十月",
"datepicker.month.Nov": "十一月",
"datepicker.month.Dec": "十二月",
"datepicker.day.Sun": "日",
"datepicker.day.Mon": "一",
"datepicker.day.Tue": "二",
"datepicker.day.Wed": "三",
"datepicker.day.Thu": "四",
"datepicker.day.Fri": "五",
"datepicker.day.Sat": "六",
"COMMENT_gt.js": "",
"gt.gridView.live": "實時",
"gt.gridView.logbook": "日誌",

Wyświetl plik

@ -692,26 +692,6 @@
"callsigns.Downloading": "下载中...",
"callsigns.never": "Never",
"callsigns.processing": "处理中...",
"COMMENT_datepicker.js": "",
"datepicker.month.Jan": "一月",
"datepicker.month.Feb": "二月",
"datepicker.month.Mar": "三月",
"datepicker.month.Apr": "四月",
"datepicker.month.May": "五月",
"datepicker.month.Jun": "六月",
"datepicker.month.Jul": "七月",
"datepicker.month.Aug": "八月",
"datepicker.month.Sep": "九月",
"datepicker.month.Oct": "十月",
"datepicker.month.Nov": "十一月",
"datepicker.month.Dec": "十二月",
"datepicker.day.Sun": "星期日",
"datepicker.day.Mon": "星期一",
"datepicker.day.Tue": "星期二",
"datepicker.day.Wed": "星期三",
"datepicker.day.Thu": "星期四",
"datepicker.day.Fri": "星期五",
"datepicker.day.Sat": "星期六",
"COMMENT_gt.js": "",
"gt.gridView.live": "实时数据",
"gt.gridView.logbook": "日志数据",

Wyświetl plik

@ -558,7 +558,7 @@
"roster.secondary.exceptions.maxFreq": "Max Freq",
"roster.secondary.exceptions.usesLoTW": "Uses LoTW",
"roster.secondary.exceptions.spottedMe": "Spotted Me",
"roster.secondary.exceptions.noMyDXCC": "Not My Dxcc",
"roster.secondary.exceptions.noMyDXCC": "Not My DXCC",
"roster.secondary.exceptions.onlyMyDXCC": "Only My DXCC",
"roster.secondary.exceptions.useseQSL":" Uses eQSL",
"roster.secondary.exceptions.usesOQRS": "Uses OQRS",
@ -692,26 +692,6 @@
"callsigns.Downloading": "Downloading...",
"callsigns.never": "Never",
"callsigns.processing": "Processing...",
"COMMENT_datepicker.js": "",
"datepicker.month.Jan": "Jan",
"datepicker.month.Feb": "Feb",
"datepicker.month.Mar": "Mar",
"datepicker.month.Apr": "Apr",
"datepicker.month.May": "May",
"datepicker.month.Jun": "Jun",
"datepicker.month.Jul": "Jul",
"datepicker.month.Aug": "Aug",
"datepicker.month.Sep": "Sep",
"datepicker.month.Oct": "Oct",
"datepicker.month.Nov": "Nov",
"datepicker.month.Dec": "Dec",
"datepicker.day.Sun": "Sun",
"datepicker.day.Mon": "Mon",
"datepicker.day.Tue": "Tue",
"datepicker.day.Wed": "Wed",
"datepicker.day.Thu": "Thur",
"datepicker.day.Fri": "Fri",
"datepicker.day.Sat": "Sat",
"COMMENT_gt.js": "",
"gt.gridView.live": "Live",
"gt.gridView.logbook": "Logbook",

Wyświetl plik

@ -18,17 +18,6 @@ Not entirely part of openlayers, but conglomerated together from other stuff:
- lib/shadow.js
## DatePicker - calendar display
- https://code-boxx.com/simple-datepicker-pure-javascript-css/
- https://code-boxx.com/wp-content/uploads/2020/06/datepicker-js.zip
- lib/datepicker.js
- lib/dp-dark.css
Code has been hacked a bit, origin not reflected in version control so be
careful when upgrading.
## Other Third Party routines
lib/third-party.js

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

Wyświetl plik

@ -85,7 +85,7 @@ Arc.prototype.wkt = function ()
};
for (var i = 0; i < this.geometries.length; i++)
{
if (this.geometries[i].coords.length === 0)
if (this.geometries[i].coords.length == 0)
{
return "LINESTRING(empty)";
}
@ -105,13 +105,13 @@ Arc.prototype.wkt = function ()
*/
var GreatCircle = function (start, end, properties)
{
if (!start || start.x === undefined || start.y === undefined)
if (!start || start.x == undefined || start.y == undefined)
{
throw new Error(
"GreatCircle constructor expects two args: start and end objects with x and y properties"
);
}
if (!end || end.x === undefined || end.y === undefined)
if (!end || end.x == undefined || end.y == undefined)
{
throw new Error(
"GreatCircle constructor expects two args: start and end objects with x and y properties"

Wyświetl plik

@ -2,23 +2,23 @@
// All rights reserved.
// See LICENSE for more information.
var g_lotwCallsigns = Object();
var g_lotwFile = "";
var g_lotwWhenDate = 0;
var g_lotwLoadTimer = null;
var g_eqslCallsigns = Object();
var g_eqslFile = "";
var g_eqslWhenDate = 0;
var g_eqslLoadTimer = null;
var g_ulsCallsignsCount = 0;
GT.lotwCallsigns = Object();
GT.lotwFile = "";
GT.lotwWhenDate = 0;
GT.lotwLoadTimer = null;
GT.eqslCallsigns = Object();
GT.eqslFile = "";
GT.eqslWhenDate = 0;
GT.eqslLoadTimer = null;
GT.ulsCallsignsCount = 0;
var g_ulsWhenDate = 0;
var g_ulsLoadTimer = null;
GT.ulsWhenDate = 0;
GT.ulsLoadTimer = null;
var g_oqrsCallsigns = Object();
var g_oqrsFile = "";
var g_oqrsWhenDate = 0;
var g_oqrsLoadTimer = null;
GT.oqrsCallsigns = Object();
GT.oqrsFile = "";
GT.oqrsWhenDate = 0;
GT.oqrsLoadTimer = null;
function dumpFile(file)
{
@ -41,33 +41,33 @@ function dumpDir(dir)
function callsignServicesInit()
{
// Dump old data files we no longer reference
dumpFile(g_jsonDir + "uls-callsigns.json");
dumpFile(g_jsonDir + "us-callsigns.json");
dumpFile(g_jsonDir + "lotw-callsigns.json");
dumpFile(g_jsonDir + "lotw-ts-callsigns.json");
dumpFile(g_jsonDir + "eqsl-callsigns.json");
dumpFile(g_jsonDir + "cloqrs-callsigns.json");
dumpFile(g_jsonDir + "internal_qso.json");
dumpFile(g_jsonDir + "spots.json");
dumpDir(g_jsonDir);
dumpFile(GT.jsonDir + "uls-callsigns.json");
dumpFile(GT.jsonDir + "us-callsigns.json");
dumpFile(GT.jsonDir + "lotw-callsigns.json");
dumpFile(GT.jsonDir + "lotw-ts-callsigns.json");
dumpFile(GT.jsonDir + "eqsl-callsigns.json");
dumpFile(GT.jsonDir + "cloqrs-callsigns.json");
dumpFile(GT.jsonDir + "internal_qso.json");
dumpFile(GT.jsonDir + "spots.json");
dumpDir(GT.jsonDir);
g_lotwFile = g_NWappData + "lotw-ts-callsigns.json";
g_eqslFile = g_NWappData + "eqsl-callsigns.json";
g_oqrsFile = g_NWappData + "cloqrs-callsigns.json";
GT.lotwFile = GT.NWappData + "lotw-ts-callsigns.json";
GT.eqslFile = GT.NWappData + "eqsl-callsigns.json";
GT.oqrsFile = GT.NWappData + "cloqrs-callsigns.json";
if (g_callsignLookups.lotwUseEnable)
if (GT.callsignLookups.lotwUseEnable)
{
lotwLoadCallsigns();
}
if (g_callsignLookups.eqslUseEnable)
if (GT.callsignLookups.eqslUseEnable)
{
eqslLoadCallsigns();
}
if (g_callsignLookups.ulsUseEnable)
if (GT.callsignLookups.ulsUseEnable)
{
ulsLoadCallsigns();
}
if (g_callsignLookups.oqrsUseEnable)
if (GT.callsignLookups.oqrsUseEnable)
{
oqrsLoadCallsigns();
}
@ -80,37 +80,37 @@ function callsignServicesInit()
function saveCallsignSettings()
{
localStorage.callsignLookups = JSON.stringify(g_callsignLookups);
localStorage.callsignLookups = JSON.stringify(GT.callsignLookups);
}
function lotwLoadCallsigns()
{
var now = timeNowSec();
if (now - g_callsignLookups.lotwLastUpdate > 86400 * 7)
{ g_callsignLookups.lotwLastUpdate = 0; }
if (now - GT.callsignLookups.lotwLastUpdate > 86400 * 7)
{ GT.callsignLookups.lotwLastUpdate = 0; }
else
{
var lotwWhenTimer = 86400 * 7 - (now - g_callsignLookups.lotwLastUpdate);
g_lotwWhenDate = now + lotwWhenTimer;
g_lotwLoadTimer = nodeTimers.setTimeout(lotwDownload, lotwWhenTimer * 1000);
var lotwWhenTimer = 86400 * 7 - (now - GT.callsignLookups.lotwLastUpdate);
GT.lotwWhenDate = now + lotwWhenTimer;
GT.lotwLoadTimer = nodeTimers.setTimeout(lotwDownload, lotwWhenTimer * 1000);
}
try
{
if (!fs.existsSync(g_lotwFile))
if (!fs.existsSync(GT.lotwFile))
{
g_callsignLookups.lotwLastUpdate = 0;
GT.callsignLookups.lotwLastUpdate = 0;
}
else
{
var data = fs.readFileSync(g_lotwFile);
g_lotwCallsigns = JSON.parse(data);
if (Object.keys(g_lotwCallsigns).length < 100)
var data = fs.readFileSync(GT.lotwFile);
GT.lotwCallsigns = JSON.parse(data);
if (Object.keys(GT.lotwCallsigns).length < 100)
{
lotwDownload();
}
}
if (g_callsignLookups.lotwLastUpdate == 0)
if (GT.callsignLookups.lotwLastUpdate == 0)
{
lotwDownload();
}
@ -118,40 +118,40 @@ function lotwLoadCallsigns()
catch (e)
{
console.log(e);
g_callsignLookups.lotwLastUpdate = 0;
GT.callsignLookups.lotwLastUpdate = 0;
lotwDownload();
}
}
function lotwSettingsDisplay()
{
lotwUseEnable.checked = g_callsignLookups.lotwUseEnable;
lotwUseEnable.checked = GT.callsignLookups.lotwUseEnable;
if (g_callsignLookups.lotwLastUpdate == 0)
if (GT.callsignLookups.lotwLastUpdate == 0)
{
lotwUpdatedTd.innerHTML = "Never";
}
else
{
lotwUpdatedTd.innerHTML = userTimeString(
g_callsignLookups.lotwLastUpdate * 1000
GT.callsignLookups.lotwLastUpdate * 1000
);
}
if (!g_callsignLookups.lotwUseEnable)
if (!GT.callsignLookups.lotwUseEnable)
{
if (g_lotwLoadTimer != null) nodeTimers.clearTimeout(g_lotwLoadTimer);
g_lotwLoadTimer = null;
g_lotwCallsigns = Object();
if (GT.lotwLoadTimer != null) nodeTimers.clearTimeout(GT.lotwLoadTimer);
GT.lotwLoadTimer = null;
GT.lotwCallsigns = Object();
}
lotwCountTd.innerHTML = Object.keys(g_lotwCallsigns).length;
lotwCountTd.innerHTML = Object.keys(GT.lotwCallsigns).length;
}
function lotwValuesChanged()
{
g_callsignLookups.lotwUseEnable = lotwUseEnable.checked;
GT.callsignLookups.lotwUseEnable = lotwUseEnable.checked;
saveCallsignSettings();
if (g_callsignLookups.lotwUseEnable == true)
if (GT.callsignLookups.lotwUseEnable == true)
{
lotwLoadCallsigns();
}
@ -159,7 +159,7 @@ function lotwValuesChanged()
setAlertVisual();
goProcessRoster();
if (g_rosterInitialized) g_callRosterWindowHandle.window.resize();
if (GT.rosterInitialized) GT.callRosterWindowHandle.window.resize();
}
function lotwDownload(fromSettings)
@ -200,19 +200,19 @@ function processLotwCallsigns(result, flag)
}
}
g_callsignLookups.lotwLastUpdate = timeNowSec();
GT.callsignLookups.lotwLastUpdate = timeNowSec();
var now = timeNowSec();
if (g_lotwLoadTimer != null) nodeTimers.clearTimeout(g_lotwLoadTimer);
if (GT.lotwLoadTimer != null) nodeTimers.clearTimeout(GT.lotwLoadTimer);
var lotwWhenTimer = 86400 * 7 - (now - g_callsignLookups.lotwLastUpdate);
g_lotwWhenDate = now + lotwWhenTimer;
g_lotwLoadTimer = nodeTimers.setTimeout(lotwDownload, lotwWhenTimer * 1000);
var lotwWhenTimer = 86400 * 7 - (now - GT.callsignLookups.lotwLastUpdate);
GT.lotwWhenDate = now + lotwWhenTimer;
GT.lotwLoadTimer = nodeTimers.setTimeout(lotwDownload, lotwWhenTimer * 1000);
if (Object.keys(lotwCallsigns).length > 100)
{
g_lotwCallsigns = lotwCallsigns;
fs.writeFileSync(g_lotwFile, JSON.stringify(g_lotwCallsigns));
GT.lotwCallsigns = lotwCallsigns;
fs.writeFileSync(GT.lotwFile, JSON.stringify(GT.lotwCallsigns));
}
lotwSettingsDisplay();
@ -221,67 +221,67 @@ function processLotwCallsigns(result, flag)
function oqrsLoadCallsigns()
{
var now = timeNowSec();
if (now - g_callsignLookups.oqrsLastUpdate > 86400 * 7)
{ g_callsignLookups.oqrsLastUpdate = 0; }
if (now - GT.callsignLookups.oqrsLastUpdate > 86400 * 7)
{ GT.callsignLookups.oqrsLastUpdate = 0; }
else
{
var oqrsWhenTimer = 86400 * 7 - (now - g_callsignLookups.oqrsLastUpdate);
g_oqrsWhenDate = now + oqrsWhenTimer;
g_oqrsLoadTimer = nodeTimers.setTimeout(oqrsDownload, oqrsWhenTimer * 1000);
var oqrsWhenTimer = 86400 * 7 - (now - GT.callsignLookups.oqrsLastUpdate);
GT.oqrsWhenDate = now + oqrsWhenTimer;
GT.oqrsLoadTimer = nodeTimers.setTimeout(oqrsDownload, oqrsWhenTimer * 1000);
}
try
{
if (!fs.existsSync(g_oqrsFile))
if (!fs.existsSync(GT.oqrsFile))
{
g_callsignLookups.oqrsLastUpdate = 0;
GT.callsignLookups.oqrsLastUpdate = 0;
}
else
{
var data = fs.readFileSync(g_oqrsFile);
g_oqrsCallsigns = JSON.parse(data);
var data = fs.readFileSync(GT.oqrsFile);
GT.oqrsCallsigns = JSON.parse(data);
}
if (g_callsignLookups.oqrsLastUpdate == 0)
if (GT.callsignLookups.oqrsLastUpdate == 0)
{
oqrsDownload();
}
}
catch (e)
{
g_callsignLookups.oqrsLastUpdate = 0;
GT.callsignLookups.oqrsLastUpdate = 0;
oqrsDownload();
}
}
function oqrsSettingsDisplay()
{
oqrsUseEnable.checked = g_callsignLookups.oqrsUseEnable;
oqrsUseEnable.checked = GT.callsignLookups.oqrsUseEnable;
if (g_callsignLookups.oqrsLastUpdate == 0)
if (GT.callsignLookups.oqrsLastUpdate == 0)
{
oqrsUpdatedTd.innerHTML = "Never";
}
else
{
oqrsUpdatedTd.innerHTML = userTimeString(
g_callsignLookups.oqrsLastUpdate * 1000
GT.callsignLookups.oqrsLastUpdate * 1000
);
}
if (!g_callsignLookups.oqrsUseEnable)
if (!GT.callsignLookups.oqrsUseEnable)
{
if (g_oqrsLoadTimer != null) nodeTimers.clearTimeout(g_oqrsLoadTimer);
g_oqrsLoadTimer = null;
g_oqrsCallsigns = Object();
if (GT.oqrsLoadTimer != null) nodeTimers.clearTimeout(GT.oqrsLoadTimer);
GT.oqrsLoadTimer = null;
GT.oqrsCallsigns = Object();
}
oqrsCountTd.innerHTML = Object.keys(g_oqrsCallsigns).length;
oqrsCountTd.innerHTML = Object.keys(GT.oqrsCallsigns).length;
}
function oqrsValuesChanged()
{
g_callsignLookups.oqrsUseEnable = oqrsUseEnable.checked;
GT.callsignLookups.oqrsUseEnable = oqrsUseEnable.checked;
saveCallsignSettings();
if (g_callsignLookups.oqrsUseEnable == true)
if (GT.callsignLookups.oqrsUseEnable == true)
{
oqrsLoadCallsigns();
}
@ -289,7 +289,7 @@ function oqrsValuesChanged()
setAlertVisual();
goProcessRoster();
if (g_rosterInitialized) g_callRosterWindowHandle.window.resize();
if (GT.rosterInitialized) GT.callRosterWindowHandle.window.resize();
}
function oqrsDownload(fromSettings)
@ -306,45 +306,45 @@ function oqrsDownload(fromSettings)
function processoqrsCallsigns(buffer, flag)
{
g_oqrsCallsigns = JSON.parse(buffer);
GT.oqrsCallsigns = JSON.parse(buffer);
g_callsignLookups.oqrsLastUpdate = timeNowSec();
GT.callsignLookups.oqrsLastUpdate = timeNowSec();
var now = timeNowSec();
if (g_oqrsLoadTimer != null) nodeTimers.clearTimeout(g_oqrsLoadTimer);
if (GT.oqrsLoadTimer != null) nodeTimers.clearTimeout(GT.oqrsLoadTimer);
var oqrsWhenTimer = 86400 * 7 - (now - g_callsignLookups.oqrsLastUpdate);
g_oqrsWhenDate = now + oqrsWhenTimer;
g_oqrsLoadTimer = nodeTimers.setTimeout(oqrsDownload, oqrsWhenTimer * 1000);
var oqrsWhenTimer = 86400 * 7 - (now - GT.callsignLookups.oqrsLastUpdate);
GT.oqrsWhenDate = now + oqrsWhenTimer;
GT.oqrsLoadTimer = nodeTimers.setTimeout(oqrsDownload, oqrsWhenTimer * 1000);
fs.writeFileSync(g_oqrsFile, JSON.stringify(g_oqrsCallsigns));
fs.writeFileSync(GT.oqrsFile, JSON.stringify(GT.oqrsCallsigns));
oqrsSettingsDisplay();
}
function eqslLoadCallsigns()
{
var now = timeNowSec();
if (now - g_callsignLookups.eqslLastUpdate > 86400 * 7)
{ g_callsignLookups.eqslLastUpdate = 0; }
if (now - GT.callsignLookups.eqslLastUpdate > 86400 * 7)
{ GT.callsignLookups.eqslLastUpdate = 0; }
else
{
var eqslWhenTimer = 86400 * 7 - (now - g_callsignLookups.eqslLastUpdate);
g_eqslWhenDate = now + eqslWhenTimer;
g_eqslLoadTimer = nodeTimers.setTimeout(eqslDownload, eqslWhenTimer * 1000);
var eqslWhenTimer = 86400 * 7 - (now - GT.callsignLookups.eqslLastUpdate);
GT.eqslWhenDate = now + eqslWhenTimer;
GT.eqslLoadTimer = nodeTimers.setTimeout(eqslDownload, eqslWhenTimer * 1000);
}
try
{
if (!fs.existsSync(g_eqslFile))
if (!fs.existsSync(GT.eqslFile))
{
g_callsignLookups.eqslLastUpdate = 0;
GT.callsignLookups.eqslLastUpdate = 0;
}
else
{
var data = fs.readFileSync(g_eqslFile);
g_eqslCallsigns = JSON.parse(data);
var data = fs.readFileSync(GT.eqslFile);
GT.eqslCallsigns = JSON.parse(data);
}
if (g_callsignLookups.eqslLastUpdate == 0)
if (GT.callsignLookups.eqslLastUpdate == 0)
{
eqslDownload();
}
@ -352,40 +352,40 @@ function eqslLoadCallsigns()
catch (e)
{
console.log(e);
g_callsignLookups.eqslLastUpdate = 0;
GT.callsignLookups.eqslLastUpdate = 0;
eqslDownload();
}
}
function eqslSettingsDisplay()
{
eqslUseEnable.checked = g_callsignLookups.eqslUseEnable;
eqslUseEnable.checked = GT.callsignLookups.eqslUseEnable;
if (g_callsignLookups.eqslLastUpdate == 0)
if (GT.callsignLookups.eqslLastUpdate == 0)
{
eqslUpdatedTd.innerHTML = "Never";
}
else
{
eqslUpdatedTd.innerHTML = userTimeString(
g_callsignLookups.eqslLastUpdate * 1000
GT.callsignLookups.eqslLastUpdate * 1000
);
}
if (!g_callsignLookups.eqslUseEnable)
if (!GT.callsignLookups.eqslUseEnable)
{
if (g_eqslLoadTimer != null) nodeTimers.clearTimeout(g_eqslLoadTimer);
g_eqslLoadTimer = null;
g_eqslCallsigns = Object();
if (GT.eqslLoadTimer != null) nodeTimers.clearTimeout(GT.eqslLoadTimer);
GT.eqslLoadTimer = null;
GT.eqslCallsigns = Object();
}
eqslCountTd.innerHTML = Object.keys(g_eqslCallsigns).length;
eqslCountTd.innerHTML = Object.keys(GT.eqslCallsigns).length;
}
function eqslValuesChanged()
{
g_callsignLookups.eqslUseEnable = eqslUseEnable.checked;
GT.callsignLookups.eqslUseEnable = eqslUseEnable.checked;
saveCallsignSettings();
if (g_callsignLookups.eqslUseEnable == true)
if (GT.callsignLookups.eqslUseEnable == true)
{
eqslLoadCallsigns();
}
@ -393,7 +393,7 @@ function eqslValuesChanged()
setAlertVisual();
goProcessRoster();
if (g_rosterInitialized) g_callRosterWindowHandle.window.resize();
if (GT.rosterInitialized) GT.callRosterWindowHandle.window.resize();
}
function eqslDownload(fromSettings)
@ -413,52 +413,52 @@ function processeqslCallsigns(buffer, flag)
var result = String(buffer);
var lines = Array();
lines = result.split("\n");
g_eqslCallsigns = Object();
GT.eqslCallsigns = Object();
for (x in lines)
{
g_eqslCallsigns[lines[x].trim()] = true;
GT.eqslCallsigns[lines[x].trim()] = true;
}
g_callsignLookups.eqslLastUpdate = timeNowSec();
GT.callsignLookups.eqslLastUpdate = timeNowSec();
var now = timeNowSec();
if (g_eqslLoadTimer != null) nodeTimers.clearTimeout(g_eqslLoadTimer);
if (GT.eqslLoadTimer != null) nodeTimers.clearTimeout(GT.eqslLoadTimer);
var eqslWhenTimer = 86400 * 7 - (now - g_callsignLookups.eqslLastUpdate);
g_eqslWhenDate = now + eqslWhenTimer;
g_eqslLoadTimer = nodeTimers.setTimeout(eqslDownload, eqslWhenTimer * 1000);
var eqslWhenTimer = 86400 * 7 - (now - GT.callsignLookups.eqslLastUpdate);
GT.eqslWhenDate = now + eqslWhenTimer;
GT.eqslLoadTimer = nodeTimers.setTimeout(eqslDownload, eqslWhenTimer * 1000);
if (Object.keys(g_eqslCallsigns).length > 10000)
{ fs.writeFileSync(g_eqslFile, JSON.stringify(g_eqslCallsigns)); }
if (Object.keys(GT.eqslCallsigns).length > 10000)
{ fs.writeFileSync(GT.eqslFile, JSON.stringify(GT.eqslCallsigns)); }
eqslSettingsDisplay();
}
function ulsLoadCallsigns()
{
if (g_ulsLoadTimer != null)
if (GT.ulsLoadTimer != null)
{
nodeTimers.clearTimeout(g_ulsLoadTimer);
g_ulsLoadTimer = null;
nodeTimers.clearTimeout(GT.ulsLoadTimer);
GT.ulsLoadTimer = null;
}
var now = timeNowSec();
if (now - g_callsignLookups.ulsLastUpdate > 86400 * 7) ulsDownload();
if (now - GT.callsignLookups.ulsLastUpdate > 86400 * 7) ulsDownload();
else
{
var ulsWhenTimer = 86400 * 7 - (now - g_callsignLookups.ulsLastUpdate);
g_ulsWhenDate = now + ulsWhenTimer;
g_ulsLoadTimer = nodeTimers.setTimeout(ulsDownload, ulsWhenTimer * 1000);
var ulsWhenTimer = 86400 * 7 - (now - GT.callsignLookups.ulsLastUpdate);
GT.ulsWhenDate = now + ulsWhenTimer;
GT.ulsLoadTimer = nodeTimers.setTimeout(ulsDownload, ulsWhenTimer * 1000);
updateCallsignCount();
}
}
function updateQSO()
{
if (g_ulsCallsignsCount > 0)
if (GT.ulsCallsignsCount > 0)
{
for (hash in g_QSOhash)
for (hash in GT.QSOhash)
{
var details = g_QSOhash[hash];
var details = GT.QSOhash[hash];
var lookupCall = false;
if ((details.cnty == null || details.state == null) && isKnownCallsignDXCC(details.dxcc))
@ -468,11 +468,11 @@ function updateQSO()
}
else if (details.cnty != null && isKnownCallsignUSplus(details.dxcc))
{
if (!(details.cnty in g_cntyToCounty))
if (!(details.cnty in GT.cntyToCounty))
{
if (details.cnty.indexOf(",") == -1)
{
if (!(details.state + "," + details.cnty in g_cntyToCounty))
if (!(details.state + "," + details.cnty in GT.cntyToCounty))
{
lookupCall = true;
}
@ -485,7 +485,7 @@ function updateQSO()
}
if (lookupCall)
{
if (g_callsignLookups.ulsUseEnable)
if (GT.callsignLookups.ulsUseEnable)
{
lookupUsCallsign(details, true);
}
@ -496,7 +496,7 @@ function updateQSO()
function updateCallsignCount()
{
g_ulsDatabase.transaction(function (tx)
GT.ulsDatabase.transaction(function (tx)
{
tx.executeSql("SELECT count(*) as cnt FROM calls", [],
function (tx, results)
@ -504,8 +504,8 @@ function updateCallsignCount()
var len = results.rows.length, i;
if (len == 1)
{
g_ulsCallsignsCount = results.rows[0].cnt;
ulsCountTd.innerHTML = g_ulsCallsignsCount;
GT.ulsCallsignsCount = results.rows[0].cnt;
ulsCountTd.innerHTML = GT.ulsCallsignsCount;
updateQSO();
}
@ -517,31 +517,31 @@ function updateCallsignCount()
function ulsSettingsDisplay()
{
ulsUseEnable.checked = g_callsignLookups.ulsUseEnable;
ulsUseEnable.checked = GT.callsignLookups.ulsUseEnable;
if (g_callsignLookups.ulsLastUpdate == 0)
if (GT.callsignLookups.ulsLastUpdate == 0)
{
ulsUpdatedTd.innerHTML = "Never";
}
else
{
ulsUpdatedTd.innerHTML = userTimeString(g_callsignLookups.ulsLastUpdate * 1000);
ulsUpdatedTd.innerHTML = userTimeString(GT.callsignLookups.ulsLastUpdate * 1000);
}
if (!g_callsignLookups.ulsUseEnable)
if (!GT.callsignLookups.ulsUseEnable)
{
if (g_ulsLoadTimer != null) nodeTimers.clearTimeout(g_ulsLoadTimer);
g_ulsLoadTimer = null;
g_ulsCallsignsCount = 0;
ulsCountTd.innerHTML = g_ulsCallsignsCount;
if (GT.ulsLoadTimer != null) nodeTimers.clearTimeout(GT.ulsLoadTimer);
GT.ulsLoadTimer = null;
GT.ulsCallsignsCount = 0;
ulsCountTd.innerHTML = GT.ulsCallsignsCount;
}
}
function ulsValuesChanged()
{
g_callsignLookups.ulsUseEnable = ulsUseEnable.checked;
GT.callsignLookups.ulsUseEnable = ulsUseEnable.checked;
if (g_callsignLookups.ulsUseEnable == true)
if (GT.callsignLookups.ulsUseEnable == true)
{
ulsLoadCallsigns();
}
@ -554,7 +554,7 @@ function ulsValuesChanged()
ulsSettingsDisplay();
goProcessRoster();
if (g_rosterInitialized) g_callRosterWindowHandle.window.resize();
if (GT.rosterInitialized) GT.callRosterWindowHandle.window.resize();
}
function ulsDownload()
@ -624,27 +624,28 @@ function getChunkedBuffer(file_url, callback, flag, mode, port, cookie, errorHan
.on("end", function () {})
.on("error", function (e)
{
ulsUpdatedTd.innerHTML = "<b><i>Error downloading</i></b>";
console.error("Got error: " + e.message);
});
});
}
var g_ulsDatabase = openDatabase(
GT.ulsDatabase = openDatabase(
"ulsDB",
"1.0",
"US Callsigns",
50 * 1024 * 1024
);
g_ulsDatabase.transaction(function (tx)
GT.ulsDatabase.transaction(function (tx)
{
tx.executeSql("CREATE TABLE IF NOT EXISTS calls (callsign TEXT PRIMARY KEY, zip, state)");
});
function resetULSDatabase()
{
g_callsignLookups.ulsLastUpdate = 0;
g_ulsCallsignsCount = 0;
GT.callsignLookups.ulsLastUpdate = 0;
GT.ulsCallsignsCount = 0;
}
function processulsCallsigns(data, flag, cookies, starting, finished)
@ -669,17 +670,17 @@ function processulsCallsigns(data, flag, cookies, starting, finished)
if (lines.length > 0)
{
g_ulsDatabase.transaction(function (tx)
GT.ulsDatabase.transaction(function (tx)
{
if (starting == true)
{
if (g_ulsLoadTimer != null)
if (GT.ulsLoadTimer != null)
{
nodeTimers.clearTimeout(g_ulsLoadTimer);
nodeTimers.clearTimeout(GT.ulsLoadTimer);
}
g_ulsLoadTimer = null;
g_ulsWhenDate = 0;
g_ulsCallsignsCount = 0;
GT.ulsLoadTimer = null;
GT.ulsWhenDate = 0;
GT.ulsCallsignsCount = 0;
ulsUpdatedTd.innerHTML = "<b><i>Processing...</i></b>";
tx.executeSql("delete from calls");
}
@ -687,9 +688,9 @@ function processulsCallsigns(data, flag, cookies, starting, finished)
{
if (lines[x].length)
{
++g_ulsCallsignsCount;
tx.executeSql("INSERT INTO calls (rowid, callsign, zip, state) VALUES (" + g_ulsCallsignsCount + ",\"" + lines[x].substr(7) + "\",\"" + lines[x].substr(0, 5) + "\",\"" + lines[x].substr(5, 2) + "\")");
if (g_ulsCallsignsCount % 10000 == 0)
++GT.ulsCallsignsCount;
tx.executeSql("INSERT INTO calls (rowid, callsign, zip, state) VALUES (" + GT.ulsCallsignsCount + ",\"" + lines[x].substr(7) + "\",\"" + lines[x].substr(0, 5) + "\",\"" + lines[x].substr(5, 2) + "\")");
if (GT.ulsCallsignsCount % 10000 == 0)
{
tx.executeSql(
"SELECT count(*) as cnt FROM calls",
@ -715,16 +716,16 @@ function processulsCallsigns(data, flag, cookies, starting, finished)
{
var now = timeNowSec();
if (g_ulsLoadTimer != null)
if (GT.ulsLoadTimer != null)
{
nodeTimers.clearTimeout(g_ulsLoadTimer);
nodeTimers.clearTimeout(GT.ulsLoadTimer);
}
var ulsWhenTimer = 86400 * 7;
g_ulsWhenDate = ulsWhenTimer + now;
g_ulsLoadTimer = nodeTimers.setTimeout(ulsDownload, ulsWhenTimer * 1000);
GT.ulsWhenDate = ulsWhenTimer + now;
GT.ulsLoadTimer = nodeTimers.setTimeout(ulsDownload, ulsWhenTimer * 1000);
g_ulsDatabase.transaction(function (tx)
GT.ulsDatabase.transaction(function (tx)
{
tx.executeSql(
"SELECT count(*) as cnt FROM calls",
@ -735,9 +736,9 @@ function processulsCallsigns(data, flag, cookies, starting, finished)
i;
if (len == 1)
{
g_ulsCallsignsCount = results.rows[0].cnt;
ulsCountTd.innerHTML = g_ulsCallsignsCount;
g_callsignLookups.ulsLastUpdate = timeNowSec();
GT.ulsCallsignsCount = results.rows[0].cnt;
ulsCountTd.innerHTML = GT.ulsCallsignsCount;
GT.callsignLookups.ulsLastUpdate = timeNowSec();
saveCallsignSettings();
ulsSettingsDisplay();
updateQSO();
@ -752,7 +753,7 @@ function processulsCallsigns(data, flag, cookies, starting, finished)
function lookupUsCallsign(object, writeState = false)
{
g_ulsDatabase.transaction(function (tx)
GT.ulsDatabase.transaction(function (tx)
{
let qry = "SELECT * FROM calls where callsign = \"" + object.DEcall + "\"";
tx.executeSql(
@ -781,7 +782,7 @@ function lookupUsCallsign(object, writeState = false)
object.zipcode = String(results.rows[0].zip);
if (object.cnty == null)
{
let request = g_Idb.transaction(["lookups"], "readwrite").objectStore("lookups").get(object.DEcall);
let request = GT.Idb.transaction(["lookups"], "readwrite").objectStore("lookups").get(object.DEcall);
request.onsuccess = function (event)
{
@ -791,9 +792,9 @@ function lookupUsCallsign(object, writeState = false)
object.qual = true;
}
if (object.cnty == null && object.zipcode in g_zipToCounty)
if (object.cnty == null && object.zipcode in GT.zipToCounty)
{
var counties = g_zipToCounty[object.zipcode];
var counties = GT.zipToCounty[object.zipcode];
if (counties.length > 1)
{
object.qual = false;
@ -870,8 +871,8 @@ function processCtyDat(buffer)
if (key in ctydata)
{
dxccInfo[key].cqzone = Number(ctydata[key].cqzone).pad(2);
dxccInfo[key].ituzone = Number(ctydata[key].ituzone).pad(2);
dxccInfo[key].cqzone = padNumber(Number(ctydata[key].cqzone), 2);
dxccInfo[key].ituzone = padNumber(Number(ctydata[key].ituzone), 2);
// Skip Guantanamo Bay, hand crafted with love
if (key != "105")
@ -895,12 +896,12 @@ function processCtyDat(buffer)
var cqTest = test.match(/\((.*)\)/);
if (cqTest)
{
cq = Number(cqTest[1]).pad(2);
cq = padNumber(Number(cqTest[1]), 2);
}
var ituTest = test.match(/\[(.*)\]/);
if (ituTest)
{
itu = Number(ituTest[1]).pad(2);
itu = padNumber(Number(ituTest[1]), 2);
}
var i = test.indexOf("(");

Wyświetl plik

@ -1,273 +0,0 @@
// FIXME ****************************************************************************** //
// The datepicker's "Time" section doesn't work. This really needs to be fixed before
// the next big RTTY Roundup or Field Day where there may be a lot of hams that want
// to use this feature to only reference their log starting when the contest starts.
// Which isn't always 00:00 UTC.
// ************************************************************************************ //
var picker = {
attach: function (opt)
{
// attach() : attach datepicker to target
// opt : options (object)
// target : datepicker will populate this field
// container : datepicker will be generated in this container
// startmon : start on Monday (default false)
// disableday : array of days to disable, e.g. [2,7] to disable Tue and Sun
// (A) Create new datepicker
var dp = document.createElement("div");
dp.dataset.target = opt.target;
dp.dataset.fire = opt.fire;
dp.dataset.startmon = opt.startmon ? "1" : "0";
dp.classList.add("picker");
if (opt.disableday)
{
dp.dataset.disableday = JSON.stringify(opt.disableday);
}
// (B) Default to current month + year
// ! NOTE: UTC+0 !
var today = new Date(),
thisMonth = today.getUTCMonth(), // Note: Jan is 0
thisYear = today.getUTCFullYear(),
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
// (C) Month select
var select = document.createElement("select"),
option = null;
select.classList.add("picker-m");
for (var mth in months)
{
option = document.createElement("option");
option.value = parseInt(mth) + 1;
option.text = months[mth];
select.appendChild(option);
}
select.selectedIndex = thisMonth;
select.addEventListener("change", function() { picker.draw(this); });
dp.appendChild(select);
// (D) Year select
var yRange = 100; // Year range to show, I.E. from thisYear-yRange to thisYear+yRange
select = document.createElement("select");
select.classList.add("picker-y");
for (var y = thisYear - yRange; y < thisYear + 20; y++)
{
option = document.createElement("option");
option.value = y;
option.text = y;
select.appendChild(option);
}
select.selectedIndex = yRange;
select.addEventListener("change", function() { picker.draw(this); });
dp.appendChild(select);
// (E) Day select
var days = document.createElement("div");
days.classList.add("picker-d");
dp.appendChild(days);
// (F) Attach date picker to target container + draw the dates
picker.draw(select);
// (F1) Popup datepicker
if (opt.container == 1)
{
// Mark this as a "popup"
var uniqueID = 0;
while (document.getElementById("picker-" + uniqueID) != null)
{
uniqueID = Math.floor(Math.random() * (100 - 2)) + 1;
}
dp.dataset.popup = "1";
dp.dataset.dpid = uniqueID;
// Create wrapper
var wrapper = document.createElement("div");
wrapper.id = "picker-" + uniqueID;
wrapper.classList.add("picker-wrap");
wrapper.appendChild(dp);
// Attach onclick to show/hide datepicker
var target = document.getElementById(opt.target);
target.dataset.dp = uniqueID;
target.onfocus = function ()
{
document.getElementById("picker-" + this.dataset.dp).classList.add("show");
};
wrapper.addEventListener("click", function (evt)
{
if (evt.target.classList.contains("picker-wrap"))
{
this.classList.remove("show");
}
});
// Attach popup datepicker to document
document.documentElement.appendChild(wrapper);
}
// (F2) Inline datepicker
else
{
document.getElementById(opt.container).appendChild(dp);
}
},
draw: function (el)
{
// draw() : draw the days in month
// el : HTML reference to either year or month selector
// (A) Get date picker components
var parent = el.parentElement,
year = parent.getElementsByClassName("picker-y")[0].value,
month = parent.getElementsByClassName("picker-m")[0].value,
days = parent.getElementsByClassName("picker-d")[0];
// (B) Date range calculation
// ! NOTE: UTC+0 !
var daysInMonth = new Date(Date.UTC(year, month, 0)).getUTCDate(),
startDay = new Date(Date.UTC(year, month - 1, 1)).getUTCDay(), // Note: Sun = 0
endDay = new Date(Date.UTC(year, month - 1, daysInMonth)).getUTCDay(),
startDay = startDay == 0 ? 7 : startDay,
endDay = endDay == 0 ? 7 : endDay;
// (C) Generate date squares (in array first)
var squares = [],
disableday = null;
if (parent.dataset.disableday)
{
disableday = JSON.parse(parent.dataset.disableday);
}
// (C1) Empty squares before first day of month
if (parent.dataset.startmon == "1" && startDay != 1)
{
for (var i = 1; i < startDay; i++) { squares.push("B"); }
}
if (parent.dataset.startmon == "0" && startDay != 7)
{
for (var i = 0; i < startDay; i++) { squares.push("B"); }
}
// (C2) Days of month
// All days enabled, just add
if (disableday == null)
{
for (var i = 1; i <= daysInMonth; i++) { squares.push([i, false]); }
}
// Some days disabled
else
{
var thisday = startDay;
for (var i = 1; i <= daysInMonth; i++)
{
// Check if day is disabled
var disabled = disableday.includes(thisday);
// Day of month, disabled
squares.push([i, disabled]);
// Next day
thisday++;
if (thisday == 8) { thisday = 1; }
}
}
// (C2) Empty squares after last day of month
if (parent.dataset.startmon == "1" && endDay != 7)
{
for (var i = endDay; i < 7; i++) { squares.push("B"); }
}
if (parent.dataset.startmon == "0" && endDay != 6)
{
for (var i = endDay; i < (endDay == 7 ? 13 : 6); i++) { squares.push("B"); }
}
// (D) Draw HTML
var daynames = ["Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
if (parent.dataset.startmon == "1") { daynames.push("Sun"); }
else { daynames.unshift("Sun"); }
// (D1) Header
var table = document.createElement("table"),
row = table.insertRow()
cell = null;
row.classList.add("picker-d-h");
for (let d of daynames)
{
cell = row.insertCell();
cell.innerHTML = d;
}
// (D2) Date cells
var total = squares.length;
row = table.insertRow();
for (var i = 0; i < total; i++)
{
if (i != total && i % 7 == 0) { row = table.insertRow(); }
cell = row.insertCell();
if (squares[i] == "B")
{
cell.classList.add("picker-d-b");
}
else
{
cell.innerHTML = squares[i][0];
// Not allowed to choose this day
if (squares[i][1])
{
cell.classList.add("picker-d-dd");
}
// Allowed to choose this day
else
{
cell.classList.add("picker-d-d");
cell.addEventListener("click", function() { picker.pick(this); });
}
}
}
// (D3) Attach new calendar to datepicker
days.innerHTML = "";
days.appendChild(table);
},
pick: function (el)
{
// pick() : choose a date
// el : HTML reference to selected date cell
// (A) Get all components
var parent = el.parentElement;
while (!parent.classList.contains("picker"))
{
parent = parent.parentElement;
}
// (B) Get full selected year month day
var year = parent.getElementsByClassName("picker-y")[0].value,
month = parent.getElementsByClassName("picker-m")[0].value,
day = el.innerHTML;
// YYYY-MM-DD Format
// ! CHANGE FORMAT HERE IF YOU WANT !
if (parseInt(month) < 10) { month = "0" + month; }
if (parseInt(day) < 10) { day = "0" + day; }
var fullDate = year + "-" + month + "-" + day;
// (C) Update selected date
document.getElementById(parent.dataset.target).value = fullDate;
if (parent.dataset.fire.length > 0)
{
window[parent.dataset.fire]();
}
// (D) Popup only - close the popup
if (parent.dataset.popup == "1")
{
document.getElementById("picker-" + parent.dataset.dpid).classList.remove("show");
}
}
};

Wyświetl plik

@ -68,8 +68,8 @@ var def_appSettings = {
mouseTrack: 0,
multicast: false,
myBand: "OOB",
myDEGrid: "",
myDEcall: "NOCALL",
myGrid: "",
myCall: "NOCALL",
myMode: "",
myRawCall: "NOCALL",
myRawFreq: "",

Wyświetl plik

@ -1,74 +0,0 @@
/* [POPUP] */
.picker-wrap {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: hidden;
transition: opacity 0.2s;
}
.picker-wrap.show {
opacity: 1;
visibility: visible;
}
.picker-wrap .picker {
margin: 50vh auto 0 auto;
transform: translateY(-50%);
}
/* [CONTAINER] */
.picker {
max-width: 200px;
border: 1px solid #444;
-webkit-border-radius: 6px;
background: #444;
border-style: outset;
padding: 5px;
}
.picker:hover {
border: 1px solid #888;
}
/* [MONTH + YEAR] */
.picker-m,
.picker-y {
width: 25%;
padding: 5px;
box-sizing: border-box;
/*font-size: 16px;*/
}
/* [DAY] */
.picker-d table {
color: #fff;
border-collapse: separate;
width: 100%;
margin-top: 5px;
}
.picker-d table td {
width: 2em; /* 7 equal columns */
padding: 2px;
text-align: center;
}
/* Header cells */
.picker-d-h td {
font-weight: bold;
}
/* Blank dates */
.picker-d-b {
background: #4e4e4e;
}
/* Pickable Dates */
.picker-d-d:hover {
cursor: pointer;
background: #a33c3c;
}
/* Unpickable Dates */
.picker-d-dd {
color: #888;
background: #4e4e4e;
}

Plik diff jest za duży Load Diff

Wyświetl plik

@ -2,8 +2,8 @@
// All rights reserved.
// See LICENSE for more information.
var g_gtEngineInterval = null;
var g_chatRecvFunctions = {
GT.gtEngineInterval = null;
GT.chatRecvFunctions = {
uuid: gtChatSetUUID,
list: gtChatNewList,
info: gtChatUpdateCall,
@ -19,11 +19,12 @@ ChatState.idle = 0;
ChatState.connect = 1;
ChatState.connecting = 2;
ChatState.connected = 3;
ChatState.waitUUID = 7;
ChatState.status = 4;
ChatState.closed = 5;
ChatState.error = 6;
var g_gtStateToFunction = {
GT.gtStateToFunction = {
"-1": gtSetIdle,
0: gtCanConnect,
1: gtConnectChat,
@ -31,61 +32,62 @@ var g_gtStateToFunction = {
3: gtChatSendUUID,
4: gtStatusCheck,
5: gtInError,
6: gtClosedSocket
6: gtClosedSocket,
7: gtWaitUUID
};
var g_gtChatSocket = null;
var g_gtFlagPins = Object();
var g_gtMessages = Object();
var g_gtUnread = Object();
var g_gtCallsigns = Object();
var g_gtSentAwayToCid = Object();
GT.gtChatSocket = null;
GT.gtFlagPins = Object();
GT.gtMessages = Object();
GT.gtUnread = Object();
GT.gtCallsigns = Object();
GT.gtSentAwayToCid = Object();
var g_gtState = ChatState.none;
var g_gtStatusCount = 0;
var g_gtStatusTime = 500;
var g_gtMaxChatMessages = 100;
var g_gtNeedUsersList = true;
var g_gtUuidValid = false;
GT.gtState = ChatState.none;
GT.gtStatusCount = 0;
GT.gtStatusTime = 500;
GT.gtMaxChatMessages = 100;
GT.gtNeedUsersList = true;
GT.gtUuidValid = false;
var g_gtLiveStatusUpdate = false;
var g_oamsBandActivityData = null;
GT.gtLiveStatusUpdate = false;
GT.oamsBandActivityData = null;
var myChatId = 0;
var myRoom = 0;
var g_gtCurrentMessageCount = 0;
GT.gtCurrentMessageCount = 0;
function gtConnectChat()
{
if (g_gtChatSocket != null)
if (GT.gtChatSocket != null)
{
// we should start over
g_gtState = ChatState.error;
GT.gtState = ChatState.error;
return;
}
var rnd = parseInt(Math.random() * 10) + 18360;
try
{
g_gtState = ChatState.connecting;
g_gtChatSocket = new WebSocket("ws://oams.space:" + rnd);
GT.gtState = ChatState.connecting;
GT.gtChatSocket = new WebSocket("ws://oams.space:" + rnd);
}
catch (e)
{
g_gtState = ChatState.error;
GT.gtState = ChatState.error;
return;
}
g_gtChatSocket.onopen = function ()
GT.gtChatSocket.onopen = function ()
{
g_gtState = ChatState.connected;
GT.gtState = ChatState.connected;
};
g_gtChatSocket.onmessage = function (evt)
GT.gtChatSocket.onmessage = function (evt)
{
if (g_appSettings.gtShareEnable == true)
if (GT.appSettings.gtShareEnable == true)
{
let jsmesg = false;
try
@ -95,18 +97,18 @@ function gtConnectChat()
catch (err)
{
// bad message, dumping client
g_gtState = ChatState.error;
GT.gtState = ChatState.error;
return;
}
if (!("type" in jsmesg))
{
g_gtState = ChatState.error;
GT.gtState = ChatState.error;
return;
}
if (jsmesg.type in g_chatRecvFunctions)
if (jsmesg.type in GT.chatRecvFunctions)
{
g_chatRecvFunctions[jsmesg.type](jsmesg);
GT.chatRecvFunctions[jsmesg.type](jsmesg);
}
else
{
@ -116,14 +118,17 @@ function gtConnectChat()
}
};
g_gtChatSocket.onerror = function ()
GT.gtChatSocket.onerror = function ()
{
g_gtState = ChatState.error;
this.close();
GT.gtChatSocket = null;
GT.gtState = ChatState.error;
};
g_gtChatSocket.onclose = function ()
GT.gtChatSocket.onclose = function ()
{
g_gtState = ChatState.closed;
GT.gtChatSocket = null;
GT.gtState = ChatState.closed;
};
}
@ -138,121 +143,121 @@ function gtChatSendClose()
{
msg = Object();
msg.type = "close";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
sendGtJson(JSON.stringify(msg));
}
function closeGtSocket()
{
if (g_gtChatSocket != null)
if (GT.gtChatSocket != null)
{
gtChatSendClose();
if (g_gtChatSocket.readyState != WebSocket.CLOSED) g_gtChatSocket.close();
if (g_gtChatSocket.readyState === WebSocket.CLOSED)
{
g_gtChatSocket = null;
g_gtState = ChatState.none;
}
GT.gtChatSocket.close();
GT.gtChatSocket = null;
GT.gtState = ChatState.none;
}
else g_gtState = ChatState.none;
else GT.gtState = ChatState.none;
}
function gtClosedSocket()
{
g_gtChatSocket = null;
g_gtState = ChatState.none;
if (GT.gtChatSocket != null)
{
GT.gtChatSocket.close();
GT.gtChatSocket = null;
}
GT.gtState = ChatState.none;
}
// Connect 15 seconds after startup
var g_lastConnectAttempt = parseInt(Date.now() / 1000) - 15;
GT.lastConnectAttempt = parseInt(Date.now() / 1000) - 15;
function gtCanConnect()
{
g_lastConnectAttempt = timeNowSec();
g_gtState = ChatState.connect;
GT.lastConnectAttempt = timeNowSec();
GT.gtState = ChatState.connect;
}
function gtSetIdle()
{
if (timeNowSec() - g_lastConnectAttempt >= 30)
if (timeNowSec() - GT.lastConnectAttempt >= 30)
{
g_gtStatusCount = 0;
g_gtNeedUsersList = true;
g_gtState = ChatState.idle;
g_lastGtStatus = "";
GT.gtStatusCount = 0;
GT.gtNeedUsersList = true;
GT.gtState = ChatState.idle;
GT.lastGtStatus = "";
}
g_gtUuidValid = false;
GT.gtUuidValid = false;
}
function gtStatusCheck()
{
if (g_gtStatusCount > 0)
if (GT.gtStatusCount > 0)
{
g_gtStatusCount--;
GT.gtStatusCount--;
}
if (g_gtStatusCount == 0 || g_gtLiveStatusUpdate == true)
if (GT.gtStatusCount == 0 || GT.gtLiveStatusUpdate == true)
{
if (g_gtLiveStatusUpdate == true)
if (GT.gtLiveStatusUpdate == true)
{
g_gtLiveStatusUpdate = false;
GT.gtLiveStatusUpdate = false;
}
else
{
g_lastGtStatus = "";
g_gtStatusCount = g_gtStatusTime;
GT.lastGtStatus = "";
GT.gtStatusCount = GT.gtStatusTime;
}
gtChatSendStatus();
}
if (g_gtNeedUsersList == true)
if (GT.gtNeedUsersList == true)
{
g_gtNeedUsersList = false;
GT.gtNeedUsersList = false;
gtChatGetList();
}
}
function sendGtJson(json, isUUIDrequest = false)
{
if (g_appSettings.gtShareEnable == true && g_gtChatSocket != null)
if (GT.appSettings.gtShareEnable == true && GT.gtChatSocket != null)
{
if (g_gtChatSocket.readyState === WebSocket.OPEN && (isUUIDrequest || g_gtUuidValid))
if (GT.gtChatSocket.readyState == WebSocket.OPEN && (isUUIDrequest || GT.gtUuidValid))
{
g_gtChatSocket.send(json);
GT.gtChatSocket.send(json);
}
else
{
if (g_gtChatSocket.readyState === WebSocket.CLOSED)
if (GT.gtChatSocket.readyState == WebSocket.CLOSED)
{
g_gtState = ChatState.closed;
GT.gtState = ChatState.closed;
}
}
}
}
var g_lastGtStatus = "";
GT.lastGtStatus = "";
function gtChatSendStatus()
{
var msg = Object();
msg.type = "status";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
msg.call = myDEcall;
msg.grid = myRawGrid;
msg.freq = myRawFreq;
msg.mode = myMode;
msg.band = myBand;
msg.call = GT.appSettings.myCall;
msg.grid = GT.appSettings.myRawGrid;
msg.freq = GT.appSettings.myRawFreq;
msg.mode = GT.appSettings.myMode;
msg.band = GT.appSettings.myBand;
msg.src = "GT";
msg.canmsg = g_appSettings.gtMsgEnable;
msg.o = g_appSettings.gtSpotEnable == true ? 1 : 0;
msg.canmsg = GT.appSettings.gtMsgEnable;
msg.o = GT.appSettings.gtSpotEnable == true ? 1 : 0;
msg = JSON.stringify(msg);
if (msg != g_lastGtStatus)
if (msg != GT.lastGtStatus)
{
sendGtJson(msg);
g_lastGtStatus = msg;
GT.lastGtStatus = msg;
}
}
@ -260,7 +265,7 @@ function gtChatSendSpots(spotsObject, detailsObject)
{
let msg = Object();
msg.type = "o";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
msg.o = spotsObject;
msg.d = detailsObject;
@ -271,17 +276,17 @@ function gtChatSendDecodes(instancesObject)
{
let msg = Object();
msg.type = "d";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
msg.i = instancesObject;
sendGtJson(JSON.stringify(msg));
}
function oamsBandActivityCheck()
{
if (g_appSettings.oamsBandActivity == true && myDEGrid.length >= 4)
if (GT.appSettings.oamsBandActivity == true && GT.appSettings.myGrid.length >= 4)
{
let grid = myDEGrid.substring(0, 4).toUpperCase();
if (g_appSettings.oamsBandActivityNeighbors == true)
let grid = GT.appSettings.myGrid.substring(0, 4).toUpperCase();
if (GT.appSettings.oamsBandActivityNeighbors == true)
{
gtChatSendBandActivityRequest(squareToNeighbors(grid));
}
@ -296,14 +301,14 @@ function gtChatSendBandActivityRequest(gridArray)
{
msg = Object();
msg.type = "ba";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
msg.ga = gridArray;
sendGtJson(JSON.stringify(msg));
}
function bandActivityReply(jsmesg)
{
g_oamsBandActivityData = jsmesg.r;
GT.oamsBandActivityData = jsmesg.r;
renderBandActivity();
}
@ -312,40 +317,34 @@ function gtChatRemoveCall(jsmesg)
var id = jsmesg.id;
var cid = jsmesg.cid;
if (cid in g_gtFlagPins)
if (cid in GT.gtFlagPins)
{
if (id in g_gtFlagPins[cid].ids)
if (id in GT.gtFlagPins[cid].ids)
{
delete g_gtFlagPins[cid].ids[id];
}
else
{
console.log("drop: No such id in g_gtFlagPins.ids:");
console.log(jsmesg);
console.log(g_gtFlagPins[cid].ids);
delete GT.gtFlagPins[cid].ids[id];
}
if (Object.keys(g_gtFlagPins[cid].ids).length == 0)
if (Object.keys(GT.gtFlagPins[cid].ids).length == 0)
{
delete g_gtCallsigns[g_gtFlagPins[cid].call][cid];
delete GT.gtCallsigns[GT.gtFlagPins[cid].call][cid];
if (g_gtFlagPins[cid].pin != null)
if (GT.gtFlagPins[cid].pin != null)
{
// remove pin from map here
if (g_layerSources.gtflags.hasFeature(g_gtFlagPins[cid].pin))
{ g_layerSources.gtflags.removeFeature(g_gtFlagPins[cid].pin); }
delete g_gtFlagPins[cid].pin;
g_gtFlagPins[cid].pin = null;
if (GT.layerSources.gtflags.hasFeature(GT.gtFlagPins[cid].pin))
{ GT.layerSources.gtflags.removeFeature(GT.gtFlagPins[cid].pin); }
delete GT.gtFlagPins[cid].pin;
GT.gtFlagPins[cid].pin = null;
}
g_gtFlagPins[cid].live = false;
GT.gtFlagPins[cid].live = false;
notifyNoChat(cid);
if (!(cid in g_gtMessages))
if (!(cid in GT.gtMessages))
{
if (Object.keys(g_gtCallsigns[g_gtFlagPins[cid].call]).length == 0)
if (Object.keys(GT.gtCallsigns[GT.gtFlagPins[cid].call]).length == 0)
{
delete g_gtCallsigns[g_gtFlagPins[cid].call];
delete GT.gtCallsigns[GT.gtFlagPins[cid].call];
}
delete g_gtFlagPins[cid];
delete GT.gtFlagPins[cid];
}
updateChatWindow(cid);
@ -358,60 +357,60 @@ function gtChatUpdateCall(jsmesg)
var id = jsmesg.id;
var cid = jsmesg.cid;
if (cid in g_gtFlagPins)
if (cid in GT.gtFlagPins)
{
g_gtFlagPins[cid].ids[id] = true;
GT.gtFlagPins[cid].ids[id] = true;
// Did they move grid location?
if (jsmesg.grid != g_gtFlagPins[cid].grid && g_gtFlagPins[cid].pin != null)
if (jsmesg.grid != GT.gtFlagPins[cid].grid && GT.gtFlagPins[cid].pin != null)
{
// remove pin from map here
if (g_layerSources.gtflags.hasFeature(g_gtFlagPins[cid].pin))
{ g_layerSources.gtflags.removeFeature(g_gtFlagPins[cid].pin); }
delete g_gtFlagPins[cid].pin;
g_gtFlagPins[cid].pin = null;
if (GT.layerSources.gtflags.hasFeature(GT.gtFlagPins[cid].pin))
{ GT.layerSources.gtflags.removeFeature(GT.gtFlagPins[cid].pin); }
delete GT.gtFlagPins[cid].pin;
GT.gtFlagPins[cid].pin = null;
}
// Changed callsign?
if (g_gtFlagPins[cid].call != jsmesg.call)
if (GT.gtFlagPins[cid].call != jsmesg.call)
{
delete g_gtCallsigns[g_gtFlagPins[cid].call][cid];
delete GT.gtCallsigns[GT.gtFlagPins[cid].call][cid];
}
}
else
{
g_gtFlagPins[cid] = Object();
g_gtFlagPins[cid].pin = null;
g_gtFlagPins[cid].ids = Object();
g_gtFlagPins[cid].ids[id] = true;
GT.gtFlagPins[cid] = Object();
GT.gtFlagPins[cid].pin = null;
GT.gtFlagPins[cid].ids = Object();
GT.gtFlagPins[cid].ids[id] = true;
}
g_gtFlagPins[cid].cid = jsmesg.cid;
g_gtFlagPins[cid].call = jsmesg.call;
g_gtFlagPins[cid].fCall = jsmesg.call.formatCallsign();
g_gtFlagPins[cid].grid = jsmesg.grid;
g_gtFlagPins[cid].freq = jsmesg.freq;
g_gtFlagPins[cid].band = jsmesg.band;
g_gtFlagPins[cid].mode = jsmesg.mode;
g_gtFlagPins[cid].src = jsmesg.src;
g_gtFlagPins[cid].canmsg = jsmesg.canmsg;
g_gtFlagPins[cid].o = jsmesg.o;
g_gtFlagPins[cid].dxcc = callsignToDxcc(jsmesg.call);
g_gtFlagPins[cid].live = true;
GT.gtFlagPins[cid].cid = jsmesg.cid;
GT.gtFlagPins[cid].call = jsmesg.call;
GT.gtFlagPins[cid].fCall = formatCallsign(jsmesg.call);
GT.gtFlagPins[cid].grid = jsmesg.grid;
GT.gtFlagPins[cid].freq = jsmesg.freq;
GT.gtFlagPins[cid].band = jsmesg.band;
GT.gtFlagPins[cid].mode = jsmesg.mode;
GT.gtFlagPins[cid].src = jsmesg.src;
GT.gtFlagPins[cid].canmsg = jsmesg.canmsg;
GT.gtFlagPins[cid].o = jsmesg.o;
GT.gtFlagPins[cid].dxcc = callsignToDxcc(jsmesg.call);
GT.gtFlagPins[cid].live = true;
// Make a pin here
if (g_gtFlagPins[cid].pin == null)
if (GT.gtFlagPins[cid].pin == null)
{
makeGtPin(g_gtFlagPins[cid]);
if (g_gtFlagPins[cid].pin != null)
makeGtPin(GT.gtFlagPins[cid]);
if (GT.gtFlagPins[cid].pin != null)
{
g_layerSources.gtflags.addFeature(g_gtFlagPins[cid].pin);
GT.layerSources.gtflags.addFeature(GT.gtFlagPins[cid].pin);
}
}
if (!(g_gtFlagPins[cid].call in g_gtCallsigns))
if (!(GT.gtFlagPins[cid].call in GT.gtCallsigns))
{
// Can happen when a user changes callsign
g_gtCallsigns[g_gtFlagPins[cid].call] = {};
GT.gtCallsigns[GT.gtFlagPins[cid].call] = {};
}
g_gtCallsigns[g_gtFlagPins[cid].call][cid] = true;
GT.gtCallsigns[GT.gtFlagPins[cid].call][cid] = true;
updateChatWindow(cid);
}
@ -420,7 +419,7 @@ function gtChatGetList()
{
msg = Object();
msg.type = "list";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
sendGtJson(JSON.stringify(msg));
}
@ -428,19 +427,19 @@ function gtChatGetList()
function redrawPins()
{
clearGtFlags();
for (cid in g_gtFlagPins)
for (cid in GT.gtFlagPins)
{
if (g_gtFlagPins[cid].pin != null)
if (GT.gtFlagPins[cid].pin != null)
{
delete g_gtFlagPins[cid].pin;
g_gtFlagPins[cid].pin = null;
delete GT.gtFlagPins[cid].pin;
GT.gtFlagPins[cid].pin = null;
}
makeGtPin(g_gtFlagPins[cid]);
makeGtPin(GT.gtFlagPins[cid]);
if (g_gtFlagPins[cid].pin != null)
if (GT.gtFlagPins[cid].pin != null)
{
g_layerSources.gtflags.addFeature(g_gtFlagPins[cid].pin);
GT.layerSources.gtflags.addFeature(GT.gtFlagPins[cid].pin);
}
}
}
@ -451,9 +450,9 @@ function makeGtPin(obj)
{
if (obj.pin)
{
if (g_layerSources.gtflags.hasFeature(obj.pin))
if (GT.layerSources.gtflags.hasFeature(obj.pin))
{
g_layerSources.gtflags.removeFeature(obj.pin);
GT.layerSources.gtflags.removeFeature(obj.pin);
}
delete obj.pin;
obj.pin = null;
@ -473,7 +472,7 @@ function makeGtPin(obj)
}
var LL = squareToCenter(obj.grid);
obj.pin = iconFeature(ol.proj.fromLonLat([LL.o, LL.a]), g_gtFlagIcon, 100);
obj.pin = iconFeature(ol.proj.fromLonLat([LL.o, LL.a]), GT.gtFlagIcon, 100);
obj.pin.key = obj.cid;
obj.pin.isGtFlag = true;
obj.pin.size = 1;
@ -486,11 +485,11 @@ function gtChatNewList(jsmesg)
clearGtFlags();
// starting clean if we're getting a new chat list
g_gtFlagPins = Object()
g_gtMessages = Object();
g_gtUnread = Object();
g_gtCallsigns = Object();
g_gtSentAwayToCid = Object();
GT.gtFlagPins = Object()
GT.gtMessages = Object();
GT.gtUnread = Object();
GT.gtCallsigns = Object();
GT.gtSentAwayToCid = Object();
for (var key in jsmesg.data.calls)
{
@ -498,43 +497,43 @@ function gtChatNewList(jsmesg)
var id = jsmesg.data.id[key];
if (id != myChatId)
{
if (cid in g_gtFlagPins)
if (cid in GT.gtFlagPins)
{
g_gtFlagPins[cid].ids[id] = true;
GT.gtFlagPins[cid].ids[id] = true;
}
else
{
g_gtFlagPins[cid] = Object();
g_gtFlagPins[cid].ids = Object();
g_gtFlagPins[cid].ids[id] = true;
g_gtFlagPins[cid].pin = null;
GT.gtFlagPins[cid] = Object();
GT.gtFlagPins[cid].ids = Object();
GT.gtFlagPins[cid].ids[id] = true;
GT.gtFlagPins[cid].pin = null;
}
g_gtFlagPins[cid].call = jsmesg.data.calls[key];
g_gtFlagPins[cid].fCall = g_gtFlagPins[cid].call.formatCallsign();
g_gtFlagPins[cid].grid = jsmesg.data.grid[key];
g_gtFlagPins[cid].freq = jsmesg.data.freq[key];
g_gtFlagPins[cid].band = jsmesg.data.band[key];
g_gtFlagPins[cid].mode = jsmesg.data.mode[key];
g_gtFlagPins[cid].src = jsmesg.data.src[key];
g_gtFlagPins[cid].cid = cid;
g_gtFlagPins[cid].canmsg = jsmesg.data.canmsg[key];
g_gtFlagPins[cid].o = jsmesg.data.o[key];
g_gtFlagPins[cid].dxcc = callsignToDxcc(g_gtFlagPins[cid].call);
g_gtFlagPins[cid].live = true;
GT.gtFlagPins[cid].call = jsmesg.data.calls[key];
GT.gtFlagPins[cid].fCall = formatCallsign(GT.gtFlagPins[cid].call);
GT.gtFlagPins[cid].grid = jsmesg.data.grid[key];
GT.gtFlagPins[cid].freq = jsmesg.data.freq[key];
GT.gtFlagPins[cid].band = jsmesg.data.band[key];
GT.gtFlagPins[cid].mode = jsmesg.data.mode[key];
GT.gtFlagPins[cid].src = jsmesg.data.src[key];
GT.gtFlagPins[cid].cid = cid;
GT.gtFlagPins[cid].canmsg = jsmesg.data.canmsg[key];
GT.gtFlagPins[cid].o = jsmesg.data.o[key];
GT.gtFlagPins[cid].dxcc = callsignToDxcc(GT.gtFlagPins[cid].call);
GT.gtFlagPins[cid].live = true;
if (!(g_gtFlagPins[cid].call in g_gtCallsigns))
if (!(GT.gtFlagPins[cid].call in GT.gtCallsigns))
{
g_gtCallsigns[g_gtFlagPins[cid].call] = Object();
GT.gtCallsigns[GT.gtFlagPins[cid].call] = Object();
}
g_gtCallsigns[g_gtFlagPins[cid].call][cid] = true;
GT.gtCallsigns[GT.gtFlagPins[cid].call][cid] = true;
makeGtPin(g_gtFlagPins[cid]);
makeGtPin(GT.gtFlagPins[cid]);
if (g_gtFlagPins[cid].pin != null)
if (GT.gtFlagPins[cid].pin != null)
{
g_layerSources.gtflags.addFeature(g_gtFlagPins[cid].pin);
GT.layerSources.gtflags.addFeature(GT.gtFlagPins[cid].pin);
}
}
}
@ -546,16 +545,16 @@ function gtChatNewList(jsmesg)
function appendToHistory(cid, jsmesg)
{
if (!(cid in g_gtMessages))
if (!(cid in GT.gtMessages))
{
g_gtMessages[cid] = Object();
g_gtMessages[cid].history = Array();
GT.gtMessages[cid] = Object();
GT.gtMessages[cid].history = Array();
}
g_gtMessages[cid].history.push(jsmesg);
while (g_gtMessages[cid].history.length > g_gtMaxChatMessages)
GT.gtMessages[cid].history.push(jsmesg);
while (GT.gtMessages[cid].history.length > GT.gtMaxChatMessages)
{
g_gtMessages[cid].history.shift();
GT.gtMessages[cid].history.shift();
}
}
@ -570,7 +569,7 @@ function htmlEntities(str)
function gtChatMessage(jsmesg)
{
if (g_appSettings.gtMsgEnable == true)
if (GT.appSettings.gtMsgEnable == true)
{
var cid = jsmesg.cid;
jsmesg.when = Date.now();
@ -587,16 +586,16 @@ function gtChatMessage(jsmesg)
if (jsmesg.call != null && jsmesg.call != "" && jsmesg.call != "NOCALL")
{
appendToHistory(cid, jsmesg);
g_gtUnread[cid] = true;
g_gtCurrentMessageCount++;
GT.gtUnread[cid] = true;
GT.gtCurrentMessageCount++;
if (newChatMessage(cid, jsmesg) == false) alertChatMessage();
if (g_msgSettings.msgAwaySelect == 1 && !(cid in g_gtSentAwayToCid))
if (GT.msgSettings.msgAwaySelect == 1 && !(cid in GT.gtSentAwayToCid))
{
g_gtSentAwayToCid[cid] = true;
GT.gtSentAwayToCid[cid] = true;
gtSendMessage(
"Away message [ " + g_msgSettings.msgAwayText + " ]",
"Away message [ " + GT.msgSettings.msgAwayText + " ]",
cid
);
}
@ -608,7 +607,7 @@ function gtSendMessage(message, who)
{
msg = Object();
msg.type = "mesg";
msg.uuid = g_appSettings.chatUUID;
msg.uuid = GT.appSettings.chatUUID;
msg.cid = who;
msg.msg = new Buffer.from(message).toString("base64"); // eslint-disable-line new-cap
sendGtJson(JSON.stringify(msg));
@ -622,76 +621,90 @@ function gtChatSendUUID()
{
var msg = Object();
msg.type = "uuid";
if (g_appSettings.chatUUID != "") msg.uuid = g_appSettings.chatUUID;
msg.call = myDEcall;
if (GT.appSettings.chatUUID != "")
{
msg.uuid = GT.appSettings.chatUUID;
}
else
{
msg.uuid = null;
}
msg.call = GT.appSettings.myCall;
msg.ver = gtShortVersion;
sendGtJson(JSON.stringify(msg), true);
GT.gtState = ChatState.waitUUID;
}
function gtWaitUUID()
{
console.log("waiting for UUID from OAMS");
}
function gtChatSetUUID(jsmesg)
{
g_appSettings.chatUUID = jsmesg.uuid;
GT.appSettings.chatUUID = jsmesg.uuid;
myChatId = jsmesg.id;
g_gtUuidValid = true;
GT.gtUuidValid = true;
gtChatSendStatus();
g_gtLiveStatusUpdate = false;
g_gtStatusCount = g_gtStatusTime;
g_gtState = ChatState.status;
GT.gtLiveStatusUpdate = false;
GT.gtStatusCount = GT.gtStatusTime;
GT.gtState = ChatState.status;
}
var g_getEngineWasRunning = false;
GT.getEngineWasRunning = false;
function gtChatStateMachine()
{
if (g_appSettings.gtShareEnable == true && g_mapSettings.offlineMode == false)
if (GT.appSettings.gtShareEnable == true && GT.mapSettings.offlineMode == false)
{
var now = timeNowSec();
g_gtStateToFunction[g_gtState]();
GT.gtStateToFunction[GT.gtState]();
if (Object.keys(g_gtUnread).length > 0 && now % 2 == 0)
if (Object.keys(GT.gtUnread).length > 0 && now % 2 == 0)
{
msgImg.style.webkitFilter = "invert(1)";
}
else msgImg.style.webkitFilter = "";
if (g_msgSettings.msgFrequencySelect > 0 && Object.keys(g_gtUnread).length > 0)
if (GT.msgSettings.msgFrequencySelect > 0 && Object.keys(GT.gtUnread).length > 0)
{
if (now - g_lastChatMsgAlert > g_msgSettings.msgFrequencySelect * 60)
if (now - GT.lastChatMsgAlert > GT.msgSettings.msgFrequencySelect * 60)
{
alertChatMessage();
}
}
g_getEngineWasRunning = true;
GT.getEngineWasRunning = true;
}
else
{
if (g_getEngineWasRunning == true)
if (GT.getEngineWasRunning == true)
{
g_getEngineWasRunning = false;
GT.getEngineWasRunning = false;
closeGtSocket();
g_lastGtStatus = "";
GT.lastGtStatus = "";
}
}
}
function gtSpotMessage(jsmesg)
{
if (jsmesg.cid in g_gtFlagPins)
if (jsmesg.cid in GT.gtFlagPins)
{
let frequency, band, mode;
if (jsmesg.ex != null)
{
frequency = Number(jsmesg.ex[0]);
band = Number(frequency / 1000000).formatBand();
band = formatBand(Number(frequency / 1000000));
mode = String(jsmesg.ex[1]);
}
else
{
frequency = g_gtFlagPins[jsmesg.cid].freq;
band = g_gtFlagPins[jsmesg.cid].band;
mode = g_gtFlagPins[jsmesg.cid].mode;
frequency = GT.gtFlagPins[jsmesg.cid].freq;
band = GT.gtFlagPins[jsmesg.cid].band;
mode = GT.gtFlagPins[jsmesg.cid].mode;
}
addNewOAMSSpot(jsmesg.cid, jsmesg.db, frequency, band, mode);
@ -700,55 +713,55 @@ function gtSpotMessage(jsmesg)
function gtChatSystemInit()
{
g_gtEngineInterval = nodeTimers.setInterval(gtChatStateMachine, 1000);
GT.gtEngineInterval = nodeTimers.setInterval(gtChatStateMachine, 1000);
}
function showGtFlags()
{
if (g_appSettings.gtFlagImgSrc > 0)
if (GT.appSettings.gtFlagImgSrc > 0)
{
if (g_mapSettings.offlineMode == false)
if (GT.mapSettings.offlineMode == false)
{
redrawPins();
g_layerVectors.gtflags.setVisible(true);
GT.layerVectors.gtflags.setVisible(true);
}
else
{
g_layerVectors.gtflags.setVisible(false);
GT.layerVectors.gtflags.setVisible(false);
}
}
else g_layerVectors.gtflags.setVisible(false);
else GT.layerVectors.gtflags.setVisible(false);
}
function clearGtFlags()
{
g_layerSources.gtflags.clear();
GT.layerSources.gtflags.clear();
}
function toggleGtMap()
{
g_appSettings.gtFlagImgSrc += 1;
g_appSettings.gtFlagImgSrc %= 2;
gtFlagImg.src = g_gtFlagImageArray[g_appSettings.gtFlagImgSrc];
if (g_spotView > 0 && g_receptionSettings.mergeSpots == false) return;
if (g_appSettings.gtFlagImgSrc > 0)
GT.appSettings.gtFlagImgSrc += 1;
GT.appSettings.gtFlagImgSrc %= 2;
gtFlagImg.src = GT.gtFlagImageArray[GT.appSettings.gtFlagImgSrc];
if (GT.spotView > 0 && GT.receptionSettings.mergeSpots == false) return;
if (GT.appSettings.gtFlagImgSrc > 0)
{
redrawPins();
g_layerVectors.gtflags.setVisible(true);
GT.layerVectors.gtflags.setVisible(true);
}
else
{
g_layerVectors.gtflags.setVisible(false);
GT.layerVectors.gtflags.setVisible(false);
}
}
function notifyNoChat(id)
{
if (g_chatWindowHandle != null)
if (GT.chatWindowHandle != null)
{
try
{
g_chatWindowHandle.window.notifyNoChat(id);
GT.chatWindowHandle.window.notifyNoChat(id);
}
catch (e) {}
}
@ -756,17 +769,17 @@ function notifyNoChat(id)
function updateChatWindow(id = null)
{
if (g_chatWindowHandle != null)
if (GT.chatWindowHandle != null)
{
try
{
if (id)
{
g_chatWindowHandle.window.updateCallsign(id);
GT.chatWindowHandle.window.updateCallsign(id);
}
else
{
g_chatWindowHandle.window.updateEverything();
GT.chatWindowHandle.window.updateEverything();
}
}
catch (e) {}
@ -776,33 +789,33 @@ function updateChatWindow(id = null)
function newChatMessage(id, jsmesg)
{
var hasFocus = false;
if (g_msgSettings.msgActionSelect == 1) showMessaging();
if (GT.msgSettings.msgActionSelect == 1) showMessaging();
if (g_chatWindowHandle != null)
if (GT.chatWindowHandle != null)
{
try
{
hasFocus = g_chatWindowHandle.window.newChatMessage(id, jsmesg);
g_chatWindowHandle.window.messagesRedraw();
hasFocus = GT.chatWindowHandle.window.newChatMessage(id, jsmesg);
GT.chatWindowHandle.window.messagesRedraw();
}
catch (e) {}
}
return hasFocus;
}
var g_lastChatMsgAlert = 0;
GT.lastChatMsgAlert = 0;
function alertChatMessage()
{
if (g_msgSettings.msgAlertSelect == 1)
if (GT.msgSettings.msgAlertSelect == 1)
{
// Text to speech
speakAlertString(g_msgSettings.msgAlertWord);
speakAlertString(GT.msgSettings.msgAlertWord);
}
if (g_msgSettings.msgAlertSelect == 2)
if (GT.msgSettings.msgAlertSelect == 2)
{
// Audible
playAlertMediaFile(g_msgSettings.msgAlertMedia);
playAlertMediaFile(GT.msgSettings.msgAlertMedia);
}
g_lastChatMsgAlert = timeNowSec();
GT.lastChatMsgAlert = timeNowSec();
}

Wyświetl plik

@ -8,7 +8,7 @@ function loadi18n()
{
$.i18n().load(languages).done(function ()
{
$.i18n().locale = g_appSettings.locale;
$.i18n().locale = GT.appSettings.locale;
});
}
@ -20,8 +20,8 @@ function renderI18n(locale)
function changeLocale()
{
g_appSettings.locale = languageLocale.value;
renderI18n(g_appSettings.locale);
GT.appSettings.locale = languageLocale.value;
renderI18n(GT.appSettings.locale);
saveAppSettings();
chrome.runtime.reload();
}
@ -30,7 +30,7 @@ function loadChildWindowI18n()
{
$.i18n().load(languages).done(function ()
{
renderI18n(window.opener.g_appSettings.locale);
renderI18n(window.opener.GT.appSettings.locale);
});
}
@ -38,12 +38,12 @@ function loadRosteri18n()
{
$.i18n().load(languages).done(function ()
{
renderI18n(window.opener.g_appSettings.locale);
renderI18n(window.opener.GT.appSettings.locale);
addControls();
});
}
function renderLocale()
{
renderI18n(g_appSettings.locale);
renderI18n(GT.appSettings.locale);
}

Wyświetl plik

@ -1,276 +1,2 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 2px solid #00f;
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0, 60, 136, 0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000;
text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000;
text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
border: 1px solid #000;
}
.ol-unsupported {
display: none;
}
.ol-unselectable,
.ol-viewport {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.ol-overlaycontainer,
.ol-overlaycontainer-stopevent {
pointer-events: none;
}
.ol-overlaycontainer-stopevent > *,
.ol-overlaycontainer > * {
pointer-events: auto;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255, 255, 255, 0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255, 255, 255, 0.6);
}
.ol-zoom {
top: 0.5em;
left: 0.5em;
}
.ol-rotate {
top: 0.5em;
right: 0.5em;
transition: opacity 0.25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity 0.25s linear, visibility 0s linear 0.25s;
}
.ol-zoom-extent {
top: 4.643em;
left: 0.5em;
}
.ol-full-screen {
right: 0.5em;
top: 0.5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: #fff;
font-size: 1.14em;
font-weight: 700;
text-decoration: none;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: 0.4em;
background-color: rgba(0, 60, 136, 0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-control button span {
pointer-events: none;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: 400;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:focus,
.ol-control button:hover {
text-decoration: none;
background-color: rgba(0, 60, 136, 0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: 0.5em;
right: 0.5em;
max-width: calc(100% - 1.3em);
}
.ol-attribution ul {
margin: 0;
padding: 0 0.5em;
color: #000;
text-shadow: 0 0 2px #fff;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button,
.ol-attribution ul {
display: inline-block;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255, 255, 255, 0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -0.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: 0.5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: inline-block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 1px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255, 255, 255, 0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0, 60, 136, 0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=ol.css.map */
.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid #b3c5db;background-color:rgba(255,255,255,.4)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-singlebar-even{background-color:#000}.ol-scale-singlebar-odd{background-color:#fff}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:rgba(0,60,136,.7);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff;font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}
/*# sourceMappingURL=ol.css.map */

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -2,7 +2,7 @@
// All rights reserved.
// See LICENSE for more information.
var g_pota = {
GT.pota = {
parks: {},
locations: {},
parksTimeout: null,
@ -17,7 +17,7 @@ var g_pota = {
rbnFrequency: 600000
};
var g_potaSpotTemplate = {
GT.potaSpotTemplate = {
activator: "",
frequency: 0,
mode: "",
@ -33,11 +33,11 @@ var g_potaSpotTemplate = {
spotterGrid: ""
};
var g_parkTemplate = {
GT.parkTemplate = {
feature: null
}
var g_potaUnknownPark = {
GT.potaUnknownPark = {
name: "Unknown park (not yet spotted)",
active: "0",
entityId: "-1",
@ -47,14 +47,14 @@ var g_potaUnknownPark = {
grid: ""
};
var g_gtParkIconActive = new ol.style.Icon({
GT.gtParkIconActive = new ol.style.Icon({
src: "./img/pota_icon_active.png",
anchorYUnits: "pixels",
anchorXUnits: "pixels",
anchor: [10, 19]
});
var g_gtParkIconInactive = new ol.style.Icon({
GT.gtParkIconInactive = new ol.style.Icon({
src: "./img/pota_icon_inactive.png",
anchorYUnits: "pixels",
anchorXUnits: "pixels",
@ -63,15 +63,15 @@ var g_gtParkIconInactive = new ol.style.Icon({
function initPota()
{
potaEnabled.checked = (g_appSettings.potaEnabled == 1);
potaMenu.checked = g_appSettings.potaShowMenu;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu && g_mapSettings.offlineMode == false) ? "" : "none";
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
potaEnabled.checked = (GT.appSettings.potaEnabled == 1);
potaMenu.checked = GT.appSettings.potaShowMenu;
potaButton.style.display = (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaShowMenu && GT.mapSettings.offlineMode == false) ? "" : "none";
potaImg.style.filter = GT.appSettings.potaMapEnabled ? "" : "grayscale(1)";
g_layerSources.pota.clear();
g_pota.mapParks = {};
GT.layerSources.pota.clear();
GT.pota.mapParks = {};
if (g_appSettings.potaEnabled == 1)
if (GT.appSettings.potaEnabled == 1)
{
getPotaParks();
}
@ -79,11 +79,11 @@ function initPota()
function changePotaEnable()
{
g_appSettings.potaEnabled = (potaEnabled.checked == true) ? 1 : 0;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu && g_mapSettings.offlineMode == false) ? "" : "none";
if (!g_appSettings.potaEnabled)
GT.appSettings.potaEnabled = (potaEnabled.checked == true) ? 1 : 0;
potaButton.style.display = (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaShowMenu && GT.mapSettings.offlineMode == false) ? "" : "none";
if (!GT.appSettings.potaEnabled)
{
g_layerSources.pota.clear();
GT.layerSources.pota.clear();
}
else
{
@ -96,18 +96,18 @@ function changePotaEnable()
function changePotaMenu()
{
g_appSettings.potaShowMenu = potaMenu.checked;
GT.appSettings.potaShowMenu = potaMenu.checked;
potaButton.style.display = (g_appSettings.potaEnabled == 1 && g_appSettings.potaShowMenu && g_mapSettings.offlineMode == false) ? "" : "none";
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
potaButton.style.display = (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaShowMenu && GT.mapSettings.offlineMode == false) ? "" : "none";
potaImg.style.filter = GT.appSettings.potaMapEnabled ? "" : "grayscale(1)";
saveAppSettings();
}
function togglePotaMap()
{
g_appSettings.potaMapEnabled = !g_appSettings.potaMapEnabled;
potaImg.style.filter = g_appSettings.potaMapEnabled ? "" : "grayscale(1)";
GT.appSettings.potaMapEnabled = !GT.appSettings.potaMapEnabled;
potaImg.style.filter = GT.appSettings.potaMapEnabled ? "" : "grayscale(1)";
saveAppSettings();
@ -116,11 +116,11 @@ function togglePotaMap()
function redrawParks()
{
g_layerSources.pota.clear();
GT.layerSources.pota.clear();
if (g_appSettings.potaEnabled == 1 && g_appSettings.potaMapEnabled)
if (GT.appSettings.potaEnabled == 1 && GT.appSettings.potaMapEnabled)
{
g_pota.mapParks = {};
GT.pota.mapParks = {};
makeParkFeatures();
}
}
@ -129,22 +129,22 @@ function makeParkFeatures()
{
try
{
for (const park in g_pota.parkSpots)
for (const park in GT.pota.parkSpots)
{
if (park in g_pota.parks)
if (park in GT.pota.parks)
{
var parkObj = Object.assign({}, g_parkTemplate);
for (const call in g_pota.parkSpots[park])
var parkObj = Object.assign({}, GT.parkTemplate);
for (const call in GT.pota.parkSpots[park])
{
var report = g_pota.parkSpots[park][call];
if (parkObj.feature == null && validateMapBandAndMode(report.band, report.mode))
var report = GT.pota.parkSpots[park][call];
if (parkObj.feature == null && validateMapBandAndMode(report.band, report.mode) && Date.now() < report.expire)
{
parkObj.feature = iconFeature(ol.proj.fromLonLat([Number(g_pota.parks[park].longitude), Number(g_pota.parks[park].latitude)]), g_gtParkIconActive, 1);
parkObj.feature = iconFeature(ol.proj.fromLonLat([Number(GT.pota.parks[park].longitude), Number(GT.pota.parks[park].latitude)]), GT.gtParkIconActive, 1);
parkObj.feature.key = park;
parkObj.feature.size = 22;
g_pota.mapParks[park] = parkObj;
g_layerSources.pota.addFeature(parkObj.feature);
GT.pota.mapParks[park] = parkObj;
GT.layerSources.pota.addFeature(parkObj.feature);
}
}
}
@ -159,62 +159,62 @@ function makeParkFeatures()
function potaSpotFromDecode(callObj)
{
if (myDEcall != "" && myDEcall != "NOCALL")
if (GT.appSettings.myCall != "" && GT.appSettings.myCall != "NOCALL")
{
var park = callObj.pota;
if (callObj.DEcall in g_pota.callSpots && park in g_pota.parkSpots)
if (callObj.DEcall in GT.pota.callSpots && park in GT.pota.parkSpots)
{
// update spot
var newObj = spotFromCallObj(callObj, park, g_pota.parkSpots[park][callObj.DEcall].count);
g_pota.parkSpots[park][callObj.DEcall] = fillObjectFromTemplate(g_pota.parkSpots[park][callObj.DEcall], newObj);
var newObj = spotFromCallObj(callObj, park, GT.pota.parkSpots[park][callObj.DEcall].count);
GT.pota.parkSpots[park][callObj.DEcall] = fillObjectFromTemplate(GT.pota.parkSpots[park][callObj.DEcall], newObj);
// may or may not be on screen, so try
if (g_appSettings.potaMapEnabled)
if (GT.appSettings.potaMapEnabled)
{
addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
addParkSpotFeature(park, GT.pota.parkSpots[park][callObj.DEcall]);
}
var hash = park + callObj.DEcall;
if (!(hash in g_pota.rbnReportTimes) || Date.now() > g_pota.rbnReportTimes[hash])
if (!(hash in GT.pota.rbnReportTimes) || Date.now() > GT.pota.rbnReportTimes[hash])
{
g_pota.rbnReportTimes[hash] = Date.now() + g_pota.rbnFrequency;
reportPotaRBN(g_pota.parkSpots[park][callObj.DEcall]);
GT.pota.rbnReportTimes[hash] = Date.now() + GT.pota.rbnFrequency;
// reportPotaRBN(GT.pota.parkSpots[park][callObj.DEcall]);
}
}
else if (callObj.DEcall in g_pota.callSchedule)
else if (callObj.DEcall in GT.pota.callSchedule)
{
// Looks like it's scheduled, so it's new
g_pota.callSpots[callObj.DEcall] = park;
GT.pota.callSpots[callObj.DEcall] = park;
if (!(park in g_pota.parkSpots))
if (!(park in GT.pota.parkSpots))
{
g_pota.parkSpots[park] = {};
GT.pota.parkSpots[park] = {};
}
var newObj = spotFromCallObj(callObj, park, 0);
newObj.expire = newObj.spotTime + 300000;
g_pota.parkSpots[park][callObj.DEcall] = newObj;
GT.pota.parkSpots[park][callObj.DEcall] = newObj;
if (g_appSettings.potaMapEnabled)
if (GT.appSettings.potaMapEnabled)
{
addParkSpotFeature(park, g_pota.parkSpots[park][callObj.DEcall]);
addParkSpotFeature(park, GT.pota.parkSpots[park][callObj.DEcall]);
}
var hash = park + callObj.DEcall;
if (!(hash in g_pota.rbnReportTimes) || Date.now() > g_pota.rbnReportTimes[hash])
if (!(hash in GT.pota.rbnReportTimes) || Date.now() > GT.pota.rbnReportTimes[hash])
{
g_pota.rbnReportTimes[hash] = Date.now() + g_pota.rbnFrequency;
reportPotaRBN(g_pota.parkSpots[park][callObj.DEcall]);
GT.pota.rbnReportTimes[hash] = Date.now() + GT.pota.rbnFrequency;
// reportPotaRBN(GT.pota.parkSpots[park][callObj.DEcall]);
}
}
else
{
if (!(callObj.DEcall in g_pota.callSpots))
if (!(callObj.DEcall in GT.pota.callSpots))
{
console.log("No call spot: " + callObj.DEcall);
}
if (!(park in g_pota.parkSpots))
if (!(park in GT.pota.parkSpots))
{
console.log("No park spot: " + park);
}
@ -222,13 +222,13 @@ function potaSpotFromDecode(callObj)
}
}
function reportPotaRBN(callSpot)
/* function reportPotaRBN(callSpot)
{
if (Date.now() < callSpot.expire)
{
var report = {
activator: callSpot.activator,
spotter: myDEcall + "-#",
spotter: GT.appSettings.myCall + "-#",
frequency: String(parseInt(callSpot.frequency * 1000)),
reference: callSpot.reference,
mode: callSpot.mode,
@ -253,7 +253,7 @@ function reportPotaRBN(callSpot)
);
}
}
}
} */
function reportPotaQSO(record)
{
@ -290,15 +290,15 @@ function reportPotaQSO(record)
function rbnReportResult(buffer, flag, cookies)
{
// It worked! process latest spots!
if (g_pota.spotsTimeout)
if (GT.pota.spotsTimeout)
{
nodeTimers.clearTimeout(g_pota.spotsTimeout);
g_pota.spotsTimeout = null;
nodeTimers.clearTimeout(GT.pota.spotsTimeout);
GT.pota.spotsTimeout = null;
}
processPotaSpots(String(buffer));
g_pota.spotsTimeout = nodeTimers.setTimeout(getPotaSpots, 300000);
GT.pota.spotsTimeout = nodeTimers.setTimeout(getPotaSpots, 300000);
}
function spotFromCallObj(callObj, park, inCount, rbnTime)
@ -306,44 +306,44 @@ function spotFromCallObj(callObj, park, inCount, rbnTime)
var callSpot = {
activator: callObj.DEcall,
activatorGrid: callObj.grid,
spotter: myDEcall + "-#",
spotterGrid: myDEGrid,
frequency: Number((g_instances[callObj.instance].status.Frequency / 1000000).toFixed(3)),
spotter: GT.appSettings.myCall + "-#",
spotterGrid: GT.appSettings.myGrid,
frequency: Number((GT.instances[callObj.instance].status.Frequency / 1000000).toFixed(3)),
reference: park,
mode: callObj.mode,
band: callObj.band,
spotTime: Date.now(),
source: "GT",
count: inCount + 1,
comments: "GT " + callObj.RSTsent + " dB " + myDEGrid + " via " + myDEcall + "-#"
comments: "GT " + callObj.RSTsent + " dB " + GT.appSettings.myGrid + " via " + GT.appSettings.myCall + "-#"
};
return callSpot;
}
function addParkSpotFeature(park, report)
{
var parkObj = Object.assign({}, g_parkTemplate);
if (park in g_pota.mapParks)
var parkObj = Object.assign({}, GT.parkTemplate);
if (park in GT.pota.mapParks)
{
parkObj = g_pota.mapParks[park];
parkObj = GT.pota.mapParks[park];
}
else
{
g_pota.mapParks[park] = parkObj;
GT.pota.mapParks[park] = parkObj;
}
if (parkObj.feature == null && validateMapBandAndMode(report.band, report.mode))
{
parkObj.feature = iconFeature(ol.proj.fromLonLat([Number(g_pota.parks[park].longitude), Number(g_pota.parks[park].latitude)]), g_gtParkIconActive, 1);
parkObj.feature = iconFeature(ol.proj.fromLonLat([Number(GT.pota.parks[park].longitude), Number(GT.pota.parks[park].latitude)]), GT.gtParkIconActive, 1);
parkObj.feature.key = park;
parkObj.feature.size = 22;
g_layerSources.pota.addFeature(parkObj.feature);
GT.layerSources.pota.addFeature(parkObj.feature);
}
}
function processPotaParks(buffer)
{
if (g_appSettings.potaEnabled == 1)
if (GT.appSettings.potaEnabled == 1)
{
try
{
@ -361,10 +361,10 @@ function processPotaParks(buffer)
}
newParks[park].locationDesc = locations.join(", ");
}
newParks["?-????"] = g_potaUnknownPark;
newParks["?-????"] = GT.potaUnknownPark;
g_pota.parks = newParks;
g_pota.locations = data.locations;
GT.pota.parks = newParks;
GT.pota.locations = data.locations;
getPotaSchedule();
getPotaSpots();
}
@ -379,13 +379,13 @@ function processPotaParks(buffer)
function getPotaParks()
{
if (g_pota.parksTimeout)
if (GT.pota.parksTimeout)
{
nodeTimers.clearTimeout(g_pota.parksTimeout);
g_pota.spotsTimeout = null;
nodeTimers.clearTimeout(GT.pota.parksTimeout);
GT.pota.spotsTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
if (GT.mapSettings.offlineMode == false && GT.appSettings.potaEnabled == 1)
{
getBuffer(
"https://storage.googleapis.com/gt_app/pota.json?cb=" + Date.now(),
@ -396,7 +396,7 @@ function getPotaParks()
);
}
g_pota.parksTimeout = nodeTimers.setTimeout(getPotaParks, 86400000)
GT.pota.parksTimeout = nodeTimers.setTimeout(getPotaParks, 86400000)
}
// This is a shallow copy, don't use with objects that contain other objects or arrays
@ -425,22 +425,23 @@ function uniqueArrayFromArray(input)
function processPotaSpots(buffer)
{
if (g_appSettings.potaEnabled == 1)
if (GT.appSettings.potaEnabled == 1)
{
try
{
var spots = JSON.parse(buffer);
g_pota.callSpots = {};
g_pota.parkSpots = {};
GT.pota.callSpots = {};
GT.pota.parkSpots = {};
for (const spot in spots)
{
if (spots[spot].reference in g_pota.parks)
if (spots[spot].reference in GT.pota.parks)
{
var newSpot = fillObjectFromTemplate(g_potaSpotTemplate, spots[spot]);
var newSpot = fillObjectFromTemplate(GT.potaSpotTemplate, spots[spot]);
newSpot.spotTime = Date.parse(newSpot.spotTime + "Z");
newSpot.frequency = parseInt(newSpot.frequency) / 1000;
newSpot.expire = newSpot.spotTime + (Number(newSpot.expire) * 1000);
newSpot.band = newSpot.frequency.formatBand();
newSpot.expire = Date.now() + (Number(newSpot.expire) * 1000);
newSpot.band = formatBand(newSpot.frequency);
if (newSpot.spotter == newSpot.activator && newSpot.comments.match(/qrt/gi))
{
// don't add the spot, they have self-QRT'ed
@ -451,14 +452,14 @@ function processPotaSpots(buffer)
}
else
{
g_pota.callSpots[newSpot.activator] = newSpot.reference;
GT.pota.callSpots[newSpot.activator] = newSpot.reference;
if (!(newSpot.reference in g_pota.parkSpots))
if (!(newSpot.reference in GT.pota.parkSpots))
{
g_pota.parkSpots[newSpot.reference] = {};
GT.pota.parkSpots[newSpot.reference] = {};
}
g_pota.parkSpots[newSpot.reference][newSpot.activator] = newSpot;
GT.pota.parkSpots[newSpot.reference][newSpot.activator] = newSpot;
}
}
else
@ -478,13 +479,13 @@ function processPotaSpots(buffer)
function getPotaSpots()
{
if (g_pota.spotsTimeout)
if (GT.pota.spotsTimeout)
{
nodeTimers.clearTimeout(g_pota.spotsTimeout);
g_pota.spotsTimeout = null;
nodeTimers.clearTimeout(GT.pota.spotsTimeout);
GT.pota.spotsTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
if (GT.mapSettings.offlineMode == false && GT.appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/spot/activator",
@ -495,18 +496,18 @@ function getPotaSpots()
);
}
g_pota.spotsTimeout = nodeTimers.setTimeout(getPotaSpots, 300000);
GT.pota.spotsTimeout = nodeTimers.setTimeout(getPotaSpots, 300000);
}
function processPotaSchedule(buffer)
{
if (g_appSettings.potaEnabled == 1)
if (GT.appSettings.potaEnabled == 1)
{
try
{
var schedules = JSON.parse(buffer);
g_pota.callSchedule = {};
g_pota.parkSchedule = {};
GT.pota.callSchedule = {};
GT.pota.parkSchedule = {};
for (const i in schedules)
{
var newObj = {};
@ -517,13 +518,13 @@ function processPotaSchedule(buffer)
newObj.comments = schedules[i].comments;
if (Date.now() < newObj.end)
{
if (newObj.id in g_pota.parks)
if (newObj.id in GT.pota.parks)
{
(g_pota.callSchedule[schedules[i].activator] = g_pota.callSchedule[schedules[i].activator] || []).push(newObj);
(GT.pota.callSchedule[schedules[i].activator] = GT.pota.callSchedule[schedules[i].activator] || []).push(newObj);
newObj = Object.assign({}, newObj);
newObj.id = schedules[i].activator;
(g_pota.parkSchedule[schedules[i].reference] = g_pota.parkSchedule[schedules[i].reference] || []).push(newObj);
(GT.pota.parkSchedule[schedules[i].reference] = GT.pota.parkSchedule[schedules[i].reference] || []).push(newObj);
}
else
{
@ -534,13 +535,13 @@ function processPotaSchedule(buffer)
}
// Sanity dedupe checks
for (const key in g_pota.callSchedule)
for (const key in GT.pota.callSchedule)
{
g_pota.callSchedule[key] = uniqueArrayFromArray(g_pota.callSchedule[key]);
GT.pota.callSchedule[key] = uniqueArrayFromArray(GT.pota.callSchedule[key]);
}
for (const key in g_pota.parkSchedule)
for (const key in GT.pota.parkSchedule)
{
g_pota.parkSchedule[key] = uniqueArrayFromArray(g_pota.parkSchedule[key]);
GT.pota.parkSchedule[key] = uniqueArrayFromArray(GT.pota.parkSchedule[key]);
}
}
catch (e)
@ -552,13 +553,13 @@ function processPotaSchedule(buffer)
function getPotaSchedule()
{
if (g_pota.scheduleTimeout)
if (GT.pota.scheduleTimeout)
{
nodeTimers.clearTimeout(g_pota.scheduleTimeout);
g_pota.scheduleTimeout = null;
nodeTimers.clearTimeout(GT.pota.scheduleTimeout);
GT.pota.scheduleTimeout = null;
}
if (g_mapSettings.offlineMode == false && g_appSettings.potaEnabled == 1)
if (GT.mapSettings.offlineMode == false && GT.appSettings.potaEnabled == 1)
{
getBuffer(
"https://api.pota.app/activation",
@ -568,18 +569,18 @@ function getPotaSchedule()
443
);
}
g_pota.scheduleTimeout = nodeTimers.setTimeout(getPotaSchedule, 900000);
GT.pota.scheduleTimeout = nodeTimers.setTimeout(getPotaSchedule, 900000);
}
var g_lastPark = null;
GT.lastPark = null;
function mouseOverPark(feature)
{
if (g_lastPark && g_lastPark == feature)
if (GT.lastPark && GT.lastPark == feature)
{
mouseParkMove();
return;
}
g_lastPark = feature;
GT.lastPark = feature;
createParkTipTable(feature);
@ -591,7 +592,7 @@ function mouseOverPark(feature)
function mouseOutPark(mouseEvent)
{
g_lastPark = null;
GT.lastPark = null;
myParktip.style.zIndex = -1;
}
@ -615,57 +616,33 @@ function mouseParkMove()
function createParkTipTable(toolElement)
{
var worker = "";
var key = toolElement.key;
var now = Date.now();
worker += "<div style='background-color:#000;color:lightgreen;font-weight:bold;font-size:12px;border:1px solid gray;margin:0px' class='roundBorder'>" +
key +
" : <font color='cyan'>" + g_pota.parks[key].name + "" +
" (<font color='yellow'>" + g_dxccToAltName[Number(g_pota.parks[key].entityId)] + "</font>)" +
"</font></br><font color='lightblue'>" + g_pota.parks[key].locationDesc + "</font></div>";
" : <font color='cyan'>" + GT.pota.parks[key].name + "" +
" (<font color='yellow'>" + GT.dxccToAltName[Number(GT.pota.parks[key].entityId)] + "</font>)" +
"</font></br><font color='lightblue'>" + GT.pota.parks[key].locationDesc + "</font></div>";
worker += "<table id='potaSpotsTable' class='darkTable' style='margin: 0 auto;'>";
worker += "<tr><th>Activator</th><th>Spotter</th><th>Freq</th><th>Mode</th><th>Count</th><th>When</th><th>Source</th><th>Comment</th></tr>";
for (const i in g_pota.parkSpots[key])
for (const i in GT.pota.parkSpots[key])
{
if (validateMapBandAndMode(g_pota.parkSpots[key][i].band, g_pota.parkSpots[key][i].mode))
if (validateMapBandAndMode(GT.pota.parkSpots[key][i].band, GT.pota.parkSpots[key][i].mode))
{
worker += "<tr>";
worker += "<td style='color:yellow'>" + g_pota.parkSpots[key][i].activator + "</td>";
worker += "<td style='color:cyan'>" + ((g_pota.parkSpots[key][i].spotter == g_pota.parkSpots[key][i].activator) ? "Self" : g_pota.parkSpots[key][i].spotter) + "</td>";
worker += "<td style='color:lightgreen' >" + g_pota.parkSpots[key][i].frequency.formatMhz(3, 3) + " <font color='yellow'>(" + g_pota.parkSpots[key][i].band + ")</font></td>";
worker += "<td style='color:orange'>" + g_pota.parkSpots[key][i].mode + "</td>";
worker += "<td>" + g_pota.parkSpots[key][i].count + "</td>";
worker += "<td style='color:lightblue' >" + parseInt((now - g_pota.parkSpots[key][i].spotTime) / 1000).toDHMS() + "</td>";
worker += "<td>" + g_pota.parkSpots[key][i].source + "</td>";
worker += "<td>" + g_pota.parkSpots[key][i].comments + "</td>";
worker += "<td style='color:yellow'>" + GT.pota.parkSpots[key][i].activator + "</td>";
worker += "<td style='color:cyan'>" + ((GT.pota.parkSpots[key][i].spotter == GT.pota.parkSpots[key][i].activator) ? "Self" : GT.pota.parkSpots[key][i].spotter) + "</td>";
worker += "<td style='color:lightgreen' >" + formatMhz(GT.pota.parkSpots[key][i].frequency, 3, 3) + " <font color='yellow'>(" + GT.pota.parkSpots[key][i].band + ")</font></td>";
worker += "<td style='color:orange'>" + GT.pota.parkSpots[key][i].mode + "</td>";
worker += "<td>" + GT.pota.parkSpots[key][i].count + "</td>";
worker += "<td style='color:lightblue' >" + toDHMS(parseInt((now - GT.pota.parkSpots[key][i].spotTime) / 1000)) + "</td>";
worker += "<td>" + GT.pota.parkSpots[key][i].source + "</td>";
worker += "<td>" + GT.pota.parkSpots[key][i].comments + "</td>";
worker += "</tr>";
}
}
worker += "</table>";
/*
buffer += "<div style='background-color:#000;color:#fff;font-size:12px;border:1px solid gray;margin:1px' class='roundBorder'>Activations (scheduled)"
buffer += "<table id='potaScheduleTable' class='darkTable' style='margin: 0 auto;'>";
buffer += "<tr><th>Activator</th><th>Start</th><th>End</th><th>Frequencies</th><th>Comment</th></tr>";
for (const i in g_pota.parkSchedule[key])
{
var start = g_pota.parkSchedule[key][i].start;
var end = g_pota.parkSchedule[key][i].end;
if (now < end)
{
buffer += "<tr>";
buffer += "<td style='color:yellow'>" + g_pota.parkSchedule[key][i].id + "</td>";
buffer += "<td style='color:lightblue'>" + ((now >= start) ? "<font color='white'>Now</font>" : (userTimeString(start) + "</br><font color='lightgreen'>T- " + Number(start - now).msToDHMS() + "</font>")) + "</td>";
buffer += "<td style='color:lightblue'>" + (userTimeString(end) + "</br><font color='orange'>T- " + Number(end - now).msToDHMS() + "</font>") + "</td>";
buffer += "<td style='color:lightgreen'>" + g_pota.parkSchedule[key][i].frequencies + "</td>";
buffer += "<td>" + g_pota.parkSchedule[key][i].comments.substr(0, 40) + "</td>";
buffer += "</tr>";
active++;
}
}
*/
myParktip.innerHTML = worker;
return 1;
}

Wyświetl plik

@ -1,7 +1,7 @@
// GridTracker Copyright © 2023 GridTracker.org
// All rights reserved.
// See LICENSE for more information.
var g_proto_bands = [
const g_proto_bands = [
"OOB",
"OOB",
1,
@ -74,9 +74,8 @@ var g_proto_bands = [
"1.25m"
];
// Incoming is already float fixed ( 14.037 ) for 14,037,000hz
Number.prototype.formatBand = function ()
function formatBand(freq)
{
let freq = this;
let newFreq = parseInt(freq);
if (newFreq > 0 && newFreq < 226) return g_proto_bands[g_proto_bands.indexOf(newFreq) + 1];
else if (newFreq >= 420 && newFreq <= 450) return "70cm";
@ -99,95 +98,53 @@ Number.prototype.formatBand = function ()
else return "OOB";
};
Number.prototype.formatMhz = function (n, x)
function formatMhz(freq, n, x)
{
var re = "\\d(?=(\\d{" + (x || 3) + "})+" + (n > 0 ? "\\." : "$") + ")";
return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, "g"), "$&.");
let re = "\\d(?=(\\d{" + (x || 3) + "})+" + (n > 0 ? "\\." : "$") + ")";
return freq.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, "g"), "$&.");
};
Number.prototype.formatSignalReport = function ()
function formatSignalReport(val)
{
var val = this;
var report = String();
let report = String();
if (val >= 0) report = "+" + val;
else report = val;
return report;
};
var CALLSIGN_REGEX = /0/g
String.prototype.formatCallsign = function ()
const CALLSIGN_REGEX = /0/g
function formatCallsign(call)
{
return this.replace(CALLSIGN_REGEX, "Ø");
return call.replace(CALLSIGN_REGEX, "Ø");
};
Number.prototype.toDHMS = function ()
function toDHMS(inputSeconds)
{
var seconds = this;
var days = Math.floor(seconds / (3600 * 24));
let seconds = inputSeconds;
let days = Math.floor(seconds / (3600 * 24));
seconds -= days * 3600 * 24;
var hrs = Math.floor(seconds / 3600);
let hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
var mnts = Math.floor(seconds / 60);
let mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
days = days ? days + "d " : "";
hrs = hrs ? hrs + "h " : "";
mnts = mnts ? mnts + "m " : "";
var first = days + hrs + mnts;
let first = days + hrs + mnts;
if (first == "") val = seconds + "s";
else val = first + (seconds > 0 ? seconds + "s" : "");
return val;
};
Number.prototype.msToDHMS = function ()
function toDHM(inputSeconds)
{
var seconds = parseInt(this / 1000);
var days = Math.floor(seconds / (3600 * 24));
let seconds = inputSeconds;
let days = Math.floor(seconds / (3600 * 24));
seconds -= days * 3600 * 24;
var hrs = Math.floor(seconds / 3600);
let hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
var mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
days = days ? days + "d " : "";
hrs = hrs ? hrs + "h " : "";
mnts = mnts ? mnts + "m " : "";
var first = days + hrs + mnts;
if (first == "") val = seconds + "s";
else val = first + (seconds > 0 ? seconds + "s" : "");
return val;
};
Number.prototype.toDHMS15 = function ()
{
// round to earliest 15 seconds
var seconds = Math.floor(this / 15) * 15;
var days = Math.floor(seconds / (3600 * 24));
seconds -= days * 3600 * 24;
var hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
var mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
days = days ? days + "d " : "";
hrs = hrs ? hrs + "h " : "";
mnts = mnts ? mnts + "m " : "";
var first = days + hrs + mnts;
if (first == "") val = seconds + "s";
else val = first + (seconds > 0 ? seconds + "s" : "");
return val;
};
Number.prototype.toDHM = function ()
{
var seconds = this;
var days = Math.floor(seconds / (3600 * 24));
seconds -= days * 3600 * 24;
var hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
var mnts = Math.floor(seconds / 60);
let mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
days = days ? days + "d " : "";
@ -199,46 +156,31 @@ Number.prototype.toDHM = function ()
return val;
};
Number.prototype.toYM = function ()
function toColonHMS(inputSeconds)
{
var months = this;
var years = parseInt(Math.floor(months / 12));
let seconds = inputSeconds;
let hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
let mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
return padNumber(hrs, 2) + ":" + padNumber(mnts, 2) + ":" + padNumber(seconds, 2);
};
function toYM(input)
{
let months = input;
let years = parseInt(Math.floor(months / 12));
months -= years * 12;
months = parseInt(months);
years = years ? years + "y " : "";
months = months ? months + "m" : "";
var total = years + months;
let total = years + months;
return total == "" ? "any" : total;
};
Number.prototype.toHMS = function ()
function padNumber(number, size)
{
var seconds = this;
var days = Math.floor(seconds / (3600 * 24));
seconds -= days * 3600 * 24;
var hrs = Math.floor(seconds / 3600);
seconds -= hrs * 3600;
var mnts = Math.floor(seconds / 60);
seconds -= mnts * 60;
hrs = hrs < 10 ? "0" + hrs : hrs;
mnts = mnts < 10 ? "0" + mnts : mnts;
seconds = seconds < 10 ? "0" + seconds : seconds;
val = hrs + "" + mnts + "" + seconds;
return val;
};
String.prototype.toProperCase = function ()
{
return this.replace(/\w\S*/g, function (txt)
{
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
};
Number.prototype.pad = function (size)
{
var s = String(this);
let s = String(number);
while (s.length < (size || 2))
{
s = "0" + s;
@ -246,7 +188,15 @@ Number.prototype.pad = function (size)
return s;
};
String.prototype.replaceAll = function (str1, str2)
function replaceAll(input, str1, str2)
{
return this.split(str1).join(str2);
return input.split(str1).join(str2);
};
function toProperCase(text)
{
return text.replace(/\w\S*/g, function (txt)
{
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
};

Plik diff jest za duży Load Diff

Wyświetl plik

@ -3,7 +3,7 @@ function prepareRosterSettings()
let rosterSettings = {
bands: {},
modes: {},
callMode: g_rosterSettings.callsign,
callMode: CR.rosterSettings.callsign,
onlyHits: false,
isAwardTracker: false,
now: timeNowSec()
@ -19,24 +19,24 @@ function prepareRosterSettings()
rosterSettings.callMode = "all";
rosterSettings.onlyHits = false;
rosterSettings.isAwardTracker = true;
g_rosterSettings.huntNeed = "confirmed";
CR.rosterSettings.huntNeed = "confirmed";
}
// this appears to be determine if we should show the OAMS column
// if the user is not in offline mode and has OAMS enabled, this could
// be it's own function maybe?
rosterSettings.canMsg =
window.opener.g_mapSettings.offlineMode == false &&
window.opener.g_appSettings.gtShareEnable == true &&
window.opener.g_appSettings.gtMsgEnable == true;
window.opener.GT.mapSettings.offlineMode == false &&
window.opener.GT.appSettings.gtShareEnable == true &&
window.opener.GT.appSettings.gtMsgEnable == true;
// The following 3 sections deal with QSLing, do we break them out
// individually or lump them into a qslUser function that sets
// all three at the same time?
// this section is for LoTW users, can be a function
if (window.opener.g_callsignLookups.lotwUseEnable == true)
if (window.opener.GT.callsignLookups.lotwUseEnable == true)
{
usesLoTWDiv.style.display = "";
if (g_rosterSettings.usesLoTW == true)
if (CR.rosterSettings.usesLoTW == true)
{
maxLoTW.style.display = "";
maxLoTWView.style.display = "";
@ -54,22 +54,22 @@ function prepareRosterSettings()
maxLoTWView.style.display = "none";
}
if (g_rosterSettings.huntNeed == "mixed")
if (CR.rosterSettings.huntNeed == "mixed")
{
rosterSettings.huntIndex = g_confirmed;
rosterSettings.workedIndex = g_worked;
rosterSettings.layeredMode = LAYERED_MODE_FOR[String(g_rosterSettings.reference)];
rosterSettings.huntIndex = CR.confirmed;
rosterSettings.workedIndex = CR.worked;
rosterSettings.layeredMode = LAYERED_MODE_FOR[String(CR.rosterSettings.reference)];
}
else if (g_rosterSettings.huntNeed == "worked")
else if (CR.rosterSettings.huntNeed == "worked")
{
rosterSettings.huntIndex = g_worked;
rosterSettings.huntIndex = CR.worked;
rosterSettings.workedIndex = false;
rosterSettings.layeredMode = false;
}
else if (g_rosterSettings.huntNeed == "confirmed")
else if (CR.rosterSettings.huntNeed == "confirmed")
{
rosterSettings.huntIndex = g_confirmed;
rosterSettings.workedIndex = g_worked;
rosterSettings.huntIndex = CR.confirmed;
rosterSettings.workedIndex = CR.worked;
rosterSettings.layeredMode = false;
}
else

Wyświetl plik

@ -24,9 +24,9 @@ function processRosterFiltering(callRoster, rosterSettings)
// this whole section is full of individual if's that could be broken out
for (const callHash in callRoster)
{
var entry = callRoster[callHash];
var callObj = entry.callObj;
var call = entry.DEcall;
let entry = callRoster[callHash];
let callObj = entry.callObj;
let call = entry.DEcall;
entry.tx = true;
callObj.shouldAlert = false;
@ -40,7 +40,7 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (rosterSettings.now - callObj.age > g_rosterSettings.rosterTime)
if (rosterSettings.now - callObj.age > CR.rosterSettings.rosterTime)
{
entry.tx = false;
entry.alerted = false;
@ -53,44 +53,44 @@ function processRosterFiltering(callRoster, rosterSettings)
entry.tx = false;
continue;
}
if (g_rosterSettings.noUnknownDXCC && callObj.dxcc === -1)
if (CR.rosterSettings.noUnknownDXCC && callObj.dxcc == -1)
{
entry.tx = false;
continue;
}
if (window.opener.g_instances[callObj.instance].crEnable == false)
if (window.opener.GT.instances[callObj.instance].crEnable == false)
{
entry.tx = false;
continue;
}
if (call in g_blockedCalls)
if (call in CR.blockedCalls)
{
entry.tx = false;
continue;
}
if (entry.DXcall + " from All" in g_blockedCQ || entry.DXcall + " from " + window.opener.g_dxccToAltName[callObj.dxcc] in g_blockedCQ)
if (entry.DXcall + " from All" in CR.blockedCQ || entry.DXcall + " from " + window.opener.GT.dxccToAltName[callObj.dxcc] in CR.blockedCQ)
{
entry.tx = false;
continue;
}
if (callObj.ituz in g_blockedITUz)
if (callObj.ituz in CR.blockedITUz)
{
entry.tx = false;
continue;
}
if (callObj.cqz in g_blockedCQz)
if (callObj.cqz in CR.blockedCQz)
{
entry.tx = false;
continue;
}
if (callObj.dxcc in g_blockedDxcc)
if (callObj.dxcc in CR.blockedDxcc)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.cqOnly == true)
if (CR.rosterSettings.cqOnly == true)
{
if (g_rosterSettings.wantRRCQ)
if (CR.rosterSettings.wantRRCQ == true)
{
if (callObj.RR73 == false && callObj.CQ == false)
{
@ -104,10 +104,9 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
}
if (g_rosterSettings.useRegex && g_rosterSettings.callsignRegex.length > 0)
if (CR.rosterSettings.useRegex && CR.rosterSettings.callsignRegex.length > 0)
{
var regexObj = regexObj || new RegExp(g_rosterSettings.callsignRegex, "i")
var regexObj = regexObj || new RegExp(CR.rosterSettings.callsignRegex, "i")
try
{
if (!call.match(regexObj))
@ -118,37 +117,37 @@ function processRosterFiltering(callRoster, rosterSettings)
}
catch (e) {}
}
if (g_rosterSettings.requireGrid == true && callObj.grid.length != 4)
if (CR.rosterSettings.requireGrid == true && callObj.grid.length != 4)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.wantMinDB == true && entry.message.SR < g_rosterSettings.minDb)
if (CR.rosterSettings.wantMinDB == true && entry.message.SR < CR.rosterSettings.minDb)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.wantMaxDT == true && Math.abs(entry.message.DT) > g_rosterSettings.maxDT)
if (CR.rosterSettings.wantMaxDT == true && Math.abs(entry.message.DT) > CR.rosterSettings.maxDT)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.wantMinFreq == true && entry.message.DF < g_rosterSettings.minFreq)
if (CR.rosterSettings.wantMinFreq == true && entry.message.DF < CR.rosterSettings.minFreq)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.wantMaxFreq == true && entry.message.DF > g_rosterSettings.maxFreq)
if (CR.rosterSettings.wantMaxFreq == true && entry.message.DF > CR.rosterSettings.maxFreq)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.noMsg == true)
if (CR.rosterSettings.noMsg == true)
{
try
{
if (callObj.msg.match(g_rosterSettings.noMsgValue))
if (callObj.msg.match(CR.rosterSettings.noMsgValue))
{
entry.tx = false;
continue;
@ -156,11 +155,11 @@ function processRosterFiltering(callRoster, rosterSettings)
}
catch (e) {}
}
if (g_rosterSettings.onlyMsg == true)
if (CR.rosterSettings.onlyMsg == true)
{
try
{
if (!callObj.msg.match(g_rosterSettings.onlyMsgValue))
if (!callObj.msg.match(CR.rosterSettings.onlyMsgValue))
{
entry.tx = false;
continue;
@ -169,80 +168,106 @@ function processRosterFiltering(callRoster, rosterSettings)
catch (e) {}
}
if (callObj.dxcc == window.opener.g_myDXCC)
if (callObj.dxcc == window.opener.GT.myDXCC)
{
if (g_rosterSettings.noMyDxcc == true)
if (CR.rosterSettings.noMyDxcc == true)
{
entry.tx = false;
continue;
}
}
else if (g_rosterSettings.onlyMyDxcc == true)
else if (CR.rosterSettings.onlyMyDxcc == true)
{
entry.tx = false;
continue;
}
if (window.opener.g_callsignLookups.lotwUseEnable == true && g_rosterSettings.usesLoTW == true)
if (CR.rosterSettings.columns.Spot == true)
{
if (!(call in window.opener.g_lotwCallsigns))
callObj.spot = window.opener.getSpotTime(callObj.DEcall + callObj.mode + callObj.band + callObj.grid);
if (callObj.spot == null)
{
callObj.spot = { when: 0, snr: 0 };
}
if (CR.rosterSettings.onlySpot == true && (callObj.spot.when == 0 || (timeNowSec() - callObj.spot.when > window.opener.GT.receptionSettings.viewHistoryTimeSec)))
{
entry.tx = false;
continue;
}
if (g_rosterSettings.maxLoTW < 27)
}
else
{
callObj.spot = { when: 0, snr: 0 };
}
let usesOneOf = 0;
let checkUses = 0;
if (window.opener.GT.callsignLookups.lotwUseEnable == true && CR.rosterSettings.usesLoTW == true)
{
checkUses++;
if (call in window.opener.GT.lotwCallsigns)
{
var months = (g_day - window.opener.g_lotwCallsigns[call]) / 30;
if (months > g_rosterSettings.maxLoTW)
usesOneOf++;
if (CR.rosterSettings.maxLoTW < 27)
{
entry.tx = false;
continue;
let months = (CR.day - window.opener.GT.lotwCallsigns[call]) / 30;
if (months > CR.rosterSettings.maxLoTW)
{
usesOneOf--;
}
}
}
}
if (window.opener.g_callsignLookups.eqslUseEnable == true && g_rosterSettings.useseQSL == true)
if (window.opener.GT.callsignLookups.eqslUseEnable == true && CR.rosterSettings.useseQSL == true)
{
if (!(call in window.opener.g_eqslCallsigns))
checkUses++;
if (call in window.opener.GT.eqslCallsigns)
{
entry.tx = false;
continue;
usesOneOf++;
}
}
if (window.opener.g_callsignLookups.oqrsUseEnable == true && g_rosterSettings.usesOQRS == true)
if (window.opener.GT.callsignLookups.oqrsUseEnable == true && CR.rosterSettings.usesOQRS == true)
{
if (!(call in window.opener.g_oqrsCallsigns))
checkUses++;
if (call in window.opener.GT.oqrsCallsigns)
{
entry.tx = false;
continue;
usesOneOf++;
}
}
if (checkUses > 0 && usesOneOf == 0)
{
entry.tx = false;
continue;
}
if (rosterSettings.callMode != "all")
{
if (entry.DXcall == "CQ DX" && callObj.dxcc == window.opener.g_myDXCC)
if (entry.DXcall == "CQ DX" && callObj.dxcc == window.opener.GT.myDXCC)
{
entry.tx = false;
continue;
}
var hash = hashMaker(call, callObj, g_rosterSettings.reference);
if (rosterSettings.callMode == "worked" && hash in g_worked.call)
let hash = hashMaker(call, callObj, CR.rosterSettings.reference);
if (rosterSettings.callMode == "worked" && hash in CR.worked.call)
{
entry.tx = false;
continue;
}
if (rosterSettings.callMode == "confirmed" && hash in g_confirmed.call)
if (rosterSettings.callMode == "confirmed" && hash in CR.confirmed.call)
{
entry.tx = false;
continue;
}
if (g_rosterSettings.hunting == "grid")
if (CR.rosterSettings.hunting == "grid")
{
var hash = hashMaker(callObj.grid.substr(0, 4),
callObj, g_rosterSettings.reference);
let hash = hashMaker(callObj.grid.substr(0, 4),
callObj, CR.rosterSettings.reference);
if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.grid)
{
entry.tx = false;
@ -255,9 +280,9 @@ function processRosterFiltering(callRoster, rosterSettings)
}
continue;
}
if (g_rosterSettings.hunting == "dxcc")
if (CR.rosterSettings.hunting == "dxcc")
{
let hash = hashMaker(String(callObj.dxcc) + "|", callObj, g_rosterSettings.reference);
let hash = hashMaker(String(callObj.dxcc) + "|", callObj, CR.rosterSettings.reference);
if (rosterSettings.huntIndex && (hash in rosterSettings.huntIndex.dxcc))
{
@ -267,24 +292,24 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (g_rosterSettings.hunting == "dxccs" && r_currentDXCCs != -1)
if (CR.rosterSettings.hunting == "dxccs" && CR.currentDXCCs != -1)
{
if (callObj.dxcc != r_currentDXCCs)
if (callObj.dxcc != CR.currentDXCCs)
{
entry.tx = false;
continue;
}
}
if (g_rosterSettings.hunting == "wpx")
if (CR.rosterSettings.hunting == "wpx")
{
if (String(callObj.px) == null)
{
entry.tx = false;
continue;
}
var hash = hashMaker(String(callObj.px),
callObj, g_rosterSettings.reference);
let hash = hashMaker(String(callObj.px),
callObj, CR.rosterSettings.reference);
if (rosterSettings.huntIndex && (hash in rosterSettings.huntIndex.px))
{
@ -295,7 +320,7 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (g_rosterSettings.hunting == "cq")
if (CR.rosterSettings.hunting == "cq")
{
if (callObj.cqz == null || !rosterSettings.huntIndex)
{
@ -303,7 +328,7 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
var hash = hashMaker(callObj.cqz + "|", callObj, g_rosterSettings.reference);
let hash = hashMaker(callObj.cqz + "|", callObj, CR.rosterSettings.reference);
if (hash in rosterSettings.huntIndex.cqz)
{
@ -314,7 +339,7 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (g_rosterSettings.hunting == "itu")
if (CR.rosterSettings.hunting == "itu")
{
if (callObj.ituz == null || !rosterSettings.huntIndex)
{
@ -322,7 +347,7 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
var hash = hashMaker(callObj.ituz + "|", callObj, g_rosterSettings.reference);
let hash = hashMaker(callObj.ituz + "|", callObj, CR.rosterSettings.reference);
if (hash in rosterSettings.huntIndex.ituz)
{
@ -333,15 +358,15 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (g_rosterSettings.hunting == "usstates" && window.opener.g_callsignLookups.ulsUseEnable == true)
if (CR.rosterSettings.hunting == "usstates" && window.opener.GT.callsignLookups.ulsUseEnable == true)
{
var state = callObj.state;
var finalDxcc = callObj.dxcc;
let state = callObj.state;
let finalDxcc = callObj.dxcc;
if (finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6)
{
if (state in window.opener.g_StateData)
if (state in window.opener.GT.StateData)
{
var hash = hashMaker(state, callObj, g_rosterSettings.reference);
let hash = hashMaker(state, callObj, CR.rosterSettings.reference);
if (rosterSettings.huntIndex && hash in rosterSettings.huntIndex.state)
{
@ -356,9 +381,9 @@ function processRosterFiltering(callRoster, rosterSettings)
continue;
}
if (g_rosterSettings.hunting == "usstate" && g_currentUSCallsigns)
if (CR.rosterSettings.hunting == "usstate" && CR.currentUSCallsigns)
{
if (call in g_currentUSCallsigns)
if (call in CR.currentUSCallsigns)
{
// Do Nothing
}
@ -373,26 +398,26 @@ function processRosterFiltering(callRoster, rosterSettings)
if (rosterSettings.isAwardTracker)
{
var tx = false;
var baseHash = hashMaker("", callObj, g_rosterSettings.reference);
let tx = false;
let baseHash = hashMaker("", callObj, CR.rosterSettings.reference);
for (const award in g_awardTracker)
for (const award in CR.awardTracker)
{
if (g_awardTracker[award].enable)
if (CR.awardTracker[award].enable)
{
tx = testAward(award, callObj, baseHash);
if (tx)
{
var x = g_awardTracker[award];
let x = CR.awardTracker[award];
// TODO: Move award reason out of exclusions code?
callObj.awardReason = g_awards[x.sponsor].awards[x.name].tooltip + " (" + g_awards[x.sponsor].sponsor + ")";
callObj.awardReason = CR.awards[x.sponsor].awards[x.name].tooltip + " (" + CR.awards[x.sponsor].sponsor + ")";
callObj.shouldAlert = true;
break;
}
}
}
let didWork = (baseHash in g_worked.call);
let didWork = (baseHash in CR.worked.call);
if (allOnlyNew.checked && didWork && !callObj.qrz)
{
callObj.shouldAlert = false;

Wyświetl plik

@ -15,7 +15,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
const currentYear = new Date().getFullYear();
const currentYearSuffix = `&rsquo;${currentYear - 2000}`;
const potaEnabled = (window.opener.g_appSettings.potaEnabled === 1);
const potaEnabled = (window.opener.GT.appSettings.potaEnabled == 1);
// 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?
@ -29,14 +29,14 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
if (callObj.qrz == true && entry.tx == false)
{
// The instance has to be enabled
if (window.opener.g_instances[callObj.instance].crEnable == true)
if (window.opener.GT.instances[callObj.instance].crEnable == true)
{
// Calling us, but we wouldn't normally display
// If they are not ignored or we're in a QSO with them, let it through
// TODO: This is here because it's after the filtering stage
if ((!(entry.DEcall in g_blockedCalls) && !(callObj.dxcc in g_blockedDxcc)) ||
window.opener.g_instances[callObj.instance].status.DXcall == entry.DEcall)
if ((!(entry.DEcall in CR.blockedCalls) && !(callObj.dxcc in CR.blockedDxcc)) ||
window.opener.GT.instances[callObj.instance].status.DXcall == entry.DEcall)
{
entry.tx = true;
}
@ -52,11 +52,11 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
if (rosterSettings.layeredMode)
{
workHashSuffix = hashMaker("", callObj, rosterSettings.layeredMode);
layeredHashSuffix = hashMaker("", callObj, g_rosterSettings.reference);
layeredHashSuffix = hashMaker("", callObj, CR.rosterSettings.reference);
}
else
{
workHashSuffix = hashMaker("", callObj, g_rosterSettings.reference);
workHashSuffix = hashMaker("", callObj, CR.rosterSettings.reference);
layeredHashSuffix = false
}
let workHash = workHashSuffix; // TODO: Remove after replacing all occurrences with Suffix
@ -102,13 +102,13 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
let layeredHash = layeredHashSuffix && (callsign + layeredHashSuffix)
// Call worked in current logbook settings, regardless of hunting mode
if (hash in g_worked.call)
if (hash in CR.worked.call)
{
callObj.callFlags.worked = true;
didWork = true;
callConf = `${unconf}${call}${inversionAlpha};`;
if (hash in g_confirmed.call)
if (hash in CR.confirmed.call)
{
callObj.callFlags.confirmed = true;
callPointer = "text-decoration: line-through; ";
@ -117,12 +117,12 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
// Calls that have OAMS chat support
if (callsign in window.opener.g_gtCallsigns)
if (callsign in window.opener.GT.gtCallsigns)
{
callObj.gt = 0;
for (const cid in window.opener.g_gtCallsigns[callsign])
for (const cid in window.opener.GT.gtCallsigns[callsign])
{
if (cid in window.opener.g_gtFlagPins && window.opener.g_gtFlagPins[cid].canmsg == true)
if (cid in window.opener.GT.gtFlagPins && window.opener.GT.gtFlagPins[cid].canmsg == true)
{
// found the first one we can message, break now
callObj.callFlags.oams = true;
@ -157,9 +157,9 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
// Entries currently calling or being called by us
if (callObj.DEcall == window.opener.g_instances[callObj.instance].status.DXcall)
if (callObj.DEcall == window.opener.GT.instances[callObj.instance].status.DXcall)
{
if (window.opener.g_instances[callObj.instance].status.TxEnabled == 1)
if (window.opener.GT.instances[callObj.instance].status.TxEnabled == 1)
{
callObj.hunting.call = "calling";
callObj.style.call = "class='dxCalling'";
@ -182,7 +182,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
px: false,
cont: false
};
if (g_rosterSettings.reference == LOGBOOK_AWARD_TRACKER)
if (CR.rosterSettings.reference == LOGBOOK_AWARD_TRACKER)
{
for (let key in awardTracker)
{
@ -252,9 +252,9 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
}
if (huntRegex.checked == true && g_rosterSettings.huntRegexValue.length > 0)
if (huntRegex.checked == true && CR.rosterSettings.huntRegexValue.length > 0)
{
var huntRegexObj = huntRegexObj || new RegExp(g_rosterSettings.huntRegexValue, "gi")
var huntRegexObj = huntRegexObj || new RegExp(CR.rosterSettings.huntRegexValue, "gi")
try
{
if (callsign.match(huntRegexObj))
@ -410,13 +410,13 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
// Hunting for US States
if ((huntState.checked || awardTrackerOverrides.states) && window.opener.g_callsignLookups.ulsUseEnable == true)
if ((huntState.checked || awardTrackerOverrides.states) && window.opener.GT.callsignLookups.ulsUseEnable == true)
{
let stateSearch = callObj.state;
let finalDxcc = callObj.dxcc;
if (finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6)
{
if (stateSearch in window.opener.g_StateData)
if (stateSearch in window.opener.GT.StateData)
{
let hash = stateSearch + workHashSuffix;
let layeredHash = rosterSettings.layeredMode && (stateSearch + layeredHashSuffix)
@ -467,7 +467,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
// Hunting for US Counties
if ((huntCounty.checked || awardTrackerOverrides.cnty) && window.opener.g_callsignLookups.ulsUseEnable == true)
if ((huntCounty.checked || awardTrackerOverrides.cnty) && window.opener.GT.callsignLookups.ulsUseEnable == true)
{
let finalDxcc = callObj.dxcc;
if (
@ -482,7 +482,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
{
if (callObj.qual == false)
{
let counties = window.opener.g_zipToCounty[callObj.zipcode];
let counties = window.opener.GT.zipToCounty[callObj.zipcode];
let foundHit = false;
for (const cnt in counties)
{
@ -527,7 +527,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
let huntTotal = 1;
let workedFound = 0;
let hash = g_dayAsString + callsign + callObj.pota + (rosterSettings.layeredMode ? layeredHashSuffix : workHashSuffix);
let hash = CR.dayAsString + callsign + callObj.pota + (rosterSettings.layeredMode ? layeredHashSuffix : workHashSuffix);
if (rosterSettings.workedIndex && hash in rosterSettings.workedIndex.pota) workedFound++;
@ -777,17 +777,17 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
// Station is calling us
if (callObj.DXcall == window.opener.myDEcall)
if (callObj.DXcall == window.opener.GT.appSettings.myCall)
{
callingBg = "#0000FF" + inversionAlpha;
calling = "#FFFF00;text-shadow: 0px 0px 2px #FFFF00";
}
else if ((callObj.CQ == true || (g_rosterSettings.wantRRCQ && callObj.RR73 == true)) && !g_rosterSettings.cqOnly)
else if ((callObj.CQ == true || (CR.rosterSettings.wantRRCQ && callObj.RR73 == true)) && !CR.rosterSettings.cqOnly)
{
callingBg = calling + inversionAlpha;
calling = bold;
// If treating RR73/73 as CQ, soften highlighting to help differentiate foreshadow from an actual CQ
if (g_rosterSettings.wantRRCQ && callObj.RR73 == true)
if (CR.rosterSettings.wantRRCQ && callObj.RR73 == true)
{
callingConf = `${unconf}#90EE90${inversionAlpha};`;
calling = `#90EE90${inversionAlpha};`
@ -822,19 +822,6 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
callObj.style = colorObject;
if (g_rosterSettings.columns.Spot)
{
callObj.spot = window.opener.getSpotTime(callObj.DEcall + callObj.mode + callObj.band + callObj.grid);
if (callObj.spot == null)
{
callObj.spot = { when: 0, snr: 0 };
}
}
else
{
callObj.spot = { when: 0, snr: 0 };
}
rosterSettings.modes[callObj.mode] = true;
rosterSettings.bands[callObj.band] = true;
}

Wyświetl plik

@ -1,28 +1,27 @@
// Because the County is clickable we do not allow the whole compact div to trigger an initiateQSO
g_isCompactCounty = false;
CR.isCompactCounty = false;
function renderCompactRosterHeaders()
{
g_isCompactCounty = (g_rosterSettings.compactEntity == "County");
CR.isCompactCounty = (CR.rosterSettings.compactEntity == "County");
return "<div id=\"buttonsDiv\" style=\"margin-left:0px;white-space:normal;\" onmouseenter='rosterInFocus()' onmouseleave='rosterNoFocus()'>";
}
function renderCompactRosterRow(callObj, showBand)
{
var ID = callObj.DEcall + callObj.band + callObj.mode;
var title = callObj.RSTsent + "&#13256;, " + parseInt(callObj.dt * 100) + "ms, " + callObj.delta + "hz" + (callObj.grid.length ? ", " + callObj.grid : "") + ", " + (timeNowSec() - callObj.age).toDHMS();
var bandView = showBand ? "<div style='color: #" + window.opener.g_pskColors[callObj.band] + ";float:right;display:inline-block;'>" + callObj.band + "</div>" : "";
if (g_rosterSettings.compactEntity == "Band")
let title = callObj.RSTsent + "&#13256;, " + parseInt(callObj.dt * 100) + "ms, " + callObj.delta + "hz" + (callObj.grid.length ? ", " + callObj.grid : "") + ", " + toDHMS(timeNowSec() - callObj.age);
let bandView = showBand ? "<div style='color: #" + window.opener.GT.pskColors[callObj.band] + ";float:right;display:inline-block;'>" + callObj.band + "</div>" : "";
if (CR.rosterSettings.compactEntity == "Band")
{
bandView = "";
}
var onClick = " onClick='initiateQso(\"" + ID + "\")' id='" + ID + "' title='" + title + "' ";
var wholeClick = (g_isCompactCounty ? "" : onClick);
var callsignClick = (g_isCompactCounty ? onClick : "");
var worker = "<div class='compact' " + wholeClick + " >";
worker += "<div class='compactCallsign' " + callsignClick + " name='Callsign' " + callObj.style.call + " >" + callObj.DEcall.formatCallsign() + bandView + "</div>";
let onClick = " onClick='initiateQso(\"" + callObj.hash + "\")' id='" + callObj.hash + "' title='" + title + "' ";
let wholeClick = (CR.isCompactCounty ? "" : onClick);
let callsignClick = (CR.isCompactCounty ? onClick : "");
let worker = "<div class='compact' " + wholeClick + " >";
worker += "<div class='compactCallsign' " + callsignClick + " name='Callsign' " + callObj.style.call + " >" + formatCallsign(callObj.DEcall) + bandView + "</div>";
worker += "<div class='compactData'>";
worker += renderEntryForColumn(g_rosterSettings.compactEntity, callObj, "div");
worker += renderEntryForColumn(CR.rosterSettings.compactEntity, callObj, "div");
worker += "</div></div>";
return worker;
}

Wyświetl plik

@ -4,7 +4,7 @@ function renderRoster(callRoster, rosterSettings)
Callsign: true
}
if (window.opener.g_callsignLookups.eqslUseEnable == true)
if (window.opener.GT.callsignLookups.eqslUseEnable == true)
{
useseQSLDiv.style.display = "";
}
@ -14,7 +14,7 @@ function renderRoster(callRoster, rosterSettings)
useseQSLDiv.style.display = "none";
}
if (window.opener.g_callsignLookups.oqrsUseEnable == true)
if (window.opener.GT.callsignLookups.oqrsUseEnable == true)
{
usesOQRSDiv.style.display = "";
}
@ -24,7 +24,7 @@ function renderRoster(callRoster, rosterSettings)
usesOQRSDiv.style.display = "none";
}
if (window.opener.g_callsignLookups.lotwUseEnable == true)
if (window.opener.GT.callsignLookups.lotwUseEnable == true)
{
// Do nothing
}
@ -43,7 +43,7 @@ function renderRoster(callRoster, rosterSettings)
columnOverrides.OAMS = false;
}
if (window.opener.g_appSettings.potaEnabled === 1)
if (window.opener.GT.appSettings.potaEnabled == 1)
{
huntingMatrixPotaDiv.style.display = "";
}
@ -58,7 +58,7 @@ function renderRoster(callRoster, rosterSettings)
columnOverrides.Wanted = true;
}
// dealing with spots
if (g_rosterSettings.columns.Spot == true) onlySpotDiv.style.display = "";
if (CR.rosterSettings.columns.Spot == true) onlySpotDiv.style.display = "";
else onlySpotDiv.style.display = "none";
// callmode (all or only new)
@ -70,7 +70,7 @@ function renderRoster(callRoster, rosterSettings)
// let visibleCallList = callRoster.filter(entry => entry.tx);
let visibleCallList = [];
for (entry in callRoster)
for (const entry in callRoster)
{
// entry should populate in general
if (callRoster[entry].tx)
@ -104,26 +104,26 @@ function renderRoster(callRoster, rosterSettings)
multiInstance = true;
}
let multiBand = Object.keys(rosterSettings.bands).length > 1;
let showBands = multiBand || g_rosterSettings.columns.Band;
let showModes = (Object.keys(rosterSettings.modes).length > 1) || g_rosterSettings.columns.Mode;
let showBands = multiBand || CR.rosterSettings.columns.Band;
let showModes = (Object.keys(rosterSettings.modes).length > 1) || CR.rosterSettings.columns.Mode;
columnOverrides.Band = showBands;
columnOverrides.Mode = showModes;
const rosterColumns = rosterColumnList(g_rosterSettings.columns, columnOverrides);
const rosterColumns = rosterColumnList(CR.rosterSettings.columns, columnOverrides);
if (g_rosterSettings.compact)
if (CR.rosterSettings.compact)
{
sortCallList(visibleCallList, "Age", false, rosterColumns);
}
else
{
sortCallList(visibleCallList, g_rosterSettings.sortColumn, g_rosterSettings.sortReverse);
sortCallList(visibleCallList, CR.rosterSettings.sortColumn, CR.rosterSettings.sortReverse);
}
let worker = g_rosterSettings.compact ? renderCompactRosterHeaders() : renderNormalRosterHeaders(rosterColumns);
let worker = CR.rosterSettings.compact ? renderCompactRosterHeaders() : renderNormalRosterHeaders(rosterColumns);
// Third loop: render all rows
for (let x in visibleCallList)
for (const x in visibleCallList)
{
let callObj = visibleCallList[x].callObj;
@ -133,9 +133,9 @@ function renderRoster(callRoster, rosterSettings)
if (callObj.DEcall.match("^[KNW][0-9][A-W|Y|Z](/w+)?$"))
{ callObj.style.call = "class='oneByOne'"; }
if (callObj.DEcall == window.opener.g_instances[callObj.instance].status.DXcall)
if (callObj.DEcall == window.opener.GT.instances[callObj.instance].status.DXcall)
{
if (window.opener.g_instances[callObj.instance].status.TxEnabled == 1)
if (window.opener.GT.instances[callObj.instance].status.TxEnabled == 1)
{
callObj.style.call = "class='dxCalling'";
}
@ -145,10 +145,10 @@ function renderRoster(callRoster, rosterSettings)
}
}
worker += g_rosterSettings.compact ? renderCompactRosterRow(callObj, multiInstance || multiBand) : renderNormalRosterRow(rosterColumns, callObj);
worker += CR.rosterSettings.compact ? renderCompactRosterRow(callObj, multiInstance || multiBand) : renderNormalRosterRow(rosterColumns, callObj);
}
worker += g_rosterSettings.compact ? renderCompactRosterFooter() : renderNormalRosterFooter();
worker += CR.rosterSettings.compact ? renderCompactRosterFooter() : renderNormalRosterFooter();
RosterTable.innerHTML = worker;
}

Wyświetl plik

@ -1,8 +1,8 @@
function rosterColumnList(settings = {}, overrides = {})
{
return g_rosterSettings.columnOrder.filter(column =>
return CR.rosterSettings.columnOrder.filter(column =>
{
return column && (settings[column] || overrides[column]) && !(overrides[column] === false)
return column && (settings[column] || overrides[column]) && !(overrides[column] == false)
})
}
@ -21,9 +21,9 @@ function renderHeaderForColumn(column)
attrs.onClick = `setRosterSorting('${column}');`
}
if (g_rosterSettings.sortColumn == column)
if (CR.rosterSettings.sortColumn == column)
{
attrs.html += "<div style='display:inline-block;margin:0px;padding:0px;'>&nbsp;" + (g_rosterSettings.sortReverse == false ? "▲" : "▼") + "</div>";
attrs.html += "<div style='display:inline-block;margin:0px;padding:0px;'>&nbsp;" + (CR.rosterSettings.sortReverse == false ? "▲" : "▼") + "</div>";
}
return renderRosterTableHTML("th", attrs)
@ -53,19 +53,19 @@ function renderRosterTableHTML(tag, attrs)
function setRosterSorting(column)
{
if (g_rosterSettings.sortColumn === column)
if (CR.rosterSettings.sortColumn == column)
{
g_rosterSettings.sortReverse = !g_rosterSettings.sortReverse
CR.rosterSettings.sortReverse = !CR.rosterSettings.sortReverse
}
else
{
g_rosterSettings.sortColumn = column
g_rosterSettings.sortReverse = false
CR.rosterSettings.sortColumn = column
CR.rosterSettings.sortReverse = false
}
writeRosterSettings();
window.opener.goProcessRoster();
viewRoster();
}
function sortCallList(callList, sortColumn, sortReverse, columns)
@ -124,14 +124,14 @@ function validateRosterColumnOrder(columns)
function changeRosterColumnOrder(columns)
{
g_rosterSettings.columnOrder = validateRosterColumnOrder(columns);
CR.rosterSettings.columnOrder = validateRosterColumnOrder(columns);
writeRosterSettings();
window.opener.goProcessRoster();
viewRoster();
}
function moveColumnLeft(column)
{
const columns = rosterColumnList(g_rosterSettings.columns, { Callsign: true, Grid: true });
const columns = rosterColumnList(CR.rosterSettings.columns, { Callsign: true, Grid: true });
const pos = columns.indexOf(column);
if (pos > 1)
{

Wyświetl plik

@ -4,7 +4,7 @@ const DEFAULT_COLUMN_ORDER = [
"dB", "Freq", "DT", "Dist", "Azim",
"CQz", "ITUz", "PX",
"LoTW", "eQSL", "OQRS",
"Life", "Spot", "OAMS", "Age"
"Life", "Spot", "OAMS", "Age", "UTC"
]
const LEGACY_COLUMN_SORT_ID = {
@ -60,10 +60,10 @@ const ROSTER_COLUMNS = {
align: "left",
onClick: `initiateQso("${callObj.hash}")`,
rawAttrs: callObj.style.call,
html: html = (callObj.DEcallHTML || callObj.DEcall).formatCallsign()
html: html = formatCallsign((callObj.DEcallHTML || callObj.DEcall))
}
let acks = window.opener.g_acknowledgedCalls || {};
let acks = window.opener.GT.acknowledgedCalls || {};
if (acks[callObj.DEcall])
{
attrs.html = `${attrs.html} <span class='acknowledged'><img class='ackBadge' src='${acks[callObj.DEcall].badge}'></span>`
@ -77,7 +77,7 @@ const ROSTER_COLUMNS = {
Band: {
compare: callObjSimpleComparer("band"),
tableData: (callObj) => ({
style: `color: #${window.opener.g_pskColors[callObj.band]};`,
style: `color: #${window.opener.GT.pskColors[callObj.band]};`,
html: callObj.band
})
},
@ -85,7 +85,7 @@ const ROSTER_COLUMNS = {
Mode: {
compare: callObjSimpleComparer("mode"),
tableData: (callObj) => ({
style: `color: #${g_modeColors[callObj.mode] || "888888"};`,
style: `color: #${CR.modeColors[callObj.mode] || "888888"};`,
html: callObj.mode
})
},
@ -104,7 +104,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
rawAttrs: callObj.style.calling,
name: callObj.CQ ? "CQ" : "Calling",
html: (g_rosterSettings.wantRRCQ && callObj.RR73) ? "RR73" : callObj.DXcall.formatCallsign()
html: (CR.rosterSettings.wantRRCQ && callObj.RR73) ? "RR73" : formatCallsign(callObj.DXcall)
})
},
@ -116,10 +116,10 @@ const ROSTER_COLUMNS = {
DXCC: {
compare: (a, b) => window.opener.myDxccCompare(a.callObj, b.callObj),
tableData: (callObj) => ({
title: window.opener.g_dxccInfo[callObj.dxcc].pp,
title: window.opener.GT.dxccInfo[callObj.dxcc].pp,
name: `DXCC (${callObj.dxcc})`,
rawAttrs: callObj.style.dxcc,
html: (callObj.dxccSuffix ? [window.opener.g_dxccToAltName[callObj.dxcc], callObj.dxccSuffix].join("&nbsp;") : window.opener.g_dxccToAltName[callObj.dxcc])
html: (callObj.dxccSuffix ? [window.opener.GT.dxccToAltName[callObj.dxcc], callObj.dxccSuffix].join("&nbsp;") : window.opener.GT.dxccToAltName[callObj.dxcc])
})
},
@ -128,7 +128,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
align: "center",
style: "margin:0; padding:0;",
html: `<img style='margin-bottom:-3px;height:14px' src='./img/flags/16/${window.opener.g_dxccInfo[callObj.dxcc].flag}'>`
html: `<img style='margin-bottom:-3px;height:14px' src='./img/flags/16/${window.opener.GT.dxccInfo[callObj.dxcc].flag}'>`
})
},
@ -150,13 +150,13 @@ const ROSTER_COLUMNS = {
let attrs = {
align: "center",
rawAttrs: callObj.style.cnty,
html: callObj.cnty ? window.opener.g_cntyToCounty[callObj.cnty] : "&nbsp;"
html: callObj.cnty ? window.opener.GT.cntyToCounty[callObj.cnty] : "&nbsp;"
}
if (callObj.cnty && callObj.qual == false)
{
attrs.title = $.i18n("rosterColumns.County.title")
attrs.onClick = `window.opener.lookupCallsign("${callObj.DEcall}", "${callObj.grid}")`
attrs.html = attrs.html + " +" + String(window.opener.g_zipToCounty[callObj.zipcode].length - 1)
attrs.html = attrs.html + " +" + String(window.opener.GT.zipToCounty[callObj.zipcode].length - 1)
attrs.style = "cursor: pointer; color: cyan;"
}
return attrs
@ -243,17 +243,17 @@ const ROSTER_COLUMNS = {
compare: false,
tableData: (callObj) =>
{
if (callObj.DEcall in window.opener.g_lotwCallsigns)
if (callObj.DEcall in window.opener.GT.lotwCallsigns)
{
if (g_rosterSettings.maxLoTW < 27)
if (CR.rosterSettings.maxLoTW < 27)
{
let months = (g_day - window.opener.g_lotwCallsigns[callObj.DEcall]) / 30;
if (months > g_rosterSettings.maxLoTW)
let months = (CR.day - window.opener.GT.lotwCallsigns[callObj.DEcall]) / 30;
if (months > CR.rosterSettings.maxLoTW)
{
return {
style: "color: yellow;",
align: "center",
title: `${$.i18n("rosterColumns.LoTW.NoUpdate")} ${Number(months).toYM()}`,
title: `${$.i18n("rosterColumns.LoTW.NoUpdate")} ${toYM(Number(months))}`,
html: "?"
}
}
@ -263,7 +263,7 @@ const ROSTER_COLUMNS = {
style: "color: #0F0;",
align: "center",
title: `${$.i18n("rosterColumns.LoTW.LastUpdate")}${
window.opener.userDayString(window.opener.g_lotwCallsigns[callObj.DEcall] * 86400000)
window.opener.userDayString(window.opener.GT.lotwCallsigns[callObj.DEcall] * 86400000)
}`,
html: "&#10004;"
}
@ -275,7 +275,7 @@ const ROSTER_COLUMNS = {
style: "color: #0F0;",
align: "center",
title: `${$.i18n("rosterColumns.LoTW.LastUpdate")}${
window.opener.userDayString(window.opener.g_lotwCallsigns[callObj.DEcall] * 86400000)
window.opener.userDayString(window.opener.GT.lotwCallsigns[callObj.DEcall] * 86400000)
}`,
html: "&#10004;"
}
@ -295,7 +295,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
style: "color: #0F0;",
align: "center",
html: (callObj.DEcall in window.opener.g_eqslCallsigns ? "&#10004;" : "&nbsp;")
html: (callObj.DEcall in window.opener.GT.eqslCallsigns ? "&#10004;" : "&nbsp;")
})
},
@ -304,7 +304,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
style: "color: #0F0;",
align: "center",
html: (callObj.DEcall in window.opener.g_oqrsCallsigns ? "&#10004;" : "&nbsp;")
html: (callObj.DEcall in window.opener.GT.oqrsCallsigns ? "&#10004;" : "&nbsp;")
})
},
@ -314,7 +314,7 @@ const ROSTER_COLUMNS = {
style: "color: #EEE;",
class: "lifeCol",
id: `lm${callObj.hash}`,
html: (timeNowSec() - callObj.life).toDHMS()
html: toDHMS(timeNowSec() - callObj.life)
})
},
@ -353,20 +353,28 @@ const ROSTER_COLUMNS = {
}
},
UTC: {
compare: callObjSimpleComparer("age"),
tableData: (callObj) => ({
style: "color: #EEE;",
html: callObj.UTC
})
},
Age: {
compare: callObjSimpleComparer("age"),
tableData: (callObj) => ({
style: "color: #EEE;",
class: "timeCol",
id: `tm${callObj.hash}`,
html: (timeNowSec() - callObj.age).toDHMS()
html: toDHMS(timeNowSec() - callObj.age)
})
},
Spot: {
compare: (a, b) =>
{
let cutoff = timeNowSec() - window.opener.g_receptionSettings.viewHistoryTimeSec;
let cutoff = timeNowSec() - window.opener.GT.receptionSettings.viewHistoryTimeSec;
if (a.callObj.spot.when <= cutoff) return -1;
if (b.callObj.spot.when <= cutoff) return 1;
@ -426,9 +434,9 @@ function potaColumnHover(callObj)
{
let value = "";
if (callObj.pota in window.opener.g_pota.parks)
if (callObj.pota in window.opener.GT.pota.parks)
{
value += callObj.pota + " - " + window.opener.g_pota.parks[callObj.pota].name + "\n";
value += callObj.pota + " - " + window.opener.GT.pota.parks[callObj.pota].name + "\n";
}
return value;

Wyświetl plik

@ -1,36 +1,36 @@
function sendAlerts(callRoster, rosterSettings)
{
var dirPath = window.opener.g_scriptDir;
var scriptExists = false;
var script = "cr-alert.sh";
let dirPath = window.opener.GT.scriptDir;
let scriptExists = false;
let script = "cr-alert.sh";
var shouldAlert = 0;
let shouldAlert = 0;
for (entry in callRoster)
for (const entry in callRoster)
{
var callObj = callRoster[entry].callObj;
let callObj = callRoster[entry].callObj;
// chrbayer: what does the tx field mean? no alerts are generated (at all) if this is in place...
// if it's "not visible in the roster, don't put it in the report!"
if (callRoster[entry].tx == false) continue;
var call = callObj.DEcall;
g_scriptReport[call] = Object.assign({}, callObj);
g_scriptReport[call].dxccName = window.opener.g_dxccToAltName[callObj.dxcc];
g_scriptReport[call].distance = (callObj.distance > 0) ? parseInt(callObj.distance * MyCircle.validateRadius(window.opener.distanceUnit.value)) : 0;
let call = callObj.DEcall;
CR.scriptReport[call] = Object.assign({}, callObj);
CR.scriptReport[call].dxccName = window.opener.GT.dxccToAltName[callObj.dxcc];
CR.scriptReport[call].distance = (callObj.distance > 0) ? parseInt(callObj.distance * MyCircle.validateRadius(window.opener.distanceUnit.value)) : 0;
delete g_scriptReport[call].DEcall;
g_scriptReport[call].rect = null;
delete g_scriptReport[call].rect;
delete g_scriptReport[call].style;
delete g_scriptReport[call].wspr;
delete g_scriptReport[call].qso;
delete g_scriptReport[call].instance;
delete CR.scriptReport[call].DEcall;
CR.scriptReport[call].rect = null;
delete CR.scriptReport[call].rect;
delete CR.scriptReport[call].style;
delete CR.scriptReport[call].wspr;
delete CR.scriptReport[call].qso;
delete CR.scriptReport[call].instance;
if (rosterSettings.callMode != "all")
{
g_scriptReport[call].shouldAlert = true;
g_scriptReport[call].reason.push(g_rosterSettings.hunting);
CR.scriptReport[call].shouldAlert = true;
CR.scriptReport[call].reason.push(CR.rosterSettings.hunting);
}
if (callObj.alerted == false && rosterSettings.callMode == "all" && callObj.shouldAlert == true)
@ -52,7 +52,7 @@ function sendAlerts(callRoster, rosterSettings)
{
if (fs.existsSync(dirPath))
{
if (window.opener.g_platform == "windows")
if (window.opener.GT.platform == "windows")
{
script = "cr-alert.bat";
}
@ -61,7 +61,7 @@ function sendAlerts(callRoster, rosterSettings)
scriptExists = true;
scriptIcon.innerHTML =
"<div class='buttonScript' onclick='window.opener.toggleCRScript();'>" +
(window.opener.g_crScript == 1
(window.opener.GT.crScript == 1
? `<font color='lightgreen'>${$.i18n("sendAlerts.scriptEnabled")}</font>`
: `<font color='yellow'>${$.i18n("sendAlerts.scriptDisabled")}</font>`) +
"</div>";
@ -77,12 +77,12 @@ function sendAlerts(callRoster, rosterSettings)
if (shouldAlert > 0)
{
if (window.opener.g_classicAlerts.huntRoster == true)
if (window.opener.GT.classicAlerts.huntRoster == true)
{
var notify = window.opener.huntRosterNotify.value;
let notify = window.opener.huntRosterNotify.value;
if (notify == "0")
{
var media = window.opener.huntRosterNotifyMedia.value;
let media = window.opener.huntRosterNotifyMedia.value;
if (media != "none") window.opener.playAlertMediaFile(media);
}
else if (notify == "1")
@ -91,15 +91,15 @@ function sendAlerts(callRoster, rosterSettings)
}
}
if (scriptExists && window.opener.g_crScript == 1)
if (scriptExists && window.opener.GT.crScript == 1)
{
try
{
fs.writeFileSync(dirPath + "cr-alert.json", JSON.stringify(g_scriptReport, null, 2));
fs.writeFileSync(dirPath + "cr-alert.json", JSON.stringify(CR.scriptReport, null, 2));
var thisProc = dirPath + script;
var cp = require("child_process");
var child = cp.spawn(thisProc, [], {
let thisProc = dirPath + script;
let cp = require("child_process");
let child = cp.spawn(thisProc, [], {
detached: true,
cwd: dirPath.slice(0, -1),
stdio: ["ignore", "ignore", "ignore"]
@ -110,8 +110,8 @@ function sendAlerts(callRoster, rosterSettings)
{
conosle.log(e);
}
g_scriptReport = Object();
CR.scriptReport = Object();
}
else g_scriptReport = Object();
else CR.scriptReport = Object();
}
}

Wyświetl plik

@ -1,5 +1,12 @@
const nodeTimers = require("timers");
// GridTracker object
var GT = {};
// CallRoster object
var CR = {};
var isShowing = false;
var s_title = null;
var s_screenSettings = {};
var s_zoomLevel = 0;
@ -71,7 +78,7 @@ function saveScreenSettings()
{
setWindowInfo();
var setting = { showing: g_isShowing, zoomLevel: s_zoomLevel, window: g_windowInfo };
var setting = { showing: isShowing, zoomLevel: s_zoomLevel, window: g_windowInfo };
s_screenSettings = JSON.parse(localStorage.screenSettings);
@ -83,14 +90,12 @@ function saveScreenSettings()
nw.Screen.on("displayAdded", screenCB.onDisplayAdded);
nw.Screen.on("displayRemoved", screenCB.onDisplayRemoved);
var g_isShowing = false;
nw.Window.get().on("loaded", function ()
{
// Use the first 12 bytes of the title(trimmed) as storage names
// This cannot be changed as current installs (12,000+) use this naming convention
s_title = document.title.substr(0, 12).trim();
g_isShowing = false;
isShowing = false;
if (typeof localStorage.screenSettings == "undefined")
{
localStorage.screenSettings = "{}";
@ -109,7 +114,7 @@ nw.Window.get().on("loaded", function ()
{
saveScreenSettings();
}
g_isShowing = s_screenSettings[s_title].showing;
isShowing = s_screenSettings[s_title].showing;
nw.Window.get().zoomLevel = s_zoomLevel = s_screenSettings[s_title].zoomLevel;
g_windowInfo = s_screenSettings[s_title].window;
@ -122,7 +127,7 @@ nw.Window.get().on("loaded", function ()
// Check the first part of the string, only one window has "GridTracker" in the name.
// It is reserved to the main app window.
if (g_isShowing || s_title.indexOf("GridTracker") == 0)
if (isShowing || s_title.indexOf("GridTracker") == 0)
{
this.show();
}

Wyświetl plik

@ -8,23 +8,23 @@
* https://groups.io/g/PstRotator/message/5825
*
*/
var g_pstrotatorSettings = {};
GT.pstrotatorSettings = {};
function pstrotatorServiceChanged()
{
if (g_pstrotatorSettings.enabled != pstrotatorCheckBox.checked)
if (GT.pstrotatorSettings.enabled != pstrotatorCheckBox.checked)
{
// This setting toggles the presence of a contextual menu item in the roster,
// which is constructed only during roster initialization.
//
// So when this setting is changed, we need to reload the entire roster window.
//
g_pstrotatorSettings.enable = pstrotatorCheckBox.checked;
if (g_rosterInitialized)
GT.pstrotatorSettings.enable = pstrotatorCheckBox.checked;
if (GT.rosterInitialized)
{
try
{
g_callRosterWindowHandle.window.location.reload();
GT.callRosterWindowHandle.window.location.reload();
}
catch (e)
{
@ -33,8 +33,8 @@ function pstrotatorServiceChanged()
}
}
g_pstrotatorSettings.ip = pstrotatorIpInput.value;
g_pstrotatorSettings.port = pstrotatorPortInput.value;
GT.pstrotatorSettings.ip = pstrotatorIpInput.value;
GT.pstrotatorSettings.port = pstrotatorPortInput.value;
saveLogSettings();
}
@ -44,9 +44,9 @@ function aimRotator(info)
const { callObj } = info
if (
g_pstrotatorSettings.enable == true &&
g_pstrotatorSettings.port > 0 &&
g_pstrotatorSettings.ip.length > 4 &&
GT.pstrotatorSettings.enable == true &&
GT.pstrotatorSettings.port > 0 &&
GT.pstrotatorSettings.ip.length > 4 &&
(callObj.distance > 0)
)
{
@ -58,8 +58,8 @@ function aimRotator(info)
sendUdpMessage(
payload,
payload.length,
parseInt(g_pstrotatorSettings.port),
g_pstrotatorSettings.ip
parseInt(GT.pstrotatorSettings.port),
GT.pstrotatorSettings.ip
);
if (callObj.DEcall)
{

Wyświetl plik

@ -3,9 +3,9 @@
**/
(function (global, factory)
{
typeof exports === "object" && typeof module !== "undefined"
typeof exports == "object" && typeof module !== "undefined"
? (module.exports = factory())
: typeof define === "function" && define.amd
: typeof define == "function" && define.amd
? define(factory)
: (global.GeoJSONTerminator = factory());
})(this, function ()
@ -292,7 +292,7 @@ var dayNight = {
}),
stroke: null
}),
opacity: Number(g_mapSettings.shadow),
opacity: Number(GT.mapSettings.shadow),
zIndex: 0
});
this.map.getLayers().insertAt(1, this.vectorLayer);
@ -305,7 +305,7 @@ var dayNight = {
})
});
this.vectorLayer.setStyle(circleStyle);
this.vectorLayer.setOpacity(Number(g_mapSettings.shadow));
this.vectorLayer.setOpacity(Number(GT.mapSettings.shadow));
this.vectorSource.clear();
this.vectorSource.addFeature(
@ -313,7 +313,7 @@ var dayNight = {
featureProjection: "EPSG:3857"
})
);
var point = ol.proj.fromLonLat([g_myLon, g_myLat]);
var point = ol.proj.fromLonLat([GT.myLon, GT.myLat]);
var arr = this.vectorSource.getFeaturesAtCoordinate(point);
return arr.length > 0;
},
@ -422,10 +422,10 @@ var moonLayer = {
refresh: function ()
{
this.vectorSource.clear();
if (g_appSettings.moonTrack == 1)
if (GT.appSettings.moonTrack == 1)
{
now = timeNowSec();
if (g_appSettings.moonPath == 1)
if (GT.appSettings.moonPath == 1)
{ this.vectorSource.addFeature(this.future(now)); }
this.pin = iconFeature(
ol.proj.fromLonLat(subLunar(now).ll),

Wyświetl plik

@ -136,9 +136,9 @@ function addTextToClipboard(data)
function setClipboardFromLookup()
{
if (window.opener.g_lastLookupAddress)
if (window.opener.GT.lastLookupAddress)
{
addTextToClipboard(window.opener.g_lastLookupAddress);
addTextToClipboard(window.opener.GT.lastLookupAddress);
}
}

Wyświetl plik

@ -23,13 +23,13 @@ function latLonToGridSquare(param1,param2, width = 4){
// other objects with lat/lon properties
// properties could be getter functions, numbers, or strings
function toNum(x){
if (typeof(x) === 'number') return x;
if (typeof(x) === 'string') return parseFloat(x);
if (typeof(x) === 'function') return parseFloat(x());
if (typeof(x) == 'number') return x;
if (typeof(x) == 'string') return parseFloat(x);
if (typeof(x) == 'function') return parseFloat(x());
throw "HamGridSquare -- toNum -- can not convert input: "+x;
}
if (typeof(param1)==='object'){
if (param1.length === 2){
if (typeof(param1)=='object'){
if (param1.length == 2){
lat = toNum(param1[0]);
lon = toNum(param1[1]);
} else if (('lat' in param1) && ('lon' in param1)){
@ -47,7 +47,7 @@ function latLonToGridSquare(param1,param2, width = 4){
}
if (isNaN(lat)) throw "lat is NaN";
if (isNaN(lon)) throw "lon is NaN";
if (Math.abs(lat) === 90.0) throw "grid g_grids invalid at N/S poles";
if (Math.abs(lat) == 90.0) throw "grid g_grids invalid at N/S poles";
if (Math.abs(lat) > 90) throw "invalid latitude: "+lat;
if (Math.abs(lon) > 180)
{
@ -84,8 +84,6 @@ function latLonToGridSquare(param1,param2, width = 4){
}
}
function bitwise(str){
var hash = 0;
if (str.length == 0) return hash;
@ -140,9 +138,6 @@ function unique (text) {
}
var MyCircle = {
validateRadius: function(unit) {
@ -152,7 +147,7 @@ var MyCircle = {
},
distance: function(lat1, lon1, lat2, lon2, unit) {
if ( unit === undefined ) unit = 'KM';
if ( unit == undefined ) unit = 'KM';
var r = this.validateRadius(unit);
lat1 *= Math.PI / 180;
lon1 *= Math.PI / 180;
@ -183,7 +178,7 @@ var MyCircle = {
},
destination: function(lat1, lon1, brng, dt, unit) {
if ( unit === undefined ) unit = 'KM';
if ( unit == undefined ) unit = 'KM';
var r = this.validateRadius(unit);
lat1 *= Math.PI / 180;
lon1 *= Math.PI / 180;
@ -297,10 +292,10 @@ function flightFeature(line, opts, layer, canAnimate) {
var dash = [];
var dashOff = 0;
if ( canAnimate == true && g_mapSettings.animate == true )
if ( canAnimate == true && GT.mapSettings.animate == true )
{
dash = g_flightPathLineDash;
dashOff = g_flightPathTotal - g_flightPathOffset;
dash = GT.flightPathLineDash;
dashOff = GT.flightPathTotal - GT.flightPathOffset;
}
var featureArrow = new ol.Feature(new ol.geom.Point(line[0]));
@ -309,7 +304,6 @@ function flightFeature(line, opts, layer, canAnimate) {
line = new ol.geom.LineString(line);
var feature = new ol.Feature({ geometry: line, name: 'flight' });
feature.setStyle(new ol.style.Style({
stroke: new ol.style.Stroke({ color: opts.color, width: opts.weight, lineDash: dash, lineDashOffset:dashOff}) }));
@ -324,8 +318,8 @@ function flightFeature(line, opts, layer, canAnimate) {
featureArrow.setStyle(thisStle);
feature.Arrow = featureArrow;
g_layerSources[layer].addFeature(featureArrow);
g_layerSources[layer].addFeature(feature);
GT.layerSources[layer].addFeature(featureArrow);
GT.layerSources[layer].addFeature(feature);
return feature;
}
@ -494,13 +488,9 @@ function sidTime(mjd, lambda) {
}
function datetojd(datestring) {
function datetojd(datestring)
{
jd = (timeNowSec() /86400.0) + 2440587.5;
return jd
}
@ -537,7 +527,7 @@ function convert(ra, dec, lmst,lat) {
}
function isMergeableObject(val) {
var nonNullObject = val && typeof val === 'object'
var nonNullObject = val && typeof val == 'object'
return nonNullObject
&& Object.prototype.toString.call(val) !== '[object RegExp]'
@ -549,18 +539,18 @@ function emptyTarget(val) {
}
function cloneIfNecessary(value, optionsArgument) {
var clone = optionsArgument && optionsArgument.clone === true
var clone = optionsArgument && optionsArgument.clone == true
return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value
}
function defaultArrayMerge(target, source, optionsArgument) {
var destination = target.slice()
source.forEach(function(e, i) {
if (typeof destination[i] === 'undefined') {
if (typeof destination[i] == 'undefined') {
destination[i] = cloneIfNecessary(e, optionsArgument)
} else if (isMergeableObject(e)) {
destination[i] = deepmerge(target[i], e, optionsArgument)
} else if (target.indexOf(e) === -1) {
} else if (target.indexOf(e) == -1) {
destination.push(cloneIfNecessary(e, optionsArgument))
}
})
@ -610,7 +600,7 @@ deepmerge.all = function deepmergeAll(array, optionsArgument) {
// https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color
function pickTextColorBasedOnBgColorAdvanced(bgColor, lightColor, darkColor) {
var color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
var color = (bgColor.charAt(0) == '#') ? bgColor.substring(1, 7) : bgColor;
var r = parseInt(color.substring(0, 2), 16); // hexToR
var g = parseInt(color.substring(2, 4), 16); // hexToG
var b = parseInt(color.substring(4, 6), 16); // hexToB

Wyświetl plik

@ -1,7 +1,7 @@
{
"name": "GridTracker",
"product_string_do_not_use": "gridtracker",
"version": "1.23.0206",
"version": "1.23.0326",
"betaVersion": "",
"description": "GridTracker, an amateur radio companion",
"author": "GridTracker.org",
@ -47,5 +47,8 @@
"diffUpdaters": false,
"MUI_FINISHPAGE_RUN": ""
}
},
"dependencies": {
"tle.js": "^4.7.3"
}
}