]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/util.js
Made Blogspam Plugin Respect textlimit Setting.
[quix0rs-gnu-social.git] / js / util.js
index 2d19b8df25d4b4dd129735e60d01115e4e772d5b..b864867fd17d12114092c3a9bb5ea5c9b0865fb1 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.GetFullYear(2029, 0, 1) });
             }
 
             function getJSONgeocodeURL(geocodeURL, data) {
@@ -513,7 +513,7 @@ var SN = { // StatusNet
                     }
 
                     if (typeof(location.name) == 'undefined') {
-                        NLN_text = position.coords.latitude + ';' + position.coords.longitude;
+                        NLN_text = data.lat + ';' + data.lon;
                     }
                     else {
                         NLN_text = location.name;
@@ -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.GetFullYear(2029, 0, 1) });
                 });
             }
 
@@ -597,9 +598,9 @@ var SN = { // StatusNet
                             else {
                                 if (NLat.length > 0 && NLon.length > 0) {
                                     var data = {
-                                        'lat': NLat,
-                                        'lon': NLon,
-                                        'token': $('#token').val()
+                                        lat: NLat,
+                                        lon: NLon,
+                                        token: $('#token').val()
                                     };
 
                                     getJSONgeocodeURL(geocodeURL, data);
@@ -628,8 +629,6 @@ var SN = { // StatusNet
                     else {
                         removeNoticeDataGeo();
                     }
-
-                    $('#'+SN.C.S.NoticeDataText).focus();
                 }).change();
             }
         },
@@ -660,6 +659,13 @@ var SN = { // StatusNet
                 }
                 return false;
             });
+        },
+
+        GetFullYear: function(year, month, day) {
+            var date = new Date();
+            date.setFullYear(year, month, day);
+
+            return date;
         }
     },