Normalize callsigns for qrz.com-Links
This commit is contained in:
parent
5f5e3589ba
commit
b3981aac22
2 changed files with 14 additions and 3 deletions
|
@ -458,6 +458,17 @@ function copyToQSO(callsign) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNormalizedCallsign(callsign) {
|
||||||
|
retval = "";
|
||||||
|
for (i = 0; i < callsign.length; ++i) {
|
||||||
|
if (! /^[a-zA-Z0-9]+$/.test(callsign[i])) {
|
||||||
|
return retval;
|
||||||
|
} else {
|
||||||
|
retval += callsign[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getCallsign(logline) {
|
function getCallsign(logline) {
|
||||||
callsign = logline.substring(logline.indexOf("from") + 5, logline.indexOf("to")).trim();
|
callsign = logline.substring(logline.indexOf("from") + 5, logline.indexOf("to")).trim();
|
||||||
name = "";
|
name = "";
|
||||||
|
@ -469,9 +480,9 @@ function getCallsign(logline) {
|
||||||
}
|
}
|
||||||
if (qrz == 1 && isNaN(callsign) && !qrz_blacklist.includes(callsign)) {
|
if (qrz == 1 && isNaN(callsign) && !qrz_blacklist.includes(callsign)) {
|
||||||
if (name != "") {
|
if (name != "") {
|
||||||
return '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
|
return '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + getNormalizedCallsign(callsign) + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
|
||||||
} else {
|
} else {
|
||||||
return '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
|
return '<a target="_new" href="https://qrz.com/db/' + getNormalizedCallsign(callsign) + '">' + callsign + '</a>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (name != "") {
|
if (name != "") {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
var dashboard_version = "2021-04-25 18:14:30";
|
var dashboard_version = "2021-04-25 18:46:55";
|
||||||
|
|
Loading…
Reference in a new issue