From ea5a2b87400feb033b5e9760c7db35ecc9427984 Mon Sep 17 00:00:00 2001 From: eric1tran Date: Fri, 11 Dec 2020 16:56:48 +0000 Subject: [PATCH] Set button to take you to claim url if the feeder is not claimed --- public_html/script.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index fd22025..d9ad517 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -2246,9 +2246,12 @@ function flightFeederCheck() { function setStatsLink() { $.ajax('/status.json', { success: function(data) { - if (data.site_url) { + if (data.unclaimed_feeder_id) { + var claim_link = "https://flightaware.com/adsb/piaware/claim/" + data.unclaimed_feeder_id; + $('#stats_page_button').text("Claim this feeder on FlightAware") + myAdsbStatsSiteUrl = claim_link; + } else if (data.site_url) { myAdsbStatsSiteUrl = data.site_url; - console.log(myAdsbStatsSiteUrl) } } })