mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
move js to a dedicated file
This commit is contained in:
@@ -17,7 +17,6 @@ class Activators extends CI_Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Render Page
|
||||
$data['page_title'] = "Gridsquare Activators";
|
||||
|
||||
$this->load->model('Activators_model');
|
||||
@@ -36,9 +35,14 @@ class Activators extends CI_Controller
|
||||
$data['activators_vucc_array'] = $this->Activators_model->get_activators_vucc($band, $this->input->post('leogeo'));
|
||||
$data['bandselect'] = $band;
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/activators.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/activators.js")),
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('activators/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function details()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row" id="leogeo">
|
||||
<div class="mb-3 row" id="leogeo" style="display: none;">
|
||||
<label class="col-md-1 control-label" for="leogeo">LEO/GEO</label>
|
||||
<div class="col-md-3">
|
||||
<select id="leogeo" name="leogeo" class="form-select">
|
||||
|
||||
@@ -1981,75 +1981,7 @@ $(document).ready(function(){
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
<?php if ($this->uri->segment(1) == "activators") { ?>
|
||||
<script>
|
||||
$('.activatorstable').DataTable({
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
"scrollY": "500px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
"language": {
|
||||
url: getDataTablesLanguageUrl(),
|
||||
},
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'csv'
|
||||
]
|
||||
});
|
||||
|
||||
// change color of csv-button if dark mode is chosen
|
||||
if (isDarkModeTheme()) {
|
||||
$(".buttons-csv").css("color", "white");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#band').change(function()
|
||||
{
|
||||
if($(this).val() == "SAT")
|
||||
{
|
||||
$('#leogeo').show();
|
||||
} else {
|
||||
$('#leogeo').hide();
|
||||
}
|
||||
});
|
||||
<?php if ($this->input->post('band') != "SAT") { ?>
|
||||
$('#leogeo').hide();
|
||||
<?php } ?>
|
||||
});
|
||||
function displayActivatorsContacts(call, band, leogeo) {
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
$.ajax({
|
||||
url: baseURL + 'index.php/activators/details',
|
||||
type: 'post',
|
||||
data: {'Callsign': call,
|
||||
'Band': band,
|
||||
'LeoGeo': leogeo
|
||||
},
|
||||
success: function(html) {
|
||||
BootstrapDialog.show({
|
||||
title: lang_general_word_qso_data,
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: 'qso-was-dialog',
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function(dialog) {
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
},
|
||||
buttons: [{
|
||||
label: lang_admin_close,
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ($this->uri->segment(1) == "mode") { ?>
|
||||
<script src="<?php echo base_url(); ?>assets/js/sections/mode.js"></script>
|
||||
|
||||
62
assets/js/sections/activators.js
Normal file
62
assets/js/sections/activators.js
Normal file
@@ -0,0 +1,62 @@
|
||||
$(".activatorstable").DataTable({
|
||||
pageLength: 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
scrollY: "500px",
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
scrollX: true,
|
||||
language: {
|
||||
url: getDataTablesLanguageUrl(),
|
||||
},
|
||||
dom: "Bfrtip",
|
||||
buttons: ["csv"],
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
let bandselect = $('#band');
|
||||
|
||||
showHideLeoGeo(bandselect);
|
||||
bandselect.change(function () {
|
||||
showHideLeoGeo(bandselect);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function showHideLeoGeo(bandselect) {
|
||||
|
||||
if (bandselect.val() == "SAT") {
|
||||
$("#leogeo").show();
|
||||
} else {
|
||||
$("#leogeo").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function displayActivatorsContacts(call, band, leogeo) {
|
||||
$.ajax({
|
||||
url: base_url + "index.php/activators/details",
|
||||
type: "post",
|
||||
data: { Callsign: call, Band: band, LeoGeo: leogeo },
|
||||
success: function (html) {
|
||||
BootstrapDialog.show({
|
||||
title: lang_general_word_qso_data,
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: "qso-was-dialog",
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function (dialog) {
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
label: lang_admin_close,
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user