Replace slashed zero for qrz.com etc. links

This commit is contained in:
phl0 2023-09-18 08:22:55 +02:00
parent 7669781424
commit e1ebbd8e16
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
2 changed files with 10 additions and 4 deletions

View File

@ -103,6 +103,7 @@ class Logbook extends CI_Controller {
// Convert - in Callsign to / Used for URL processing
$callsign = str_replace("-","/",$callsign);
$callsign = str_replace("Ø","0",$callsign);
// Check if callsign is an LoTW User
// Check Database for all other data

View File

@ -506,9 +506,10 @@ $("#callsign").focusout(function() {
var find_callsign = $(this).val().toUpperCase();
find_callsign.replace(/\//g, "-");
find_callsign.replace('Ø', '0');
// Replace / in a callsign with - to stop urls breaking
$.getJSON(base_url + 'index.php/logbook/json/' + find_callsign.replace(/\//g, "-") + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result)
$.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result)
{
// Make sure the typed callsign and json result match
@ -521,9 +522,12 @@ $("#callsign").focusout(function() {
$('#country').val(convert_case(result.dxcc.entity));
$('#callsign_info').text(convert_case(result.dxcc.entity));
var callsign = find_callsign.replace(/\//g, "-");
callsign = callsign.replace('Ø', '0');
if($("#sat_name" ).val() != "") {
//logbook/jsonlookupgrid/io77/SAT/0/0
$.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/SAT/0/0', function(result)
$.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign + '/SAT/0/0', function(result)
{
// Reset CSS values before updating
$('#callsign').removeClass("workedGrid");
@ -545,7 +549,7 @@ $("#callsign").focusout(function() {
}
})
} else {
$.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
$.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
{
// Reset CSS values before updating
$('#callsign').removeClass("confirmedGrid");
@ -940,11 +944,12 @@ $("#callsign").on("keypress", function(e) {
$("#callsign").keyup(function() {
if ($(this).val().length >= 3) {
$('.callsign-suggest').show();
$callsign = $(this).val().replace('Ø', '0');
$.ajax({
url: 'lookup/scp',
method: 'POST',
data: {
callsign: $(this).val().toUpperCase()
callsign: $callsign.toUpperCase()
},
success: function(result) {
$('.callsign-suggestions').text(result);