kopia lustrzana https://github.com/magicbug/Cloudlog
[OQRS] Fixed time formatting. Added datatable and submit with enter on search.
rodzic
0142209022
commit
041aa02b02
|
@ -22,6 +22,21 @@
|
||||||
<button onclick="searchOqrsGrouped();" class="btn btn-sm btn-primary" id="stationbuttonsubmit" type="button"><i class="fas fa-search"></i> Search</button>
|
<button onclick="searchOqrsGrouped();" class="btn btn-sm btn-primary" id="stationbuttonsubmit" type="button"><i class="fas fa-search"></i> Search</button>
|
||||||
</form>';
|
</form>';
|
||||||
echo '<div class="searchinfo"></div>';
|
echo '<div class="searchinfo"></div>';
|
||||||
|
?>
|
||||||
|
<script>// Get the input field
|
||||||
|
var input = document.getElementById("oqrssearch");
|
||||||
|
|
||||||
|
// Execute a function when the user presses a key on the keyboard
|
||||||
|
input.addEventListener("keypress", function(event) {
|
||||||
|
// If the user presses the "Enter" key on the keyboard
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
// Cancel the default action, if needed
|
||||||
|
event.preventDefault();
|
||||||
|
// Trigger the button element with a click
|
||||||
|
document.getElementById("stationbuttonsubmit").click();
|
||||||
|
}
|
||||||
|
});</script>
|
||||||
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo '<div class="resulttable">';
|
echo '<div class="resulttable">';
|
||||||
if ($stations->result() != NULL) { ?>
|
if ($stations->result() != NULL) { ?>
|
||||||
|
|
|
@ -49,6 +49,25 @@ function searchOqrsGrouped() {
|
||||||
data: {'callsign': $("#oqrssearch").val().toUpperCase()},
|
data: {'callsign': $("#oqrssearch").val().toUpperCase()},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$(".searchinfo").append(data);
|
$(".searchinfo").append(data);
|
||||||
|
$('.qsotime').change(function() {
|
||||||
|
var raw_time = $(this).val();
|
||||||
|
if(raw_time.match(/^\d\[0-6]d$/)) {
|
||||||
|
raw_time = "0"+raw_time;
|
||||||
|
}
|
||||||
|
if(raw_time.match(/^[012]\d[0-5]\d$/)) {
|
||||||
|
raw_time = raw_time.substring(0,2)+":"+raw_time.substring(2,4);
|
||||||
|
$(this).val(raw_time);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('.result-table').DataTable({
|
||||||
|
"pageLength": 25,
|
||||||
|
responsive: false,
|
||||||
|
ordering: false,
|
||||||
|
"scrollY": "410px",
|
||||||
|
"scrollCollapse": true,
|
||||||
|
"paging": false,
|
||||||
|
"scrollX": true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue