Moved initialisation sequences to pred.js and slightly improved hash string checking

pull/73/head
jonsowman 2010-06-11 15:17:56 +01:00
rodzic 7b2964d0de
commit 4e794232ab
2 zmienionych plików z 30 dodań i 30 usunięć

Wyświetl plik

@ -42,37 +42,9 @@ var burst_img = "images/pop-marker.png";
var clickListener;
var clickMarker;
function initialize() {
// are we trying to display an old prediction?
if(window.location.hash != "") {
var ln = window.location.hash.split("=");
current_uuid = ln[1];
}
initMap(52, 0, 8);
populateLaunchSite();
setupEventHandlers();
// make launch card draggable
$("#input_form").draggable({containment: '#map_canvas'});
// see if we want an old prediction displayed
if ( current_uuid != '0' ) {
appendDebug("Got an old UUID to plot:<br>" + current_uuid);
appendDebug("Trying to populate form with scenario data...");
populateFormByUUID(current_uuid);
appendDebug("Trying to get flight path from server...");
getCSV(current_uuid);
}
// plot the initial launch location
plotClick();
}
</script>
</head>
<body onload="initialize()" bgcolor="#000000">
<body bgcolor="#000000">
<div id="map_canvas" style="width:100%; height:100%"></div>

Wyświetl plik

@ -9,7 +9,35 @@
*/
$(document).ready(function() {
// do nothing
// are we trying to display an old prediction?
if(window.location.hash != "") {
var ln = window.location.hash.split("=");
var posteq = ln[1];
if ( posteq.length != 40 ) {
throwError("The supplied hashstring was not a valid UUID.");
appendDebug("The hashstring was not the expected length");
} else {
current_uuid = posteq;
}
}
initMap(52, 0, 8);
populateLaunchSite();
setupEventHandlers();
// make launch card draggable
$("#input_form").draggable({containment: '#map_canvas'});
// see if we want an old prediction displayed
if ( current_uuid != '0' ) {
appendDebug("Got an old UUID to plot:<br>" + current_uuid);
appendDebug("Trying to populate form with scenario data...");
populateFormByUUID(current_uuid);
appendDebug("Trying to get flight path from server...");
getCSV(current_uuid);
}
// plot the initial launch location
plotClick();
});
function predSub() {