]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Ran NoticeLocationAttach() through jslint
authorSarven Capadisli <csarven@status.net>
Mon, 4 Jan 2010 13:44:32 +0000 (13:44 +0000)
committerSarven Capadisli <csarven@status.net>
Mon, 4 Jan 2010 13:44:32 +0000 (13:44 +0000)
js/util.js

index 0200314224ce1c27d22509d439697f948a435c1a..2d108118a37534a15ab0395d831a90f6c0e2bbaf 100644 (file)
@@ -442,6 +442,15 @@ var SN = { // StatusNet
         },
 
         NoticeLocationAttach: function() {
+            function removeNoticeDataGeo() {
+                $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
+                $('#'+SN.C.S.NoticeDataGeoSelected).hide();
+                $('#'+SN.C.S.NoticeLat).val('');
+                $('#'+SN.C.S.NoticeLon).val('');
+                $('#'+SN.C.S.NoticeLocationNs).val('');
+                $('#'+SN.C.S.NoticeLocationId).val('');
+            }
+
             var NDG = $('#'+SN.C.S.NoticeDataGeo);
             if (NDG.length > 0) {
                 var NLE = $('#notice_data-location_wrap');
@@ -460,7 +469,7 @@ var SN = { // StatusNet
                         }
 
                         var S = '<div id="'+SN.C.S.NoticeDataGeoSelected+'" class="'+SN.C.S.Success+'"/>';
-                        NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
+                        var NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
                         if (NDGS.length > 0) {
                             NDGS.replaceWith(S);
                         }
@@ -470,7 +479,7 @@ var SN = { // StatusNet
                         NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
                         NDGS.prepend('<span id="'+SN.C.S.NoticeLocationName+'">Geo</span>');
 
-                        NLN = $('#'+SN.C.S.NoticeLocationName);
+                        var NLN = $('#'+SN.C.S.NoticeLocationName);
 
                         if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) {
                             NLN.addClass('processing');
@@ -504,6 +513,7 @@ var SN = { // StatusNet
                                     };
 
                                     $.getJSON(geocodeURL, data, function(location) {
+                                        NLN = $('#'+SN.C.S.NoticeLocationName);
                                         NLN.replaceWith('<a id="notice_data-location_name"/>');
                                         NLN = $('#'+SN.C.S.NoticeLocationName);
 
@@ -542,22 +552,12 @@ var SN = { // StatusNet
                         else {
                             removeNoticeDataGeo();
                         }
-                    });
+                    }).change();
 
                     var cookieVal = $.cookie(SN.C.S.NoticeLocationCookieName);
-                    NDG.attr('checked', (cookieVal == null || cookieVal == 'true'));
-                    NDG.change();
+                    NDG.attr('checked', (cookieVal === null || cookieVal == 'true'));
                 }
             }
-
-            function removeNoticeDataGeo() {
-                $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
-                $('#'+SN.C.S.NoticeDataGeoSelected).hide();
-                $('#'+SN.C.S.NoticeLat).val('');
-                $('#'+SN.C.S.NoticeLon).val('');
-                $('#'+SN.C.S.NoticeLocationNs).val('');
-                $('#'+SN.C.S.NoticeLocationId).val('');
-            }
         },
 
         NewDirectMessage: function() {