diff options
author | Sarven Capadisli <csarven@status.net> | 2010-01-25 14:55:04 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-01-25 23:42:40 +0100 |
commit | b3121d09c9dc49579934189fc56a0e0195c673f9 (patch) | |
tree | 946a2f33edfb5652d42efbc2ebbd5d5e851e6ec7 /js/util.js | |
parent | 5c021620801d4e06dd7eebcbacfbf040397297a8 (diff) |
An update to geolocation cookie to use a single file and set the
expiry date to 30 days from now.
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js index a7339010a..8d52d859b 100644 --- a/js/util.js +++ b/js/util.js @@ -495,7 +495,7 @@ var SN = { // StatusNet $('#'+SN.C.S.NoticeLocationId).val(''); $('#'+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) { @@ -537,7 +537,8 @@ var SN = { // StatusNet NLNU: location.url, 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; }); + }, + + GetDateFromNow: function(days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + + return date; } }, |