]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
An update to geolocation cookie to use a single file and set the
authorSarven Capadisli <csarven@status.net>
Mon, 25 Jan 2010 14:55:04 +0000 (14:55 +0000)
committerSarven Capadisli <csarven@status.net>
Tue, 26 Jan 2010 00:12:06 +0000 (01:12 +0100)
expiry date to 30 days from now.

js/util.js

index a7339010a7b206218a9955c7730da97355a3ca23..8d52d859b774bce10992ab3a54fa0d42b5363e58 100644 (file)
@@ -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;
         }
     },