{"id":212,"date":"2014-05-06T14:33:17","date_gmt":"2014-05-06T14:33:17","guid":{"rendered":"http:\/\/www.autorouter.eu\/wiki\/?page_id=212"},"modified":"2014-05-06T14:33:27","modified_gmt":"2014-05-06T14:33:27","slug":"fpal-parse-flight-plan","status":"publish","type":"page","link":"https:\/\/www.autorouter.aero\/wiki\/flight-plan-addressing\/fpal-parse-flight-plan\/","title":{"rendered":"FPAL &#8211; Parse Flight Plan"},"content":{"rendered":"<p>Enter a flight plan in the field below and click submit to return the addresses.<\/p>\n<p>&nbsp;<\/p>\n\n\t\t<textarea id=\"fpl\" style=\"width: 400px; height: 200px; margin-bottom: 20px;\"><\/textarea><br \/>\n\t\t<div id=\"cf-turnstile-fplparse\"><\/div>\n\t\t<input type=\"submit\" id=\"fplsubmit\" value=\"Submit\" \/>\n\t\t<div id=\"fpalresult\" style=\"margin-top: 20px;\"><\/div>\n\t\t<script>\n\t\t(function() {\n\t\t\tvar fplWidgetId = null;\n\t\t\tfunction renderFplTurnstile() {\n\t\t\t\tfplWidgetId = turnstile.render(\"#cf-turnstile-fplparse\", {\n\t\t\t\t\tsitekey: \"0x4AAAAAABgSOF4YVJHopseN\",\n\t\t\t\t\ttheme: \"light\"\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (typeof turnstile !== \"undefined\") {\n\t\t\t\trenderFplTurnstile();\n\t\t\t} else if (!window._turnstileScriptLoading) {\n\t\t\t\twindow._turnstileScriptLoading = true;\n\t\t\t\twindow.onTurnstileLoad = function() {\n\t\t\t\t\twindow._turnstileScriptLoaded = true;\n\t\t\t\t\t(window._turnstileCallbacks || []).forEach(function(cb) { cb(); });\n\t\t\t\t\twindow._turnstileCallbacks = [];\n\t\t\t\t};\n\t\t\t\tvar s = document.createElement(\"script\");\n\t\t\t\ts.src = \"https:\/\/challenges.cloudflare.com\/turnstile\/v0\/api.js?onload=onTurnstileLoad&render=explicit\";\n\t\t\t\ts.async = true; s.defer = true;\n\t\t\t\tdocument.head.appendChild(s);\n\t\t\t\twindow._turnstileCallbacks = [renderFplTurnstile];\n\t\t\t} else {\n\t\t\t\twindow._turnstileCallbacks = window._turnstileCallbacks || [];\n\t\t\t\twindow._turnstileCallbacks.push(renderFplTurnstile);\n\t\t\t}\n\t\t\tjQuery(\"#fplsubmit\").click(function(e)\n\t\t\t{\n\t\t\t\tjQuery(\"#fpalresult\").html(\"<img src=\\\"\/images\/inprogress.gif\\\" \/>\");\n\t\t\t\te.preventDefault();\n\t\t\t\tjQuery.post(\"\/api\/system\/onetimeauth\/fplparse\",\n\t\t\t\t{\n\t\t\t\t\t\"cf-turnstile-response\": turnstile.getResponse(fplWidgetId)\n\t\t\t\t}, function(data)\n\t\t\t\t{\n\t\t\t\t\tif (typeof data.error != \"undefined\")\n\t\t\t\t\t{\n\t\t\t\t\t\tjQuery(\"#fpalresult\").html(\"<span style=\\\"color: red;\\\"><strong>Error<\/strong>: \" + data.error + \"<\/span>\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tjQuery.ajax(\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"PUT\",\n\t\t\t\t\t\turl: \"\/api\/flightplan\/fpal\/parse?onetimeauth_fplparse=\" + data.onetimeauth_fplparse,\n\t\t\t\t\t\tdata: jQuery(\"#fpl\").val()\n\t\t\t\t\t}).done(function(data)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar output;\n\t\t\t\t\t\tif (typeof data.error !== \"undefined\")\n\t\t\t\t\t\t\toutput = \"<span style=\\\"color: red;\\\"><strong>Error:<\/strong> \" + data.error + \"<\/span>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toutput = \"<h1>List of addresses<\/h1><ul>\";\n\t\t\t\t\t\t\tjQuery.each(data, function (index, address)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toutput += \"<li>\" + address.addr + \" (\" + address.type + \", \" + address.doctype + \")<ul>\";\n\t\t\t\t\t\t\t\tjQuery.each(address.idents, function(index, ident)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\toutput += \"<li>\" + ident + \"<\/li>\";\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\toutput += \"<\/ul><\/li>\";\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\toutput += \"<\/ul>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjQuery(\"#fpalresult\").html(output);\n\t\t\t\t\t});\n\t\t\t\t\tturnstile.reset(fplWidgetId);\n\t\t\t\t});\n\t\t\t});\n\t\t})();\n\t\t<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Enter a flight plan in the field below and click submit to return the addresses. &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":157,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-212","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":2,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/212\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/212\/revisions\/214"}],"up":[{"embeddable":true,"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/pages\/157"}],"wp:attachment":[{"href":"https:\/\/www.autorouter.aero\/wiki\/wp-json\/wp\/v2\/media?parent=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}