refactor so far

pipelines/432154651^2
Matthew Chambers 2021-06-28 19:19:26 -05:00
rodzic f554d50862
commit 7c7baef4c6
3 zmienionych plików z 65 dodań i 110 usunięć

Wyświetl plik

@ -22,6 +22,13 @@
<script src="./lib/protos.js" type="text/javascript"></script> <script src="./lib/protos.js" type="text/javascript"></script>
<script src="./lib/third-party.js" type="text/javascript"></script> <script src="./lib/third-party.js" type="text/javascript"></script>
<script src="./lib/roster.js" type="text/javascript"></script> <script src="./lib/roster.js" type="text/javascript"></script>
<script src="./lib/roster/prepareRosterSettings.js" type="text/javascript"></script>
<script src="./lib/roster/processRosterFiltering.js" type="text/javascript"></script>
<script src="./lib/roster/processRosterHunting.js" type="text/javascript"></script>
<script src="./lib/roster/renderCompactRoster.js" type="text/javascript"></script>
<script src="./lib/roster/renderNormalRoster.js" type="text/javascript"></script>
<script src="./lib/roster/renderRoster.js" type="text/javascript"></script>
<script src="./lib/roster/sendAlerts.js" type="text/javascript"></script>
<script src="./lib/screens.js"></script> <script src="./lib/screens.js"></script>
</head> </head>
<body onload="init()" class="roster" oncontextmenu="return handleContextMenu(event);"> <body onload="init()" class="roster" oncontextmenu="return handleContextMenu(event);">

Wyświetl plik

@ -369,58 +369,6 @@ function myGTCompare(a, b)
return 0; return 0;
} }
var r_sortFunction = [
myCallCompare,
myGridCompare,
myDbCompare,
myDTCompare,
myFreqCompare,
myDxccCompare,
myTimeCompare,
myDistanceCompare,
myHeadingCompare,
myStateCompare,
myCQCompare,
myWPXCompare,
myLifeCompare,
mySpotCompare,
myGTCompare,
myCntyCompare,
myContCompare
];
var r_excptTest = [
timeChk,
crEnable,
blockedCall,
blockedFrom,
blcokedDXCC,
cqOnly,
useRegex,
reqGrid,
minDB,
maxDT,
minFreq,
maxFreq,
noMsg,
onlyMesg,
myDXCC,
lotwUse,
eqslUse,
oqrsUse,
noMyCQDX,
callWorked,
callConfirmed,
huntGrid,
huntDXCC,
huntDXCCs,
huntWPX,
huntCQ,
huntITU,
huntUSStates,
huntUSState
];
function showRosterBox(sortIndex) function showRosterBox(sortIndex)
{ {
if (g_rosterSettings.lastSortIndex != sortIndex) if (g_rosterSettings.lastSortIndex != sortIndex)

Wyświetl plik

@ -52,84 +52,84 @@ function sendAlerts(callRoster, rosterSettings)
} }
callObj.shouldAlert = false; callObj.shouldAlert = false;
}
// NOTE: Ring alerts if needed // NOTE: Ring alerts if needed
try try
{
if (fs.existsSync(dirPath))
{ {
if (window.opener.g_platform == "windows") if (fs.existsSync(dirPath))
{ {
script = "cr-alert.bat"; if (window.opener.g_platform == "windows")
} {
if ( script = "cr-alert.bat";
fs.existsSync(dirPath + script) && }
if (
fs.existsSync(dirPath + script) &&
g_rosterSettings.realtime == false g_rosterSettings.realtime == false
) )
{ {
scriptExists = true; scriptExists = true;
scriptIcon.innerHTML = scriptIcon.innerHTML =
"<div class='buttonScript' onclick='window.opener.toggleCRScript();'>" + "<div class='buttonScript' onclick='window.opener.toggleCRScript();'>" +
(window.opener.g_crScript == 1 (window.opener.g_crScript == 1
? "<font color='lightgreen'>Script Enabled</font>" ? "<font color='lightgreen'>Script Enabled</font>"
: "<font color='yellow'>Script Disabled</font>") + : "<font color='yellow'>Script Disabled</font>") +
"</div>"; "</div>";
scriptIcon.style.display = "block"; scriptIcon.style.display = "block";
} }
else else
{ {
scriptIcon.style.display = "none"; scriptIcon.style.display = "none";
}
} }
} }
} catch (e) {}
catch (e) {}
if (shouldAlert > 0) if (shouldAlert > 0)
{
if (window.opener.g_classicAlerts.huntRoster == true)
{ {
var notify = window.opener.huntRosterNotify.value; if (window.opener.g_classicAlerts.huntRoster == true)
if (notify == "0")
{ {
var media = window.opener.huntRosterNotifyMedia.value; var notify = window.opener.huntRosterNotify.value;
if (media != "none") window.opener.playAlertMediaFile(media); if (notify == "0")
{
var media = window.opener.huntRosterNotifyMedia.value;
if (media != "none") window.opener.playAlertMediaFile(media);
}
else if (notify == "1")
{
window.opener.speakAlertString(
window.opener.huntRosterNotifyWord.value
);
}
} }
else if (notify == "1")
{
window.opener.speakAlertString(
window.opener.huntRosterNotifyWord.value
);
}
}
if ( if (
g_rosterSettings.realtime == false && g_rosterSettings.realtime == false &&
scriptExists && scriptExists &&
window.opener.g_crScript == 1 window.opener.g_crScript == 1
) )
{
try
{ {
fs.writeFileSync( try
dirPath + "cr-alert.json", {
JSON.stringify(g_scriptReport, null, 2) fs.writeFileSync(
); dirPath + "cr-alert.json",
JSON.stringify(g_scriptReport, null, 2)
);
var thisProc = dirPath + script; var thisProc = dirPath + script;
var cp = require("child_process"); var cp = require("child_process");
var child = cp.spawn(thisProc, [], { var child = cp.spawn(thisProc, [], {
detached: true, detached: true,
cwd: dirPath.slice(0, -1), cwd: dirPath.slice(0, -1),
stdio: ["ignore", "ignore", "ignore"] stdio: ["ignore", "ignore", "ignore"]
}); });
child.unref(); child.unref();
}
catch (e)
{
conosle.log(e);
}
g_scriptReport = Object();
} }
catch (e) else g_scriptReport = Object();
{
conosle.log(e);
}
g_scriptReport = Object();
} }
else g_scriptReport = Object();
} }