merge-requests/231/head
Sebastian Delmont 2022-10-10 08:37:55 -04:00
rodzic 7e301597b3
commit e4b0265fc3
7 zmienionych plików z 88 dodań i 27 usunięć

Wyświetl plik

@ -200,6 +200,22 @@
<div>
<label><input type="checkbox" id="huntCont" onchange="wantedChanged(this);" /> Cont</label>
</div>
<div>
<label title="Callsign Regular Expression">
<input type="checkbox" id="huntRegex" onchange="wantedChanged(this);" /> Regex
</label>
<input
type="text"
class="inputTextValue"
size="12"
id="huntRegexValue"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="blurOnEnter(this);"
/>
</div>
</div>
</div>
@ -316,7 +332,7 @@
<div id="allOnlyNewDiv">
<label><input type="checkbox" id="allOnlyNew" onchange="valuesChanged();" /> Only New Calls</label>
</div>
<div>
<label><input type="checkbox" id="wantRRCQ" onchange="valuesChanged();" /> RR73 as CQ</label>
</div>
@ -330,10 +346,10 @@
class="inputTextValue"
size="8"
id="noMsgValue"
onfocus="g_regFocus=true;"
onblur="g_regFocus=false;"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="checkForEnter(this);"
onkeydown="blurOnEnter(this);"
/>
</div>
@ -347,10 +363,10 @@
class="inputTextValue"
size="8"
id="onlyMsgValue"
onfocus="g_regFocus=true;"
onblur="g_regFocus=false;"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="checkForEnter(this);"
onkeydown="blurOnEnter(this);"
/>
</div>
@ -365,10 +381,10 @@
class="inputTextValue"
size="12"
id="callsignRegex"
onfocus="g_regFocus=true;"
onblur="g_regFocus=false;"
onfocus="g_typingInRoster=true;"
onblur="g_typingInRoster=false;"
oninput="valuesChanged();"
onkeydown="checkForEnter(this);"
onkeydown="blurOnEnter(this);"
/>
</div>
</div>
@ -376,11 +392,11 @@
</div>
</header>
<div id="instancesWrapper">
<div id="instancesDiv"></div>
</div>
<main id="RosterTable"></main>
</div>

Wyświetl plik

@ -104,10 +104,10 @@ Number.prototype.formatSignalReport = function ()
return report;
};
var CALLSIGN_REGEX = /0/g
String.prototype.formatCallsign = function ()
{
var re = new RegExp("0", "g");
return this.replace(re, "Ø");
return this.replace(CALLSIGN_REGEX, "Ø");
};
Number.prototype.toDHMS = function ()

Wyświetl plik

@ -45,7 +45,7 @@ var g_clearCQzIgnoreMainMenu = null;
var g_clearITUzIgnore = null;
var g_clearITUzIgnoreMainMenu = null;
var g_timerInterval = null;
var g_regFocus = false;
var g_typingInRoster = false;
var g_awards = {};
var g_awardTypes = {};
var g_awardTracker = {};
@ -93,6 +93,7 @@ var g_defaultSettings = {
allOnlyNew: false,
useRegex: false,
callsignRegex: "",
huntRegexValue: "",
realtime: true,
wanted: {
huntCallsign: false,
@ -107,7 +108,8 @@ var g_defaultSettings = {
huntPX: false,
huntPOTA: false,
huntQRZ: true,
huntOAMS: false
huntOAMS: false,
huntRegex: false
},
columns: {
Callsign: true,
@ -376,7 +378,7 @@ function realtimeRoster()
let now = timeNowSec();
g_day = parseInt(now / 86400);
g_dayAsString = String(g_day);
if (g_rosterSettings.realtime == false) return;
let timeCols = document.getElementsByClassName("timeCol");
@ -953,6 +955,16 @@ function setVisual()
}
}
}
if (huntRegex.checked == true)
{
huntRegexValue.style.display = "";
}
else
{
huntRegexValue.style.display = "none";
}
if (wantMaxDT.checked == true)
{
maxDT.style.display = "";
@ -1066,6 +1078,8 @@ function wantedChanged(element)
}
}
setVisual();
writeRosterSettings();
g_scriptReport = Object();
@ -1125,6 +1139,7 @@ function valuesChanged()
g_rosterSettings.allOnlyNew = allOnlyNew.checked;
g_rosterSettings.useRegex = useRegex.checked;
g_rosterSettings.callsignRegex = callsignRegex.value;
g_rosterSettings.huntRegexValue = huntRegexValue.value;
writeRosterSettings();
@ -1531,13 +1546,13 @@ function openIgnoreEdit()
function onMyKeyDown(event)
{
if (!g_regFocus)
if (!g_typingInRoster)
{
window.opener.onMyKeyDown(event);
}
}
function checkForEnter(ele)
function blurOnEnter(ele)
{
if (event.key === "Enter")
{
@ -2105,6 +2120,7 @@ function init()
allOnlyNew.checked = g_rosterSettings.allOnlyNew;
useRegex.checked = g_rosterSettings.useRegex;
callsignRegex.value = g_rosterSettings.callsignRegex;
huntRegexValue.value = g_rosterSettings.huntRegexValue;
setVisual();
document.addEventListener("keydown", onMyKeyDown, false);

Wyświetl plik

@ -78,9 +78,11 @@ function processRosterFiltering(callRoster, rosterSettings)
}
if (g_rosterSettings.useRegex && g_rosterSettings.callsignRegex.length > 0)
{
var regexObj = regexObj || new RegExp(g_rosterSettings.callsignRegex, "i")
try
{
if (!call.match(g_rosterSettings.callsignRegex))
if (!call.match(regexObj))
{
entry.tx = false;
continue;

Wyświetl plik

@ -66,6 +66,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
callObj.hunting = {}
callObj.callFlags = {}
callObj.style = callObj.style || {}
callObj.DEcallHTML = callObj.DEcall
let colorObject = Object();
@ -96,7 +97,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
"";
let cntyPointer = (callObj.cnty && callObj.qual == false) ? "cursor: pointer;" : "";
let hash = callsign + workHashSuffix;
let layeredHash = layeredHashSuffix && (callsign + layeredHashSuffix)
@ -226,6 +227,26 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
}
}
if (huntRegex.checked == true && g_rosterSettings.huntRegexValue.length > 0)
{
var huntRegexObj = huntRegexObj || new RegExp(g_rosterSettings.huntRegexValue, "gi")
try
{
if (callsign.match(huntRegexObj))
{
callObj.reason.push("regex");
callObj.hunting.regex = "hunted";
callObj.DEcallHTML = callsign.replace(huntRegexObj, (x, y) => `<span class='regexMatch'>${x}</span>`)
if (!callObj.hunting.call)
{
callBg = `${call}${inversionAlpha};`;
call = bold;
}
}
}
catch (e) {}
}
// Hunting for "stations calling you"
if (huntQRZ.checked == true && callObj.qrz == true)
{
@ -493,7 +514,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
{
shouldAlert = true;
callObj.reason.push("pota");
callObj.hunting.pota = "hunted";
potaBg = `${pota}${inversionAlpha};`;
pota = bold;
@ -518,7 +539,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
if (rosterSettings.huntIndex && marathonHash in rosterSettings.huntIndex.cqz) marathonFound++;
else if (rosterSettings.workedIndex && marathonHash in rosterSettings.workedIndex.cqz) marathonFound++;
}
if (huntFound != huntTotal)
{
shouldAlert = true;
@ -591,7 +612,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
if (rosterSettings.layeredMode && layeredHash in rosterSettings.huntIndex.ituz) layeredFound++;
if (rosterSettings.workedIndex && hash in rosterSettings.workedIndex.ituz) workedFound++;
if (rosterSettings.layeredMode && layeredHash in rosterSettings.workedIndex.ituz) layeredWorkedFound++;
if (huntFound != huntTotal)
{
shouldAlert = true;
@ -773,7 +794,7 @@ function processRosterHunting(callRoster, rosterSettings, awardTracker)
if (didWork && shouldAlert) shouldAlert = false;
// callObj.shouldAlert ||= shouldAlert; // eslint doesn't like this, why?
// If alert was set (award tracker), don't clear it
if (!callObj.shouldAlert)
{

Wyświetl plik

@ -60,7 +60,7 @@ const ROSTER_COLUMNS = {
align: "left",
onClick: `initiateQso("${callObj.hash}")`,
rawAttrs: callObj.style.call,
html: html = callObj.DEcall.formatCallsign()
html: html = (callObj.DEcallHTML || callObj.DEcall).formatCallsign()
}
let acks = window.opener.g_acknowledgedCalls || {};
@ -428,7 +428,7 @@ function potaColumnHover(callObj)
return value;
}
WANTED_ORDER = ["call", "qrz", "cont", "dxcc", "cqz", "ituz", "dxccMarathon", "cqzMarathon", "state", "pota", "grid", "cnty", "wpx", "oams"];
WANTED_ORDER = ["regex", "call", "qrz", "cont", "dxcc", "cqz", "ituz", "dxccMarathon", "cqzMarathon", "state", "pota", "grid", "cnty", "wpx", "oams"];
WANTED_LABELS = {
cont: "Continent",
cqz: "CQ Zone",
@ -441,6 +441,7 @@ WANTED_LABELS = {
cnty: "County",
wpx: "WPX",
call: "Call",
regex: "Regex",
oams: "OAMS",
pota: "POTA"
}
@ -473,6 +474,7 @@ function wantedColumnParts(callObj, options)
// else if (wanted == "caller") { parts.push("Called"); }
else if (wanted == "hunted" && field == "qrz") { parts.push("Caller"); }
else if (wanted == "hunted" && field == "oams") { parts.push("OAMS User"); }
else if (wanted == "hunted" && field == "regex") { parts.push("Regex match"); }
else if (wanted == "hunted") { parts.push(`${options.html ? "<b>" : ""}New ${WANTED_LABELS[field]}${options.html ? "<b>" : ""}`); }
else if (wanted == "worked") { parts.push(`Worked ${WANTED_LABELS[field]}`); }
else if (wanted == "mixed") { parts.push(`${callObj.band} ${WANTED_LABELS[field]}`); }

Wyświetl plik

@ -472,6 +472,10 @@ table.rosterTable thead th:first-child {
color: #ff0;
}
.regexMatch {
text-decoration: underline;
}
.dxCaller {
background-clip: content-box;
box-shadow: 0 0 4px 4px inset #0f0;