Merge remote-tracking branch 'upstream/dev' into passwords

This commit is contained in:
HB9HIL
2024-05-09 09:45:09 +02:00
21 changed files with 580 additions and 486 deletions

View File

@@ -201,6 +201,17 @@ class Logbookadvanced extends CI_Controller {
$this->load->view('adif/data/exportall', $data);
}
function export_to_adif_params() {
$this->load->model('logbookadvanced_model');
$postdata = $this->input->post();
$postdata['user_id'] = (int)$this->session->userdata('user_id');
$postdata['qsoresults'] = 'All';
$data['qsos'] = $this->logbookadvanced_model->getSearchResult($postdata);
$this->load->view('adif/data/exportall', $data);
}
function update_qsl() {
$this->load->model('logbookadvanced_model');
@@ -306,7 +317,7 @@ class Logbookadvanced extends CI_Controller {
'ids' => xss_clean($this->input->post('ids'))
);
$result = $this->logbookadvanced_model->searchDb($searchCriteria);
$result = $this->logbookadvanced_model->getSearchResultArray($searchCriteria);
$this->prepareMappedQSos($result);
}
@@ -347,7 +358,7 @@ class Logbookadvanced extends CI_Controller {
'qslimages' => xss_clean($this->input->post('qslimages')),
);
$result = $this->logbookadvanced_model->searchDb($searchCriteria);
$result = $this->logbookadvanced_model->getSearchResultArray($searchCriteria);
$this->prepareMappedQSos($result);
}

View File

@@ -208,7 +208,11 @@ class Logbookadvanced_model extends CI_Model {
$where = "AND $where";
}
$limit = $searchCriteria['qsoresults'];
$limit = '';
if ($searchCriteria['qsoresults'] != 'All') {
$limit = 'limit ' . $searchCriteria['qsoresults'];
}
$where2 = '';
@@ -222,7 +226,7 @@ class Logbookadvanced_model extends CI_Model {
}
$sql = "
SELECT *
SELECT *, dxcc_entities.name AS station_country
FROM " . $this->config->item('table_name') . " qsos
INNER JOIN station_profile ON qsos.station_id=station_profile.station_id
LEFT OUTER JOIN satellite ON qsos.COL_SAT_NAME = satellite.name
@@ -237,12 +241,19 @@ class Logbookadvanced_model extends CI_Model {
$where
$where2
ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
LIMIT $limit
$limit
";
$data = $this->db->query($sql, $binding);
return $this->db->query($sql, $binding);
$results = $data->result('array');
return $results;
}
public function getSearchResult($searchCriteria) {
return $this->searchDb($searchCriteria);
}
public function getSearchResultArray($searchCriteria) {
$result = $this->searchDb($searchCriteria);
return $result->result('array');
}
/*
@@ -250,7 +261,7 @@ class Logbookadvanced_model extends CI_Model {
* @return array
*/
public function searchQsos($searchCriteria) : array {
$results = $this->searchDb($searchCriteria);
$results = $this->getSearchResultArray($searchCriteria);
$qsos = [];
foreach ($results as $data) {

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="container gridsquare_map_form">
<br>
@@ -96,7 +96,7 @@
</div>
<div id="gridmapcontainer">
<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>
<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>:&nbsp;</div>

View File

@@ -1,21 +1,5 @@
<style>
.coordinates {
justify-content: center;
align-items: stretch;
}
.cohidden {
display:none;
}
#latDeg, #lngDeg {
width: 170px;
}
#locator, #distance, #bearing {
width: 120px;
}
</style>
<div class="container">
<div class="container gridsquare_map_form">
<!-- Award Info Box -->
<br>
<div id="awardInfoButton">
@@ -40,7 +24,7 @@
</div>
<div id="gridmapcontainer">
<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>
<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>: </div>

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="container gridsquare_map_form">
<!-- Award Info Box -->
<br>
<div id="awardInfoButton">
@@ -23,7 +23,7 @@
<div id="gridmapcontainer">
<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>
<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>: </div>

View File

@@ -66,7 +66,15 @@
<tr>
<td>PHP Version</td>
<td><?php echo phpversion(); ?></td>
<td>
<?php
if (version_compare(PHP_VERSION, '8.0.0') >= 0) {
echo phpversion()." <span class=\"badge text-bg-success\">OK</span>";
} else {
echo phpversion()." <span data-bs-toggle=\"tooltip\" title=\"Please update!\" class=\"badge text-bg-warning\">Deprecated</span>";
}
?>
</td>
</tr>
<tr>
@@ -587,4 +595,4 @@
<?php } else { ?>
var local_branch = 'n/a';
<?php } ?>
</script>
</script>

View File

@@ -1,4 +1,4 @@
<div class="container">
<div class="container gridsquare_map_form">
<br>
@@ -140,7 +140,7 @@
</div>
<div id="gridmapcontainer">
<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>
<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude') ?>:&nbsp;</div>

View File

@@ -1,67 +1,67 @@
<script type="text/javascript">
/*
*
* Define custom date format
*
*/
var custom_date_format = "<?php echo $custom_date_format ?>";
var lang_gen_hamradio_latitude = '<?php echo lang('gen_hamradio_latitude'); ?>';
var lang_gen_hamradio_longitude = '<?php echo lang('gen_hamradio_longitude'); ?>';
var lang_gen_hamradio_gridsquare = '<?php echo lang('gen_hamradio_gridsquare'); ?>';
var lang_gen_hamradio_distance = '<?php echo lang('gen_hamradio_distance'); ?>';
var lang_gen_hamradio_bearing = '<?php echo lang('gen_hamradio_bearing'); ?>';
<?php
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
if (!isset($options)) {
$options = "{\"datetime\":{\"show\":\"true\"},\"de\":{\"show\":\"true\"},\"dx\":{\"show\":\"true\"},\"mode\":{\"show\":\"true\"},\"rstr\":{\"show\":\"true\"},\"rsts\":{\"show\":\"true\"},\"band\":{\"show\":\"true\"},\"myrefs\":{\"show\":\"true\"},\"refs\":{\"show\":\"true\"},\"name\":{\"show\":\"true\"},\"qslvia\":{\"show\":\"true\"},\"qsl\":{\"show\":\"true\"},\"lotw\":{\"show\":\"true\"},\"eqsl\":{\"show\":\"true\"},\"qslmsg\":{\"show\":\"true\"},\"dxcc\":{\"show\":\"true\"},\"state\":{\"show\":\"true\"},\"cqzone\":{\"show\":\"true\"},\"ituzone\":{\"show\":\"true\"},\"iota\":{\"show\":\"true\"},\"pota\":{\"show\":\"true\"},\"operator\":{\"show\":\"true\"},\"comment\":{\"show\":\"true\"}}";
}
$current_opts=json_decode($options);
echo "var user_options = $options;";
if (!isset($current_opts->pota)) {
echo "\nvar o_template = { pota: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->operator)) {
echo "\nvar o_template = { operator: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->comment)) {
echo "\nvar o_template = { comment: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->ituzone)) {
echo "\nvar o_template = { ituzone: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
/*
*
* Define custom date format
*
*/
var custom_date_format = "<?php echo $custom_date_format ?>";
var lang_gen_hamradio_latitude = '<?php echo lang('gen_hamradio_latitude'); ?>';
var lang_gen_hamradio_longitude = '<?php echo lang('gen_hamradio_longitude'); ?>';
var lang_gen_hamradio_gridsquare = '<?php echo lang('gen_hamradio_gridsquare'); ?>';
var lang_gen_hamradio_distance = '<?php echo lang('gen_hamradio_distance'); ?>';
var lang_gen_hamradio_bearing = '<?php echo lang('gen_hamradio_bearing'); ?>';
<?php
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
if (!isset($options)) {
$options = "{\"datetime\":{\"show\":\"true\"},\"de\":{\"show\":\"true\"},\"dx\":{\"show\":\"true\"},\"mode\":{\"show\":\"true\"},\"rstr\":{\"show\":\"true\"},\"rsts\":{\"show\":\"true\"},\"band\":{\"show\":\"true\"},\"myrefs\":{\"show\":\"true\"},\"refs\":{\"show\":\"true\"},\"name\":{\"show\":\"true\"},\"qslvia\":{\"show\":\"true\"},\"qsl\":{\"show\":\"true\"},\"lotw\":{\"show\":\"true\"},\"eqsl\":{\"show\":\"true\"},\"qslmsg\":{\"show\":\"true\"},\"dxcc\":{\"show\":\"true\"},\"state\":{\"show\":\"true\"},\"cqzone\":{\"show\":\"true\"},\"ituzone\":{\"show\":\"true\"},\"iota\":{\"show\":\"true\"},\"pota\":{\"show\":\"true\"},\"operator\":{\"show\":\"true\"},\"comment\":{\"show\":\"true\"}}";
}
$current_opts = json_decode($options);
echo "var user_options = $options;";
if (!isset($current_opts->pota)) {
echo "\nvar o_template = { pota: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->operator)) {
echo "\nvar o_template = { operator: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->comment)) {
echo "\nvar o_template = { comment: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->ituzone)) {
echo "\nvar o_template = { ituzone: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
foreach ($mapoptions as $mo) {
if ($mo != null) {
echo "var " . $mo->option_name . "=" . $mo->option_value . ";";
}
}
?>
var tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"
foreach ($mapoptions as $mo) {
if ($mo != null) {
echo "var " . $mo->option_name . "=" . $mo->option_value . ";";
}
}
?>
var tileUrl = "<?php echo $this->optionslib->get_option('option_map_tile_server'); ?>"
</script>
<style>
.row>[class*="col-"] {
padding-right: 5px;
padding-left: 5px;
}
.row>[class*="col-"] {
padding-right: 5px;
padding-left: 5px;
}
</style>
<?php
$options = json_decode($options);
?>
<div class="container-fluid qso_manager pt-3 ps-4 pe-4">
<?php if ($this->session->flashdata('message')) { ?>
<!-- Display Message -->
<div class="alert-message error">
<p><?php echo $this->session->flashdata('message'); ?></p>
</div>
<?php } ?>
<div class="row">
<div id="lba_div">
<div class="container-fluid qso_manager pt-3 ps-4 pe-4">
<?php if ($this->session->flashdata('message')) { ?>
<!-- Display Message -->
<div class="alert-message error">
<p><?php echo $this->session->flashdata('message'); ?></p>
</div>
<?php } ?>
<div class="row">
<form id="searchForm" name="searchForm" action="<?php echo base_url()."index.php/logbookadvanced/search";?>"
method="post">
<form id="searchForm" name="searchForm" action="<?php echo base_url()."index.php/logbookadvanced/search";?>" method="post">
<input type="hidden" id="dupes" name="dupes" value="">
<div class="filterbody collapse">
<div class="row">
@@ -112,8 +112,7 @@ $options = json_decode($options);
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="gridsquare"><?php echo lang('gen_hamradio_gridsquare'); ?></label>
<input type="text" name="gridsquare" id="gridsquare" class="form-control form-control-sm"
value="">
<input type="text" name="gridsquare" id="gridsquare" class="form-control form-control-sm" value="">
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="mode"><?php echo lang('gen_hamradio_mode'); ?></label>
@@ -139,7 +138,7 @@ $options = json_decode($options);
</div>
<div hidden class="sats_dropdown mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="sats"><?php echo lang('general_word_satellite'); ?></label>
<select class="form-select form-select-sm" id="sats">
<select class="form-select form-select-sm" id="sats" name="sats">
<option value="All"><?php echo lang('general_word_all'); ?></option>
<?php foreach($sats as $sat) {
echo '<option value="' . htmlentities($sat) . '"' . '>' . htmlentities($sat) . '</option>'."\n";
@@ -148,7 +147,7 @@ $options = json_decode($options);
</div>
<div hidden class="orbits_dropdown mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="orbits"><?php echo lang('general_word_orbit'); ?></label>
<select class="form-select form-select-sm" id="orbits">
<select class="form-select form-select-sm" id="orbits" name="orbits">
<option value="All"><?php echo lang('general_word_all'); ?></option>
<?php foreach($orbits as $orbit) {
echo '<option value="' . htmlentities($orbit) . '"' . '>' . htmlentities($orbit) . '</option>'."\n";
@@ -157,7 +156,7 @@ $options = json_decode($options);
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="selectPropagation"><?php echo lang('filter_general_propagation'); ?></label>
<select id="selectPropagation" name="selectPropagation" class="form-select form-select-sm">
<select id="selectPropagation" class="form-select form-select-sm" name="propmode">
<option value=""><?php echo lang('general_word_all'); ?></option>
<option value="AS">Aircraft Scatter</option>
<option value="AUR">Aurora</option>
@@ -310,7 +309,7 @@ $options = json_decode($options);
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qslvia"><?php echo lang('filter_qsl_via'); ?></label>
<input type="search" name="qslviainput" class="form-control form-control-sm">
<input type="search" name="qslvia" class="form-control form-control-sm">
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qslimages"><?php echo lang('filter_qsl_images'); ?></label>
@@ -392,16 +391,16 @@ $options = json_decode($options);
</div>
<div class="row pt-2">
<div class="mb-3 d-flex align-items-center col-lg d-flex flex-row justify-content-center align-items-center">
<button type="button" class="btn btn-sm btn-primary me-1" data-bs-toggle="collapse"
<button type="button" class="btn btn-sm btn-primary me-1 lba_buttons" data-bs-toggle="collapse"
data-bs-target=".quickfilterbody"><?php echo lang('filter_quickfilters'); ?></button>
<button type="button" class="btn btn-sm btn-primary me-1" data-bs-toggle="collapse"
<button type="button" class="btn btn-sm btn-primary me-1 lba_buttons" data-bs-toggle="collapse"
data-bs-target=".qslfilterbody"><?php echo lang('filter_qsl_filters'); ?></button>
<button type="button" class="btn btn-sm btn-primary me-1" data-bs-toggle="collapse"
<button type="button" class="btn btn-sm btn-primary me-1 lba_buttons" data-bs-toggle="collapse"
data-bs-target=".filterbody"><?php echo lang('filter_filters'); ?></button>
<button type="button" class="btn btn-sm btn-primary me-1" data-bs-toggle="collapse"
<button type="button" class="btn btn-sm btn-primary me-1 lba_buttons" data-bs-toggle="collapse"
data-bs-target=".actionbody"><?php echo lang('filter_actions'); ?></button>
<label for="qsoResults" class="me-2"><?php echo lang('filter_results'); ?></label>
<select id="qsoResults" name="qsoResults" class="form-select form-select-sm me-2 w-auto">
<select id="qsoResults" name="qsoresults" class="form-select form-select-sm me-2 w-auto">
<option value="250">250</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
@@ -434,87 +433,88 @@ $options = json_decode($options);
<button type="options" class="btn btn-sm btn-primary me-1" id="optionButton"><?php echo lang('filter_options'); ?></button>
<button type="reset" class="btn btn-sm btn-danger me-1" id="resetButton"><?php echo lang('filter_reset'); ?></button>
</div>
</div>
</form>
<table style="width:100%" class="table-sm table table-bordered table-hover table-striped table-condensed text-center" id="qsoList">
<thead>
<tr>
<th>
<div class="form-check" style="margin-top: -1.5em"><input class="form-check-input" type="checkbox" id="checkBoxAll" /></div>
</th>
<?php if (($options->datetime->show ?? "true") == "true") {
echo '<th>' . lang('general_word_datetime') . '</th>';
} ?>
<?php if (($options->de->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_de') . '</th>';
} ?>
<?php if (($options->dx->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_dx') . '</th>';
} ?>
<?php if (($options->mode->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_mode') . '</th>';
} ?>
<?php if (($options->rsts->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_rsts') . '</th>';
} ?>
<?php if (($options->rstr->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_rstr') . '</th>';
} ?>
<?php if (($options->band->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_band') . '</th>';
} ?>
<?php if (($options->myrefs->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_myrefs') . '</th>';
} ?>
<?php if (($options->refs->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_refs') . '</th>';
} ?>
<?php if (($options->name->show ?? "true") == "true") {
echo '<th>' . lang('general_word_name') . '</th>';
} ?>
<?php if (($options->qslvia->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qslvia') . '</th>';
} ?>
<?php if (($options->qsl->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qsl') . '</th>';
} ?>
<?php if ($this->session->userdata('user_eqsl_name') != "" && ($options->eqsl->show ?? "true") == "true") {
echo '<th class="eqslconfirmation">eQSL</th>';
} ?>
<?php if ($this->session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true") {
echo '<th class="lotwconfirmation">LoTW</th>';
} ?>
<?php if (($options->qslmsg->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qslmsg') . '</th>';
} ?>
<?php if (($options->dxcc->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_dxcc') . '</th>';
} ?>
<?php if (($options->state->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_state') . '</th>';
} ?>
<?php if (($options->cqzone->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_cq_zone') . '</th>';
} ?>
<?php if (($options->ituzone->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_itu_zone') . '</th>';
} ?>
<?php if (($options->iota->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_iota') . '</th>';
} ?>
<?php if (($options->pota->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_pota') . '</th>';
} ?>
<?php if (($options->operator->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_operator') . '</th>';
} ?>
<?php if (($options->comment->show ?? "true") == "true") {
echo '<th>' . lang('general_word_comment') . '</th>';
} ?>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</form>
<table style="width:100%" class="table-sm table table-bordered table-hover table-striped table-condensed text-center" id="qsoList">
<thead>
<tr>
<th>
<div class="form-check" style="margin-top: -1.5em"><input class="form-check-input" type="checkbox" id="checkBoxAll" /></div>
</th>
<?php if (($options->datetime->show ?? "true") == "true") {
echo '<th>' . lang('general_word_datetime') . '</th>';
} ?>
<?php if (($options->de->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_de') . '</th>';
} ?>
<?php if (($options->dx->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_dx') . '</th>';
} ?>
<?php if (($options->mode->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_mode') . '</th>';
} ?>
<?php if (($options->rsts->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_rsts') . '</th>';
} ?>
<?php if (($options->rstr->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_rstr') . '</th>';
} ?>
<?php if (($options->band->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_band') . '</th>';
} ?>
<?php if (($options->myrefs->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_myrefs') . '</th>';
} ?>
<?php if (($options->refs->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_refs') . '</th>';
} ?>
<?php if (($options->name->show ?? "true") == "true") {
echo '<th>' . lang('general_word_name') . '</th>';
} ?>
<?php if (($options->qslvia->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qslvia') . '</th>';
} ?>
<?php if (($options->qsl->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qsl') . '</th>';
} ?>
<?php if ($this->session->userdata('user_eqsl_name') != "" && ($options->eqsl->show ?? "true") == "true"){
echo '<th class="eqslconfirmation">eQSL</th>';
} ?>
<?php if ($this->session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true"){
echo '<th class="lotwconfirmation">LoTW</th>';
} ?>
<?php if (($options->qslmsg->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_qslmsg') . '</th>';
} ?>
<?php if (($options->dxcc->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_dxcc') . '</th>';
} ?>
<?php if (($options->state->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_state') . '</th>';
} ?>
<?php if (($options->cqzone->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_cq_zone') . '</th>';
} ?>
<?php if (($options->ituzone->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_itu_zone') . '</th>';
} ?>
<?php if (($options->iota->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_iota') . '</th>';
} ?>
<?php if (($options->pota->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_pota') . '</th>';
} ?>
<?php if (($options->operator->show ?? "true") == "true") {
echo '<th>' . lang('gen_hamradio_operator') . '</th>';
} ?>
<?php if (($options->comment->show ?? "true") == "true") {
echo '<th>' . lang('general_word_comment') . '</th>';
} ?>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>

View File

@@ -59,6 +59,32 @@
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.MaidenheadColoured.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/sections/gridmap.js?"></script>
<script>
// auto setting of gridmap height
function set_map_height() {
//header menu
var headerNavHeight = $('nav').outerHeight();
// console.log('nav: ' + headerNavHeight);
// line with coordinates
// var coordinatesHeight = $('.coordinates').outerHeight();
// console.log('.coordinates: ' + coordinatesHeight);
// form for gridsquare map
var gridsquareFormHeight = $('.gridsquare_map_form').outerHeight();
// console.log('.gridsquare_map_form: ' + gridsquareFormHeight);
// calculate correct map height
var gridsquareMapHeight = window.innerHeight - headerNavHeight - gridsquareFormHeight - 8;
// and set it
$('#gridsquare_map').css('height', gridsquareMapHeight + 'px');
// console.log('#gridsquare_map: ' + gridsquareMapHeight);
}
</script>
<script>
var layer = L.tileLayer('<?php echo $this->optionslib->get_option('option_map_tile_server');?>', {

View File

@@ -65,11 +65,6 @@
height: 500px !important;
}
#gridsquare_map {
height: calc(100vh - 380px) !important;
max-height: 900px !important;
}
@media (min-width: 992px) {
.modal-lg, .modal-xl {
max-width: 1300px;

View File

@@ -223,11 +223,6 @@ path.grid-worked {
height: 500px !important;
}
#gridsquare_map {
height: calc(100vh - 380px) !important;
max-height: 900px !important;
}
#mapqso {
height: 400px !important;
}

View File

@@ -241,11 +241,6 @@ div.alert-danger {
height: 500px !important;
}
#gridsquare_map {
height: calc(100vh - 380px) !important;
max-height: 900px !important;
}
#mapqso {
height: 400px !important;
}

View File

@@ -65,11 +65,6 @@ thead > tr > td {
height: 500px !important;
}
#gridsquare_map {
height: calc(100vh - 380px) !important;
max-height: 900px !important;
}
@media (min-width: 992px) {
.modal-lg, .modal-xl {
max-width: 1300px;

View File

@@ -666,11 +666,6 @@ div#station_logbooks_linked_table_paginate {
margin-bottom: 0px;
}
#advancedmap {
height: calc(100vh - 280px) !important;
max-height: 1000px !important;
}
.lotw-cert-list table {
margin-bottom: 0px;
}
@@ -840,9 +835,14 @@ label {
}
.coordinates {
justify-content: center;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
justify-content: center;
align-items: stretch;
}
.cohidden {
display:none;
}

View File

@@ -87,11 +87,6 @@ path.grid-worked {
height: 400px !important;
}
#gridsquare_map {
height: calc(100vh - 380px) !important;
max-height: 900px !important;
}
/*
* Dark Navigation
*/

View File

@@ -929,6 +929,28 @@ $(document).ready(function() {
}
});
// auto setting of gridmap height
function set_map_height() {
//header menu
var headerNavHeight = $('nav').outerHeight();
// console.log('nav: ' + headerNavHeight);
// line with coordinates
var coordinatesHeight = $('.coordinates').outerHeight();
// console.log('.coordinates: ' + coordinatesHeight);
// form for gridsquare map
var gridsquareFormHeight = $('.gridsquare_map_form').outerHeight();
// console.log('.gridsquare_map_form: ' + gridsquareFormHeight);
// calculate correct map height
var gridsquareMapHeight = window.innerHeight - headerNavHeight - coordinatesHeight - gridsquareFormHeight;
// and set it
$('#gridsquare_map').css('height', gridsquareMapHeight + 'px');
// console.log('#gridsquare_map: ' + gridsquareMapHeight);
}
console.log("Ready to unleash your coding prowess and join the fun?\n\n" +
"Check out our GitHub Repository and dive into the coding adventure:\n\n" +

View File

@@ -13,7 +13,8 @@ function gridPlot(form) {
if(container != null){
container._leaflet_id = null;
container.remove();
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>');
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>');
set_map_height();
}
ajax_url = site_url + '/awards/getFfmaGridsjs';
@@ -23,6 +24,7 @@ function gridPlot(form) {
type: 'get',
success: function (data) {
$('.cohidden').show();
set_map_height();
$(".ld-ext-right-plot").removeClass('running');
$(".ld-ext-right-plot").prop('disabled', false);
$('#plot').prop("disabled", false);
@@ -145,5 +147,8 @@ function spawnGridsquareModal(loc_4char) {
}
$(document).ready(function(){
gridPlot(this.form);
gridPlot(this.form);
$(window).resize(function () {
set_map_height();
});
})

View File

@@ -39,7 +39,8 @@ function gridPlot(form, visitor=true) {
if(container != null){
container._leaflet_id = null;
container.remove();
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>');
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>');
set_map_height();
}
if (typeof type == 'undefined') { type=''; }
@@ -68,6 +69,7 @@ function gridPlot(form, visitor=true) {
},
success: function (data) {
$('.cohidden').show();
set_map_height();
$(".ld-ext-right-plot").removeClass('running');
$(".ld-ext-right-plot").prop('disabled', false);
$('#plot').prop("disabled", false);
@@ -219,5 +221,8 @@ function clearMarkers() {
}
$(document).ready(function(){
gridPlot(this.form, visitor);
gridPlot(this.form, visitor);
$(window).resize(function () {
set_map_height();
});
})

View File

@@ -13,7 +13,8 @@ function gridPlot(form, dxcc) {
if(container != null){
container._leaflet_id = null;
container.remove();
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%; height: 800px"></div>');
$("#gridmapcontainer").append('<div id="gridsquare_map" class="map-leaflet" style="width: 100%;"></div>');
set_map_height();
}
ajax_url = site_url + '/awards/getGridmasterGridsjs/'+dxcc;
@@ -27,6 +28,7 @@ function gridPlot(form, dxcc) {
success: function (data) {
$('.cohidden').show();
set_map_height();
$(".ld-ext-right-plot").removeClass('running');
$(".ld-ext-right-plot").prop('disabled', false);
$('#plot').prop("disabled", false);
@@ -151,5 +153,8 @@ function spawnGridsquareModal(loc_4char) {
}
$(document).ready(function(){
gridPlot(this.form, dxcc);
gridPlot(this.form, dxcc);
$(window).resize(function () {
set_map_height();
});
})

View File

@@ -294,10 +294,10 @@ $(document).ready(function () {
iota: this.iota.value,
operator: this.operator.value,
dxcc: this.dxcc.value,
propmode: this.selectPropagation.value,
propmode: this.propmode.value,
gridsquare: this.gridsquare.value,
state: this.state.value,
qsoresults: this.qsoResults.value,
qsoresults: this.qsoresults.value,
sats: this.sats.value,
orbits: this.orbits.value,
cqzone: this.cqzone.value,
@@ -306,7 +306,7 @@ $(document).ready(function () {
lotwReceived: this.lotwReceived.value,
eqslSent: this.eqslSent.value,
eqslReceived: this.eqslReceived.value,
qslvia: $('[name="qslviainput"]').val(),
qslvia: $('[name="qslvia"]').val(),
sota: this.sota.value,
pota: this.pota.value,
wwff: this.wwff.value,
@@ -421,10 +421,7 @@ $(document).ready(function () {
$('#exportAdif').click(function (event) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
$('#exportAdif').prop("disabled", true);
var id_list=[];
elements.each(function() {
@@ -432,26 +429,39 @@ $(document).ready(function () {
id_list.push(id);
unselectQsoID(id);
});
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
var a;
if (xhttp.readyState === 4 && xhttp.status === 200) {
// Trick for making downloadable link
a = document.createElement('a');
a.href = window.URL.createObjectURL(xhttp.response);
// Give filename you wish to download
a.download = "logbook_export.adi";
a.style.display = 'none';
document.body.appendChild(a);
a.click();
}
};
// Post data to URL which handles post request
xhttp.open("POST", site_url+'/logbookadvanced/export_to_adif', true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// You should set responseType as blob for binary responses
xhttp.responseType = 'blob';
xhttp.send("id=" + JSON.stringify(id_list, null, 2)+"&sortorder=" +$('.table').DataTable().order());
xhttp.onreadystatechange = function() {
var a;
if (xhttp.readyState === 4 && xhttp.status === 200) {
// Trick for making downloadable link
a = document.createElement('a');
a.href = window.URL.createObjectURL(xhttp.response);
// Give filename you wish to download
a.download = "logbook_export.adi";
a.style.display = 'none';
document.body.appendChild(a);
a.click();
}
};
if (id_list.length > 0) {
// Post data to URL which handles post request
xhttp.open("POST", site_url+'/logbookadvanced/export_to_adif', true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// You should set responseType as blob for binary responses
xhttp.responseType = 'blob';
xhttp.send("id=" + JSON.stringify(id_list, null, 2)+"&sortorder=" +$('.table').DataTable().order());
} else {
// Post data to URL which handles post request
xhttp.open("POST", site_url+'/logbookadvanced/export_to_adif_params', true);
xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
// You should set responseType as blob for binary responses
xhttp.responseType = 'blob';
xhttp.send($('#searchForm').serialize());
}
$('#exportAdif').prop("disabled", false);
});

View File

@@ -273,8 +273,8 @@ function loadMap(data, iconsList) {
container._leaflet_id = null;
container.remove();
$(".coordinates").remove();
$(".qso_manager").append('<div id="advancedmap" class="map-leaflet"></div>');
$(".qso_manager").append('<div class="coordinates d-flex">' +
$("#lba_div").append('<div id="advancedmap" class="map-leaflet"></div>');
$("#lba_div").append('<div class="coordinates d-flex">' +
'<div class="cohidden">' + lang_gen_hamradio_latitude + '&nbsp;</div>' +
'<div class="cohidden col-auto text-success fw-bold" id="latDeg"></div>' +
'<div class="cohidden">' + lang_gen_hamradio_longitude + '&nbsp;</div>' +
@@ -287,6 +287,7 @@ function loadMap(data, iconsList) {
'<div class="cohidden col-auto text-success fw-bold" id="bearing"></div>' +
'</div>');
$('.cohidden').show();
set_advancedmap_height();
}
map = new L.Map('advancedmap', {
@@ -435,204 +436,204 @@ function loadMap(data, iconsList) {
}
}
function createContentMessage(qso) {
var table = '<table><tbody>' +
'<tr>' +
'<td>' +
'Station callsign: ' + qso.mycallsign +
"</td></tr>" +
'<tr>' +
'<td>' +
'Gridsquare: ' + qso.mygridsquare +
"</td></tr>";
return (table += "</tbody></table>");
}
function createContentMessage(qso) {
var table = '<table><tbody>' +
'<tr>' +
'<td>' +
'Station callsign: ' + qso.mycallsign +
"</td></tr>" +
'<tr>' +
'<td>' +
'Gridsquare: ' + qso.mygridsquare +
"</td></tr>";
return (table += "</tbody></table>");
}
function createContentMessageDx(qso) {
var table = '<table><tbody>' +
'<tr>' +
'<td>Callsign</td>' +
'<td>' + qso.callsign + '</td>' +
'</tr>' +
'<tr>' +
'<td>Date/time</td>' +
'<td>' + qso.datetime + '</td>' +
function createContentMessageDx(qso) {
var table = '<table><tbody>' +
'<tr>' +
'<td>Callsign</td>' +
'<td>' + qso.callsign + '</td>' +
'</tr>' +
'<tr>' +
'<td>Date/time</td>' +
'<td>' + qso.datetime + '</td>' +
'</tr>' +
'<tr>';
if (qso.satname != "") {
table += '<td>Band</td>' +
'<td>SAT ' + qso.satname
if (qso.orbit != "") {
table += ' (' + qso.orbit + ') '
}
table += '</td>' +
'</tr>' +
'<tr>';
if (qso.satname != "") {
table += '<td>Band</td>' +
'<td>SAT ' + qso.satname
if (qso.orbit != "") {
table += ' (' + qso.orbit + ') '
} else {
table += '<td>Band</td>' +
'<td>' + qso.band + '</td>' +
'</tr>' +
'<tr>';
}
table += '<td>Mode</td>' +
'<td>' + qso.mode + '</td>' +
'</tr>' +
'<tr>';
if (qso.gridsquare != undefined) {
table += '<td>Gridsquare</td>' +
'<td>' + qso.gridsquare + '</td>' +
'</tr>';
}
if (qso.distance != undefined) {
table += '<td>Distance</td>' +
'<td>' + qso.distance + '</td>' +
'</tr>';
}
if (qso.bearing != undefined) {
table += '<td>Bearing</td>' +
'<td>' + qso.bearing + '</td>' +
'</tr>';
}
return (table += '</tbody></table>');
}
function loadMapOptions(data) {
$.ajax({
url: base_url + 'index.php/user_options/get_map_custom',
type: 'GET',
dataType: 'json',
error: function () {
},
success: function (json_mapinfo) {
if (typeof json_mapinfo.qso !== "undefined") {
iconsList = json_mapinfo;
}
table += '</td>' +
'</tr>' +
'<tr>';
} else {
table += '<td>Band</td>' +
'<td>' + qso.band + '</td>' +
'</tr>' +
'<tr>';
loadMap(data, iconsList)
}
table += '<td>Mode</td>' +
'<td>' + qso.mode + '</td>' +
'</tr>' +
'<tr>';
if (qso.gridsquare != undefined) {
table += '<td>Gridsquare</td>' +
'<td>' + qso.gridsquare + '</td>' +
'</tr>';
}
if (qso.distance != undefined) {
table += '<td>Distance</td>' +
'<td>' + qso.distance + '</td>' +
'</tr>';
}
if (qso.bearing != undefined) {
table += '<td>Bearing</td>' +
'<td>' + qso.bearing + '</td>' +
'</tr>';
}
return (table += '</tbody></table>');
});
}
function mapQsos(form) {
$('#mapButton').prop("disabled", true).addClass("running");
var id_list=[];
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
unselectQsoID(id);
});
$("#qsoList").attr("Hidden", true);
$("#qsoList_wrapper").attr("Hidden", true);
$("#qsoList_info").attr("Hidden", true);
amap = $('#advancedmap').val();
if (amap == undefined) {
$("#lba_div").append('<div id="advancedmap" class="map-leaflet"></div>');
}
function loadMapOptions(data) {
if (id_list.length > 0) {
$.ajax({
url: base_url + 'index.php/logbookadvanced/mapSelectedQsos',
type: 'post',
data: {
ids: id_list,
de: form.de.value
},
success: function(data) {
loadMapOptions(data);
},
error: function() {
$('#mapButton').prop("disabled", false).removeClass("running");
},
});
} else {
$.ajax({
url: base_url + 'index.php/logbookadvanced/mapQsos',
type: 'post',
data: {
dateFrom: form.dateFrom.value,
dateTo: form.dateTo.value,
de: form.de.value,
dx: form.dx.value,
mode: form.mode.value,
band: form.band.value,
qslSent: form.qslSent.value,
qslReceived: form.qslReceived.value,
qslSentMethod: this.qslSentMethod.value,
qslReceivedMethod: this.qslReceivedMethod.value,
iota: form.iota.value,
dxcc: form.dxcc.value,
propmode: form.propmode.value,
gridsquare: form.gridsquare.value,
state: form.state.value,
qsoresults: form.qsoresults.value,
sats: form.sats.value,
orbits: form.orbits.value,
cqzone: form.cqzone.value,
lotwSent: form.lotwSent.value,
lotwReceived: form.lotwReceived.value,
eqslSent: form.eqslSent.value,
eqslReceived: form.eqslReceived.value,
qslvia: $('[name="qslvia"]').val(),
sota: form.sota.value,
pota: form.pota.value,
operator: form.operator.value,
wwff: form.wwff.value,
qslimages: form.qslimages.value,
},
success: function(data) {
loadMapOptions(data);
},
error: function() {
$('#mapButton').prop("disabled", false).removeClass("running");
},
});
}
};
function mapGlobeQsos(form) {
var container = L.DomUtil.get('advancedmap');
if(container != null){
container._leaflet_id = null;
container.remove();
$(".coordinates").remove();
}
var id_list=[];
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
unselectQsoID(id);
});
$("#qsoList").attr("Hidden", true);
$("#qsoList_wrapper").attr("Hidden", true);
$("#qsoList_info").attr("Hidden", true);
amap = $('#advancedmap').val();
if (amap == undefined) {
$("#lba_div").append('<div id="advancedmap" class="map-leaflet"></div>');
}
if (id_list.length > 0) {
$.ajax({
url: base_url + 'index.php/user_options/get_map_custom',
type: 'GET',
dataType: 'json',
error: function () {
},
success: function (json_mapinfo) {
if (typeof json_mapinfo.qso !== "undefined") {
iconsList = json_mapinfo;
}
loadMap(data, iconsList)
}
});
}
function mapQsos(form) {
$('#mapButton').prop("disabled", true).addClass("running");
var id_list=[];
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
unselectQsoID(id);
});
$("#qsoList").attr("Hidden", true);
$("#qsoList_wrapper").attr("Hidden", true);
$("#qsoList_info").attr("Hidden", true);
amap = $('#advancedmap').val();
if (amap == undefined) {
$(".qso_manager").append('<div id="advancedmap" class="map-leaflet"></div>');
}
if (id_list.length > 0) {
$.ajax({
url: base_url + 'index.php/logbookadvanced/mapSelectedQsos',
type: 'post',
data: {
ids: id_list,
de: form.de.value
},
success: function(data) {
loadMapOptions(data);
},
error: function() {
$('#mapButton').prop("disabled", false).removeClass("running");
},
});
} else {
$.ajax({
url: base_url + 'index.php/logbookadvanced/mapQsos',
type: 'post',
data: {
dateFrom: form.dateFrom.value,
dateTo: form.dateTo.value,
de: form.de.value,
dx: form.dx.value,
mode: form.mode.value,
band: form.band.value,
qslSent: form.qslSent.value,
qslReceived: form.qslReceived.value,
qslSentMethod: this.qslSentMethod.value,
qslReceivedMethod: this.qslReceivedMethod.value,
iota: form.iota.value,
dxcc: form.dxcc.value,
propmode: form.selectPropagation.value,
gridsquare: form.gridsquare.value,
state: form.state.value,
qsoresults: form.qsoResults.value,
sats: form.sats.value,
orbits: form.orbits.value,
cqzone: form.cqzone.value,
lotwSent: form.lotwSent.value,
lotwReceived: form.lotwReceived.value,
eqslSent: form.eqslSent.value,
eqslReceived: form.eqslReceived.value,
qslvia: $('[name="qslviainput"]').val(),
sota: form.sota.value,
pota: form.pota.value,
operator: form.operator.value,
wwff: form.wwff.value,
qslimages: form.qslimages.value,
},
success: function(data) {
loadMapOptions(data);
},
error: function() {
$('#mapButton').prop("disabled", false).removeClass("running");
},
});
}
};
function mapGlobeQsos(form) {
var container = L.DomUtil.get('advancedmap');
if(container != null){
container._leaflet_id = null;
container.remove();
$(".coordinates").remove();
}
var id_list=[];
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
unselectQsoID(id);
});
$("#qsoList").attr("Hidden", true);
$("#qsoList_wrapper").attr("Hidden", true);
$("#qsoList_info").attr("Hidden", true);
amap = $('#advancedmap').val();
if (amap == undefined) {
$(".qso_manager").append('<div id="advancedmap" class="map-leaflet"></div>');
}
if (id_list.length > 0) {
$.ajax({
url: base_url + 'index.php/logbookadvanced/mapSelectedQsos',
type: 'post',
data: {
ids: id_list,
de: form.de.value
},
success: function(data) {
globemap(data);
},
error: function() {
url: base_url + 'index.php/logbookadvanced/mapSelectedQsos',
type: 'post',
data: {
ids: id_list,
de: form.de.value
},
success: function(data) {
globemap(data);
},
error: function() {
},
});
@@ -653,10 +654,10 @@ function loadMap(data, iconsList) {
qslReceivedMethod: this.qslReceivedMethod.value,
iota: form.iota.value,
dxcc: form.dxcc.value,
propmode: form.selectPropagation.value,
propmode: form.propmode.value,
gridsquare: form.gridsquare.value,
state: form.state.value,
qsoresults: form.qsoResults.value,
qsoresults: form.qsoresults.value,
sats: form.sats.value,
orbits: form.orbits.value,
cqzone: form.cqzone.value,
@@ -664,7 +665,7 @@ function loadMap(data, iconsList) {
lotwReceived: form.lotwReceived.value,
eqslSent: form.eqslSent.value,
eqslReceived: form.eqslReceived.value,
qslvia: $('[name="qslviainput"]').val(),
qslvia: $('[name="qslvia"]').val(),
sota: form.sota.value,
pota: form.pota.value,
operator: form.operator.value,
@@ -676,51 +677,82 @@ function loadMap(data, iconsList) {
},
error: function() {
},
});
}
};
function globemap(x) {
globePayArc=[];
globePayLab=[];
x.forEach((element) => {
let OneQsoArc={};
OneQsoArc.startLat=element.latlng1[0];
OneQsoArc.startLng=element.latlng1[1];
OneQsoArc.endLat=element.latlng2[0];
OneQsoArc.endLng=element.latlng2[1];
OneQsoArc.name=element.callsign;
if (element.confirmed) {
OneQsoArc.color = 'green';
} else {
OneQsoArc.color = 'red';
}
// OneQsoArc.color = [['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)], ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]]
OneQsoArc.altitude=0.15;
globePayArc.push(OneQsoArc);
let OneQsoLab={};
OneQsoLab.lat=element.latlng2[0];
OneQsoLab.lng=element.latlng2[1];
OneQsoLab.text=element.callsign;
globePayLab.push(OneQsoLab);
},
});
renderGlobe(globePayArc,globePayLab);
}
};
function renderGlobe(arcsData,labelData) {
Globe()
.globeImageUrl(base_url + '/assets/images/earth-blue-marble.jpg')
.pointOfView({ lat: arcsData[0].startLat, lng: arcsData[0].startLng, altitude:1}, 100)
.labelsData(labelData)
.arcsData(arcsData)
.arcColor('color')
//.arcAltitude('altitude')
.arcAltitudeAutoScale(.3)
.arcStroke(.2)
.arcDashLength(() => .1)
.arcDashGap(() => 0.01)
.arcDashAnimateTime(() => 4000 + 500)
(document.getElementById('advancedmap'))
}
function globemap(x) {
globePayArc=[];
globePayLab=[];
x.forEach((element) => {
let OneQsoArc={};
OneQsoArc.startLat=element.latlng1[0];
OneQsoArc.startLng=element.latlng1[1];
OneQsoArc.endLat=element.latlng2[0];
OneQsoArc.endLng=element.latlng2[1];
OneQsoArc.name=element.callsign;
if (element.confirmed) {
OneQsoArc.color = 'green';
} else {
OneQsoArc.color = 'red';
}
// OneQsoArc.color = [['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)], ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]]
OneQsoArc.altitude=0.15;
globePayArc.push(OneQsoArc);
let OneQsoLab={};
OneQsoLab.lat=element.latlng2[0];
OneQsoLab.lng=element.latlng2[1];
OneQsoLab.text=element.callsign;
globePayLab.push(OneQsoLab);
});
renderGlobe(globePayArc,globePayLab);
}
function renderGlobe(arcsData,labelData) {
Globe()
.globeImageUrl(base_url + '/assets/images/earth-blue-marble.jpg')
.pointOfView({ lat: arcsData[0].startLat, lng: arcsData[0].startLng, altitude:1}, 100)
.labelsData(labelData)
.arcsData(arcsData)
.arcColor('color')
//.arcAltitude('altitude')
.arcAltitudeAutoScale(.3)
.arcStroke(.2)
.arcDashLength(() => .1)
.arcDashGap(() => 0.01)
.arcDashAnimateTime(() => 4000 + 500)
(document.getElementById('advancedmap'))
}
// auto setting of gridmap height
function set_advancedmap_height() {
//header menu
var headerNavHeight = $('nav').outerHeight();
// console.log('nav: ' + headerNavHeight);
// line with coordinates
var coordinatesHeight = $('.coordinates').outerHeight();
// console.log('.coordinates: ' + coordinatesHeight);
// form for gridsquare map
var qsoManagerHeight = $('.qso_manager').outerHeight();
// console.log('.qso_manager: ' + qsoManagerHeight);
// calculate correct map height
var advancedMapHeight = window.innerHeight - headerNavHeight - coordinatesHeight - qsoManagerHeight;
// and set it
$('#advancedmap').css('height', advancedMapHeight + 'px');
// console.log('#advancedmap: ' + advancedMapHeight);
}
$(document).ready(function() {
$(window).resize(function() {
set_advancedmap_height();
});
$('.lba_buttons').click(function() {
// we need some delay because of the bs collapse menu
setTimeout(set_advancedmap_height, 400);
});
});