added callook preference setting and lookup code. if checked,

US callsigns will always be queried from callook since it usually
has more data than free qrz.
This commit is contained in:
christian 2021-01-26 21:07:26 -05:00
parent e34823f87e
commit df796f481c
2 changed files with 38 additions and 2 deletions

View file

@ -1380,8 +1380,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<tr align="center" id="lookupCredentials" style="display: none">
<td>
Username<input id="lookupLogin" type="text" class="inputTextValue" size="8"
oninput="lookupValueChanged();" / > Password<input id="lookupPassword" type="password"
class="inputTextValue" size="8" oninput="lookupValueChanged();" / >
oninput="lookupValueChanged();" /> Password<input id="lookupPassword" type="password"
class="inputTextValue" size="8" oninput="lookupValueChanged();" />
</td>
<td>
<div class="button" onclick="GetSessionID(lookupQrzTestResult);">Test</div>
@ -1440,6 +1440,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</tr>
</table>
</div>
<div class="mapItem" id="lookupCallookPreferredDiv">
<table align="center">
<tr>
<td align="center">Use Callook before using other service</td>
</tr>
<tr align="center">
<td title="Use Callook before using other service. Free Callook yields more data than free QRZ.">
<input type="checkbox" id="lookupCallookPreferred" onclick="lookupValueChanged()" />
</td>
</tr>
</table>
</div>
<br />
<div id="callsignDatabaseDiv" class="mapItem">

View file

@ -14088,6 +14088,7 @@ function lookupValueChanged(what)
}
}
g_appSettings.lookupService = lookupService.value;
g_appSettings.lookupCallookPreferred = lookupCallookPreferred.value;
lookupQrzTestResult.innerHTML = "";
g_qrzLookupSessionId = null;
if (lookupService.value == "CALLOOK")
@ -14150,6 +14151,29 @@ function continueWithLookup(callsign, gridPass)
"lookupInfoDiv",
"Looking up <font color='cyan'>" + callsign + "</font>, please wait..."
);
if (g_appSettings.lookupCallookPreferred) {
var dxcc = callsignToDxcc(callsign);
var where;
var ccode = 0;
if (dxcc in g_dxccToAltName)
{
where = g_dxccToAltName[dxcc];
ccode = g_worldGeoData[g_dxccToGeoData[dxcc]].ccode;
}
else where = "Unknown";
if (ccode == 840)
{
getBuffer(
"https://callook.info/" + callsign + "/json",
callookResults,
gridPass,
"https",
443,
true
);
}
}
if (g_appSettings.lookupService != "CALLOOK")
{
g_qrzLookupCallsign = callsign;