Skip to content

Commit

Permalink
Add page for raw fpl
Browse files Browse the repository at this point in the history
  • Loading branch information
korsumaki committed Mar 21, 2024
1 parent 6836d01 commit c4fb875
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 5 deletions.
21 changes: 19 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ <h3 style="color:navy">Lentoapuri ei pysty täyttämään lentosuunnitelmalomake
</div>
<!-- "https://www.ais.fi/fi/lennonvalmistelu-ja-lentosuunnitelmat/fpl-lomake" -->
<!--form method="POST" target="_blank" action="https://www.ais.fi/user/submit-flight-plan" -->
<form method="GET" action="https://www.ais.fi/user/submit-flight-plan">
<!--form method="GET" action="https://www.ais.fi/user/submit-flight-plan"-->
<form method="POST" action="">
<input type="hidden" id="form_id" name="ilma_aluksen_tunnus"> <!-- id -->
<input type="hidden" id="form_rules" name="rules">
<input type="hidden" id="form_type" name="type">
Expand Down Expand Up @@ -368,9 +369,25 @@ <h4>Tehdyt lentosuunnitelmat</h4>
<p><a href="linkit.html" rel="external" data-ajax="false">Ilmailulinkit</a></p>

</div><!-- content -->

</div>

<div data-role="page" id="page-raw-plan">
<div data-role="header" data-position="inline" data-theme="a"> <!-- b -->
<a href="#page-main" data-direction="reverse" data-icon="arrow-l">Takaisin</a>
<h1>Raaka FPL</h1>
</div>
<div data-role="content">
<div class="ui-field-contain">
<label for="raw-fpl-field">Raaka FPL</label>
<textarea id="raw-fpl-field" type="textarea" data-mini="true"></textarea>
</div> <!-- fieldcontain -->
<div class="ui-field-contain">
<label for="button-to-ais-webpage">FPL lomake</label>
<a href="https://www.ais.fi/user/submit-flight-plan" target="_blank" id="button-to-ais-webpage" class="ui-btn ui-corner-all ui-shadow ui-mini ">ais.fi FPL lomake...</a>
</div> <!-- fieldcontain -->
</div> <!-- content -->
</div>

<div data-role="page" id="page-stored-plan">
<div data-role="header" data-position="inline" data-theme="a"> <!-- b -->
<a href="#page-main" data-direction="reverse" data-icon="arrow-l">Takaisin</a>
Expand Down
71 changes: 68 additions & 3 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ var PYROTECHNICS_NOTE_REMARKS = "pyrotechnics on board";

var OPENAVIATIONDATA_APIKEY = "mkXQV7UpiiBgOVjxbTzioYfpOlNVtEtg";

// TODO update to flyk.com, test
var NAV_WRNG_map_link = "https://aviamaps.com/map?wrng";
var NAV_WRNG_map_next_link = "https://aviamaps.com/map?wrng&next";

Expand Down Expand Up @@ -356,7 +357,7 @@ function getCountryByICAO(icao) {
if (icao.length != 4) {
debug_log("ERROR: getCountryByICAO: icao='" + icao + "' is not valid. Expected 4 characters.");
}
var country = icao.substr(0,2).toUpperCase();;
var country = icao.substr(0,2).toUpperCase();
// Let's assume ZZZZ fields are in Finland.
if (country == 'ZZ') {
country = 'EF';
Expand Down Expand Up @@ -3790,8 +3791,72 @@ function updateFlightPlanForm() {
if (showAlertText) {
alert(alertText);
}

return true;

// Fill text field
var br = "\n";
var fplString = $("#form_id").val();
fplString += " " + $("#form_rules").val();
fplString += " " + $("#form_type").val();
fplString += " " + $("#form_aircraft").val();
fplString += " " + $("#form_cat").val();
fplString += " " + $("#form_equipment").val();
fplString += "/" + $("#form_ssr").val() + br;

fplString += $("#form_ad").val();
fplString += " " + $("#form_time").val() + br;
fplString += $("#form_spd").val() ;
fplString += $("#form_speed").val();
fplString += " " + $("#form_lv").val();
fplString += $("#form_level").val();

fplString += " " + $("#form_route").val() + br;
fplString += $("#form_dad").val();
fplString += " " + $("#form_eet").val() + br;
fplString += $("#form_other").val() + br;
fplString += $("#form_endurance").val();
fplString += " " + $("#form_person").val();
fplString += " " + $("#form_markings").val() + br;
fplString += $("#form_remarks").val() + br;
fplString += $("#form_e").val() + br;
// Change text so far to CAPITAL
fplString = fplString.toUpperCase();

fplString += $("#form_pic").val();
fplString += " " + $("#form_tel").val();
fplString += "/" + $("#form_filed").val() + br;

/* var fplString = "form_id" + ": " + $("#form_id").val() + br;
fplString += "form_rules" + ": " + $("#form_rules").val() + br;
fplString += "form_type" + ": " + $("#form_type").val() + br;
fplString += "form_aircraft" + ": " + $("#form_aircraft").val() + br;
fplString += "form_cat" + ": " + $("#form_cat").val() + br;
fplString += "form_equipment" + ": " + $("#form_equipment").val() + br;
fplString += "form_ssr" + ": " + $("#form_ssr").val() + br;
fplString += "form_ad" + ": " + $("#form_ad").val() + br;
fplString += "form_time" + ": " + $("#form_time").val() + br;
fplString += "form_spd" + ": " + $("#form_spd").val() + br;
fplString += "form_speed" + ": " + $("#form_speed").val() + br;
fplString += "form_lv" + ": " + $("#form_lv").val() + br;
fplString += "form_level" + ": " + $("#form_level").val() + br;
fplString += "form_route" + ": " + $("#form_route").val() + br;
fplString += "form_dad" + ": " + $("#form_dad").val() + br;
fplString += "form_eet" + ": " + $("#form_eet").val() + br;
fplString += "form_other" + ": " + $("#form_other").val() + br;
fplString += "form_endurance" + ": " + $("#form_endurance").val() + br;
fplString += "form_person" + ": " + $("#form_person").val() + br;
fplString += "form_markings" + ": " + $("#form_markings").val() + br;
fplString += "form_remarks" + ": " + $("#form_remarks").val() + br;
fplString += "form_e" + ": " + $("#form_e").val() + br;
fplString += "form_pic" + ": " + $("#form_pic").val() + br;
fplString += "form_tel" + ": " + $("#form_tel").val() + br;
fplString += "form_filed" + ": " + $("#form_filed").val() + br;
*/
console.log(fplString);
$('#raw-fpl-field').val( fplString );
window.open( "#page-raw-plan", "_self" );

return false;
//return true;
}


Expand Down

0 comments on commit c4fb875

Please sign in to comment.