Skip to content
Snippets Groups Projects
Commit 43fed63c authored by deuce's avatar deuce
Browse files

Add a matched property to the returned object indicating how much of the

callsign was used in the match.
parent 01176839
Branches
Tags
No related merge requests found
......@@ -918,16 +918,21 @@ var CallSign={
}
}
var match;
var matched;
if(ctydat.exact[callsign] != undefined) {
match = ctydat.exact[callsign];
matched=callsign;
}
for(var i=0; i<callsign.length && match==undefined; i++) {
if(ctydat.prefix[callsign.substr(0, i)]!=undefined)
if(ctydat.prefix[callsign.substr(0, i)]!=undefined) {
match=ctydat.prefix[callsign.substr(0, i)];
matched=callsign.substr(0, i);
}
}
if(match==undefined)
return match;
var ret={
matched:matched,
name:match.country.name,
cq:match.country.cq,
itu:match.country.itu,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment