Added Custom button and made links into buttons

pull/73/head
jonsowman 2010-08-10 22:28:08 +00:00
rodzic 9d5c52ade4
commit 2e0d56e129
2 zmienionych plików z 29 dodań i 10 usunięć

Wyświetl plik

@ -118,7 +118,7 @@ var hlTimeout = 5000; // high latency
<!-- save location -->
<div id="location_save" class="box ui-corner-all">
<h1>Request Location Save</h1><br />
<h1>Save Launch Location</h1><br />
<form name="location_save_form" id="location_save_form">
<table name="req_table" id="req_table">
<tr>
@ -130,7 +130,7 @@ var hlTimeout = 5000; // high latency
</tr><tr>
<td>Site Name: </td><td><input type="text" name="req_name" id="req_name" size="10"></td>
</tr><tr>
<td></td><td><input type="button" value="Request" name="submit" id="req_sub_btn"></td>
<td></td><td><input type="button" value="Save" name="submit" id="req_sub_btn"></td>
</tr>
</table>
</form><br />
@ -164,7 +164,12 @@ var hlTimeout = 5000; // high latency
<form action="" id="modelForm" name="modelForm">
<table>
<tr>
<td>Launch Site:</td>
<td>
Launch Site:
<span class="control_buttons ui-corner-all">
<a id="cookieLocations" class="control_button">Custom</a>
</span>
</td>
<td>
<select id="site" name="launchsite">
</select>
@ -178,8 +183,16 @@ var hlTimeout = 5000; // high latency
<td><input id="lon" type="text" name="lon" value="0.0964" onKeyDown="SetSiteOther()"></td>
</tr>
<tr>
<td><a id="setWithClick">Set With Map</a></td>
<td><a id="req_open">Save Location</a></td>
<td>
<span class="control_buttons ui-corner-all">
<a class="control_button" id="setWithClick">Set With Map</a>
</span>
</td>
<td>
<span class="control_buttons ui-corner-all">
<a class="control_button" id="req_open">Save Location</a>
</span>
</td>
</tr>
<tr>
<td>Launch altitude (m):</td>

Wyświetl plik

@ -620,8 +620,8 @@ function setupEventHandlers() {
var idx = $.Jookie.Get(cookie_name, "idx");
}
if ( $.Jookie.Get(cookie_name, "idx") > 5 ) {
throwError("Too many saved locations");
if ( $.Jookie.Get(cookie_name, "idx") >= 5 ) {
throwError("You may only save 5 locations - please delete some.");
} else {
// Find the next free index we can use
var i=1;
@ -640,7 +640,7 @@ function setupEventHandlers() {
// Close dialog and let the user know it worked
$("#location_save").hide();
throwError("Successfully saved the location to cookie " + cookie_name);
appendDebug("Successfully saved the location to cookie " + cookie_name);
}
});
@ -679,6 +679,12 @@ function setupEventHandlers() {
$("#closeErrorWindow").click(function() {
$("#error_window").fadeOut();
});
$("#cookieLocations").click(function() {
appendDebug("User requested locally saved launch sites");
if ( constructCookieLocationsTable("cusf_predictor") ) {
$("#location_save_local").fadeIn();
}
});
$("#about_window_show").click(function() {
$("#about_window").dialog({
modal:true,
@ -724,11 +730,11 @@ function constructCookieLocationsTable(cookie_name) {
$.Jookie.Initialise(cookie_name, 99999999);
if ( !$.Jookie.Get(cookie_name, "idx") || $.Jookie.Get(cookie_name, "idx") == 0 ) {
throwError("Tried to write from an empty cookie");
throwError("You haven't saved any locations yet! Please click Save Location to do so.");
return false;
} else {
idx = $.Jookie.Get(cookie_name, "idx");
t += "<td>Name</td><td>Use</td><td>Delete</td>";
t += "<tr style='font-weight:bold'><td>Name</td><td>Use</td><td>Delete</td></tr>";
var i=1;
var j=0;
while ( j<idx ) {