Merge pull request #3001 from DH5DAX/master

Contest Logging Dupe Checking Bugfix/Improvement
这个提交包含在:
Peter Goodhall 2024-03-11 17:38:29 +00:00 提交者 GitHub
当前提交 35bf8854d0
找不到此签名对应的密钥
GPG 密钥 ID: B5690EEEBB952194
共有 2 个文件被更改,包括 20 次插入2 次删除

查看文件

@ -202,6 +202,8 @@ class Contesting extends CI_Controller {
$custom_date_format = $this->session->userdata('user_date_format'); $custom_date_format = $this->session->userdata('user_date_format');
$abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF)); $abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF));
echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before')); echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before'));
} else {
echo json_encode(array('message' => 'OKAY'));
} }
return; return;
} }

查看文件

@ -103,6 +103,11 @@ $(function () {
}); });
}); });
// checked if worked before after blur
$("#callsign").blur(function () {
checkIfWorkedBefore();
});
// Here we capture keystrokes to execute functions // Here we capture keystrokes to execute functions
document.onkeyup = function (e) { document.onkeyup = function (e) {
// ALT-W wipe // ALT-W wipe
@ -217,8 +222,8 @@ $("#callsign").keyup(function () {
highlight(call.toUpperCase()); highlight(call.toUpperCase());
} }
}); });
// moved to blur
checkIfWorkedBefore(); // checkIfWorkedBefore();
var qTable = $('.qsotable').DataTable(); var qTable = $('.qsotable').DataTable();
qTable.search(call).draw(); qTable.search(call).draw();
} }
@ -242,10 +247,21 @@ function checkIfWorkedBefore() {
}, },
success: function (result) { success: function (result) {
if (result.message.substr(0, 6) == 'Worked') { if (result.message.substr(0, 6) == 'Worked') {
$('#callsign_info').removeClass('text-bg-success');
$('#callsign_info').addClass('text-bg-danger');
$('#callsign_info').text(result.message); $('#callsign_info').text(result.message);
} }
else if (result.message == "OKAY") {
$('#callsign_info').removeClass('text-bg-danger');
$('#callsign_info').addClass('text-bg-success');
$('#callsign_info').text("Go Work Them!");
} else {
$('#callsign_info').text("");
}
} }
}); });
} else {
$('#callsign_info').text("");
} }
} }