Move searchdistance to POST parameters

这个提交包含在:
phl0 2023-08-29 23:38:24 +02:00
父节点 8929f17886
当前提交 a84aa06965
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 3 个文件被更改,包括 30 次插入6 次删除

查看文件

@ -917,7 +917,9 @@ class Logbook extends CI_Controller {
} }
/* return distance */ /* return distance */
function searchdistance($locator, $station_id = null) { function searchdistance() {
$locator = xss_clean($this->input->post('grid'));
$station_id = xss_clean($this->input->post('stationProfile'));
$this->load->library('Qra'); $this->load->library('Qra');
if($locator != null) { if($locator != null) {

查看文件

@ -153,8 +153,19 @@ function qso_edit(id) {
$('#locator').change(function(){ $('#locator').change(function(){
if ($(this).val().length >= 4) { if ($(this).val().length >= 4) {
$('#locator_info').load(base_url + "index.php/logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); $('#locator_info').load(base_url + "index.php/logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow");
$.get(base_url + 'index.php/logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { $.ajax({
document.getElementById("distance").value = result; url: base_url + 'index.php/logbook/searchdistance',
type: 'post',
data: {
grid: $(this).val(),
stationProfile: $('#stationProfile').val()
},
success: function(data) {
document.getElementById("distance").value = data;
},
error: function() {
document.getElementById("distance").value = 'Error calculating distance!';
},
}); });
} }
}); });

查看文件

@ -849,11 +849,22 @@ $("#locator").keyup(function(){
$('#locator_info').html(data).fadeIn("slow"); $('#locator_info').html(data).fadeIn("slow");
}, },
error: function() { error: function() {
$('#locator_info').text("Error loading bearing and distance").fadeIn("slow"); $('#locator_info').text("Error loading bearing!").fadeIn("slow");
}, },
}); });
$.get(base_url + 'index.php/logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { $.ajax({
document.getElementById("distance").value = result; url: base_url + 'index.php/logbook/searchdistance',
type: 'post',
data: {
grid: $(this).val(),
stationProfile: $('#stationProfile').val()
},
success: function(data) {
document.getElementById("distance").value = data;
},
error: function() {
document.getElementById("distance").value = 'Error calculating distance!';
},
}); });
} }
} }