Skip to content

Commit

Permalink
frequency info and collapsible sections added
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mckeown committed Oct 1, 2023
1 parent 1b4e131 commit 4f74bf8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,12 @@ <h3 class="mb-4">{{airportInfo.name}}</h3>

<!-- Weather section -->
<div class="container mt-4">
<h4 class="mb-3">Weather Information</h4>

<div class="alert alert-secondary" role="alert" data-bs-toggle="collapse" href="#weatherSection">
<h4 class="mb-3 d-inline">
Weather Information <i class="fas fa-caret-right" aria-hidden="true" id="weatherCaret"></i>
</h4>
</div>
<div class="collapse" id="weatherSection">
<div class="row mb-2">
<div class="col-md-8">
<label class="fw-bold">METAR:</label>
Expand Down Expand Up @@ -268,6 +272,30 @@ <h4 class="mb-3">Weather Information</h4>
</div>
</div>
</div>
</div>

<!-- Frequencies section -->
<div class="container mt-4">
<div class="alert alert-secondary" role="alert" data-bs-toggle="collapse" href="#frequenciesSection">
<h4 class="mb-3 d-inline">
Frequencies <i class="fas fa-caret-right" aria-hidden="true" id="frequenciesCaret"></i>
</h4>
</div>
<div class="collapse" id="frequenciesSection">

<form>
<div class="row mb-2" ng-repeat="freq in airportData.freqs">
<div class="col-md-3">
<label class="fw-bold small">{{freq.description}}:</label>
</div>
<div class="col-md-3">
<p class="small">{{freq.frequency_mhz}}</p>
</div>
<!-- You can add more columns if needed. For now, I've reserved space for two columns per frequency -->
</div>
</form>
</div>
</div>

</div>

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ app.controller('ChecklistController', ['$scope', '$sce', '$timeout', '$http', '$
$scope.runways = $scope.airportData.runways;
$scope.frequencies = $scope.airportData.freqs;
console.log($scope.airportData);
console.log($scope.airportData.freqs);

$scope.parseMetar($scope.airportInfo.metar);

Expand Down
30 changes: 30 additions & 0 deletions src/main/resources/static/vanilla-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,34 @@ fetch('/support')
.then(response => response.text())
.then(content => {
document.getElementById('support').innerHTML = content;
});

document.addEventListener('DOMContentLoaded', function() {
const weatherSection = document.getElementById('weatherSection');
const frequenciesSection = document.getElementById('frequenciesSection');

const weatherCaret = document.getElementById('weatherCaret');
const frequenciesCaret = document.getElementById('frequenciesCaret');

// Event listener for Weather section
weatherSection.addEventListener('show.bs.collapse', function () {
weatherCaret.classList.remove('fa-caret-right');
weatherCaret.classList.add('fa-caret-down');
});

weatherSection.addEventListener('hide.bs.collapse', function () {
weatherCaret.classList.remove('fa-caret-down');
weatherCaret.classList.add('fa-caret-right');
});

// Event listener for Frequencies section
frequenciesSection.addEventListener('show.bs.collapse', function () {
frequenciesCaret.classList.remove('fa-caret-right');
frequenciesCaret.classList.add('fa-caret-down');
});

frequenciesSection.addEventListener('hide.bs.collapse', function () {
frequenciesCaret.classList.remove('fa-caret-down');
frequenciesCaret.classList.add('fa-caret-right');
});
});

0 comments on commit 4f74bf8

Please sign in to comment.