An update to geolocation cookie to use a single file and set the

expiry date to 30 days from now.
This commit is contained in:
Sarven Capadisli 2010-01-25 14:55:04 +00:00
parent a7a0041a11
commit 591c5037a7

View File

@ -495,7 +495,7 @@ var SN = { // StatusNet
$('#'+SN.C.S.NoticeLocationId).val(''); $('#'+SN.C.S.NoticeLocationId).val('');
$('#'+SN.C.S.NoticeDataGeo).attr('checked', false); $('#'+SN.C.S.NoticeDataGeo).attr('checked', false);
$.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled'); $.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled', { path: '/', expires: SN.U.GetDateFromNow(30) });
} }
function getJSONgeocodeURL(geocodeURL, data) { function getJSONgeocodeURL(geocodeURL, data) {
@ -537,7 +537,8 @@ var SN = { // StatusNet
NLNU: location.url, NLNU: location.url,
NDG: true NDG: true
}; };
$.cookie(SN.C.S.NoticeDataGeoCookie, JSON.stringify(cookieValue));
$.cookie(SN.C.S.NoticeDataGeoCookie, JSON.stringify(cookieValue), { path: '/', expires: SN.U.GetDateFromNow(30) });
}); });
} }
@ -658,6 +659,13 @@ var SN = { // StatusNet
} }
return false; return false;
}); });
},
GetDateFromNow: function(days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
return date;
} }
}, },