Skip to content

Commit e9d154d

Browse files
authored
Merge pull request projecthorus#167 from projecthorus/testing
New Station Reporting System
2 parents 40b6c96 + 3ef252c commit e9d154d

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

js/tracker.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,29 @@ function showLaunchSites() {
878878
var popup = new L.popup({ autoClose: false, closeOnClick: false });
879879
marker.bindPopup(popup);
880880
launches.addLayer(marker);
881+
var popupLink = "https://docs.google.com/forms/d/e/1FAIpQLSfIbBSQMZOXpNE4VpK4BqUbKDPCWCDgU9QxYgmhh-JD-JGSsQ/viewform?usp=pp_url&entry.796606853=Modify+Existing+Site";
882+
popupLink += "&entry.749833526=" + key;
883+
if (json[key].hasOwnProperty('station_name')) {
884+
popupLink += "&entry.675505431=" + json[key].station_name.replace(/\s/g, '+');
885+
}
886+
if (json[key].hasOwnProperty('position')) {
887+
popupLink += "&entry.1613779787=" + json[key].position.reverse().toString();
888+
}
889+
if (json[key].hasOwnProperty('alt')) {
890+
popupLink += "&entry.753148337=" + json[key].alt;
891+
}
892+
if (json[key].hasOwnProperty('ascent_rate')) {
893+
popupLink += "&entry.509146334=" + json[key]["ascent_rate"];
894+
}
895+
if (json[key].hasOwnProperty('burst_altitude')) {
896+
popupLink += "&entry.1897602989=" + json[key]["burst_altitude"];
897+
}
898+
if (json[key].hasOwnProperty('descent_rate')) {
899+
popupLink += "&entry.267462486=" + json[key]["descent_rate"];
900+
}
901+
if (json[key].hasOwnProperty('notes')) {
902+
popupLink += "&entry.197384117=" + json[key]["notes"].replace(/\s/g, '+');
903+
}
881904
if (json[key].hasOwnProperty('times')) {
882905
var popupContent = null;
883906
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList;
@@ -932,14 +955,14 @@ function showLaunchSites() {
932955
if (json[key].hasOwnProperty('notes')) {
933956
popupContent += "<br><b>Notes:</b> " + json[key]["notes"];
934957
}
935-
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>";
958+
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='" + popupLink + "' target='_blank'>here</a>";
936959
popupContent += "<br><button onclick='launchSitePredictions(\"" + json[key]['times'].toString() + "\", \"" + latlon.toString() + "\", \"" + ascent_rate + ":" + descent_rate + ":" + burst_altitude + ":" + burst_samples + ":" + descent_samples + "\", \"" + launches.getLayerId(marker) + "\")' style='margin-bottom:0;'>Generate Predictions</button>";
937960
} else {
938961
popupContent = "<font style='font-size: 13px'>" + json[key].station_name + "</font><br><br><b>Sondes launched:</b> " + sondesList;
939962
if (json[key].hasOwnProperty('notes')) {
940963
popupContent += "<br><b>Notes:</b> " + json[key]["notes"];
941964
}
942-
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='https://github.com/projecthorus/sondehub-tracker/issues/114' target='_blank'>here</a>";
965+
popupContent += "<br><b>Know when this site launches?</b> Contribute <a href='" + popupLink + "' target='_blank'>here</a>";
943966
}
944967
popup.setContent(popupContent);
945968
}

0 commit comments

Comments
 (0)