Removed sites and made locations_limit variable
rodzic
8a82e050e9
commit
16b5179a4e
|
@ -610,6 +610,7 @@ function setupEventHandlers() {
|
|||
var req_alt = $("#req_alt").val();
|
||||
var req_name = $("#req_name").val();
|
||||
var cookie_name = "cusf_predictor";
|
||||
var locations_limit = 5;
|
||||
|
||||
// Now let's init the cookie
|
||||
$.Jookie.Initialise(cookie_name, 99999999);
|
||||
|
@ -620,12 +621,13 @@ function setupEventHandlers() {
|
|||
var idx = $.Jookie.Get(cookie_name, "idx");
|
||||
}
|
||||
|
||||
if ( $.Jookie.Get(cookie_name, "idx") >= 5 ) {
|
||||
throwError("You may only save 5 locations - please delete some.");
|
||||
if ( $.Jookie.Get(cookie_name, "idx") >= locations_limit ) {
|
||||
$("#location_save").fadeOut();
|
||||
throwError("You may only save "+locations_limit+" locations - please delete some.");
|
||||
} else {
|
||||
// Find the next free index we can use
|
||||
var i=1;
|
||||
while ( $.Jookie.Get(cookie_name, i+"_name") && i<=5 ) {
|
||||
while ( $.Jookie.Get(cookie_name, i+"_name") && i<=locations_limit ) {
|
||||
i++;
|
||||
}
|
||||
// We will use this idx for the next location
|
||||
|
|
|
@ -9,16 +9,6 @@
|
|||
"longitude" : -0.0927,
|
||||
"altitude" : 0
|
||||
},
|
||||
"Glenrothes": {
|
||||
"latitude" : 56.13,
|
||||
"longitude" : -3.06,
|
||||
"altitude" : 0
|
||||
},
|
||||
"Bujaraloz, Monegros": {
|
||||
"latitude" : 41.4958,
|
||||
"longitude" : -0.15797,
|
||||
"altitude" : 0
|
||||
},
|
||||
"Adelaide": {
|
||||
"altitude" : 0,
|
||||
"latitude" : -34.9499,
|
||||
|
@ -44,14 +34,4 @@
|
|||
"latitude" : 54.654118,
|
||||
"longitude" : -7.034914
|
||||
},
|
||||
"Agia Kiriaki": {
|
||||
"altitude" : 0,
|
||||
"latitude" : 40.0429,
|
||||
"longitude" : 23.8125
|
||||
},
|
||||
"Utrecht, NL": {
|
||||
"altitude" : 0,
|
||||
"latitude" : 52.1,
|
||||
"longitude" : 5.2
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue