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 14:55:04 +0000
commit73f6250b9d8a1f65bfcbf76b05f087bd6e118bea (patch)
tree3ccc07774ee7d30f1031469d58ff1086e620249b /js
parent089305ac7a89ba42286973feb14ca23687ec0995 (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;
}
},