]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Some code cleaning for geo UI
authorSarven Capadisli <csarven@status.net>
Fri, 8 Jan 2010 13:58:23 +0000 (13:58 +0000)
committerSarven Capadisli <csarven@status.net>
Fri, 8 Jan 2010 13:58:23 +0000 (13:58 +0000)
js/util.js
lib/noticeform.php
theme/base/css/display.css
theme/default/css/display.css
theme/identica/css/display.css

index a29b158be55c137bc533d5ed256207436b6bb339..9c6342ffe77a5a95d8dc81d4c9e2981a089d917c 100644 (file)
@@ -51,8 +51,7 @@ var SN = { // StatusNet
             NoticeLon: 'notice_data-lon',
             NoticeLocationId: 'notice_data-location_id',
             NoticeLocationNs: 'notice_data-location_ns',
-            NoticeLocationName: 'notice_data-location_name',
-            NoticeLocationCookieName: 'location_enabled',
+            NoticeGeoName: 'notice_data-geo_name',
             NoticeDataGeo: 'notice_data-geo',
             NoticeDataGeoSelected: 'notice_data-geo_selected'
         }
@@ -460,7 +459,7 @@ var SN = { // StatusNet
             var NLon = $('#'+SN.C.S.NoticeLon).val();
             var NLNS = $('#'+SN.C.S.NoticeLocationNs).val();
             var NLID = $('#'+SN.C.S.NoticeLocationId).val();
-            var NLN = $('#'+SN.C.S.NoticeLocationName).text();
+            var NLN = $('#'+SN.C.S.NoticeGeoName).text();
             var NDGe = $('#'+SN.C.S.NoticeDataGeo);
 
             function removeNoticeDataGeo() {
@@ -473,7 +472,7 @@ var SN = { // StatusNet
                 $('#'+SN.C.S.NoticeLocationId).val('');
                 $('#'+SN.C.S.NoticeDataGeo).attr('checked', false);
 
-                $.cookie(SN.C.S.NoticeLocationCookieName, 'disabled');
+                $.cookie(SN.C.S.NoticeDataGeo, 'disabled');
             }
 
             function getJSONgeocodeURL(geocodeURL, data) {
@@ -497,10 +496,10 @@ var SN = { // StatusNet
                         NLN_text = location.name;
                     }
 
-                    $('#'+SN.C.S.NoticeLocationName)
-                        .replaceWith('<a id="notice_data-location_name"/>');
+                    $('#'+SN.C.S.NoticeGeoName)
+                        .replaceWith('<a id="notice_data-geo_name"/>');
 
-                    $('#'+SN.C.S.NoticeLocationName)
+                    $('#'+SN.C.S.NoticeGeoName)
                         .attr('href', location.url)
                         .text(NLN_text)
                         .click(function() {
@@ -524,32 +523,31 @@ var SN = { // StatusNet
                         'NLNU': location.url,
                         'NDG': true
                     };
-                    $.cookie(SN.C.S.NoticeLocationCookieName, JSON.stringify(cookieValue));
+                    $.cookie(SN.C.S.NoticeDataGeo, JSON.stringify(cookieValue));
                 });
             }
 
             if (NDGe.length > 0) {
-                var cookieValue = $.cookie(SN.C.S.NoticeLocationCookieName);
-                if (cookieValue == 'disabled') {
+                if ($.cookie(SN.C.S.NoticeDataGeo) == 'disabled') {
                     NDGe.attr('checked', false);
                 }
                 else {
                     NDGe.attr('checked', true);
                 }
 
-                var NLE = $('#notice_data-location_wrap');
-                var geocodeURL = NLE.attr('title');
-                NLE.removeAttr('title');
+                var NGW = $('#notice_data-geo_wrap');
+                var geocodeURL = NGW.attr('title');
+                NGW.removeAttr('title');
 
                 $('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', jQuery.trim($('label[for='+SN.C.S.NoticeDataGeo+']').text()));
 
                 NDGe.change(function() {
-                    var NLN = $('#'+SN.C.S.NoticeLocationName);
+                    var NLN = $('#'+SN.C.S.NoticeGeoName);
                     if (NLN.length > 0) {
                         NLN.remove();
                     }
 
-                    if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true || $.cookie(SN.C.S.NoticeLocationCookieName) === null) {
+                    if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true || $.cookie(SN.C.S.NoticeDataGeo) === null) {
                         $('label[for='+SN.C.S.NoticeDataGeo+']').addClass('checked');
 
                         var S = '<div id="'+SN.C.S.NoticeDataGeoSelected+'" class="'+SN.C.S.Success+'"/>';
@@ -563,9 +561,9 @@ var SN = { // StatusNet
                         }
 
                         NDGS = $('#'+SN.C.S.NoticeDataGeoSelected);
-                        NDGS.prepend('<span id="'+SN.C.S.NoticeLocationName+'">Geo</span> <button class="minimize">&#95;</button> <button class="close">&#215;</button>');
+                        NDGS.prepend('<span id="'+SN.C.S.NoticeGeoName+'">Geo</span> <button class="minimize">&#95;</button> <button class="close">&#215;</button>');
 
-                        var NLN = $('#'+SN.C.S.NoticeLocationName);
+                        var NLN = $('#'+SN.C.S.NoticeGeoName);
                         NLN.addClass('processing');
 
                         $('#'+SN.C.S.NoticeDataGeoSelected+' button.close').click(function(){
@@ -582,7 +580,7 @@ var SN = { // StatusNet
                             return false;
                         });
 
-                        if ($.cookie(SN.C.S.NoticeLocationCookieName) === null || $.cookie(SN.C.S.NoticeLocationCookieName) == 'disabled') {
+                        if ($.cookie(SN.C.S.NoticeDataGeo) === null || $.cookie(SN.C.S.NoticeDataGeo) == 'disabled') {
                             if (navigator.geolocation) {
                                 navigator.geolocation.getCurrentPosition(
                                     function(position) {
@@ -623,17 +621,17 @@ var SN = { // StatusNet
                             }
                         }
                         else {
-                            var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeLocationCookieName));
+                            var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeo));
                             $('#'+SN.C.S.NoticeLat).val(cookieValue.NLat);
                             $('#'+SN.C.S.NoticeLon).val(cookieValue.NLon);
                             $('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS);
                             $('#'+SN.C.S.NoticeLocationId).val(cookieValue.NLID);
                             $('#'+SN.C.S.NoticeDataGeo).attr('checked', cookieValue.NDG);
 
-                            $('#'+SN.C.S.NoticeLocationName)
-                                .replaceWith('<a id="notice_data-location_name"/>');
+                            $('#'+SN.C.S.NoticeGeoName)
+                                .replaceWith('<a id="notice_data-geo_name"/>');
 
-                            $('#'+SN.C.S.NoticeLocationName)
+                            $('#'+SN.C.S.NoticeGeoName)
                                 .attr('href', cookieValue.NLNU)
                                 .text(cookieValue.NLN)
                                 .click(function() {
index 99865645aa7c0bbf86c0c908a100e2cd73737ec6..ddfe450556d45775c872a46f79fb7bf698b34d12 100644 (file)
@@ -207,7 +207,7 @@ class NoticeForm extends Form
                 $this->out->hidden('notice_data-location_id', empty($this->location_id) ? (empty($this->profile->location_id) ? null : $this->profile->location_id) : $this->location_id, 'location_id');
                 $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? (empty($this->profile->location_ns) ? null : $this->profile->location_ns) : $this->location_ns, 'location_ns');
 
-                $this->out->elementStart('div', array('id' => 'notice_data-location_wrap',
+                $this->out->elementStart('div', array('id' => 'notice_data-geo_wrap',
                                                       'title' => common_local_url('geocode')));
                 $this->out->checkbox('notice_data-geo', _('Share your location'), true);
                 $this->out->elementEnd('div');
index 2031aed216f20d37e54e90debccedcde61839fad..cdacb9a62989493a579b7456561ae1a384304c47 100644 (file)
@@ -555,7 +555,7 @@ margin-bottom:0;
 line-height:1.618;
 }
 .form_notice #notice_data-attach_selected code,
-.form_notice #notice_data-location_name {
+.form_notice #notice_data-geo_name {
 float:left;
 width:80%;
 display:block;
@@ -575,7 +575,7 @@ font-size:0.8em;
 float:left;
 }
 
-.form_notice #notice_data-location_wrap label {
+.form_notice #notice_data-geo_wrap label {
 position:absolute;
 top:25px;
 right:4px;
@@ -585,16 +585,16 @@ width:16px;
 height:16px;
 display:block;
 }
-.form_notice #notice_data-location_wrap input {
+.form_notice #notice_data-geo_wrap input {
 display:none;
 }
-.form_notice #notice_data-location_wrap label {
+.form_notice #notice_data-geo_wrap label {
 font-weight:normal;
 font-size:1em;
 margin-bottom:0;
 text-indent:-9999px;
 }
-.form_notice #notice_data-location_name {
+.form_notice #notice_data-geo_name {
 display:block;
 padding-left:21px;
 }
index 1fe2bd5695c6e56a2dccd56014b7ecfdbe9b9301..2360976e57de0f3a22970ef0fb225f0c5df9f7d5 100644 (file)
@@ -111,10 +111,10 @@ box-shadow:3px 3px 3px rgba(194, 194, 194, 0.1);
 text-shadow:none;
 }
 
-.form_notice span#notice_data-location_name {
+.form_notice span#notice_data-geo_name {
 background-position:0 47%;
 }
-.form_notice a#notice_data-location_name {
+.form_notice a#notice_data-geo_name {
 background-position:0 -1711px;
 }
 .form_notice label[for=notice_data-geo] {
@@ -192,7 +192,7 @@ button.close,
 .entity_silence input.submit,
 .entity_delete input.submit,
 .notice-options .repeated,
-.form_notice a#notice_data-location_name,
+.form_notice a#notice_data-geo_name,
 .form_notice label[for=notice_data-geo],
 button.minimize {
 background-image:url(../../base/images/icons/icons-01.gif);
index dd02de6b97bc1131db5c1b9c27e67359d7ab3207..91af1d8ec8de6b89d19156ec45ec3aaed0801960 100644 (file)
@@ -111,10 +111,10 @@ box-shadow:3px 3px 3px rgba(194, 194, 194, 0.1);
 text-shadow:none;
 }
 
-.form_notice span#notice_data-location_name {
+.form_notice span#notice_data-geo_name {
 background-position:0 47%;
 }
-.form_notice a#notice_data-location_name {
+.form_notice a#notice_data-geo_name {
 background-position:0 -1711px;
 }
 .form_notice label[for=notice_data-geo] {
@@ -192,7 +192,7 @@ button.close,
 .entity_silence input.submit,
 .entity_delete input.submit,
 .notice-options .repeated,
-.form_notice a#notice_data-location_name,
+.form_notice a#notice_data-geo_name,
 .form_notice label[for=notice_data-geo],
 button.minimize {
 background-image:url(../../base/images/icons/icons-01.gif);