summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-25 14:55:04 +0000
committerSarven Capadisli <csarven@status.net>2010-01-25 23:42:40 +0100
commitb3121d09c9dc49579934189fc56a0e0195c673f9 (patch)
tree946a2f33edfb5652d42efbc2ebbd5d5e851e6ec7 /js
parent5c021620801d4e06dd7eebcbacfbf040397297a8 (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')
-rw-r--r--js/util.js12
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;
}
},