summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-25 14:55:04 +0000
committerSarven Capadisli <csarven@status.net>2010-01-26 01:12:06 +0100
commit591c5037a745f1b620b213ddaa84c82c64201b71 (patch)
treeec94d38680fd9d81de5c3712ae03ae56aa243914
parenta7a0041a1157ad3ceec2ebd6af722a2529ad422f (diff)
An update to geolocation cookie to use a single file and set the
expiry date to 30 days from now.
-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;
}
},