Documentation Updates

This commit is contained in:
2022-06-03 20:35:55 -04:00
parent 2361d2a43a
commit b6ce9fd733
5 changed files with 47 additions and 3 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
{
"python.pythonPath": "/usr/bin/python3",
"liveServer.settings.port": 5501
"liveServer.settings.port": 5501,
"docwriter.progress.trackFunctions": false
}
+1 -1
View File
@@ -30,7 +30,7 @@
<script type="text/javascript" src="js/script2.js"></script>
<script type="text/javascript" src="js/excanvas.min.js"></script>
<script type="text/javascript" src="js/schedules.js"></script>
<script type="text/javascript" src="js/liveatc.js"></script>
<script async type="text/javascript" src="js/liveatc.js"></script>
<link rel="stylesheet" href="material/material.min.css">
<script src="material/material.min.js"></script>
<link rel="stylesheet" href="material/font.css">
+6
View File
@@ -1,5 +1,11 @@
var baseurl = "https://avwx.rest/api/"
/**
* "This function takes two arguments, x and y, and uses them to make an AJAX call to a weather API,
* then it takes the data returned from the API and displays it on the page."
* @param x - longitude
* @param y - latitude
*/
function nearestStations(x, y) {
FetchPending = $.ajax({
url: baseurl + 'metar/' + x + ',' + y + '?token=' + keys['AVWX'] + '&options=info&format=json',
+23
View File
@@ -1,3 +1,8 @@
/**
* It takes a URL and a title, and then it plays the audio stream at the URL.
* @param url - The URL of the PLS file
* @param title - The title of the stream
*/
function playPLS(url, title) {
window.setInterval(function () {
if (document.getElementById("player").readyState === 3 || document.getElementById("player").readyState === 4) {
@@ -65,6 +70,10 @@ function playPLS(url, title) {
})
}
/**
* If the icon is a play button, play the audio and change the icon to a pause button. If the icon is a
* pause button, pause the audio and change the icon to a play button.
*/
function playPause() {
var text = document.getElementById("audioControl_icon").innerHTML
@@ -76,6 +85,10 @@ function playPause() {
document.getElementById("audioControl_icon").innerHTML = "play_arrow"
}
}
/**
* It creates a div for each state in the JSON file, and then adds a div with a bunch of line breaks to
* the end.
*/
function listStations() {
document.getElementById("atc_selector").innerHTML = ""
@@ -100,6 +113,10 @@ function listStations() {
})
}
/**
* It takes a state name as an argument, and then it creates a list of airports in that state.
* @param state - The state that the user has selected
*/
function selectState(state) {
document.getElementById("atc_selector").innerHTML = ""
@@ -143,6 +160,12 @@ function selectState(state) {
})
}
/**
* It takes the airport code and state code and then uses the airport code to find the feeds for that
* airport in the JSON file.
* @param airport - The airport code
* @param state - The state that the airport is in
*/
function selectAirport(airport, state) {
document.getElementById("atc_selector").innerHTML = ""
+15 -1
View File
@@ -1,5 +1,9 @@
var us_airports = {}
/**
* It creates a div for each state in the us_airports object, and when clicked, it calls the
* loadAirport function with the state as the argument.
*/
function initializeSchedulesPage() {
document.getElementById("itin_body").innerHTML = ""
document.getElementById("itin_img").setAttribute("src", 'images/black.jpg')
@@ -21,6 +25,10 @@ function initializeSchedulesPage() {
}
})
}
/**
* It loads the airports in a state.
* @param state - The state that the user has selected
*/
function loadAirport(state) {
document.getElementById("itin_img").setAttribute("src", 'images/black.jpg')
@@ -51,7 +59,13 @@ function loadAirport(state) {
}
}
}
/* Retrieving the schedule for a given airport. */
/**
* It takes in an airport code and state, and then it uses ajax to retrieve the airport's schedule from
* a server.
* @param airport - "KLAX"
* @param state - "California"
*/
function retrieveSchedule(airport, state) {
document.getElementById("itin_arr").style.display = "none"
document.getElementById("itin_dep").style.display = "none"