2021-01-06 01:46:53 +00:00
|
|
|
// GridTracker Copyright © 2021 GridTracker.org
|
2020-11-03 18:02:55 +00:00
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE for more information.
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var fs = require("fs");
|
2020-09-06 23:50:53 +00:00
|
|
|
|
2020-08-19 17:01:51 +00:00
|
|
|
var callRoster = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
var g_blockedCalls = {};
|
|
|
|
var g_blockedCQ = {};
|
|
|
|
var g_blockedDxcc = {};
|
2020-08-19 17:01:51 +00:00
|
|
|
var g_scriptReport = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
var g_worked = {};
|
|
|
|
var g_confirmed = {};
|
2020-08-19 17:01:51 +00:00
|
|
|
var g_modes = {};
|
|
|
|
var g_modes_phone = {};
|
|
|
|
var g_currentUSCallsigns = null;
|
|
|
|
var r_currentUSState = "";
|
|
|
|
var r_currentDXCCs = -1;
|
|
|
|
var r_callsignManifest = null;
|
|
|
|
var g_rosterSettings = {};
|
|
|
|
var g_day = 0;
|
|
|
|
var g_menu = null;
|
|
|
|
var g_callMenu = null;
|
|
|
|
var g_ageMenu = null;
|
|
|
|
var g_callingMenu = null;
|
2020-08-22 00:35:49 +00:00
|
|
|
var g_compactMenu = null;
|
2020-08-19 17:01:51 +00:00
|
|
|
var g_targetHash = "";
|
|
|
|
var g_clearIgnores = null;
|
|
|
|
var g_clearIgnoresCall = null;
|
|
|
|
var g_dxccMenu = null;
|
|
|
|
var g_targetDxcc = -1;
|
|
|
|
var g_clearDxccIgnore = null;
|
|
|
|
var g_clearDxccIgnoreMainMenu = null;
|
|
|
|
var g_CQMenu = null;
|
|
|
|
var g_targetCQ = "";
|
|
|
|
var g_clearCQIgnore = null;
|
|
|
|
var g_clearCQIgnoreMainMenu = null;
|
|
|
|
var g_timerInterval = null;
|
|
|
|
var g_regFocus = false;
|
|
|
|
var g_awards = {};
|
|
|
|
var g_awardTypes = {};
|
|
|
|
var g_awardTracker = {};
|
2020-08-26 02:38:51 +00:00
|
|
|
var g_callsignDatabaseDXCC = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
var g_callsignDatabaseUS = {};
|
2020-08-26 02:38:51 +00:00
|
|
|
var g_callsignDatabaseUSplus = {};
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var g_developerMode = process.versions["nw-flavor"] == "sdk";
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-08-19 17:01:51 +00:00
|
|
|
var g_modeColors = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
g_modeColors.FT4 = "1111FF";
|
|
|
|
g_modeColors.FT8 = "11FF11";
|
|
|
|
g_modeColors.JT4 = "EE1111";
|
|
|
|
g_modeColors.JT9 = "7CFC00";
|
|
|
|
g_modeColors.JT65 = "E550E5";
|
|
|
|
g_modeColors.QRA64 = "FF00FF";
|
|
|
|
g_modeColors.MSK144 = "4949FF";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
var g_defaultSettings = {
|
|
|
|
callsign: "all",
|
|
|
|
hunting: "dxcc",
|
|
|
|
huntNeed: "confirmed",
|
|
|
|
requireGrid: true,
|
|
|
|
wantMaxDT: false,
|
|
|
|
wantMinDB: false,
|
|
|
|
wantMinFreq: false,
|
|
|
|
wantMaxFreq: false,
|
|
|
|
maxDT: 0.5,
|
|
|
|
minDb: -25,
|
|
|
|
minFreq: 0,
|
|
|
|
maxFreq: 3500,
|
|
|
|
noMyDxcc: false,
|
|
|
|
onlyMyDxcc: false,
|
|
|
|
noMsg: false,
|
|
|
|
noMsgValue: "CQ RU",
|
|
|
|
onlyMsg: false,
|
|
|
|
onlyMsgValue: "CQ FD",
|
|
|
|
cqOnly: true,
|
|
|
|
usesLoTW: false,
|
|
|
|
maxLoTW: 27,
|
|
|
|
useseQSL: false,
|
|
|
|
usesOQRS: false,
|
|
|
|
onlySpot: false,
|
|
|
|
allOnlyNew: false,
|
|
|
|
useRegex: false,
|
|
|
|
callsignRegex: "",
|
|
|
|
realtime: false,
|
|
|
|
wanted: {
|
|
|
|
huntCallsign: false,
|
|
|
|
huntGrid: true,
|
|
|
|
huntDXCC: true,
|
|
|
|
huntCQz: false,
|
|
|
|
huntITUz: false,
|
|
|
|
huntState: false,
|
|
|
|
huntCounty: false,
|
|
|
|
huntCont: false,
|
|
|
|
huntPX: false,
|
|
|
|
huntQRZ: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
huntOAMS: false
|
2020-10-31 14:01:03 +00:00
|
|
|
},
|
|
|
|
columns: {
|
|
|
|
Band: false,
|
|
|
|
Mode: false,
|
|
|
|
Calling: true,
|
|
|
|
Msg: false,
|
|
|
|
DXCC: true,
|
|
|
|
Flag: true,
|
|
|
|
State: true,
|
|
|
|
County: true,
|
|
|
|
Cont: true,
|
|
|
|
dB: true,
|
|
|
|
Freq: false,
|
|
|
|
DT: false,
|
|
|
|
Dist: false,
|
|
|
|
Azim: true,
|
|
|
|
CQz: false,
|
|
|
|
ITUz: false,
|
|
|
|
PX: true,
|
|
|
|
LoTW: false,
|
|
|
|
eQSL: false,
|
|
|
|
OQRS: false,
|
|
|
|
Spot: false,
|
|
|
|
Life: false,
|
|
|
|
OAMS: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
Age: true
|
2020-10-31 14:01:03 +00:00
|
|
|
},
|
|
|
|
reference: 0,
|
|
|
|
controls: true,
|
2020-12-05 19:19:11 +00:00
|
|
|
controlsExpanded: false,
|
2020-10-31 14:01:03 +00:00
|
|
|
compact: false,
|
|
|
|
settingProfiles: false,
|
|
|
|
lastSortIndex: 6,
|
2020-12-14 02:10:27 +00:00
|
|
|
lastSortReverse: 1
|
2020-10-31 14:01:03 +00:00
|
|
|
};
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
const LOGBOOK_LIVE_BAND_LIVE_MODE = "0";
|
|
|
|
const LOGBOOK_LIVE_BAND_MIX_MODE = "1";
|
|
|
|
const LOGBOOK_LIVE_BAND_DIGI_MODE = "2";
|
|
|
|
const LOGBOOK_MIX_BAND_LIVE_MODE = "3";
|
|
|
|
const LOGBOOK_MIX_BAND_MIX_MODE = "4";
|
|
|
|
const LOGBOOK_MIX_BAND_DIGI_MODE = "5";
|
|
|
|
const LOGBOOK_AWARD_TRACKER = "6";
|
|
|
|
|
|
|
|
const LAYERED_MODE_FOR = {}
|
|
|
|
LAYERED_MODE_FOR[LOGBOOK_MIX_BAND_LIVE_MODE] = LOGBOOK_LIVE_BAND_LIVE_MODE;
|
|
|
|
LAYERED_MODE_FOR[LOGBOOK_MIX_BAND_MIX_MODE] = LOGBOOK_LIVE_BAND_MIX_MODE;
|
|
|
|
LAYERED_MODE_FOR[LOGBOOK_MIX_BAND_DIGI_MODE] = LOGBOOK_LIVE_BAND_DIGI_MODE;
|
2021-01-08 13:55:18 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
document.addEventListener("dragover", function (event)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
event.preventDefault();
|
2020-08-19 17:01:51 +00:00
|
|
|
});
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
document.addEventListener("drop", function (event)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
event.preventDefault();
|
2020-08-19 17:01:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (typeof localStorage.blockedCQ == "undefined")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
localStorage.blockedCQ = "{}";
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (typeof localStorage.awardTracker == "undefined")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
localStorage.awardTracker = "{}";
|
|
|
|
g_rosterSettings = {};
|
|
|
|
writeRosterSettings();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awardTracker = JSON.parse(localStorage.awardTracker);
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (typeof localStorage.blockedCalls != "undefined")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCalls = JSON.parse(localStorage.blockedCalls);
|
|
|
|
g_blockedCQ = JSON.parse(localStorage.blockedCQ);
|
|
|
|
g_blockedDxcc = JSON.parse(localStorage.blockedDxcc);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function storeBlocks()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
localStorage.blockedCalls = JSON.stringify(g_blockedCalls);
|
|
|
|
localStorage.blockedCQ = JSON.stringify(g_blockedCQ);
|
|
|
|
localStorage.blockedDxcc = JSON.stringify(g_blockedDxcc);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function storeAwardTracker()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
localStorage.awardTracker = JSON.stringify(g_awardTracker);
|
2020-08-26 02:38:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function loadSettings()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var readSettings = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
if (typeof localStorage.rosterSettings != "undefined")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
readSettings = JSON.parse(localStorage.rosterSettings);
|
|
|
|
}
|
|
|
|
g_rosterSettings = deepmerge(g_defaultSettings, readSettings);
|
2020-08-26 02:38:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if ("GT" in g_rosterSettings.columns) delete g_rosterSettings.columns.GT;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
writeRosterSettings();
|
2020-08-26 02:38:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function writeRosterSettings()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function isKnownCallsignDXCC(dxcc)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (dxcc in g_callsignDatabaseDXCC) return true;
|
|
|
|
return false;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function isKnownCallsignUS(dxcc)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (dxcc in g_callsignDatabaseUS) return true;
|
|
|
|
return false;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function isKnownCallsignUSplus(dxcc)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (dxcc in g_callsignDatabaseUSplus) return true;
|
|
|
|
return false;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function timeNowSec()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return parseInt(Date.now() / 1000);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function lockNewWindows()
|
|
|
|
{
|
|
|
|
if (typeof nw != "undefined")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var gui = require("nw.gui");
|
|
|
|
var win = gui.Window.get();
|
2020-12-14 02:10:27 +00:00
|
|
|
win.on("new-win-policy", function (frame, url, policy)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
gui.Shell.openExternal(url);
|
|
|
|
policy.ignore();
|
|
|
|
});
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myCallCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return a.DEcall.localeCompare(b.DEcall);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myGridCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var gridA = a.grid ? a.grid : "0";
|
|
|
|
var gridB = b.grid ? b.grid : "0";
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (gridA > gridB) return 1;
|
|
|
|
if (gridA < gridB) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myDxccCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return window.opener.myDxccCompare(a, b);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myTimeCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.age > b.age) return 1;
|
|
|
|
if (a.age < b.age) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myLifeCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.life > b.life) return 1;
|
|
|
|
if (a.life < b.life) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function mySpotCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.spot.when > b.spot.when) return 1;
|
|
|
|
if (a.spot.when < b.spot.when) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myDbCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.RSTsent > b.RSTsent) return 1;
|
|
|
|
if (a.RSTsent < b.RSTsent) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myFreqCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.delta > b.delta) return 1;
|
|
|
|
if (a.delta < b.delta) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myDTCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.dt > b.dt) return 1;
|
|
|
|
if (a.dt < b.dt) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myDistanceCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.distance > b.distance) return 1;
|
|
|
|
if (a.distance < b.distance) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myHeadingCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.heading > b.heading) return 1;
|
|
|
|
if (a.heading < b.heading) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myStateCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.state == null) return 1;
|
|
|
|
if (b.state == null) return -1;
|
|
|
|
if (a.state > b.state) return 1;
|
|
|
|
if (a.state < b.state) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myCQCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return a.DXcall.localeCompare(b.DXcall);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myWPXCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.px == null) return 1;
|
|
|
|
if (b.px == null) return -1;
|
|
|
|
if (a.px > b.px) return 1;
|
|
|
|
if (a.px < b.px) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myCntyCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.cnty == null) return 1;
|
|
|
|
if (b.cnty == null) return -1;
|
|
|
|
if (a.cnty.substr(3) > b.cnty.substr(3)) return 1;
|
|
|
|
if (a.cnty.substr(3) < b.cnty.substr(3)) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function myContCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.cont == null) return 1;
|
|
|
|
if (b.cont == null) return -1;
|
|
|
|
if (a.cont > b.cont) return 1;
|
|
|
|
if (a.cont < b.cont) return -1;
|
|
|
|
return 0;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
function myGTCompare(a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (a.style.gt != 0 && b.style.gt == 0) return 1;
|
|
|
|
if (a.style.gt == 0 && b.style.gt != 0) return -1;
|
|
|
|
return 0;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var r_sortFunction = [
|
|
|
|
myCallCompare,
|
|
|
|
myGridCompare,
|
|
|
|
myDbCompare,
|
|
|
|
myDTCompare,
|
|
|
|
myFreqCompare,
|
|
|
|
myDxccCompare,
|
|
|
|
myTimeCompare,
|
|
|
|
myDistanceCompare,
|
|
|
|
myHeadingCompare,
|
|
|
|
myStateCompare,
|
|
|
|
myCQCompare,
|
|
|
|
myWPXCompare,
|
|
|
|
myLifeCompare,
|
|
|
|
mySpotCompare,
|
|
|
|
myGTCompare,
|
|
|
|
myCntyCompare,
|
2020-12-14 02:10:27 +00:00
|
|
|
myContCompare
|
2020-10-31 14:01:03 +00:00
|
|
|
];
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function showRosterBox(sortIndex)
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.lastSortIndex != sortIndex)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.lastSortIndex = sortIndex;
|
|
|
|
g_rosterSettings.lastSortReverse = 0;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.lastSortReverse ^= 1;
|
|
|
|
}
|
2020-08-22 00:35:49 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
writeRosterSettings();
|
|
|
|
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
function hashMaker(start, callObj, reference)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-01-08 13:55:18 +00:00
|
|
|
if (reference == LOGBOOK_LIVE_BAND_LIVE_MODE) return `${start}${callObj.band}${callObj.mode}`;
|
|
|
|
|
|
|
|
if (reference == LOGBOOK_AWARD_TRACKER) return `${start}${callObj.band}${callObj.mode}`;
|
|
|
|
|
|
|
|
if (reference == LOGBOOK_LIVE_BAND_MIX_MODE) return `${start}${callObj.band}`;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
if (reference == LOGBOOK_LIVE_BAND_DIGI_MODE) return `${start}${callObj.band}dg`;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
if (reference == LOGBOOK_MIX_BAND_LIVE_MODE) return `${start}${callObj.mode}`;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
if (reference == LOGBOOK_MIX_BAND_MIX_MODE) return `${start}`;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
if (reference == LOGBOOK_MIX_BAND_DIGI_MODE) return `${start}dg`;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-01-08 13:55:18 +00:00
|
|
|
return "";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function processRoster(roster)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callRoster = roster;
|
|
|
|
viewRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function viewRoster()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var bands = Object();
|
|
|
|
var modes = Object();
|
|
|
|
|
|
|
|
var callMode = g_rosterSettings.callsign;
|
|
|
|
var onlyHits = false;
|
|
|
|
var isAwardTracker = false;
|
2020-11-18 04:22:17 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode == "hits")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callMode = "all";
|
|
|
|
onlyHits = true;
|
|
|
|
}
|
2021-01-08 13:55:18 +00:00
|
|
|
if (referenceNeed.value == LOGBOOK_AWARD_TRACKER)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callMode = "all";
|
|
|
|
onlyHits = false;
|
|
|
|
isAwardTracker = true;
|
|
|
|
g_rosterSettings.huntNeed = "confirmed";
|
|
|
|
}
|
|
|
|
|
|
|
|
var canMsg =
|
|
|
|
window.opener.g_mapSettings.offlineMode == false &&
|
|
|
|
window.opener.g_appSettings.gtShareEnable == "true" &&
|
|
|
|
window.opener.g_appSettings.gtMsgEnable == "true";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (window.opener.g_callsignLookups.lotwUseEnable == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
usesLoTWDiv.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.usesLoTW == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
maxLoTW.style.display = "";
|
|
|
|
maxLoTWView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
maxLoTW.style.display = "none";
|
|
|
|
maxLoTWView.style.display = "none";
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
usesLoTWDiv.style.display = "none";
|
|
|
|
maxLoTW.style.display = "none";
|
|
|
|
maxLoTWView.style.display = "none";
|
|
|
|
}
|
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (window.opener.g_callsignLookups.eqslUseEnable == true) useseQSLDiv.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
else useseQSLDiv.style.display = "none";
|
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (window.opener.g_callsignLookups.oqrsUseEnable == true) usesOQRSDiv.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
else usesOQRSDiv.style.display = "none";
|
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (g_rosterSettings.columns.Spot == true) onlySpotDiv.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
else onlySpotDiv.style.display = "none";
|
|
|
|
|
2020-12-22 17:30:21 +00:00
|
|
|
if (callMode == "all") allOnlyNewDiv.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
else allOnlyNewDiv.style.display = "none";
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
var huntIndex, workedIndex, layeredMode;
|
|
|
|
if (g_rosterSettings.huntNeed == "mixed")
|
|
|
|
{
|
|
|
|
huntIndex = g_confirmed;
|
|
|
|
workedIndex = g_worked;
|
|
|
|
layeredMode = LAYERED_MODE_FOR[String(g_rosterSettings.reference)];
|
|
|
|
}
|
|
|
|
else if (g_rosterSettings.huntNeed == "worked")
|
2021-04-07 11:35:45 +00:00
|
|
|
{
|
|
|
|
huntIndex = g_worked;
|
|
|
|
workedIndex = false;
|
2021-04-07 19:52:51 +00:00
|
|
|
layeredMode = false;
|
2021-04-07 11:35:45 +00:00
|
|
|
}
|
|
|
|
else if (g_rosterSettings.huntNeed == "confirmed")
|
|
|
|
{
|
|
|
|
huntIndex = g_confirmed;
|
|
|
|
workedIndex = g_worked;
|
2021-04-07 19:52:51 +00:00
|
|
|
layeredMode = false;
|
2021-04-07 11:35:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
huntIndex = false;
|
|
|
|
workedIndex = false;
|
2021-04-07 19:52:51 +00:00
|
|
|
layeredMode = false;
|
2021-04-07 11:35:45 +00:00
|
|
|
}
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var now = timeNowSec();
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
// First loop, exclude calls, mostly based on "Exceptions" settings
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var callHash in callRoster)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
var entry = callRoster[callHash];
|
2021-04-07 19:52:51 +00:00
|
|
|
var callObj = entry.callObj;
|
2021-04-07 11:35:45 +00:00
|
|
|
|
|
|
|
var call = entry.DEcall;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = true;
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.shouldAlert = false;
|
|
|
|
callObj.reason = Array();
|
|
|
|
callObj.awardReason = "Callsign";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (now - callObj.age > window.opener.g_mapSettings.rosterTime)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
|
|
|
entry.alerted = false;
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.qrz = false;
|
|
|
|
callObj.reset = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
if (window.opener.g_instances[callObj.instance].crEnable == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (call in g_blockedCalls)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.DXcall + " from All" in g_blockedCQ ||
|
2021-04-07 19:52:51 +00:00
|
|
|
entry.DXcall + " from " + window.opener.g_dxccToAltName[callObj.dxcc] in g_blockedCQ
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.dxcc in g_blockedDxcc)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
if (g_rosterSettings.cqOnly == true && callObj.CQ == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-01-08 12:59:33 +00:00
|
|
|
if (g_rosterSettings.useRegex && g_rosterSettings.callsignRegex.length > 0)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (!call.match(g_rosterSettings.callsignRegex))
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e) {}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
if (g_rosterSettings.requireGrid == true && callObj.grid.length != 4)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (g_rosterSettings.wantMinDB == true && entry.message.SR < g_rosterSettings.minDb)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (g_rosterSettings.wantMaxDT == true && Math.abs(entry.message.DT) > g_rosterSettings.maxDT)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (g_rosterSettings.wantMinFreq == true && entry.message.DF < g_rosterSettings.minFreq)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (g_rosterSettings.wantMaxFreq == true && entry.message.DF > g_rosterSettings.maxFreq)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.noMsg == true)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.msg.match(g_rosterSettings.noMsgValue))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e) {}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.onlyMsg == true)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (!callObj.msg.match(g_rosterSettings.onlyMsgValue))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e) {}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.dxcc == window.opener.g_myDXCC)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
if (g_rosterSettings.noMyDxcc == true)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.onlyMyDxcc == true)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 12:03:15 +00:00
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (window.opener.g_callsignLookups.lotwUseEnable == true && g_rosterSettings.usesLoTW == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
if (!(call in window.opener.g_lotwCallsigns))
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.maxLoTW < 27)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var months = (g_day - window.opener.g_lotwCallsigns[call]) / 30;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (months > g_rosterSettings.maxLoTW)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 12:03:15 +00:00
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (window.opener.g_callsignLookups.eqslUseEnable == true && g_rosterSettings.useseQSL == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
if (!(call in window.opener.g_eqslCallsigns))
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 12:03:15 +00:00
|
|
|
|
2021-01-08 12:59:33 +00:00
|
|
|
if (window.opener.g_callsignLookups.oqrsUseEnable == true && g_rosterSettings.usesOQRS == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
if (!(call in window.opener.g_oqrsCallsigns))
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 12:03:15 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode != "all")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (entry.DXcall == "CQ DX" && callObj.dxcc == window.opener.g_myDXCC)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(call, callObj, g_rosterSettings.reference);
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode == "worked" && hash in g_worked.call)
|
2020-10-31 14:01:03 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-12-14 01:30:10 +00:00
|
|
|
continue;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode == "confirmed" && hash in g_confirmed.call)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-12-14 01:30:10 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "grid")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(callObj.grid.substr(0, 4),
|
|
|
|
callObj, g_rosterSettings.reference);
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && hash in huntIndex.grid)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.grid.length == 0)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "dxcc")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(String(callObj.dxcc),
|
|
|
|
callObj, g_rosterSettings.reference);
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && (hash in huntIndex.dxcc))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "dxccs" && r_currentDXCCs != -1)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.dxcc != r_currentDXCCs)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "wpx")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (String(callObj.px) == null)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(String(callObj.px),
|
|
|
|
callObj, g_rosterSettings.reference);
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && (hash in huntIndex.px))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "cq")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var huntTotal = callObj.cqza.length;
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntTotal == 0 || !huntIndex)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
var huntFound = 0;
|
2021-04-07 19:52:51 +00:00
|
|
|
for (index in callObj.cqza)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(callObj.cqza[index], callObj, g_rosterSettings.reference);
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (hash in huntIndex.cqz) huntFound++;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntFound == huntTotal)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "itu")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var huntTotal = callObj.ituza.length;
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntTotal == 0 || !huntIndex)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
var huntFound = 0;
|
2021-04-07 19:52:51 +00:00
|
|
|
for (index in callObj.ituza)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(callObj.ituza[index], callObj, g_rosterSettings.reference);
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (hash in huntIndex.ituz) huntFound++;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntFound == huntTotal)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.grid.length == 0)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (g_rosterSettings.hunting == "usstates" && window.opener.g_callsignLookups.ulsUseEnable == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var state = callObj.state;
|
|
|
|
var finalDxcc = callObj.dxcc;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6)
|
|
|
|
{
|
|
|
|
if (state in window.opener.g_StateData)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = hashMaker(state, callObj, g_rosterSettings.reference);
|
2020-08-22 00:35:49 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && hash in huntIndex.state)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
else entry.tx = false;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
else entry.tx = false;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.hunting == "usstate" && g_currentUSCallsigns)
|
|
|
|
{
|
|
|
|
if (call in g_currentUSCallsigns)
|
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
// Do Nothing
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (isAwardTracker)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var tx = false;
|
2021-04-07 19:52:51 +00:00
|
|
|
var baseHash = hashMaker("", callObj, g_rosterSettings.reference);
|
2021-01-08 13:55:18 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var award in g_awardTracker)
|
|
|
|
{
|
|
|
|
if (g_awardTracker[award].enable)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
tx = testAward(award, callObj, baseHash);
|
2020-12-14 02:10:27 +00:00
|
|
|
if (tx)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var x = g_awardTracker[award];
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.awardReason =
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[x.sponsor].awards[x.name].tooltip +
|
|
|
|
" (" +
|
|
|
|
g_awards[x.sponsor].sponsor +
|
|
|
|
")";
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = tx;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var hasGtPin = false;
|
|
|
|
|
|
|
|
var newCallList = Array();
|
|
|
|
var inversionAlpha = "DD";
|
|
|
|
var row = "#000000";
|
2021-04-27 11:34:07 +00:00
|
|
|
var bold = "#000000;font-weight: bold;";
|
2021-05-09 23:13:18 +00:00
|
|
|
var unconf = "background-clip:padding-box;box-shadow: 0 0 7px 3px inset ";
|
2021-04-27 11:34:07 +00:00
|
|
|
var layeredAlpha = "77";
|
|
|
|
var layeredInversionAlpha = "66";
|
2021-05-09 23:13:18 +00:00
|
|
|
var layeredUnconf = "background-clip:padding-box;box-shadow: 0 0 4px 2px inset ";
|
2021-04-27 11:34:07 +00:00
|
|
|
var layeredUnconfAlpha = "AA";
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
// Second loop, hunting and highlighting
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var callHash in callRoster)
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
var entry = callRoster[callHash];
|
2021-04-07 19:52:51 +00:00
|
|
|
var callObj = entry.callObj;
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
// Special case check for called station
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.qrz == true && entry.tx == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// The instance has to be enabled
|
2021-04-07 19:52:51 +00:00
|
|
|
if (window.opener.g_instances[callObj.instance].crEnable == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// Calling us, but we wouldn't normally display
|
|
|
|
// If they are not ignored or we're in a QSO with them, var it through
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if ((!(entry.DEcall in g_blockedCalls) && !(callObj.dxcc in g_blockedDxcc)) ||
|
|
|
|
window.opener.g_instances[callObj.instance].status.DXcall == entry.DEcall)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Only render entries with `tx == true`, ignore the rest
|
|
|
|
if (callObj.dxcc != -1 && entry.tx == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
// In layered mode ("Hunting: mixed") the workHashSuffix becomes a more stricter 'live band',
|
|
|
|
// while the layered suffix is a broader 'mixed band'
|
|
|
|
var workHashSuffix, layeredHashSuffix;
|
|
|
|
if (layeredMode)
|
|
|
|
{
|
|
|
|
workHashSuffix = hashMaker("", callObj, layeredMode);
|
|
|
|
layeredHashSuffix = hashMaker("", callObj, g_rosterSettings.reference);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
workHashSuffix = hashMaker("", callObj, g_rosterSettings.reference);
|
|
|
|
layeredHashSuffix = false
|
|
|
|
}
|
|
|
|
var workHash = workHashSuffix; // TODO: Remove after replacing all occurrences with Suffix
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
var callsign = entry.DEcall;
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
callObj.hunting = {}
|
|
|
|
callObj.callFlags = {}
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var colorObject = Object();
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
var callPointer = callObj.CQ == true ? "cursor:pointer" : "";
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var didWork = false;
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
var call = "#FFFF00";
|
2020-10-31 14:01:03 +00:00
|
|
|
var grid = "#00FFFF";
|
|
|
|
var calling = "#90EE90";
|
|
|
|
var dxcc = "#FFA500";
|
|
|
|
var state = "#90EE90";
|
|
|
|
var cnty = "#CCDD00";
|
|
|
|
var cont = "#00DDDD";
|
|
|
|
var cqz = "#DDDDDD";
|
|
|
|
var ituz = "#DDDDDD";
|
|
|
|
var wpx = "#FFFF00";
|
|
|
|
|
|
|
|
hasGtPin = false;
|
2021-03-25 01:44:16 +00:00
|
|
|
var shouldAlert = false;
|
2021-04-27 11:34:07 +00:00
|
|
|
var callBg, gridBg, callingBg, dxccBg, stateBg, cntyBg, contBg, cqzBg, ituzBg, wpxBg, gtBg;
|
2021-04-07 11:35:45 +00:00
|
|
|
var callConf, gridConf, callingConf, dxccConf, stateConf, cntyConf, contConf, cqzConf, ituzConf, wpxConf;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
callBg = gridBg = callingBg = dxccBg = stateBg = cntyBg = contBg = cqzBg = ituzBg = wpxBg = gtBg = row;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
callConf = gridConf = callingConf = dxccConf = stateConf = cntyConf = contConf = cqzConf = ituzConf = wpxConf =
|
|
|
|
"";
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
var hash = callsign + workHashSuffix;
|
|
|
|
var layeredHash = layeredHashSuffix && (callsign + layeredHashSuffix)
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
// Call worked in current logbook settings, regardless of hunting mode
|
|
|
|
if (hash in g_worked.call)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.callFlags.worked = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
didWork = true;
|
2021-04-27 11:34:07 +00:00
|
|
|
callConf = `${unconf}${call}${inversionAlpha};`;
|
|
|
|
|
2021-05-16 21:35:50 +00:00
|
|
|
if (hash in g_confirmed.call)
|
|
|
|
{
|
|
|
|
callObj.callFlags.confirmed = true;
|
|
|
|
callPointer = "text-decoration: line-through; ";
|
|
|
|
callConf = "";
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Calls that have OAMS chat support
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
2021-04-27 11:34:07 +00:00
|
|
|
callsign in window.opener.g_gtCallsigns &&
|
|
|
|
window.opener.g_gtCallsigns[callsign] in window.opener.g_gtFlagPins &&
|
|
|
|
window.opener.g_gtFlagPins[window.opener.g_gtCallsigns[callsign]].canmsg == true
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.callFlags.oams = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
// grab the CID
|
2021-04-27 11:34:07 +00:00
|
|
|
colorObject.gt = window.opener.g_gtCallsigns[callsign];
|
2020-10-31 14:01:03 +00:00
|
|
|
hasGtPin = true;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
colorObject.gt = 0;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// We only do hunt highlighting when showing all entries
|
|
|
|
// This means "Callsigns: All Traffic", "Callsigns: All Traffic/Only Wanted" and "Logbook: Award Tracker"
|
|
|
|
// There is no highlighting in other modes
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode == "all")
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
// Skip when "only new calls"
|
|
|
|
// Questions: Move to the first loop? Why only skip new calls in "all traffic" and not other modes?
|
|
|
|
if (allOnlyNew.checked == true && didWork && callObj.qrz == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
entry.tx = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for callsigns
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntCallsign.checked == true)
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
var hash = callsign + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (callsign + layeredHashSuffix)
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.call))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
callObj.reason.push("call");
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.call)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.call)
|
|
|
|
{
|
|
|
|
callObj.hunting.call = "worked-and-mixed";
|
|
|
|
callConf = `${layeredUnconf}${call}${layeredUnconfAlpha};`;
|
|
|
|
callBg = `${call}${layeredInversionAlpha}`;
|
|
|
|
call = bold;
|
|
|
|
}
|
|
|
|
// /* Currently we don't have a way to figure out
|
|
|
|
// * if the call is worked only in this band or also others,
|
|
|
|
// * so we cannot cover this particular combination
|
|
|
|
// * and have to default to just showing it as plain "worked"
|
|
|
|
// */
|
|
|
|
// else if (layeredMode && layeredHash in workedIndex.call)
|
|
|
|
// {
|
|
|
|
// callObj.hunting.call = "worked-and-mixed-worked";
|
|
|
|
// callConf = `${layeredUnconf}${call}${layeredAlpha};`;
|
|
|
|
// }
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.call = "worked";
|
|
|
|
callConf = `${unconf}${call}${inversionAlpha};`;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.call)
|
|
|
|
{
|
|
|
|
callObj.hunting.call = "mixed";
|
|
|
|
callBg = `${call}${layeredAlpha};`;
|
|
|
|
call = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.call)
|
|
|
|
{
|
|
|
|
callObj.hunting.call = "mixed-worked";
|
|
|
|
callConf = `${unconf}${call}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.call = "hunted";
|
|
|
|
callBg = `${call}${inversionAlpha};`;
|
|
|
|
call = bold;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for "stations calling you"
|
|
|
|
if (huntQRZ.checked == true && callObj.qrz == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.callFlags.calling = true
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("qrz");
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for stations with OAMS
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntOAMS.checked == true && hasGtPin == true)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.hunting.oams = "hunted";
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("oams");
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for grids
|
|
|
|
if (huntGrid.checked == true && callObj.grid.length > 1)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = callObj.grid.substr(0, 4) + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (callObj.grid.substr(0, 4) + layeredHashSuffix)
|
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.grid))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("grid");
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.grid)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.grid)
|
|
|
|
{
|
|
|
|
callObj.hunting.grid = "worked-and-mixed";
|
|
|
|
gridConf = `${layeredUnconf}${grid}${layeredUnconfAlpha};`;
|
|
|
|
gridBg = `${grid}${layeredInversionAlpha}`;
|
|
|
|
grid = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.grid = "worked";
|
|
|
|
gridConf = `${unconf}${grid}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.grid)
|
|
|
|
{
|
|
|
|
callObj.hunting.grid = "mixed";
|
|
|
|
gridBg = `${grid}${layeredAlpha};`;
|
|
|
|
grid = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.grid)
|
|
|
|
{
|
|
|
|
callObj.hunting.grid = "mixed-worked";
|
|
|
|
gridConf = `${unconf}${grid}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.grid = "hunted";
|
|
|
|
gridBg = `${grid}${inversionAlpha};`;
|
|
|
|
grid = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for DXCC
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntDXCC.checked == true)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = String(callObj.dxcc) + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (String(callObj.dxcc) + layeredHashSuffix)
|
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.dxcc))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("dxcc");
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.dxcc)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.dxcc)
|
|
|
|
{
|
|
|
|
callObj.hunting.dxcc = "worked-and-mixed";
|
|
|
|
dxccConf = `${layeredUnconf}${dxcc}${layeredUnconfAlpha};`;
|
|
|
|
dxccBg = `${dxcc}${layeredInversionAlpha}`;
|
|
|
|
dxcc = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.dxcc = "worked";
|
|
|
|
dxccConf = `${unconf}${dxcc}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.dxcc)
|
|
|
|
{
|
|
|
|
callObj.hunting.dxcc = "mixed";
|
|
|
|
dxccBg = `${dxcc}${layeredAlpha};`;
|
|
|
|
dxcc = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.dxcc)
|
|
|
|
{
|
|
|
|
callObj.hunting.dxcc = "mixed-worked";
|
|
|
|
dxccConf = `${unconf}${dxcc}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.dxcc = "hunted";
|
|
|
|
dxccBg = `${dxcc}${inversionAlpha};`;
|
|
|
|
dxcc = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
// Hunting for US States
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntState.checked == true && window.opener.g_callsignLookups.ulsUseEnable == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var stateSearch = callObj.state;
|
|
|
|
var finalDxcc = callObj.dxcc;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6)
|
|
|
|
{
|
|
|
|
if (stateSearch in window.opener.g_StateData)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = stateSearch + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (stateSearch + layeredHashSuffix)
|
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.state))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("state");
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.state)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.state)
|
|
|
|
{
|
|
|
|
callObj.hunting.state = "worked-and-mixed";
|
|
|
|
stateConf = `${layeredUnconf}${state}${layeredUnconfAlpha};`;
|
|
|
|
stateBg = `${state}${layeredInversionAlpha}`;
|
|
|
|
state = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.state = "worked";
|
|
|
|
stateConf = `${unconf}${state}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.state)
|
|
|
|
{
|
|
|
|
callObj.hunting.state = "mixed";
|
|
|
|
stateBg = `${state}${layeredAlpha};`;
|
|
|
|
state = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.state)
|
|
|
|
{
|
|
|
|
callObj.hunting.state = "mixed-worked";
|
|
|
|
stateConf = `${unconf}${state}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.state = "hunted";
|
|
|
|
stateBg = `${state}${inversionAlpha};`;
|
|
|
|
state = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for US Counties
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntCounty.checked == true && window.opener.g_callsignLookups.ulsUseEnable == true)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var finalDxcc = callObj.dxcc;
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.cnty &&
|
2021-04-07 11:35:45 +00:00
|
|
|
(finalDxcc == 291 || finalDxcc == 110 || finalDxcc == 6 || finalDxcc == 202) &&
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.cnty.length > 0
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = callObj.cnty + (layeredMode ? layeredHashSuffix : workHashSuffix);
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if ((huntIndex && !(hash in huntIndex.cnty)) || callObj.qual == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.qual == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var counties = window.opener.g_zipToCounty[callObj.zipcode];
|
2020-10-31 14:01:03 +00:00
|
|
|
var foundHit = false;
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var cnt in counties)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var hh = counties[cnt] + workHash;
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.cnty = counties[cnt];
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hh in huntIndex.cnty))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
foundHit = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (foundHit) shouldAlert = true;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (shouldAlert)
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.reason.push("cnty");
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (workedIndex && hash in workedIndex.cnty)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.hunting.cnty = "worked";
|
|
|
|
cntyConf = `${unconf}${cnty}${inversionAlpha};`;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.hunting.cnty = "hunted";
|
|
|
|
cntyBg = `${cnty}${inversionAlpha}`;
|
2020-10-31 14:01:03 +00:00
|
|
|
cnty = bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for CQ Zones
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntCQz.checked == true)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var huntTotal = callObj.cqza.length;
|
|
|
|
var huntFound = 0, layeredFound = 0, workedFound = 0, layeredWorkedFound = 0;
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
for (index in callObj.cqza)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = callObj.cqza[index] + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (callObj.cqza[index] + layeredHashSuffix)
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (huntIndex && hash in huntIndex.cqz) huntFound++;
|
|
|
|
if (layeredMode && layeredHash in huntIndex.cqz) layeredFound++;
|
2021-04-07 11:35:45 +00:00
|
|
|
if (workedIndex && hash in workedIndex.cqz) workedFound++;
|
2021-04-07 19:52:51 +00:00
|
|
|
if (layeredMode && layeredHash in workedIndex.cqz) layeredWorkedFound++;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntFound != huntTotal)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.reason.push("cqz");
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && workedFound == huntTotal)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.cqz = "worked-and-mixed";
|
|
|
|
cqzConf = `${layeredUnconf}${cqz}${layeredUnconfAlpha};`;
|
|
|
|
cqzBg = `${cqz}${layeredInversionAlpha}`;
|
|
|
|
cqz = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.cqz = "worked";
|
2021-05-25 14:20:44 +00:00
|
|
|
cqzConf = `${unconf}${cqz}${inversionAlpha};`;
|
2021-04-27 11:34:07 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.cqz = "mixed";
|
|
|
|
cqzBg = `${cqz}${layeredAlpha};`;
|
|
|
|
cqz = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredWorkedFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.cqz = "mixed-worked";
|
|
|
|
cqzConf = `${unconf}${cqz}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.cqz = "hunted";
|
|
|
|
cqzBg = `${cqz}${inversionAlpha};`;
|
|
|
|
cqz = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for ITU Zones
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntITUz.checked == true)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var huntTotal = callObj.ituza.length;
|
|
|
|
var huntFound = 0, layeredFound = 0, workedFound = 0, layeredWorkedFound = 0;
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
for (index in callObj.ituza)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = callObj.ituza[index] + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (callObj.ituza[index] + layeredHashSuffix)
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
if (huntIndex && hash in huntIndex.ituz) huntFound++;
|
|
|
|
if (layeredMode && layeredHash in huntIndex.ituz) layeredFound++;
|
2021-04-07 11:35:45 +00:00
|
|
|
if (workedIndex && hash in workedIndex.ituz) workedFound++;
|
2021-04-07 19:52:51 +00:00
|
|
|
if (layeredMode && layeredHash in workedIndex.ituz) layeredWorkedFound++;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntFound != huntTotal)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.reason.push("ituz");
|
2021-04-07 19:52:51 +00:00
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && workedFound == huntTotal)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.ituz = "worked-and-mixed";
|
|
|
|
ituzConf = `${layeredUnconf}${ituz}${layeredUnconfAlpha};`;
|
|
|
|
ituzBg = `${ituz}${layeredInversionAlpha}`;
|
|
|
|
ituz = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.ituz = "worked";
|
|
|
|
ituzConf = `${unconf}${ituz}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.ituz = "mixed";
|
|
|
|
ituzBg = `${ituz}${layeredAlpha};`;
|
|
|
|
ituz = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredWorkedFound == huntTotal)
|
|
|
|
{
|
|
|
|
callObj.hunting.ituz = "mixed-worked";
|
|
|
|
ituzConf = `${unconf}${ituz}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.ituz = "hunted";
|
|
|
|
ituzBg = `${ituz}${inversionAlpha};`;
|
|
|
|
ituz = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for WPX (Prefixes)
|
|
|
|
if (huntPX.checked == true && callObj.px)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-16 11:02:42 +00:00
|
|
|
var hash = String(callObj.px) + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (String(callObj.px) + layeredHashSuffix)
|
2021-04-07 19:52:51 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.px))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-16 11:02:42 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.reason.push("wpx");
|
2021-04-16 11:02:42 +00:00
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.px)
|
2021-04-16 11:02:42 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.px)
|
|
|
|
{
|
|
|
|
callObj.hunting.wpx = "worked-and-mixed";
|
|
|
|
wpxConf = `${layeredUnconf}${wpx}${layeredUnconfAlpha};`;
|
|
|
|
wpxBg = `${wpx}${layeredInversionAlpha}`;
|
|
|
|
wpx = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.wpx = "worked";
|
|
|
|
wpxConf = `${unconf}${wpx}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.px)
|
|
|
|
{
|
|
|
|
callObj.hunting.wpx = "mixed";
|
|
|
|
wpxBg = `${wpx}${layeredAlpha};`;
|
|
|
|
wpx = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.px)
|
|
|
|
{
|
|
|
|
callObj.hunting.wpx = "mixed-worked";
|
|
|
|
wpxConf = `${unconf}${wpx}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.wpx = "hunted";
|
|
|
|
wpxBg = `${wpx}${inversionAlpha};`;
|
|
|
|
wpx = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Hunting for Continents
|
|
|
|
if (huntCont.checked == true && callObj.cont)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var hash = String(callObj.cont) + workHashSuffix;
|
|
|
|
var layeredHash = layeredMode && (String(callObj.cont) + layeredHashSuffix)
|
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (huntIndex && !(hash in huntIndex.cont))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert = true;
|
2021-04-07 19:52:51 +00:00
|
|
|
|
|
|
|
callObj.reason.push("cont");
|
|
|
|
|
2021-04-27 11:34:07 +00:00
|
|
|
if (workedIndex && hash in workedIndex.cont)
|
2021-04-07 19:52:51 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.cont)
|
|
|
|
{
|
|
|
|
callObj.hunting.cont = "worked-and-mixed";
|
|
|
|
contConf = `${layeredUnconf}${cont}${layeredUnconfAlpha};`;
|
|
|
|
contBg = `${cont}${layeredInversionAlpha}`;
|
|
|
|
cont = bold;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.cont = "worked";
|
|
|
|
contConf = `${unconf}${cont}${inversionAlpha};`;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
if (layeredMode && layeredHash in huntIndex.cont)
|
|
|
|
{
|
|
|
|
callObj.hunting.cont = "mixed";
|
|
|
|
contBg = `${cont}${layeredAlpha};`;
|
|
|
|
cont = bold;
|
|
|
|
}
|
|
|
|
else if (layeredMode && layeredHash in workedIndex.cont)
|
|
|
|
{
|
|
|
|
callObj.hunting.cont = "mixed-worked";
|
|
|
|
contConf = `${unconf}${cont}${layeredAlpha};`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
callObj.hunting.cont = "hunted";
|
|
|
|
contBg = `${cont}${inversionAlpha};`;
|
|
|
|
cont = bold;
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Station is calling us
|
|
|
|
if (callObj.DXcall == window.opener.myDEcall)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callingBg = "#0000FF" + inversionAlpha;
|
|
|
|
calling = "#FFFF00;text-shadow: 0px 0px 2px #FFFF00";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
else if (callObj.CQ == true && g_rosterSettings.cqOnly == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callingBg = calling + inversionAlpha;
|
|
|
|
calling = bold;
|
|
|
|
}
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Assemble all styles
|
2021-04-27 11:34:07 +00:00
|
|
|
colorObject.call = "style='" + callConf + "background-color:" + callBg + ";color:" +
|
|
|
|
call + ";" + callPointer + "'";
|
2021-04-07 11:35:45 +00:00
|
|
|
colorObject.grid = "style='" + gridConf + "background-color:" + gridBg + ";color:" + grid + ";cursor:pointer'";
|
|
|
|
colorObject.calling = "style='" + callingConf + "background-color:" + callingBg + ";color:" + calling + "'";
|
|
|
|
colorObject.dxcc = "style='" + dxccConf + "background-color:" + dxccBg + ";color:" + dxcc + "'";
|
|
|
|
colorObject.state = "style='" + stateConf + "background-color:" + stateBg + ";color:" + state + "'";
|
|
|
|
colorObject.cnty = "style='" + cntyConf + "background-color:" + cntyBg + ";color:" + cnty + "'";
|
|
|
|
colorObject.cont = "style='" + contConf + "background-color:" + contBg + ";color:" + cont + "'";
|
|
|
|
colorObject.cqz = "style='" + cqzConf + "background-color:" + cqzBg + ";color:" + cqz + "'";
|
|
|
|
colorObject.ituz = "style='" + ituzConf + "background-color:" + ituzBg + ";color:" + ituz + "'";
|
|
|
|
colorObject.px = "style='" + wpxConf + "background-color:" + wpxBg + ";color:" + wpx + "'";
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Just in case, don't alert if we worked this callsign alread
|
2020-10-31 14:01:03 +00:00
|
|
|
if (didWork && shouldAlert) shouldAlert = false;
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.shouldAlert = shouldAlert;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style = colorObject;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.columns.Spot)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.spot = window.opener.getSpotTime(
|
|
|
|
callObj.DEcall + callObj.mode + callObj.band + callObj.grid
|
2020-10-31 14:01:03 +00:00
|
|
|
);
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.spot == null)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.spot = { when: 0, snr: 0 };
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
else
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.spot = { when: 0, snr: 0 };
|
2021-04-07 11:35:45 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
modes[callObj.mode] = true;
|
|
|
|
bands[callObj.band] = true;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
newCallList.push(callObj);
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-05-25 12:08:21 +00:00
|
|
|
// Show the roster count in the window title
|
|
|
|
|
|
|
|
var totalCount = Object.keys(callRoster).length;
|
|
|
|
var visibleCount = newCallList.length;
|
|
|
|
var huntedCount = newCallList.filter(obj => Object.keys(obj.hunting).length > 0).length
|
|
|
|
var countParts = [];
|
|
|
|
|
|
|
|
if (totalCount != visibleCount)
|
|
|
|
{
|
|
|
|
countParts.push(`${totalCount} heard`);
|
|
|
|
}
|
|
|
|
|
|
|
|
countParts.push(`${visibleCount} in roster`);
|
|
|
|
|
|
|
|
if (huntedCount != visibleCount)
|
|
|
|
{
|
|
|
|
countParts.push(`${huntedCount} wanted`);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.document.title = `Call Roster: ${countParts.join(" • ")}`;
|
|
|
|
|
|
|
|
// Render the roster
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
newCallList.sort(r_sortFunction[g_rosterSettings.lastSortIndex]);
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.lastSortReverse == 1)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
newCallList.reverse();
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// Age sort for now... make this happen Tag
|
|
|
|
newCallList.sort(r_sortFunction[6]).reverse();
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
var showBands = (Object.keys(bands).length > 1) || g_rosterSettings.columns.Band;
|
|
|
|
var showModes = (Object.keys(modes).length > 1) || g_rosterSettings.columns.Mode;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var worker = "";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Render the table headers for the regular roster table
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker = "<table id='callTable' class='rosterTable' align=left>";
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
worker += "<thead><th style='cursor:pointer;' onclick='showRosterBox(0);' align=left>Callsign</th>";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (showBands)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th onclick='' >Band</th>"; }
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (showModes)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th onclick='' >Mode</th>"; }
|
|
|
|
|
|
|
|
worker += "<th style='cursor:pointer;' onclick='showRosterBox(1);' >Grid</th>";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Calling)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(10);' >Calling</th>"; }
|
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Msg)
|
|
|
|
{ worker += "<th >Msg</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.DXCC)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(5);' >DXCC</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Flag)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(5);' >Flag</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.State)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(9);' >State</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.County)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(15);' >County</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Cont)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(16);' >Cont</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.dB)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(2);' >dB</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Freq)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(4);' >Freq</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.DT)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(3);' >DT</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Dist)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
worker += "<th style='cursor:pointer;' onclick='showRosterBox(7);' >Dist(" +
|
|
|
|
window.opener.distanceUnit.value.toLowerCase() + ")</th>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Azim)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(8);' >Azim</th>"; }
|
|
|
|
|
|
|
|
if (g_rosterSettings.columns.CQz)
|
|
|
|
{ worker += "<th>CQz</th>"; }
|
|
|
|
|
|
|
|
if (g_rosterSettings.columns.ITUz)
|
|
|
|
{ worker += "<th>ITUz</th>"; }
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.PX)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(11);'>PX</th>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2021-04-07 11:35:45 +00:00
|
|
|
if (window.opener.g_callsignLookups.lotwUseEnable == true && g_rosterSettings.columns.LoTW)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ worker += "<th >LoTW</th>"; }
|
2021-04-07 11:35:45 +00:00
|
|
|
|
|
|
|
if (window.opener.g_callsignLookups.eqslUseEnable == true && g_rosterSettings.columns.eQSL)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ worker += "<th >eQSL</th>"; }
|
2021-04-07 11:35:45 +00:00
|
|
|
|
|
|
|
if (window.opener.g_callsignLookups.oqrsUseEnable == true && g_rosterSettings.columns.OQRS)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ worker += "<th >OQRS</th>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Spot)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(13);' >Spot</th>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Life)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(12);' >Life</th>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.OAMS)
|
2021-05-24 17:26:48 +00:00
|
|
|
{ worker += "<th title='Off-Air Message User' style='cursor:pointer;' onclick='showRosterBox(14);'>OAMS</th>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Age)
|
2021-04-07 11:35:45 +00:00
|
|
|
{ worker += "<th style='cursor:pointer;' onclick='showRosterBox(6);' >Age</th></thead>"; }
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
// No headers for compact roster table
|
2020-12-14 02:10:27 +00:00
|
|
|
else
|
|
|
|
{
|
2021-04-07 11:35:45 +00:00
|
|
|
worker = "<div id=\"buttonsDiv\" style=\"margin-left:0px;white-space:normal;\">";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var shouldAlert = 0;
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
// Render all rows
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var x in newCallList)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var callObj = newCallList[x];
|
|
|
|
|
|
|
|
if (callObj.shouldAlert == false && onlyHits == true && callObj.qrz == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ continue; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
var spotString = "";
|
2021-04-07 19:52:51 +00:00
|
|
|
if (g_rosterSettings.columns.Spot && callObj.qrz == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
spotString = getSpotString(callObj);
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.onlySpot && spotString == "") continue;
|
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
var grid = callObj.grid.length > 1 ? callObj.grid.substr(0, 4) : "-";
|
2021-04-07 11:35:45 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
var geo = window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[callObj.dxcc]];
|
2021-04-07 11:35:45 +00:00
|
|
|
var cqzone = grid in window.opener.g_gridToCQZone ? window.opener.g_gridToCQZone[grid].join(", ") : "-";
|
|
|
|
var ituzone = grid in window.opener.g_gridToITUZone ? window.opener.g_gridToITUZone[grid].join(", ") : "-";
|
2021-04-07 19:52:51 +00:00
|
|
|
var thisCall = callObj.DEcall;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (thisCall.match("^[A-Z][0-9][A-Z](/w+)?$"))
|
2021-04-27 11:34:07 +00:00
|
|
|
{ callObj.style.call = "class='oneByOne'"; }
|
2021-04-07 19:52:51 +00:00
|
|
|
if (thisCall == window.opener.g_instances[callObj.instance].status.DXcall)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (window.opener.g_instances[callObj.instance].status.TxEnabled == 1)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.style.call = "class='dxCalling'";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.style.call = "class='dxCaller'";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2021-05-20 11:43:11 +00:00
|
|
|
var acks = window.opener.g_acknowledgedCalls
|
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
var thisHash = thisCall + callObj.band + callObj.mode;
|
2021-05-20 11:43:11 +00:00
|
|
|
var callStr = thisCall.formatCallsign()
|
|
|
|
if (acks[thisCall])
|
|
|
|
{
|
2021-05-20 18:46:14 +00:00
|
|
|
callStr = `${callStr} <span class='acknowledged'><img class='ackBadge' src='${acks[thisCall].badge}'></span>`
|
|
|
|
callObj.awardReason += ` - ${acks[thisCall].message}`
|
2021-05-20 11:43:11 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
worker += "<tbody><tr id='" + thisHash + "'>";
|
|
|
|
worker +=
|
|
|
|
"<td title='" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.awardReason +
|
2020-10-31 14:01:03 +00:00
|
|
|
"' name='Callsign' align=left " +
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.style.call +
|
2020-10-31 14:01:03 +00:00
|
|
|
" onClick='initiateQso(\"" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-10-31 14:01:03 +00:00
|
|
|
"\")'>" +
|
2021-05-20 11:43:11 +00:00
|
|
|
callStr +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (showBands)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#" +
|
2021-04-07 19:52:51 +00:00
|
|
|
window.opener.g_pskColors[callObj.band] +
|
2020-10-31 14:01:03 +00:00
|
|
|
"' >" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (showModes)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var color = "888888";
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.mode in g_modeColors)
|
|
|
|
{ color = g_modeColors[callObj.mode]; }
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
2021-04-07 19:52:51 +00:00
|
|
|
"<td style='color:#" + color + "' >" + callObj.mode + "</td>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
worker +=
|
|
|
|
"<td " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.grid +
|
2020-10-31 14:01:03 +00:00
|
|
|
" onClick='centerOn(\"" +
|
|
|
|
grid +
|
|
|
|
"\")' >" +
|
|
|
|
grid +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.columns.Calling)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var lookString = callObj.CQ ? "name='CQ'" : "name='Calling'";
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.calling +
|
2020-10-31 14:01:03 +00:00
|
|
|
" " +
|
|
|
|
lookString +
|
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.DXcall.formatCallsign() +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
|
|
|
}
|
|
|
|
if (g_rosterSettings.columns.Msg)
|
2021-04-07 19:52:51 +00:00
|
|
|
{ worker += "<td>" + callObj.msg + "</td>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.DXCC)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
2021-04-07 19:52:51 +00:00
|
|
|
"<td title='" + window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[callObj.dxcc]].pp +
|
2021-01-10 16:50:17 +00:00
|
|
|
"' name='DXCC (" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.dxcc +
|
2020-10-31 14:01:03 +00:00
|
|
|
")' " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.dxcc +
|
2020-10-31 14:01:03 +00:00
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
window.opener.g_dxccToAltName[callObj.dxcc] + "</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Flag)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' style='margin:0;padding:0'><img style='padding-top:3px' src='./img/flags/16/" +
|
|
|
|
geo.flag +
|
|
|
|
"'></td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.State)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.state +
|
2020-10-31 14:01:03 +00:00
|
|
|
" >" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.state ? callObj.state.substr(3) : "") +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.County)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.cnty +
|
2020-10-31 14:01:03 +00:00
|
|
|
" " +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.cnty
|
|
|
|
? (callObj.qual
|
2020-12-14 02:10:27 +00:00
|
|
|
? ""
|
|
|
|
: "onClick='window.opener.lookupCallsign(\"" +
|
2021-02-01 14:38:32 +00:00
|
|
|
thisCall +
|
|
|
|
"\",\"" +
|
|
|
|
grid +
|
|
|
|
"\")'"
|
|
|
|
)
|
2020-10-31 14:01:03 +00:00
|
|
|
: "") +
|
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.cnty
|
|
|
|
? (callObj.qual ? "" : "~ ") +
|
|
|
|
window.opener.g_cntyToCounty[callObj.cnty] +
|
|
|
|
(callObj.qual ? "" : " ~")
|
2020-10-31 14:01:03 +00:00
|
|
|
: "") +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Cont)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.cont +
|
2020-10-31 14:01:03 +00:00
|
|
|
" >" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.cont ? callObj.cont : "") +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.dB)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#DD44DD'><b>" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.RSTsent +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</b></td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Freq)
|
2021-04-07 19:52:51 +00:00
|
|
|
{ worker += "<td style='color:#00FF00'>" + callObj.delta + "</td>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.DT)
|
2021-04-07 19:52:51 +00:00
|
|
|
{ worker += "<td style='color:#1E90FF'>" + callObj.dt + "</td>"; }
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Dist)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:cyan'>" +
|
|
|
|
parseInt(
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.distance *
|
2020-10-31 14:01:03 +00:00
|
|
|
MyCircle.validateRadius(window.opener.distanceUnit.value)
|
|
|
|
) +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Azim)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:yellow'>" +
|
2021-04-07 19:52:51 +00:00
|
|
|
parseInt(callObj.heading) +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.CQz)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.cqz +
|
2020-10-31 14:01:03 +00:00
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.cqza.join(",") +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.ITUz)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.ituz +
|
2020-10-31 14:01:03 +00:00
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.ituza.join(",") +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.PX)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.px +
|
2020-10-31 14:01:03 +00:00
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.px ? callObj.px : "") +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
window.opener.g_callsignLookups.lotwUseEnable == true &&
|
|
|
|
g_rosterSettings.columns.LoTW
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
if (thisCall in window.opener.g_lotwCallsigns)
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.maxLoTW < 27)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var months = (g_day - window.opener.g_lotwCallsigns[thisCall]) / 30;
|
|
|
|
if (months > g_rosterSettings.maxLoTW)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:yellow' align='center' title='Has not uploaded a QSO in " +
|
|
|
|
Number(months).toYM() +
|
|
|
|
"'>?</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
else
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#0F0' align='center' title=' Last Upload " +
|
|
|
|
window.opener.userDayString(
|
|
|
|
window.opener.g_lotwCallsigns[thisCall] * 86400000
|
|
|
|
) +
|
|
|
|
"'>✔</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#0F0' align='center' title=' Last Upload " +
|
|
|
|
window.opener.userDayString(
|
|
|
|
window.opener.g_lotwCallsigns[thisCall] * 86400000
|
|
|
|
) +
|
|
|
|
"'>✔</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else worker += "<td></td>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
if (
|
|
|
|
window.opener.g_callsignLookups.eqslUseEnable == true &&
|
|
|
|
g_rosterSettings.columns.eQSL
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#0F0;' align='center'>" +
|
|
|
|
(thisCall in window.opener.g_eqslCallsigns ? "✔" : "") +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
window.opener.g_callsignLookups.oqrsUseEnable == true &&
|
|
|
|
g_rosterSettings.columns.OQRS
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#0F0;' align='center'>" +
|
|
|
|
(thisCall in window.opener.g_oqrsCallsigns ? "✔" : "") +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Spot)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#EEE;' class='spotCol' id='sp" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-12-14 02:25:39 +00:00
|
|
|
"'>" +
|
2020-10-31 14:01:03 +00:00
|
|
|
spotString +
|
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Life)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#EEE;' class='lifeCol' id='lm" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-10-31 14:01:03 +00:00
|
|
|
"'>" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(timeNowSec() - callObj.life).toDHMS() +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.columns.OAMS)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.style.gt != 0)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
if (callObj.reason.includes("oams"))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' style='margin:0;padding:0;cursor:pointer;background-clip:content-box;box-shadow: 0 0 4px 4px inset #2222FFFF;' onClick='openChatToCid(\"" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.gt +
|
2020-10-31 14:01:03 +00:00
|
|
|
"\")'><img height='16px' style='' src='./img/gt_chat.png'></td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td align='center' style='margin:0;padding:0;cursor:pointer;' onClick='openChatToCid(\"" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.gt +
|
2020-10-31 14:01:03 +00:00
|
|
|
"\")'><img height='16px' style='' src='./img/gt_chat.png'></td>";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else worker += "<td></td>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (g_rosterSettings.columns.Age)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<td style='color:#EEE' class='timeCol' id='tm" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-10-31 14:01:03 +00:00
|
|
|
"'>" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(timeNowSec() - callObj.age).toDHMS() +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</td>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
worker += "</tr></tbody>";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var tt =
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.RSTsent +
|
2020-10-31 14:01:03 +00:00
|
|
|
"㏈, " +
|
2021-04-07 19:52:51 +00:00
|
|
|
parseInt(callObj.dt * 100) +
|
2020-10-31 14:01:03 +00:00
|
|
|
"ms, " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.delta +
|
2020-10-31 14:01:03 +00:00
|
|
|
"hz" +
|
2021-04-07 19:52:51 +00:00
|
|
|
(callObj.grid.length ? ", " + callObj.grid : "") +
|
2020-10-31 14:01:03 +00:00
|
|
|
", " +
|
2021-04-07 19:52:51 +00:00
|
|
|
(timeNowSec() - callObj.age).toDHMS();
|
2020-10-31 14:01:03 +00:00
|
|
|
worker +=
|
|
|
|
"<div class='compact' onClick='initiateQso(\"" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-10-31 14:01:03 +00:00
|
|
|
"\")' ";
|
|
|
|
worker +=
|
|
|
|
"id='" +
|
|
|
|
thisCall +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.band +
|
|
|
|
callObj.mode +
|
2020-10-31 14:01:03 +00:00
|
|
|
"' title='" +
|
|
|
|
tt +
|
|
|
|
"'>";
|
|
|
|
worker +=
|
|
|
|
"<div class='compactCallsign' name='Callsign' " +
|
2021-04-27 11:34:07 +00:00
|
|
|
callObj.style.call +
|
2020-10-31 14:01:03 +00:00
|
|
|
" >" +
|
|
|
|
thisCall.formatCallsign() +
|
|
|
|
"</div>";
|
|
|
|
worker +=
|
|
|
|
"<div class='compactDXCC' name='DXCC (" +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.dxcc +
|
2020-10-31 14:01:03 +00:00
|
|
|
")' " +
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.style.dxcc +
|
2020-10-31 14:01:03 +00:00
|
|
|
">" +
|
2021-04-07 19:52:51 +00:00
|
|
|
window.opener.g_dxccToAltName[callObj.dxcc] +
|
2020-10-31 14:01:03 +00:00
|
|
|
"</div>";
|
|
|
|
worker += "</div>";
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.realtime == false)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
var call = callObj.DEcall;
|
|
|
|
g_scriptReport[call] = Object.assign({}, callObj);
|
2020-10-31 14:01:03 +00:00
|
|
|
g_scriptReport[call].dxccName =
|
2021-04-07 19:52:51 +00:00
|
|
|
window.opener.g_dxccToAltName[callObj.dxcc];
|
2020-10-31 14:01:03 +00:00
|
|
|
g_scriptReport[call].distance = parseInt(
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.distance *
|
2020-10-31 14:01:03 +00:00
|
|
|
MyCircle.validateRadius(window.opener.distanceUnit.value)
|
|
|
|
);
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callMode != "all")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_scriptReport[call].shouldAlert = true;
|
|
|
|
g_scriptReport[call].reason.push(g_rosterSettings.hunting);
|
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.alerted == false &&
|
2020-10-31 14:01:03 +00:00
|
|
|
callMode == "all" &&
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.shouldAlert == true
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.alerted = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert++;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2021-04-07 19:52:51 +00:00
|
|
|
else if (callObj.alerted == false && callMode != "all")
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.alerted = true;
|
2020-10-31 14:01:03 +00:00
|
|
|
shouldAlert++;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2021-04-07 19:52:51 +00:00
|
|
|
callObj.shouldAlert = false;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
worker += "</table>";
|
2020-11-02 14:57:06 +00:00
|
|
|
RosterTable.innerHTML = worker;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-02 14:57:06 +00:00
|
|
|
RosterTable.innerHTML = worker + "</div>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var dirPath = window.opener.g_scriptDir;
|
|
|
|
var scriptExists = false;
|
|
|
|
var script = "cr-alert.sh";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if (fs.existsSync(dirPath))
|
|
|
|
{
|
|
|
|
if (window.opener.g_platform == "windows")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
script = "cr-alert.bat";
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
fs.existsSync(dirPath + script) &&
|
|
|
|
g_rosterSettings.realtime == false
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
scriptExists = true;
|
|
|
|
scriptIcon.innerHTML =
|
|
|
|
"<div class='buttonScript' onclick='window.opener.toggleCRScript();'>" +
|
|
|
|
(window.opener.g_crScript == 1
|
|
|
|
? "<font color='lightgreen'>Script Enabled</font>"
|
|
|
|
: "<font color='yellow'>Script Disabled</font>") +
|
|
|
|
"</div>";
|
|
|
|
scriptIcon.style.display = "block";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
scriptIcon.style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e) {}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (shouldAlert > 0)
|
|
|
|
{
|
|
|
|
if (window.opener.g_classicAlerts.huntRoster == true)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var notify = window.opener.huntRosterNotify.value;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (notify == "0")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var media = window.opener.huntRosterNotifyMedia.value;
|
|
|
|
if (media != "none") window.opener.playAlertMediaFile(media);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else if (notify == "1")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.speakAlertString(
|
|
|
|
window.opener.huntRosterNotifyWord.value
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
g_rosterSettings.realtime == false &&
|
|
|
|
scriptExists &&
|
|
|
|
window.opener.g_crScript == 1
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
fs.writeFileSync(
|
|
|
|
dirPath + "cr-alert.json",
|
|
|
|
JSON.stringify(g_scriptReport, null, 2)
|
|
|
|
);
|
|
|
|
|
|
|
|
var thisProc = dirPath + script;
|
|
|
|
var cp = require("child_process");
|
|
|
|
var child = cp.spawn(thisProc, [], {
|
|
|
|
detached: true,
|
|
|
|
cwd: dirPath.slice(0, -1),
|
2020-12-14 02:10:27 +00:00
|
|
|
stdio: ["ignore", "ignore", "ignore"]
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
child.unref();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
conosle.log(e);
|
|
|
|
}
|
|
|
|
g_scriptReport = Object();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else g_scriptReport = Object();
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function realtimeRoster()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var now = timeNowSec();
|
|
|
|
g_day = now / 86400;
|
|
|
|
|
|
|
|
if (g_rosterSettings.realtime == false) return;
|
|
|
|
|
|
|
|
var timeCols = document.getElementsByClassName("timeCol");
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var x in timeCols)
|
|
|
|
{
|
2021-05-25 14:20:44 +00:00
|
|
|
if ((typeof timeCols[x].id != "undefined") && (typeof callRoster[timeCols[x].id.substr(2)] != "undefined"))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var when = now - callRoster[timeCols[x].id.substr(2)].callObj.age;
|
|
|
|
timeCols[x].innerHTML = when.toDHMS();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var lifeCols = document.getElementsByClassName("lifeCol");
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var x in lifeCols)
|
|
|
|
{
|
2021-05-25 14:20:44 +00:00
|
|
|
if ((typeof lifeCols[x].id != "undefined") && (typeof callRoster[lifeCols[x].id.substr(2)] != "undefined"))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var when = now - callRoster[lifeCols[x].id.substr(2)].callObj.life;
|
|
|
|
lifeCols[x].innerHTML = when.toDHMS();
|
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.columns.Spot)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var spotCols = document.getElementsByClassName("spotCol");
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var x in spotCols)
|
|
|
|
{
|
2021-05-25 14:20:44 +00:00
|
|
|
if ((typeof spotCols[x].id != "undefined") && (typeof callRoster[spotCols[x].id.substr(2)] != "undefined"))
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
spotCols[x].innerHTML = getSpotString(
|
|
|
|
callRoster[spotCols[x].id.substr(2)].callObj
|
|
|
|
);
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.onlySpot && spotCols[x].innerHTML == "")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
viewRoster();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function getSpotString(callObj)
|
|
|
|
{
|
2020-12-14 02:25:39 +00:00
|
|
|
var result = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callObj.spot && callObj.spot.when > 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
when = timeNowSec() - callObj.spot.when;
|
|
|
|
if (when <= window.opener.g_receptionSettings.viewHistoryTimeSec)
|
2020-12-14 06:46:28 +00:00
|
|
|
{ result = parseInt(when).toDHMS(); }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:25:39 +00:00
|
|
|
if (result) result += " / " + callObj.spot.snr;
|
|
|
|
return result;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function openChatToCid(cid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.showMessaging(true, cid);
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function initiateQso(thisHash)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.initiateQso(thisHash);
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function callLookup(thisHash, grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.startLookup(
|
|
|
|
callRoster[thisHash].DEcall,
|
|
|
|
callRoster[thisHash].grid
|
|
|
|
);
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function callingLookup(thisHash, grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var thisCall = callRoster[thisHash].DXcall;
|
|
|
|
window.opener.startLookup(thisCall, grid);
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function callGenMessage(thisHash, grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var thisCall = callRoster[thisHash].DEcall;
|
|
|
|
var instance = callRoster[thisHash].callObj.instance;
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.startGenMessages(thisCall, grid, instance);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function callingGenMessage(thisHash, grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var thisCall = callRoster[thisHash].DXcall;
|
|
|
|
var instance = callRoster[thisHash].callObj.instance;
|
|
|
|
|
|
|
|
window.opener.startGenMessages(thisCall, grid, instance);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function centerOn(grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.centerOn(grid);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function instanceChange(what)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.g_instances[what.id].crEnable = what.checked;
|
|
|
|
window.opener.goProcessRoster();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function updateInstances()
|
|
|
|
{
|
|
|
|
if (window.opener.g_instancesIndex.length > 1)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var instances = window.opener.g_instances;
|
|
|
|
|
|
|
|
var worker = "";
|
|
|
|
|
|
|
|
var keys = Object.keys(instances).sort();
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in keys)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var inst = keys[key];
|
|
|
|
var sp = inst.split(" - ");
|
|
|
|
var shortInst = sp[sp.length - 1].substring(0, 18);
|
|
|
|
var color = "blue";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (instances[inst].open == false)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
color = "purple";
|
|
|
|
}
|
|
|
|
worker +=
|
2021-04-05 21:49:23 +00:00
|
|
|
`<div class='button' style='background-color:${color};'>` +
|
|
|
|
`<input type='checkbox' id='${inst}' onchange='instanceChange(this);' ` +
|
2020-10-31 14:01:03 +00:00
|
|
|
(instances[inst].crEnable ? "checked" : "") +
|
2021-04-05 21:49:23 +00:00
|
|
|
`> ${shortInst}</div>`
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
instancesDiv.innerHTML = worker;
|
2021-04-05 21:49:23 +00:00
|
|
|
instancesWrapper.style.display = "";
|
|
|
|
}
|
2021-04-06 21:28:40 +00:00
|
|
|
else
|
|
|
|
{
|
2021-04-05 21:49:23 +00:00
|
|
|
instancesDiv.innerHTML = "";
|
|
|
|
instancesWrapper.style.display = "none";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function processStatus(newMessage)
|
|
|
|
{
|
|
|
|
if (newMessage.Transmitting == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// Not Transmitting
|
2020-12-14 02:10:27 +00:00
|
|
|
if (newMessage.Decoding == 1)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// Decoding
|
|
|
|
txrxdec.style.backgroundColor = "Blue";
|
|
|
|
txrxdec.style.borderColor = "Cyan";
|
|
|
|
txrxdec.innerHTML = "DECODE";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
txrxdec.style.backgroundColor = "Green";
|
|
|
|
txrxdec.style.borderColor = "GreenYellow";
|
|
|
|
txrxdec.innerHTML = "RECEIVE";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
txrxdec.style.backgroundColor = "Red";
|
|
|
|
txrxdec.style.borderColor = "Orange";
|
|
|
|
txrxdec.innerHTML = "TRANSMIT";
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function toTitleCase(str)
|
|
|
|
{
|
|
|
|
return str.replace(/\w\S*/g, function (txt)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
|
|
});
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function newOption(value, text)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (typeof text == "undefined") text = value;
|
|
|
|
var option = document.createElement("option");
|
|
|
|
option.value = value;
|
|
|
|
option.text = text;
|
|
|
|
return option;
|
|
|
|
}
|
|
|
|
|
|
|
|
function createSelectOptions(
|
|
|
|
selectElementString,
|
|
|
|
selectNameDefault,
|
|
|
|
forObject,
|
|
|
|
altName = null,
|
|
|
|
defaultValue = null,
|
|
|
|
checkSponsor = null
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var selector = document.getElementById(selectElementString);
|
|
|
|
selector.innerHTML = "";
|
|
|
|
|
|
|
|
var option = document.createElement("option");
|
|
|
|
option.value = defaultValue;
|
|
|
|
option.text = selectNameDefault;
|
|
|
|
option.selected = true;
|
|
|
|
option.disabled = true;
|
|
|
|
option.style.display = "none";
|
|
|
|
selector.appendChild(option);
|
|
|
|
|
|
|
|
var obj = null;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (forObject)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
obj = Object.keys(forObject).sort();
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var k in obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var opt = obj[k];
|
|
|
|
var option = document.createElement("option");
|
|
|
|
option.value = opt;
|
|
|
|
option.text = altName ? forObject[opt][altName] : opt;
|
|
|
|
if (checkSponsor && opt + "-" + checkSponsor in g_awardTracker)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ option.disabled = true; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
selector.appendChild(option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function awardSponsorChanged()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
awardName.style.display = "";
|
|
|
|
createSelectOptions(
|
|
|
|
"awardName",
|
|
|
|
"Select Award",
|
|
|
|
g_awards[awardSponsor.value].awards,
|
|
|
|
"name",
|
|
|
|
null,
|
|
|
|
awardSponsor.value
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function awardNameChanged()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var awardToAdd = newAwardTrackerObject(
|
|
|
|
awardSponsor.value,
|
|
|
|
awardName.value,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
var hash = awardToAdd.name + "-" + awardToAdd.sponsor;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (!(hash in g_awardTracker))
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awardTracker[hash] = awardToAdd;
|
|
|
|
storeAwardTracker();
|
|
|
|
processAward(hash);
|
|
|
|
updateAwardList(hash);
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
createSelectOptions(
|
|
|
|
"awardName",
|
|
|
|
"Select Award",
|
|
|
|
g_awards[awardToAdd.sponsor].awards,
|
|
|
|
"name",
|
|
|
|
null,
|
|
|
|
awardToAdd.sponsor
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function updateAwardList(target = null)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var worker =
|
2020-12-14 02:10:27 +00:00
|
|
|
"<table id=\"awardTable\" class=\"awardTableCSS\" style=\"padding:0;margin:0;margin-top:-5px;\" >";
|
2020-10-31 14:01:03 +00:00
|
|
|
worker += "<tr style='font-size:smaller'>";
|
|
|
|
worker += "<td align='left'>";
|
|
|
|
worker += "Name";
|
|
|
|
worker += "</td>";
|
|
|
|
worker += "<td>";
|
|
|
|
worker += "Award";
|
|
|
|
worker += "</td>";
|
|
|
|
worker += "<td>";
|
|
|
|
worker += "Track";
|
|
|
|
worker += "</td>";
|
|
|
|
worker += "<td>";
|
|
|
|
worker += "";
|
|
|
|
worker += "</td>";
|
|
|
|
worker += "</tr>";
|
|
|
|
|
|
|
|
worker += "</table>";
|
|
|
|
|
2020-11-02 14:57:06 +00:00
|
|
|
AwardWantedList.innerHTML = worker;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
var keys = Object.keys(g_awardTracker).sort();
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in keys)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var award = g_awardTracker[keys[key]];
|
|
|
|
var rule = g_awards[award.sponsor].awards[award.name].rule;
|
|
|
|
var row = awardTable.insertRow();
|
|
|
|
row.id = keys[key];
|
|
|
|
var baseAward = false;
|
|
|
|
var baseCount = 0;
|
|
|
|
|
|
|
|
var endorseCount = 0;
|
|
|
|
var endorseTotal = 0;
|
|
|
|
var allEndorse = false;
|
|
|
|
|
|
|
|
var tooltip =
|
|
|
|
g_awards[award.sponsor].awards[award.name].tooltip +
|
|
|
|
" (" +
|
|
|
|
g_awards[award.sponsor].sponsor +
|
|
|
|
")\n";
|
|
|
|
tooltip += toTitleCase(award.test.qsl_req) + " QSO\n";
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var mode in award.comp.counts)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
tooltip += mode + "\n";
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var count in award.comp.counts[mode])
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
endorseTotal++;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (award.comp.counts[mode][count].per == 100)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
baseAward = true;
|
|
|
|
endorseCount++;
|
|
|
|
}
|
|
|
|
if (award.comp.counts[mode][count].num > baseCount)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ baseCount = award.comp.counts[mode][count].num; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
tooltip +=
|
|
|
|
"\t" +
|
|
|
|
award.comp.counts[mode][count].num +
|
|
|
|
"/" +
|
|
|
|
count +
|
|
|
|
" (" +
|
|
|
|
award.comp.counts[mode][count].per +
|
|
|
|
"%)\n";
|
|
|
|
var wrk = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
if (Object.keys(award.comp.endorse).length > 0)
|
|
|
|
{
|
|
|
|
for (var band in award.comp.endorse[mode])
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
endorseTotal++;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (award.comp.endorse[mode][band][count] == true)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
endorseCount++;
|
|
|
|
wrk += band + " ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (wrk.length > 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
tooltip += "\t\t" + wrk + "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (baseCount > 0 && endorseCount == endorseTotal) allEndorse = true;
|
|
|
|
|
|
|
|
var cell = createCellHtml(
|
|
|
|
row,
|
|
|
|
"<p style='font-size:smaller;'>" + award.name + " - " + award.sponsor
|
|
|
|
);
|
|
|
|
cell.style.textAlign = "left";
|
|
|
|
cell.style.color = "lightblue";
|
|
|
|
|
|
|
|
createCellHtml(
|
|
|
|
row,
|
|
|
|
"<p style='margin:0;' >" +
|
|
|
|
(allEndorse
|
2021-05-15 20:37:05 +00:00
|
|
|
? "<img src='./img/award-trophy.png' height='18px'>"
|
2020-10-31 14:01:03 +00:00
|
|
|
: baseAward
|
2021-05-15 20:37:05 +00:00
|
|
|
? "<img src='./img/award-medal.png' height='16px'>"
|
2020-12-14 02:10:27 +00:00
|
|
|
: baseCount > 0
|
2021-05-15 20:37:05 +00:00
|
|
|
? "<img src='./img/award-tally.png' height='16px'>"
|
|
|
|
: "<img src='./img/award-empty.png' height='14px'>"),
|
2020-10-31 14:01:03 +00:00
|
|
|
tooltip
|
|
|
|
);
|
|
|
|
createCell(
|
|
|
|
row,
|
|
|
|
"enable",
|
|
|
|
award.enable,
|
|
|
|
award.enable,
|
|
|
|
"Toggle Tracking",
|
|
|
|
true
|
|
|
|
);
|
|
|
|
createCellHtml(
|
|
|
|
row,
|
2021-05-15 20:37:05 +00:00
|
|
|
"<p title='Remove Tracker' onclick='deleteAwardTracker(this)' style='margin:0;cursor:pointer;'><img src='./img/award-delete.png' height='16px'>"
|
2020-10-31 14:01:03 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function deleteAwardTracker(sender)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var id = sender.parentNode.parentNode.id;
|
|
|
|
delete g_awardTracker[id];
|
|
|
|
storeAwardTracker();
|
|
|
|
resetAwardAdd();
|
|
|
|
updateAwardList();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function awardCheckboxChanged(sender)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var awardId = sender.target.parentNode.parentNode.id;
|
|
|
|
g_awardTracker[sender.target.parentNode.parentNode.id][sender.target.name] =
|
|
|
|
sender.target.checked;
|
|
|
|
storeAwardTracker();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function awardValueChanged(sender)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var awardId = sender.target.parentNode.parentNode.id;
|
|
|
|
g_awardTracker[sender.target.parentNode.parentNode.id][sender.target.name] =
|
|
|
|
sender.target.value;
|
|
|
|
storeAwardTracker();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
|
|
|
function createCell(
|
|
|
|
row,
|
|
|
|
target,
|
|
|
|
value,
|
|
|
|
data = null,
|
|
|
|
title = null,
|
|
|
|
checkbox = false
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cell = row.insertCell();
|
|
|
|
if (data == null) cell.innerHTML = value;
|
|
|
|
if (title) cell.title = title;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (checkbox)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var x = document.createElement("INPUT");
|
|
|
|
x.setAttribute("type", "checkbox");
|
|
|
|
x.checked = value;
|
|
|
|
x.name = target;
|
|
|
|
x.addEventListener("change", awardCheckboxChanged);
|
|
|
|
cell.appendChild(x);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else if (data)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
cell.appendChild(createAwardSelector(cell, target, value, data));
|
|
|
|
}
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function createCellHtml(row, html, title = null)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cell = row.insertCell();
|
|
|
|
cell.innerHTML = html;
|
|
|
|
if (title) cell.title = title;
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function createAwardSelector(cell, target, value, forObject)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var selector = document.createElement("select");
|
|
|
|
selector.name = target;
|
|
|
|
selector.value = value;
|
2020-12-14 02:10:27 +00:00
|
|
|
selector.disabled = forObject.length == 1;
|
2020-10-31 14:01:03 +00:00
|
|
|
selector.style.margin = "0px";
|
|
|
|
selector.style.padding = "1px";
|
|
|
|
if (selector.disabled) selector.style.cursor = "auto";
|
|
|
|
selector.addEventListener("change", awardValueChanged);
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var opt in forObject)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var option = document.createElement("option");
|
|
|
|
option.value = forObject[opt];
|
|
|
|
if (option.value == "Phone" || option.value == "CW") option.disabled = true;
|
|
|
|
option.text = forObject[opt];
|
|
|
|
selector.appendChild(option);
|
|
|
|
}
|
|
|
|
return selector;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function resetAwardAdd()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
awardName.style.display = "none";
|
|
|
|
createSelectOptions("awardName", "Select Award", null);
|
|
|
|
createSelectOptions("awardSponsor", "Select Sponsor", g_awards, "sponsor");
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function openAwardPopup()
|
|
|
|
{
|
2020-12-22 17:53:41 +00:00
|
|
|
awardHunterDiv.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
resetAwardAdd();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function closeAwardPopup()
|
|
|
|
{
|
2020-12-22 17:53:41 +00:00
|
|
|
awardHunterDiv.style.display = "none";
|
2020-10-31 14:01:03 +00:00
|
|
|
resetAwardAdd();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function toggleMoreControls()
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
g_rosterSettings.controlsExtended = !g_rosterSettings.controlsExtended;
|
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
2020-11-02 14:57:06 +00:00
|
|
|
|
2020-12-05 19:19:11 +00:00
|
|
|
setVisual();
|
2020-11-02 14:57:06 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function setVisual()
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
huntNeed.style.display = "none";
|
|
|
|
stateSelect.style.display = "none";
|
|
|
|
DXCCsSelect.style.display = "none";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.controls)
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.controlsExtended)
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
RosterControls.className = "extended";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
RosterControls.className = "normal";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
RosterControls.className = "hidden";
|
2020-11-02 14:57:06 +00:00
|
|
|
}
|
2020-12-05 19:19:11 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
// Award Hunter
|
2021-01-08 13:55:18 +00:00
|
|
|
if (referenceNeed.value == LOGBOOK_AWARD_TRACKER)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
/* for ( key in g_rosterSettings.wanted )
|
|
|
|
{
|
|
|
|
document.getElementById(key).checked = true;
|
|
|
|
var t = key.replace("hunt","");
|
|
|
|
if ( t in g_rosterSettings.columns )
|
|
|
|
g_rosterSettings.columns[t] = true;
|
|
|
|
} */
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-22 17:30:21 +00:00
|
|
|
HuntModeControls.style.display = "none";
|
2020-11-02 14:57:06 +00:00
|
|
|
CallsignsControls.style.display = "none";
|
|
|
|
AwardTrackerControls.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
huntingMatrixDiv.style.display = "";
|
|
|
|
updateAwardList();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (var key in g_rosterSettings.wanted)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (document.getElementById(key))
|
2020-12-14 02:10:27 +00:00
|
|
|
{ document.getElementById(key).checked = g_rosterSettings.wanted[key]; }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-11-02 14:57:06 +00:00
|
|
|
AwardTrackerControls.style.display = "none";
|
2020-12-22 17:30:21 +00:00
|
|
|
HuntModeControls.style.display = "";
|
|
|
|
huntMode.style.display = "";
|
2020-11-02 14:57:06 +00:00
|
|
|
CallsignsControls.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
closeAwardPopup();
|
2020-12-14 02:10:27 +00:00
|
|
|
if (callsignNeed.value == "all" || callsignNeed.value == "hits")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
huntingMatrixDiv.style.display = "";
|
2020-12-22 17:30:21 +00:00
|
|
|
huntNeed.style.display = "";
|
|
|
|
huntMode.style.display = "none";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
huntingMatrixDiv.style.display = "none";
|
2020-12-22 17:30:21 +00:00
|
|
|
huntMode.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
huntMode.value != "callsign" &&
|
|
|
|
huntMode.value != "usstate" &&
|
|
|
|
huntMode.value != "dxccs"
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
huntNeed.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntMode.value == "usstate")
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
stateSelect.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntMode.value == "usstates")
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
huntNeed.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (huntMode.value == "dxccs")
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
DXCCsSelect.style.display = "";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (wantMaxDT.checked == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
maxDT.style.display = "";
|
|
|
|
maxDTView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
maxDT.style.display = "none";
|
|
|
|
maxDTView.style.display = "none";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (wantMinDB.checked == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
minDb.style.display = "";
|
|
|
|
minDbView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
minDb.style.display = "none";
|
|
|
|
minDbView.style.display = "none";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (wantMinFreq.checked == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
minFreq.style.display = "";
|
|
|
|
minFreqView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
minFreq.style.display = "none";
|
|
|
|
minFreqView.style.display = "none";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (wantMaxFreq.checked == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
maxFreq.style.display = "";
|
|
|
|
maxFreqView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
maxFreq.style.display = "none";
|
|
|
|
maxFreqView.style.display = "none";
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (useRegex.checked == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
callsignRegex.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callsignRegex.style.display = "none";
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (window.opener.g_callsignLookups.lotwUseEnable == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
usesLoTWDiv.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_rosterSettings.usesLoTW == true)
|
|
|
|
{
|
2020-12-22 17:30:21 +00:00
|
|
|
maxLoTW.style.display = "";
|
|
|
|
maxLoTWView.style.display = "";
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
maxLoTW.style.display = "none";
|
|
|
|
maxLoTWView.style.display = "none";
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
usesLoTWDiv.style.display = "none";
|
|
|
|
maxLoTW.style.display = "none";
|
|
|
|
maxLoTWView.style.display = "none";
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (window.opener.g_callsignLookups.eqslUseEnable == true)
|
2020-12-22 17:30:21 +00:00
|
|
|
{ useseQSLDiv.style.display = ""; }
|
2020-10-31 14:01:03 +00:00
|
|
|
else useseQSLDiv.style.display = "none";
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (window.opener.g_callsignLookups.oqrsUseEnable == true)
|
2020-12-22 17:30:21 +00:00
|
|
|
{ usesOQRSDiv.style.display = ""; }
|
2020-10-31 14:01:03 +00:00
|
|
|
else usesOQRSDiv.style.display = "none";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.columns.Spot == true)
|
2020-12-22 17:30:21 +00:00
|
|
|
{ onlySpotDiv.style.display = ""; }
|
2020-10-31 14:01:03 +00:00
|
|
|
else onlySpotDiv.style.display = "none";
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.callsign == "all" || g_rosterSettings.callsign == "hits")
|
2020-12-22 17:30:21 +00:00
|
|
|
{ allOnlyNewDiv.style.display = ""; }
|
2020-10-31 14:01:03 +00:00
|
|
|
else allOnlyNewDiv.style.display = "none";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
resize();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function wantedChanged(element)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.wanted[element.id] = element.checked;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (element.checked == true)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var t = element.id.replace("hunt", "");
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (t in g_rosterSettings.columns)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.columns[t] = true;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i = 0; i < g_menu.items.length; ++i)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
typeof g_menu.items[i].checked != "undefined" &&
|
|
|
|
g_menu.items[i].label == t
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ g_menu.items[i].checked = true; }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
writeRosterSettings();
|
|
|
|
|
|
|
|
g_scriptReport = Object();
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var callHash in window.opener.g_callRoster)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.g_callRoster[callHash].callObj.alerted = false;
|
|
|
|
}
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function valuesChanged()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
setVisual();
|
|
|
|
|
|
|
|
g_rosterSettings.callsign = callsignNeed.value;
|
|
|
|
g_rosterSettings.hunting = huntMode.value;
|
|
|
|
g_rosterSettings.huntNeed = huntNeed.value;
|
|
|
|
g_rosterSettings.requireGrid = wantGrid.checked;
|
|
|
|
|
|
|
|
g_rosterSettings.wantMaxDT = wantMaxDT.checked;
|
|
|
|
g_rosterSettings.wantMinDB = wantMinDB.checked;
|
|
|
|
g_rosterSettings.wantMinFreq = wantMinFreq.checked;
|
|
|
|
g_rosterSettings.wantMaxFreq = wantMaxFreq.checked;
|
|
|
|
|
|
|
|
maxDTView.innerHTML = g_rosterSettings.maxDT = maxDT.value;
|
|
|
|
minDbView.innerHTML = g_rosterSettings.minDb = minDb.value;
|
|
|
|
minFreqView.innerHTML = g_rosterSettings.minFreq = minFreq.value;
|
|
|
|
maxFreqView.innerHTML = g_rosterSettings.maxFreq = maxFreq.value;
|
|
|
|
g_rosterSettings.maxLoTW = maxLoTW.value;
|
|
|
|
maxLoTWView.innerHTML =
|
|
|
|
g_rosterSettings.maxLoTW < 27
|
|
|
|
? Number(g_rosterSettings.maxLoTW).toYM()
|
|
|
|
: "<b>∞</b>";
|
|
|
|
g_rosterSettings.maxLoTW = maxLoTW.value;
|
|
|
|
g_rosterSettings.cqOnly = cqOnly.checked;
|
|
|
|
g_rosterSettings.noMyDxcc = noMyDxcc.checked;
|
|
|
|
g_rosterSettings.onlyMyDxcc = onlyMyDxcc.checked;
|
|
|
|
if (
|
|
|
|
noMsg.checked &&
|
|
|
|
onlyMsg.checked &&
|
|
|
|
noMsgValue.value == onlyMsgValue.value
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_rosterSettings.noMsg) noMsg.checked = false;
|
|
|
|
else onlyMsg.checked = false;
|
|
|
|
}
|
|
|
|
g_rosterSettings.noMsg = noMsg.checked;
|
|
|
|
g_rosterSettings.onlyMsg = onlyMsg.checked;
|
|
|
|
g_rosterSettings.noMsgValue = noMsgValue.value;
|
|
|
|
g_rosterSettings.onlyMsgValue = onlyMsgValue.value;
|
|
|
|
g_rosterSettings.usesLoTW = usesLoTW.checked;
|
|
|
|
g_rosterSettings.useseQSL = useseQSL.checked;
|
|
|
|
g_rosterSettings.usesOQRS = usesOQRS.checked;
|
|
|
|
g_rosterSettings.onlySpot = onlySpot.checked;
|
|
|
|
g_rosterSettings.reference = referenceNeed.value;
|
|
|
|
g_rosterSettings.allOnlyNew = allOnlyNew.checked;
|
|
|
|
g_rosterSettings.useRegex = useRegex.checked;
|
|
|
|
g_rosterSettings.callsignRegex = callsignRegex.value;
|
|
|
|
|
|
|
|
writeRosterSettings();
|
|
|
|
|
|
|
|
g_scriptReport = Object();
|
|
|
|
for (var callHash in window.opener.g_callRoster)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ window.opener.g_callRoster[callHash].callObj.alerted = false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function getBuffer(file_url, callback, flag, mode, port, cookie)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var url = require("url");
|
|
|
|
var http = require(mode);
|
|
|
|
var fileBuffer = null;
|
|
|
|
var options = null;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (cookie != null)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
options = {
|
2020-12-14 01:30:10 +00:00
|
|
|
host: url.parse(file_url).host, // eslint-disable-line node/no-deprecated-api
|
2020-10-31 14:01:03 +00:00
|
|
|
port: port,
|
2020-12-14 01:30:10 +00:00
|
|
|
path: url.parse(file_url).path, // eslint-disable-line node/no-deprecated-api
|
2020-10-31 14:01:03 +00:00
|
|
|
headers: {
|
2020-12-14 02:10:27 +00:00
|
|
|
Cookie: cookie
|
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
};
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
options = {
|
2020-12-14 01:30:10 +00:00
|
|
|
host: url.parse(file_url).host, // eslint-disable-line node/no-deprecated-api
|
2020-10-31 14:01:03 +00:00
|
|
|
port: port,
|
2020-12-14 02:10:27 +00:00
|
|
|
path: url.parse(file_url).path // eslint-disable-line node/no-deprecated-api
|
2020-10-31 14:01:03 +00:00
|
|
|
};
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
http.get(options, function (res)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var fsize = res.headers["content-length"];
|
|
|
|
var cookies = null;
|
|
|
|
if (typeof res.headers["set-cookie"] != "undefined")
|
2020-12-14 02:10:27 +00:00
|
|
|
{ cookies = res.headers["set-cookie"]; }
|
2020-10-31 14:01:03 +00:00
|
|
|
res
|
2020-12-14 02:10:27 +00:00
|
|
|
.on("data", function (data)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (fileBuffer == null) fileBuffer = data;
|
|
|
|
else fileBuffer += data;
|
|
|
|
})
|
2020-12-14 02:10:27 +00:00
|
|
|
.on("end", function ()
|
|
|
|
{
|
|
|
|
if (typeof callback === "function")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
// Call it, since we have confirmed it is callable
|
|
|
|
callback(fileBuffer, flag, cookies);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.on("error", function () {});
|
|
|
|
});
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function callsignResult(buffer, flag)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var rawData = JSON.parse(buffer);
|
|
|
|
r_currentUSState = flag;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
g_currentUSCallsigns = Object();
|
2020-12-14 01:30:10 +00:00
|
|
|
for (var key in rawData.c) g_currentUSCallsigns[rawData.c[key]] = true;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.goProcessRoster();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function stateChangedValue(what)
|
|
|
|
{
|
|
|
|
if (r_currentUSState != stateSelect.value && stateSelect.value != "")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
r_currentUSState = stateSelect.value;
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (window.opener.g_mapSettings.offlineMode == false)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var callState = r_currentUSState.replace("CN-", "");
|
|
|
|
getBuffer(
|
2020-12-05 01:50:14 +00:00
|
|
|
"http://app.gridtracker.org/callsigns/" + callState + ".callsigns.json",
|
2020-10-31 14:01:03 +00:00
|
|
|
callsignResult,
|
|
|
|
r_currentUSState,
|
2020-12-05 01:50:14 +00:00
|
|
|
"http",
|
|
|
|
80
|
2020-10-31 14:01:03 +00:00
|
|
|
);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.goProcessRoster();
|
|
|
|
r_currentUSState = "";
|
|
|
|
g_currentUSCallsigns = null;
|
|
|
|
stateSelect.value = "";
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (stateSelect.value == "")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
r_currentUSState = "";
|
|
|
|
g_currentUSCallsigns = null;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function DXCCsChangedValue(what)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
r_currentDXCCs = DXCCsSelect.value;
|
|
|
|
window.opener.goProcessRoster();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function initDXCCSelector()
|
|
|
|
{
|
|
|
|
var items = Object.keys(window.opener.g_dxccToAltName).sort(function (a, b)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return window.opener.g_dxccToAltName[a].localeCompare(
|
|
|
|
window.opener.g_dxccToAltName[b]
|
|
|
|
);
|
|
|
|
});
|
|
|
|
var newSelect = document.getElementById("DXCCsSelect");
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in items)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var key = items[i];
|
|
|
|
|
|
|
|
if (
|
|
|
|
window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[key]].geo !=
|
|
|
|
"deleted"
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var option = document.createElement("option");
|
|
|
|
option.value = key;
|
|
|
|
option.text =
|
|
|
|
window.opener.g_dxccToAltName[key] +
|
|
|
|
" (" +
|
|
|
|
window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[key]].pp +
|
|
|
|
")";
|
|
|
|
|
|
|
|
newSelect.appendChild(option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
newSelect.oninput = DXCCsChangedValue;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function manifestResult(buffer, flag)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
r_callsignManifest = JSON.parse(buffer);
|
|
|
|
var newSelect = document.getElementById("stateSelect");
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in r_callsignManifest.cnt)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var option = document.createElement("option");
|
2020-12-14 02:10:27 +00:00
|
|
|
if (window.opener.g_enums[key])
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
option.value = key;
|
|
|
|
option.text = window.opener.g_enums[key];
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
option.value = "CN-" + key;
|
|
|
|
option.text = window.opener.g_enums["CN-" + key];
|
|
|
|
}
|
|
|
|
newSelect.appendChild(option);
|
|
|
|
}
|
|
|
|
newSelect.oninput = stateChangedValue;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
function receiveMessage(event) {}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var g_tracker = {};
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function updateWorked()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_worked = window.opener.g_tracker.worked;
|
|
|
|
g_confirmed = window.opener.g_tracker.confirmed;
|
|
|
|
g_modes = window.opener.g_modes;
|
|
|
|
g_modes_phone = window.opener.g_modes_phone;
|
|
|
|
g_tracker = window.opener.g_tracker;
|
|
|
|
|
|
|
|
processAllAwardTrackers();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function deleteCallsignIgnore(key)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
delete g_blockedCalls[key];
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function deleteDxccIgnore(key)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
delete g_blockedDxcc[key];
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function deleteCQIgnore(key)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
delete g_blockedCQ[key];
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function clearAllCallsignIgnores()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCalls = Object();
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function clearAllDxccIgnores()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedDxcc = Object();
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function clearAllCQIgnores()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCQ = Object();
|
|
|
|
storeBlocks();
|
|
|
|
openIgnoreEdit();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function closeEditIgnores()
|
|
|
|
{
|
2020-12-23 20:18:46 +00:00
|
|
|
MainCallRoster.style.display = "block";
|
2020-10-31 14:01:03 +00:00
|
|
|
editView.style.display = "none";
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function openIgnoreEdit()
|
|
|
|
{
|
2020-12-23 20:18:46 +00:00
|
|
|
MainCallRoster.style.display = "none";
|
2020-10-31 14:01:03 +00:00
|
|
|
editView.style.display = "inline-block";
|
|
|
|
var worker = "";
|
|
|
|
var clearString = "<th>none</th>";
|
|
|
|
|
2020-12-14 01:30:10 +00:00
|
|
|
if (Object.keys(g_blockedCalls).length > 0)
|
2020-10-31 14:01:03 +00:00
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
clearString =
|
|
|
|
"<th style='cursor:pointer;' onclick='clearAllCallsignIgnores()'>Clear All</th>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<div style='margin:10px;padding:0px;vertical-align:top;display:inline-block;margin-right:2px;overflow:auto;overflow-x:hidden;height:" +
|
|
|
|
(window.innerHeight - 135) +
|
|
|
|
"px;'><table class='darkTable' align=center><tr><th align=left>Callsigns</th>" +
|
|
|
|
clearString +
|
|
|
|
"</tr>";
|
|
|
|
Object.keys(g_blockedCalls)
|
|
|
|
.sort()
|
2020-12-14 02:10:27 +00:00
|
|
|
.forEach(function (key, i)
|
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<tr><td align=left style='color:#FFFF00;' >" +
|
|
|
|
key +
|
|
|
|
"</td><td style='cursor:pointer;' onclick='deleteCallsignIgnore(\"" +
|
|
|
|
key +
|
|
|
|
"\")'><img src='/img/trash_24x48.png' style='height:17px;margin:-1px;margin-bottom:-3px;padding:0px'></td></tr>";
|
|
|
|
});
|
|
|
|
worker += "</table></div>";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 01:30:10 +00:00
|
|
|
clearString = "<th>none</th>";
|
|
|
|
if (Object.keys(g_blockedCQ).length > 0)
|
2020-10-31 14:01:03 +00:00
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
clearString =
|
|
|
|
"<th style='cursor:pointer;' onclick='clearAllCQIgnores()'>Clear All</th>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<div style='margin:10px;padding:0px;vertical-align:top;display:inline-block;margin-right:2px;overflow:auto;overflow-x:hidden;height:" +
|
|
|
|
(window.innerHeight - 135) +
|
|
|
|
"px;'><table class='darkTable' align=center><tr><th align=left>CQ</th>" +
|
|
|
|
clearString +
|
|
|
|
"</tr>";
|
|
|
|
Object.keys(g_blockedCQ)
|
|
|
|
.sort()
|
2020-12-14 02:10:27 +00:00
|
|
|
.forEach(function (key, i)
|
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<tr><td align=left style='color:cyan;' >" +
|
|
|
|
key +
|
|
|
|
"</td><td style='cursor:pointer;' onclick='deleteCQIgnore(\"" +
|
|
|
|
key +
|
|
|
|
"\")'><img src='/img/trash_24x48.png' style='height:17px;margin:-1px;margin-bottom:-3px;padding:0px'></td></tr>";
|
|
|
|
});
|
|
|
|
worker += "</table></div>";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 01:30:10 +00:00
|
|
|
clearString = "<th>none</th>";
|
|
|
|
if (Object.keys(g_blockedDxcc).length > 0)
|
2020-10-31 14:01:03 +00:00
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
clearString =
|
|
|
|
"<th style='cursor:pointer;' onclick='clearAllDxccIgnores()'>Clear All</th>";
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<div style='margin:10px;vertical-align:top;display:inline-block;overflow:auto;overflow-x:hidden;height:" +
|
|
|
|
(window.innerHeight - 135) +
|
|
|
|
"px;'><table class='darkTable' align=center><tr><th align=left>DXCCs</th>" +
|
|
|
|
clearString +
|
|
|
|
"</tr>";
|
|
|
|
Object.keys(g_blockedDxcc)
|
|
|
|
.sort()
|
2020-12-14 02:10:27 +00:00
|
|
|
.forEach(function (key, i)
|
|
|
|
{
|
2020-12-14 01:30:10 +00:00
|
|
|
worker +=
|
|
|
|
"<tr><td align=left style='color:#FFA500' >" +
|
|
|
|
window.opener.g_dxccToAltName[key] +
|
|
|
|
" (" +
|
|
|
|
window.opener.g_worldGeoData[window.opener.g_dxccToGeoData[key]].pp +
|
|
|
|
")</td><td style='cursor:pointer;' onclick='deleteDxccIgnore(\"" +
|
|
|
|
key +
|
|
|
|
"\")'><img src='/img/trash_24x48.png' style='height:17px;margin:-1px;margin-bottom:-3px;padding:0px'></td></tr>";
|
|
|
|
});
|
|
|
|
worker += "</table></div>";
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
editTables.innerHTML = worker;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function onMyKeyDown(event)
|
|
|
|
{
|
|
|
|
if (!g_regFocus)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
window.opener.onMyKeyDown(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function checkForEnter(ele)
|
|
|
|
{
|
|
|
|
if (event.key === "Enter")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
ele.blur();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function resize()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (editView.style.display == "inline-block") openIgnoreEdit();
|
|
|
|
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function init()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_callsignDatabaseDXCC = window.opener.g_callsignDatabaseDXCC;
|
|
|
|
g_callsignDatabaseUS = window.opener.g_callsignDatabaseUS;
|
|
|
|
g_callsignDatabaseUSplus = window.opener.g_callsignDatabaseUSplus;
|
|
|
|
|
|
|
|
loadAwardJson();
|
|
|
|
|
|
|
|
updateWorked();
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
// addAllAwards();
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
|
|
|
|
lockNewWindows();
|
|
|
|
|
|
|
|
if (window.opener.g_mapSettings.offlineMode == false)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
getBuffer(
|
2020-12-05 01:50:14 +00:00
|
|
|
"http://app.gridtracker.org/callsigns/manifest.json",
|
2020-10-31 14:01:03 +00:00
|
|
|
manifestResult,
|
|
|
|
null,
|
2020-12-05 01:50:14 +00:00
|
|
|
"http",
|
|
|
|
80
|
2020-10-31 14:01:03 +00:00
|
|
|
);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
loadSettings();
|
|
|
|
|
|
|
|
window.opener.setRosterSpot(g_rosterSettings.columns.Spot);
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in g_rosterSettings.wanted)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (document.getElementById(key))
|
2020-12-14 02:10:27 +00:00
|
|
|
{ document.getElementById(key).checked = g_rosterSettings.wanted[key]; }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_menu = new nw.Menu();
|
|
|
|
g_compactMenu = new nw.Menu();
|
|
|
|
|
2020-12-05 19:19:11 +00:00
|
|
|
var item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: g_rosterSettings.controls ? "Hide Controls" : "Show Controls",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
|
|
|
if (this.label == "Hide Controls")
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
this.label = "Show Controls";
|
|
|
|
g_rosterSettings.controls = false;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
this.label = "Hide Controls";
|
|
|
|
g_rosterSettings.controls = true;
|
|
|
|
}
|
|
|
|
g_compactMenu.items[0].label = g_rosterSettings.controls
|
|
|
|
? "Hide Controls"
|
|
|
|
: "Show Controls";
|
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
|
|
|
setVisual();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-12-05 19:19:11 +00:00
|
|
|
});
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: g_rosterSettings.controls ? "Hide Controls" : "Show Controls",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
|
|
|
if (this.label == "Hide Controls")
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
this.label = "Show Controls";
|
|
|
|
g_rosterSettings.controls = false;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
this.label = "Hide Controls";
|
|
|
|
g_rosterSettings.controls = true;
|
|
|
|
}
|
|
|
|
g_menu.items[0].label = g_rosterSettings.controls
|
|
|
|
? "Hide Controls"
|
|
|
|
: "Show Controls";
|
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
|
|
|
setVisual();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-12-05 19:19:11 +00:00
|
|
|
});
|
|
|
|
g_compactMenu.append(item);
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Compact Mode",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.compact = true;
|
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
|
|
|
resize();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Roster Mode",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.compact = false;
|
|
|
|
localStorage.rosterSettings = JSON.stringify(g_rosterSettings);
|
|
|
|
resize();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_compactMenu.append(item);
|
|
|
|
|
|
|
|
g_callMenu = new nw.Menu();
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Lookup",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callLookup(g_targetHash, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_callMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Gen Msgs",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callGenMessage(g_targetHash, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_callMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({ type: "separator" });
|
|
|
|
|
|
|
|
g_callMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Ignore Call",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var thisCall = callRoster[g_targetHash].DEcall;
|
|
|
|
g_blockedCalls[thisCall] = true;
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_callMenu.append(item);
|
|
|
|
|
|
|
|
g_callingMenu = new nw.Menu();
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Lookup",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callingLookup(g_targetHash, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_callingMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Gen Msgs",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
callingGenMessage(g_targetHash, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_callingMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({ type: "separator" });
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "checkbox",
|
|
|
|
label: "Realtime",
|
|
|
|
checked: g_rosterSettings.realtime,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.realtime = this.checked;
|
|
|
|
writeRosterSettings();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({ type: "separator" });
|
|
|
|
g_menu.append(item);
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in g_rosterSettings.columns)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var itemx = new nw.MenuItem({
|
|
|
|
type: "checkbox",
|
|
|
|
label: key,
|
|
|
|
checked: g_rosterSettings.columns[key],
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_rosterSettings.columns[this.label] = this.checked;
|
|
|
|
if (this.label == "Spot")
|
2020-12-14 02:10:27 +00:00
|
|
|
{ window.opener.setRosterSpot(g_rosterSettings.columns.Spot); }
|
2020-10-31 14:01:03 +00:00
|
|
|
writeRosterSettings();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
resize();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
g_menu.append(itemx);
|
|
|
|
}
|
|
|
|
|
|
|
|
item = new nw.MenuItem({ type: "separator" });
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
g_clearIgnores = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear Call Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCalls = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(g_clearIgnores);
|
|
|
|
|
|
|
|
g_clearIgnoresCall = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCalls = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_callMenu.append(g_clearIgnoresCall);
|
|
|
|
|
|
|
|
g_CQMenu = new nw.Menu();
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Ignore CQ from DXCC",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCQ[
|
|
|
|
callRoster[g_targetCQ].DXcall +
|
|
|
|
" from " +
|
|
|
|
window.opener.g_dxccToAltName[callRoster[g_targetCQ].callObj.dxcc]
|
|
|
|
] = true;
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_CQMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Ignore CQ from All",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCQ[callRoster[g_targetCQ].DXcall + " from All"] = true;
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_CQMenu.append(item);
|
|
|
|
|
|
|
|
g_clearCQIgnoreMainMenu = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear CQ Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCQ = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(g_clearCQIgnoreMainMenu);
|
|
|
|
|
|
|
|
g_clearCQIgnore = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedCQ = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_CQMenu.append(g_clearCQIgnore);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Edit Ignores",
|
|
|
|
enabled: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
openIgnoreEdit();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_CQMenu.append(item);
|
|
|
|
|
|
|
|
g_dxccMenu = new nw.Menu();
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Ignore DXCC",
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedDxcc[g_targetDxcc] = true;
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
g_dxccMenu.append(item);
|
|
|
|
|
|
|
|
g_clearDxccIgnoreMainMenu = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear DXCC Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedDxcc = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(g_clearDxccIgnoreMainMenu);
|
|
|
|
|
|
|
|
g_clearDxccIgnore = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Clear Ignore",
|
|
|
|
enabled: false,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_blockedDxcc = Object();
|
|
|
|
storeBlocks();
|
|
|
|
window.opener.goProcessRoster();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_dxccMenu.append(g_clearDxccIgnore);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Edit Ignores",
|
|
|
|
enabled: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
openIgnoreEdit();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_menu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Edit Ignores",
|
|
|
|
enabled: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
openIgnoreEdit();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_callMenu.append(item);
|
|
|
|
|
|
|
|
item = new nw.MenuItem({
|
|
|
|
type: "normal",
|
|
|
|
label: "Edit Ignores",
|
|
|
|
enabled: true,
|
2020-12-14 02:10:27 +00:00
|
|
|
click: function ()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
openIgnoreEdit();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
});
|
|
|
|
g_dxccMenu.append(item);
|
|
|
|
|
|
|
|
callsignNeed.value = g_rosterSettings.callsign;
|
|
|
|
huntMode.value = g_rosterSettings.hunting;
|
|
|
|
huntNeed.value = g_rosterSettings.huntNeed;
|
|
|
|
wantGrid.checked = g_rosterSettings.requireGrid;
|
|
|
|
|
|
|
|
wantMaxDT.checked = g_rosterSettings.wantMaxDT;
|
|
|
|
wantMinDB.checked = g_rosterSettings.wantMinDB;
|
|
|
|
wantMinFreq.checked = g_rosterSettings.wantMinFreq;
|
|
|
|
wantMaxFreq.checked = g_rosterSettings.wantMaxFreq;
|
|
|
|
|
|
|
|
maxDTView.innerHTML = maxDT.value = g_rosterSettings.maxDT;
|
|
|
|
minDbView.innerHTML = minDb.value = g_rosterSettings.minDb;
|
|
|
|
minFreqView.innerHTML = minFreq.value = g_rosterSettings.minFreq;
|
|
|
|
maxFreqView.innerHTML = maxFreq.value = g_rosterSettings.maxFreq;
|
|
|
|
|
|
|
|
maxLoTW.value = g_rosterSettings.maxLoTW;
|
|
|
|
maxLoTWView.innerHTML =
|
|
|
|
maxLoTW.value < 27 ? Number(maxLoTW.value).toYM() : "<b>∞</b>";
|
|
|
|
|
|
|
|
cqOnly.checked = g_rosterSettings.cqOnly;
|
|
|
|
noMyDxcc.checked = g_rosterSettings.noMyDxcc;
|
|
|
|
onlyMyDxcc.checked = g_rosterSettings.onlyMyDxcc;
|
|
|
|
|
|
|
|
noMsg.checked = g_rosterSettings.noMsg;
|
|
|
|
onlyMsg.checked = g_rosterSettings.onlyMsg;
|
|
|
|
noMsgValue.value = g_rosterSettings.noMsgValue;
|
|
|
|
onlyMsgValue.value = g_rosterSettings.onlyMsgValue;
|
|
|
|
|
|
|
|
usesLoTW.checked = g_rosterSettings.usesLoTW;
|
|
|
|
useseQSL.checked = g_rosterSettings.useseQSL;
|
|
|
|
onlySpot.checked = g_rosterSettings.onlySpot;
|
|
|
|
usesOQRS.checked = g_rosterSettings.usesOQRS;
|
|
|
|
|
|
|
|
referenceNeed.value = g_rosterSettings.reference;
|
|
|
|
allOnlyNew.checked = g_rosterSettings.allOnlyNew;
|
|
|
|
useRegex.checked = g_rosterSettings.useRegex;
|
|
|
|
callsignRegex.value = g_rosterSettings.callsignRegex;
|
|
|
|
|
|
|
|
setVisual();
|
|
|
|
document.addEventListener("keydown", onMyKeyDown, false);
|
|
|
|
|
|
|
|
initDXCCSelector();
|
|
|
|
|
|
|
|
g_timerInterval = setInterval(realtimeRoster, 1000);
|
|
|
|
|
|
|
|
updateInstances();
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function handleContextMenu(ev)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (editView.style.display == "inline-block") return false;
|
|
|
|
|
2020-12-05 19:40:19 +00:00
|
|
|
var mouseX = Math.round(ev.x);
|
|
|
|
var mouseY = Math.round(ev.y);
|
2020-12-05 19:19:11 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var len = Object.keys(g_blockedCalls).length;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (len > 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearIgnores.enabled = true;
|
|
|
|
g_clearIgnores.label =
|
|
|
|
"Clear Call Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
|
|
|
g_clearIgnoresCall.enabled = true;
|
|
|
|
g_clearIgnoresCall.label =
|
|
|
|
"Clear Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearIgnores.label = "Clear Call Ignore";
|
|
|
|
g_clearIgnores.enabled = false;
|
|
|
|
g_clearIgnoresCall.label = "Clear Ignore";
|
|
|
|
g_clearIgnoresCall.enabled = false;
|
|
|
|
}
|
2021-01-03 21:57:16 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
len = Object.keys(g_blockedDxcc).length;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (len > 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearDxccIgnoreMainMenu.enabled = true;
|
|
|
|
g_clearDxccIgnoreMainMenu.label =
|
|
|
|
"Clear DXCC Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
|
|
|
g_clearDxccIgnore.enabled = true;
|
|
|
|
g_clearDxccIgnore.label =
|
|
|
|
"Clear Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearDxccIgnoreMainMenu.label = "Clear DXCC Ignore";
|
|
|
|
g_clearDxccIgnoreMainMenu.enabled = false;
|
|
|
|
g_clearDxccIgnore.label = "Clear Ignore";
|
|
|
|
g_clearDxccIgnore.enabled = false;
|
|
|
|
}
|
2021-01-03 21:57:16 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
len = Object.keys(g_blockedCQ).length;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (len > 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearCQIgnoreMainMenu.enabled = true;
|
|
|
|
g_clearCQIgnoreMainMenu.label =
|
|
|
|
"Clear CQ Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
|
|
|
g_clearCQIgnore.enabled = true;
|
|
|
|
g_clearCQIgnore.label = "Clear Ignore" + (len > 1 ? "s (" + len + ")" : "");
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_clearCQIgnoreMainMenu.label = "Clear CQ Ignore";
|
|
|
|
g_clearCQIgnoreMainMenu.enabled = false;
|
|
|
|
g_clearCQIgnore.label = "Clear Ignore";
|
|
|
|
g_clearCQIgnore.enabled = false;
|
|
|
|
}
|
2021-01-03 21:57:16 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (typeof ev.target != "undefined")
|
|
|
|
{
|
2021-01-03 21:57:16 +00:00
|
|
|
if (g_developerMode)
|
|
|
|
{
|
|
|
|
if ((ev.target.id === "ShowMoreControlsLink") ||
|
|
|
|
(ev.target.id === "ShowFewerControlsLink") ||
|
|
|
|
(ev.target.id === "txrxdec"))
|
|
|
|
{
|
|
|
|
// Allow event to bubble up so that NWJS will show the developer menu
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
var name = ev.target.getAttribute("name");
|
2020-12-14 02:10:27 +00:00
|
|
|
if (name == "Callsign")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_targetHash = ev.target.parentNode.id;
|
2020-12-05 19:19:11 +00:00
|
|
|
g_callMenu.popup(mouseX, mouseY);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else if (name == "Calling")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_targetHash = ev.target.parentNode.id;
|
2020-12-05 19:19:11 +00:00
|
|
|
g_callingMenu.popup(mouseX, mouseY);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else if (name == "CQ")
|
|
|
|
{
|
|
|
|
if (callRoster[ev.target.parentNode.id].DXcall != "CQ")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_targetCQ = ev.target.parentNode.id;
|
2020-12-05 19:19:11 +00:00
|
|
|
g_CQMenu.popup(mouseX, mouseY);
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else if (name && name.startsWith("DXCC"))
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var dxcca = name.split("(");
|
|
|
|
var dxcc = parseInt(dxcca[1]);
|
|
|
|
g_targetDxcc = dxcc;
|
2020-12-05 19:19:11 +00:00
|
|
|
g_dxccMenu.popup(mouseX, mouseY);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
g_menu.popup(mouseX, mouseY);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
g_compactMenu.popup(mouseX, mouseY);
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (g_rosterSettings.compact == false)
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
g_menu.popup(mouseX, mouseY);
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-12-05 19:19:11 +00:00
|
|
|
g_compactMenu.popup(mouseX, mouseY);
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-03 21:57:16 +00:00
|
|
|
ev.preventDefault();
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function getTypeFromMode(mode)
|
|
|
|
{
|
|
|
|
if (mode in g_modes)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (g_modes[mode] == true) return "Digital";
|
|
|
|
else if (g_modes_phone[mode] == true) return "Phone";
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAward(awardName, obj, baseHash)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.dxcc &&
|
|
|
|
g_awardTracker[awardName].rule.dxcc.indexOf(obj.dxcc) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.mode &&
|
|
|
|
g_awardTracker[awardName].rule.mode.indexOf(obj.mode) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.band &&
|
|
|
|
g_awardTracker[awardName].rule.band.indexOf(obj.band) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.DEcall &&
|
|
|
|
g_awardTracker[awardName].rule.call.indexOf(obj.DEcall) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.cont &&
|
|
|
|
g_awardTracker[awardName].rule.cont.indexOf(obj.cont) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.prop &&
|
|
|
|
g_awardTracker[awardName].rule.propMode != obj.propMode
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
g_awardTracker[awardName].test.sat &&
|
|
|
|
g_awardTracker[awardName].rule.satName.indexOf(obj.satName) == -1
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
return g_awardTypes[g_awardTracker[awardName].rule.type].test(
|
|
|
|
g_awardTracker[awardName],
|
|
|
|
obj,
|
|
|
|
baseHash
|
|
|
|
);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function processAward(awardName)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var award =
|
|
|
|
g_awards[g_awardTracker[awardName].sponsor].awards[
|
|
|
|
g_awardTracker[awardName].name
|
|
|
|
];
|
|
|
|
g_awardTracker[awardName].rule = award.rule;
|
|
|
|
var test = (g_awardTracker[awardName].test = {});
|
|
|
|
var mode = award.rule.mode.slice();
|
|
|
|
|
|
|
|
var Index = mode.indexOf("Mixed");
|
|
|
|
if (Index > -1) mode.splice(Index, 1);
|
|
|
|
|
|
|
|
Index = mode.indexOf("Digital");
|
|
|
|
if (Index > -1) mode.splice(Index, 1);
|
|
|
|
|
|
|
|
Index = mode.indexOf("Phone");
|
|
|
|
if (Index > -1) mode.splice(Index, 1);
|
|
|
|
|
|
|
|
test.mode = mode.length > 0;
|
|
|
|
|
|
|
|
test.confirmed =
|
|
|
|
"qsl_req" in
|
|
|
|
g_awards[g_awardTracker[awardName].sponsor].awards[
|
|
|
|
g_awardTracker[awardName].name
|
|
|
|
].rule
|
|
|
|
? g_awards[g_awardTracker[awardName].sponsor].awards[
|
2021-02-01 14:38:32 +00:00
|
|
|
g_awardTracker[awardName].name
|
|
|
|
].rule.qsl_req == "confirmed"
|
2020-10-31 14:01:03 +00:00
|
|
|
: g_awards[g_awardTracker[awardName].sponsor].qsl_req == "confirmed";
|
|
|
|
|
|
|
|
test.look = "confirmed";
|
|
|
|
|
|
|
|
test.qsl_req =
|
|
|
|
"qsl_req" in
|
|
|
|
g_awards[g_awardTracker[awardName].sponsor].awards[
|
|
|
|
g_awardTracker[awardName].name
|
|
|
|
].rule
|
|
|
|
? g_awards[g_awardTracker[awardName].sponsor].awards[
|
2021-02-01 14:38:32 +00:00
|
|
|
g_awardTracker[awardName].name
|
|
|
|
].rule.qsl_req
|
2020-10-31 14:01:03 +00:00
|
|
|
: g_awards[g_awardTracker[awardName].sponsor].qsl_req;
|
|
|
|
|
|
|
|
test.DEcall = "call" in award.rule;
|
|
|
|
test.band = "band" in award.rule && award.rule.band.indexOf("Mixed") == -1;
|
|
|
|
test.dxcc = "dxcc" in award.rule;
|
|
|
|
test.cont = "cont" in award.rule;
|
|
|
|
test.prop = "propMode" in award.rule;
|
|
|
|
test.sat = "satName" in award.rule;
|
|
|
|
|
|
|
|
g_awardTracker[awardName].stat = {};
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in window.opener.g_QSOhash)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var obj = window.opener.g_QSOhash[i];
|
|
|
|
|
|
|
|
if (test.confirmed && !obj.confirmed) continue;
|
|
|
|
|
|
|
|
if (obj.dxcc < 1) continue;
|
|
|
|
|
|
|
|
if (test.dxcc && award.rule.dxcc.indexOf(obj.dxcc) == -1) continue;
|
|
|
|
|
|
|
|
if (test.mode && award.rule.mode.indexOf(obj.mode) == -1) continue;
|
|
|
|
|
|
|
|
if (test.band && award.rule.band.indexOf(obj.band) == -1) continue;
|
|
|
|
|
|
|
|
if (test.DEcall && award.rule.call.indexOf(obj.DEcall) == -1) continue;
|
|
|
|
|
|
|
|
if (test.cont && award.rule.cont.indexOf(obj.cont) == -1) continue;
|
|
|
|
|
|
|
|
if (test.prop && award.rule.propMode != obj.propMode) continue;
|
|
|
|
|
|
|
|
if (test.sat && award.rule.satName.indexOf(obj.satName) == -1) continue;
|
|
|
|
|
|
|
|
g_awardTypes[award.rule.type].score(g_awardTracker[awardName], obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_awardTracker[awardName].comp = g_awardTypes[award.rule.type].compile(
|
|
|
|
g_awardTracker[awardName],
|
|
|
|
g_awardTracker[awardName].stat
|
|
|
|
);
|
|
|
|
g_awardTracker[awardName].stat = {};
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function newAwardCountObject()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var statCountObject = {};
|
|
|
|
|
|
|
|
statCountObject.bands = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
statCountObject.bands.Mixed = {};
|
|
|
|
statCountObject.bands.Digital = {};
|
|
|
|
statCountObject.bands.Phone = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
statCountObject.modes = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
statCountObject.modes.Mixed = {};
|
|
|
|
statCountObject.modes.Digital = {};
|
|
|
|
statCountObject.modes.Phone = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
statCountObject.unique = null;
|
|
|
|
return statCountObject;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function workAwardObject(obj, band, mode, isDigital, isPhone, unique = null)
|
|
|
|
{
|
|
|
|
obj.bands.Mixed[band] = ~~obj.bands.Mixed[band] + 1;
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(mode in obj.bands)) obj.bands[mode] = {};
|
|
|
|
obj.bands[mode][band] = ~~obj.bands[mode][band] + 1;
|
2020-12-14 02:10:27 +00:00
|
|
|
obj.modes.Mixed[mode] = ~~obj.modes.Mixed[mode] + 1;
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (isDigital)
|
|
|
|
{
|
|
|
|
obj.bands.Digital[band] = ~~obj.bands.Digital[band] + 1;
|
|
|
|
obj.modes.Digital[mode] = ~~obj.modes.Digital[mode] + 1;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (isPhone)
|
|
|
|
{
|
|
|
|
obj.bands.Phone[band] = ~~obj.bands.Phone[band] + 1;
|
|
|
|
obj.modes.Phone[mode] = ~~obj.modes.Phone[mode] + 1;
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
if (unique)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (obj.unique == null) obj.unique = {};
|
|
|
|
if (!(unique in obj.unique)) obj.unique[unique] = newAwardCountObject();
|
|
|
|
workAwardObject(obj.unique[unique], band, mode, isDigital, isPhone);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function buildAwardTypeHandlers()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awardTypes = {
|
|
|
|
IOTA: { name: "Islands On The Air" },
|
|
|
|
call: { name: "Callsign" },
|
|
|
|
callarea: { name: "Call Area" },
|
|
|
|
calls2dxcc: { name: "Stations per DXCC" },
|
|
|
|
cnty: { name: "County" },
|
|
|
|
cont: { name: "Continents" },
|
|
|
|
cont5: { name: "5 Continents" },
|
|
|
|
cont52band: { name: "5 Continents per Band" },
|
|
|
|
cqz: { name: "CQ Zone" },
|
|
|
|
dxcc: { name: "DXCC" },
|
|
|
|
grids: { name: "Grids" },
|
|
|
|
numsfx: { name: "Call Area + Suffix" },
|
|
|
|
px: { name: "Prefix" },
|
|
|
|
pxa: { name: "Prefixes" },
|
|
|
|
pxplus: { name: "Special Calls" },
|
|
|
|
sfx: { name: "Suffix" },
|
|
|
|
states: { name: "States" },
|
|
|
|
cont2band: { name: "Continents per Band" },
|
|
|
|
calls2band: { name: "Stations per Band" },
|
|
|
|
dxcc2band: { name: "DXCC per Band" },
|
2020-12-14 02:10:27 +00:00
|
|
|
states2band: { name: "States per Band" }
|
2020-10-31 14:01:03 +00:00
|
|
|
};
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
g_awardTypes.IOTA.score = scoreAIOTA;
|
|
|
|
g_awardTypes.call.score = scoreAcall;
|
|
|
|
g_awardTypes.callarea.score = scoreAcallarea;
|
|
|
|
g_awardTypes.calls2dxcc.score = scoreAcalls2dxcc;
|
|
|
|
g_awardTypes.cnty.score = scoreAcnty;
|
|
|
|
g_awardTypes.cont.score = scoreAcont;
|
|
|
|
g_awardTypes.cont5.score = scoreAcont5;
|
|
|
|
g_awardTypes.cont52band.score = scoreAcont52band;
|
|
|
|
g_awardTypes.cqz.score = scoreAcqz;
|
|
|
|
g_awardTypes.dxcc.score = scoreAdxcc;
|
|
|
|
g_awardTypes.grids.score = scoreAgrids;
|
|
|
|
g_awardTypes.numsfx.score = scoreAnumsfx;
|
|
|
|
g_awardTypes.px.score = scoreApx;
|
|
|
|
g_awardTypes.pxa.score = scoreApxa;
|
|
|
|
g_awardTypes.pxplus.score = scoreApxplus;
|
|
|
|
g_awardTypes.sfx.score = scoreAsfx;
|
|
|
|
g_awardTypes.states.score = scoreAstates;
|
|
|
|
g_awardTypes.cont2band.score = scoreAcont2band;
|
|
|
|
g_awardTypes.calls2band.score = scoreAcalls2band;
|
|
|
|
g_awardTypes.dxcc2band.score = scoreAdxcc2band;
|
|
|
|
g_awardTypes.states2band.score = scoreAstates2band;
|
|
|
|
|
|
|
|
g_awardTypes.IOTA.test = testAIOTA;
|
|
|
|
g_awardTypes.call.test = testAcall;
|
|
|
|
g_awardTypes.callarea.test = testAcallarea;
|
|
|
|
g_awardTypes.calls2dxcc.test = testAcalls2dxcc;
|
|
|
|
g_awardTypes.cnty.test = testAcnty;
|
|
|
|
g_awardTypes.cont.test = testAcont;
|
|
|
|
g_awardTypes.cont5.test = testAcont5;
|
|
|
|
g_awardTypes.cont52band.test = testAcont52band;
|
|
|
|
g_awardTypes.cqz.test = testAcqz;
|
|
|
|
g_awardTypes.dxcc.test = testAdxcc;
|
|
|
|
g_awardTypes.grids.test = testAgrids;
|
|
|
|
g_awardTypes.numsfx.test = testAnumsfx;
|
|
|
|
g_awardTypes.px.test = testApx;
|
|
|
|
g_awardTypes.pxa.test = testApxa;
|
|
|
|
g_awardTypes.pxplus.test = testApxplus;
|
|
|
|
g_awardTypes.sfx.test = testAsfx;
|
|
|
|
g_awardTypes.states.test = testAstates;
|
|
|
|
g_awardTypes.cont2band.test = testAcont2band;
|
|
|
|
g_awardTypes.calls2band.test = testAcalls2band;
|
|
|
|
g_awardTypes.dxcc2band.test = testAdxcc2band;
|
|
|
|
g_awardTypes.states2band.test = testAstates2band;
|
|
|
|
|
|
|
|
g_awardTypes.IOTA.compile = singleCompile;
|
|
|
|
g_awardTypes.call.compile = singleCompile;
|
|
|
|
g_awardTypes.callarea.compile = singleCompile;
|
|
|
|
g_awardTypes.calls2dxcc.compile = doubleCompile;
|
|
|
|
g_awardTypes.cnty.compile = singleCompile;
|
|
|
|
g_awardTypes.cont.compile = singleCompile;
|
|
|
|
g_awardTypes.cont5.compile = singleCompile;
|
|
|
|
g_awardTypes.cont52band.compile = doubleCompile;
|
|
|
|
g_awardTypes.cqz.compile = singleCompile;
|
|
|
|
g_awardTypes.dxcc.compile = singleCompile;
|
|
|
|
g_awardTypes.grids.compile = singleCompile;
|
|
|
|
g_awardTypes.numsfx.compile = singleCompile;
|
|
|
|
g_awardTypes.px.compile = singleCompile;
|
|
|
|
g_awardTypes.pxa.compile = singleCompile;
|
|
|
|
g_awardTypes.pxplus.compile = singleCompile;
|
|
|
|
g_awardTypes.sfx.compile = singleCompile;
|
|
|
|
g_awardTypes.states.compile = singleCompile;
|
|
|
|
g_awardTypes.cont2band.compile = doubleCompile;
|
|
|
|
g_awardTypes.calls2band.compile = doubleCompile;
|
|
|
|
g_awardTypes.dxcc2band.compile = doubleCompile;
|
|
|
|
g_awardTypes.states2band.compile = doubleCompile;
|
|
|
|
}
|
|
|
|
|
|
|
|
function scoreAstates(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.state)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.state in award.stat))
|
2020-12-14 02:10:27 +00:00
|
|
|
{ award.stat[obj.state] = newAwardCountObject(); }
|
2020-10-31 14:01:03 +00:00
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.state],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAstates(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.state && obj.state + baseHash in g_tracker[award.test.look].state)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAstates2band(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.state)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.band in award.stat)) award.stat[obj.band] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.band],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
obj.state
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAstates2band(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.state && obj.state + baseHash in g_tracker[award.test.look].state)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAdxcc(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.dxcc in award.stat)) award.stat[obj.dxcc] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.dxcc],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAdxcc(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (String(obj.dxcc) + baseHash in g_tracker[award.test.look].dxcc)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcont(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
if (!(cont in award.stat)) award.stat[cont] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[cont],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcont(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (cont + baseHash in g_tracker[award.test.look].cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcont5(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "NA" || cont == "SA") cont = "AM";
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
|
|
|
if (!(cont in award.stat)) award.stat[cont] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[cont],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcont5(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "NA" || cont == "SA") cont = "AM";
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (cont + baseHash in g_tracker[award.test.look].cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcont2band(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.band in award.stat)) award.stat[obj.band] = newAwardCountObject();
|
|
|
|
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.band],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
obj.cont
|
|
|
|
);
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcont2band(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (cont + baseHash in g_tracker[award.test.look].cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcont52band(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "NA" || cont == "SA") cont = "AM";
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
|
|
|
if (!(obj.band in award.stat)) award.stat[obj.band] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.band],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
cont
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcont52band(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var cont = obj.cont;
|
|
|
|
if (cont == "NA" || cont == "SA") cont = "AM";
|
|
|
|
if (cont == "AN") cont = "OC";
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (cont + baseHash in g_tracker[award.test.look].cont)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAgrids(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var grid = obj.grid.substr(0, 4);
|
|
|
|
|
|
|
|
if (!(grid in award.stat)) award.stat[grid] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[grid],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAgrids(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.grid && obj.grid + baseHash in g_tracker[award.test.look].grid)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcnty(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.cnty)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.cnty in award.stat)) award.stat[obj.cnty] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.cnty],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcnty(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cnty && obj.cnty + baseHash in g_tracker[award.test.look].cnty)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcall(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var call = obj.DEcall;
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (call.indexOf("/") > -1)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (call.endsWith("/MM")) return false;
|
|
|
|
call = call.replace("/P", "").replace("/R", "").replace("/QRP");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(call in award.stat)) award.stat[call] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[call],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcall(award, obj, baseHash)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (obj.DEcall.indexOf("/") > -1 && obj.DEcall.endsWith("/MM")) return false;
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (obj.DEcall + baseHash in g_tracker[award.test.look].call)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAIOTA(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.IOTA)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
|
|
|
|
if ("IOTA" in test.rule && test.rule.IOTA.indexOf(obj.IOTA) == -1)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
|
|
|
if (!(obj.IOTA in award.stat)) award.stat[obj.IOTA] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.IOTA],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NO IOTA YET
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAIOTA(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
/* if ( obj.IOTA )
|
2020-12-14 01:30:10 +00:00
|
|
|
{
|
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 01:30:10 +00:00
|
|
|
if ( "IOTA" in test.rule && test.rule.IOTA.indexOf(obj.IOTA) == -1 )
|
|
|
|
return false;
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
} */
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcallarea(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.zone != null)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if ("zone" in test.rule && test.rule.zone.indexOf(obj.zone) == -1)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.zone in award.stat)) award.stat[obj.zone] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.zone],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcallarea(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.zone != null)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if ("zone" in test.rule && test.rule.zone.indexOf(obj.zone) == -1)
|
2020-12-14 02:10:27 +00:00
|
|
|
{ return false; }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
return true;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreApx(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var px = obj.px;
|
2020-12-14 02:10:27 +00:00
|
|
|
if ("px" in test.rule)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
px = px.substr(0, test.rule.px[0].length);
|
|
|
|
if (test.rule.px.indexOf(px) == -1) return false;
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(px in award.stat)) award.stat[px] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[px],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testApx(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var px = obj.px;
|
2020-12-14 02:10:27 +00:00
|
|
|
if ("px" in test.rule)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
px = px.substr(0, test.rule.px[0].length);
|
|
|
|
if (test.rule.px.indexOf(px) == -1) return false;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (String(obj.px) + baseHash in g_tracker[award.test.look].px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreApxa(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.pxa)
|
|
|
|
{
|
|
|
|
if (test.rule.pxa[i].indexOf(obj.px) > -1)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(i in award.stat)) award.stat[i] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[i],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testApxa(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.pxa)
|
|
|
|
{
|
|
|
|
if (test.rule.pxa[i].indexOf(obj.px) > -1)
|
|
|
|
{
|
|
|
|
if (String(obj.px) + baseHash in g_tracker[award.test.look].px)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAsfx(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var suf = obj.DEcall.replace(obj.px, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.sfx)
|
|
|
|
{
|
|
|
|
for (var s in test.rule.sfx[i])
|
|
|
|
{
|
|
|
|
if (suf.indexOf(test.rule.sfx[i][s]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(i in award.stat)) award.stat[i] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[i],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAsfx(award, obj, baseHash)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var suf = obj.DEcall.replace(obj.px, "");
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.sfx)
|
|
|
|
{
|
|
|
|
for (var s in test.rule.sfx[i])
|
|
|
|
{
|
|
|
|
if (suf.indexOf(test.rule.sfx[i][s]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return true;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcalls2dxcc(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.dxcc in award.stat)) award.stat[obj.dxcc] = newAwardCountObject();
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.dxcc],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
obj.DEcall
|
|
|
|
);
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcalls2dxcc(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.DEcall + baseHash in g_tracker[award.test.look].call)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcalls2band(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.band in award.stat)) award.stat[obj.band] = newAwardCountObject();
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.band],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
obj.DEcall
|
|
|
|
);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcalls2band(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.DEcall + baseHash in g_tracker[award.test.look].call)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAdxcc2band(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.band in award.stat)) award.stat[obj.band] = newAwardCountObject();
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.band],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone,
|
|
|
|
obj.dxcc
|
|
|
|
);
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAdxcc2band(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (String(obj.dxcc) + baseHash in g_tracker[award.test.look].dxcc)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAcqz(award, obj)
|
|
|
|
{
|
|
|
|
if (obj.cqz)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(obj.cqz in award.stat)) award.stat[obj.cqz] = newAwardCountObject();
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return workAwardObject(
|
|
|
|
award.stat[obj.cqz],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAcqz(award, obj, baseHash)
|
|
|
|
{
|
|
|
|
if (obj.cqza)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var x = 0;
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var z in obj.cqza)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (obj.cqza[z] + baseHash in g_tracker[award.test.look].cqz) x++;
|
|
|
|
}
|
|
|
|
if (obj.cqza.length == x) return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreAnumsfx(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var px = obj.px.substr(0, obj.px.length - 1);
|
|
|
|
var suf = obj.DEcall.replace(px, "");
|
|
|
|
suf = suf.substr(0, test.rule.numsfx[0][0].length);
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.numsfx)
|
|
|
|
{
|
|
|
|
for (var s in test.rule.numsfx[i])
|
|
|
|
{
|
|
|
|
if (suf.indexOf(test.rule.numsfx[i][s]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(i in award.stat)) award.stat[i] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[i],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testAnumsfx(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var px = obj.px.substr(0, obj.px.length - 1);
|
|
|
|
var suf = obj.DEcall.replace(px, "");
|
|
|
|
suf = suf.substr(0, test.rule.numsfx[0][0].length);
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var i in test.rule.numsfx)
|
|
|
|
{
|
|
|
|
for (var s in test.rule.numsfx[i])
|
|
|
|
{
|
|
|
|
if (suf.indexOf(test.rule.numsfx[i][s]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function scoreApxplus(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (test.rule.pxplus)
|
|
|
|
{
|
|
|
|
for (var i in test.rule.pxplus)
|
|
|
|
{
|
|
|
|
if (obj.DEcall.indexOf(test.rule.pxplus[i]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(i in award.stat)) award.stat[i] = newAwardCountObject();
|
|
|
|
return workAwardObject(
|
|
|
|
award.stat[i],
|
|
|
|
obj.band,
|
|
|
|
obj.mode,
|
|
|
|
obj.digital,
|
|
|
|
obj.phone
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2020-08-19 17:01:51 +00:00
|
|
|
}
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function testApxplus(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (test.rule.pxplus)
|
|
|
|
{
|
|
|
|
for (var i in test.rule.pxplus)
|
|
|
|
{
|
|
|
|
if (obj.DEcall.indexOf(test.rule.pxplus[i]) == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function loadAwardJson()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards = {};
|
|
|
|
var fs = require("fs");
|
2020-12-14 02:10:27 +00:00
|
|
|
if (fs.existsSync("./data/awards.json"))
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
fileBuf = fs.readFileSync("./data/awards.json");
|
2020-12-14 02:10:27 +00:00
|
|
|
try
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards = JSON.parse(fileBuf);
|
2020-12-14 02:10:27 +00:00
|
|
|
// fs.writeFileSync("./data/awards.json", JSON.stringify(g_awards,null,2));
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var sp in g_awards)
|
|
|
|
{
|
|
|
|
for (var aw in g_awards[sp].awards)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!("unique" in g_awards[sp].awards[aw].rule))
|
2020-12-14 02:10:27 +00:00
|
|
|
{ g_awards[sp].awards[aw].rule.unique = 1; }
|
2020-10-31 14:01:03 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_awards[sp].awards[aw].rule.band[0] == "Mixed")
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[sp].awards[aw].rule.band.shift();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
if (g_awards[sp].awards[aw].rule.band.length == 0)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[sp].awards[aw].rule.band = [];
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in g_awards[sp].mixed)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[sp].awards[aw].rule.band.push(g_awards[sp].mixed[key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
g_awards[sp].awards[aw].rule.endorse.length == 1 &&
|
|
|
|
g_awards[sp].awards[aw].rule.endorse[0] == "Mixed"
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[sp].awards[aw].rule.endorse = [];
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in g_awards[sp].mixed)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awards[sp].awards[aw].rule.endorse.push(
|
|
|
|
g_awards[sp].mixed[key]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
buildAwardTypeHandlers();
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
alert("Core awards.json : " + e);
|
|
|
|
g_awards = {};
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
|
|
|
else alert("Missing core awards.json");
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function processAllAwardTrackers()
|
|
|
|
{
|
|
|
|
for (var tracker in g_awardTracker)
|
|
|
|
{
|
|
|
|
if (!(g_awardTracker[tracker].sponsor in g_awards))
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
delete g_awardTracker[tracker];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
!(
|
|
|
|
g_awardTracker[tracker].name in
|
|
|
|
g_awards[g_awardTracker[tracker].sponsor].awards
|
|
|
|
)
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
delete g_awardTracker[tracker];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
processAward(tracker);
|
|
|
|
}
|
|
|
|
updateAwardList();
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function newAwardTrackerObject(sponsor, award, enable)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var newAward = {};
|
|
|
|
newAward.sponsor = sponsor;
|
|
|
|
newAward.name = award;
|
|
|
|
newAward.enable = enable;
|
|
|
|
newAward.mode = g_awards[sponsor].awards[award].rule.mode[0];
|
|
|
|
newAward.band = g_awards[sponsor].awards[award].rule.band[0];
|
2020-12-14 01:30:10 +00:00
|
|
|
newAward.count = g_awards[sponsor].awards[award].rule.count[0];
|
|
|
|
newAward.stat = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
newAward.comp = {};
|
|
|
|
newAward.test = {};
|
|
|
|
return newAward;
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function addAllAwards()
|
|
|
|
{
|
|
|
|
for (var sponsor in g_awards)
|
|
|
|
{
|
|
|
|
for (var award in g_awards[sponsor].awards)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var awardToAdd = newAwardTrackerObject(sponsor, award, true);
|
|
|
|
|
|
|
|
var hash = awardToAdd.name + "-" + awardToAdd.sponsor;
|
2020-12-14 02:10:27 +00:00
|
|
|
if (!(hash in g_awardTracker))
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awardTracker[hash] = awardToAdd;
|
|
|
|
processAward(hash);
|
|
|
|
storeAwardTracker();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateAwardList();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function delAllAwards()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
g_awardTracker = {};
|
|
|
|
storeAwardTracker();
|
|
|
|
updateAwardList();
|
|
|
|
window.opener.goProcessRoster();
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function newCompileCountObject()
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var compileCountObject = {};
|
|
|
|
compileCountObject.bands = {};
|
|
|
|
compileCountObject.modes = {};
|
|
|
|
compileCountObject.endorse = {};
|
|
|
|
compileCountObject.counts = {};
|
|
|
|
return compileCountObject;
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function singleCompile(award, obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var rule = test.rule;
|
|
|
|
var comp = newCompileCountObject();
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var mode in rule.mode)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.modes[rule.mode[mode]] = 0;
|
|
|
|
comp.bands[rule.mode[mode]] = {};
|
2020-08-19 16:55:41 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var band in rule.band)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.bands[rule.mode[mode]][rule.band[band]] = 0;
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var key in obj)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (
|
|
|
|
rule.mode[mode] in obj[key].bands &&
|
|
|
|
Object.keys(obj[key].bands[rule.mode[mode]]).length
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.modes[rule.mode[mode]] += 1;
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var band in rule.band)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (rule.band[band] in obj[key].bands[rule.mode[mode]])
|
2020-12-14 02:10:27 +00:00
|
|
|
{ comp.bands[rule.mode[mode]][rule.band[band]] += 1; }
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var mode in comp.modes)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.endorse[mode] = {};
|
|
|
|
comp.counts[mode] = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var cnts in rule.count)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.counts[mode][rule.count[cnts]] = {
|
|
|
|
num: comp.modes[mode],
|
|
|
|
per: parseInt(
|
|
|
|
Math.min(100, (comp.modes[mode] / rule.count[cnts]) * 100.0)
|
2020-12-14 02:10:27 +00:00
|
|
|
)
|
2020-10-31 14:01:03 +00:00
|
|
|
};
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var endorse in rule.endorse)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.endorse[mode][rule.endorse[endorse]] = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var cnts in rule.count)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
comp.endorse[mode][rule.endorse[endorse]][rule.count[cnts]] =
|
|
|
|
comp.bands[mode][rule.endorse[endorse]] >= rule.count[cnts];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return comp;
|
2020-08-19 16:55:41 +00:00
|
|
|
}
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
function doubleCompile(award, firstLevel)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
var test = g_awards[award.sponsor].awards[award.name];
|
|
|
|
var rule = test.rule;
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var k in firstLevel)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
firstLevel[k].bands = {};
|
2020-12-14 02:10:27 +00:00
|
|
|
// firstLevel[k].modes = {};
|
2020-10-31 14:01:03 +00:00
|
|
|
var obj = singleCompile(award, firstLevel[k].unique);
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-12-14 02:10:27 +00:00
|
|
|
for (var mode in obj.bands)
|
|
|
|
{
|
|
|
|
for (var cnt in test.rule.count)
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (obj.counts[mode][test.rule.count[cnt]].num >= test.rule.unique)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
|
|
|
for (var band in obj.bands[mode])
|
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
if (!(mode in firstLevel[k].bands)) firstLevel[k].bands[mode] = {};
|
2020-08-19 17:01:51 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
if (obj.bands[mode][band] > 0)
|
2020-12-14 02:10:27 +00:00
|
|
|
{
|
2020-10-31 14:01:03 +00:00
|
|
|
firstLevel[k].bands[mode][band] =
|
|
|
|
~~firstLevel[k].bands[mode][band] + 1;
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
}
|
2020-10-31 14:01:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-14 02:10:27 +00:00
|
|
|
/* for ( var mode in obj.modes )
|
2020-12-14 01:30:10 +00:00
|
|
|
{
|
|
|
|
if ( !(mode in firstLevel[k].modes) )
|
|
|
|
firstLevel[k].modes[mode] = 0;
|
|
|
|
if ( obj.modes[mode] > 0 )
|
|
|
|
firstLevel[k].modes[mode] += 1;
|
2020-12-14 02:10:27 +00:00
|
|
|
} */
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
delete firstLevel[k].unique;
|
|
|
|
firstLevel[k].unique = null;
|
|
|
|
}
|
2020-09-28 19:28:09 +00:00
|
|
|
|
2020-10-31 14:01:03 +00:00
|
|
|
return singleCompile(award, firstLevel);
|
2020-09-04 23:14:05 +00:00
|
|
|
}
|