]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/util.js
Further column collisions in ReplyNoticeStream
[quix0rs-gnu-social.git] / js / util.js
index 5f95595edd134ec5c646ee151b7e9c536709447c..c1a3b771537949dfb9d229b3ea455bd0d88400c9 100644 (file)
@@ -308,7 +308,6 @@ var SN = { // StatusNet
          * @fixme cookieValue is a global variable, but probably shouldn't be
          * @fixme saving the location cache cookies should be split out
          * @fixme some error messages are hardcoded english: needs i18n
-         * @fixme special-case for bookmarklet is confusing and uses a global var "self". Is this ok?
          *
          * @param {jQuery} form: jQuery object whose first element is a form
          *
@@ -394,11 +393,6 @@ var SN = { // StatusNet
                     if (errorResult.length > 0) {
                         showFeedback('error', errorResult.text());
                     } else {
-                        if ($('body')[0].id == 'bookmarklet') {
-                            // @fixme self is not referenced anywhere?
-                            self.close();
-                        }
-
                         var commandResult = $('#' + SN.C.S.CommandResult, data);
                         if (commandResult.length > 0) {
                             showFeedback('success', commandResult.text());
@@ -868,8 +862,8 @@ var SN = { // StatusNet
                 $(attachment_more[0]).click(function () {
                     var m = $(this);
                     m.addClass(SN.C.S.Processing);
-                    $.get(m.attr('href') + '/ajax', null, function (data) {
-                        m.parent('.entry-content').html($(data).find('#attachment_view .entry-content').html());
+                    $.get(m.attr('href'), {ajax: 1}, function (data) {
+                        m.parent('.e-content').html($(data).find('#attachment_view .e-content').html());
                     });
 
                     return false;
@@ -1183,18 +1177,22 @@ var SN = { // StatusNet
                                 }
                             }
                         } else {
-                            var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));
-
-                            form.find('[name=lat]').val(cookieValue.NLat);
-                            form.find('[name=lon]').val(cookieValue.NLon);
-                            form.find('[name=location_ns]').val(cookieValue.NLNS);
-                            form.find('[name=location_id]').val(cookieValue.NLID);
-                            form.find('[name=notice_data-geo]').prop('checked', cookieValue.NDG);
-
-                            SN.U.NoticeGeoStatus(form, cookieValue.NLN, cookieValue.NLat, cookieValue.NLon, cookieValue.NLNU);
-                            label
-                                .attr('title', NoticeDataGeo_text.ShareDisable + ' (' + cookieValue.NLN + ')')
-                                .addClass('checked');
+                            try {
+                                var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));
+
+                                form.find('[name=lat]').val(cookieValue.NLat);
+                                form.find('[name=lon]').val(cookieValue.NLon);
+                                form.find('[name=location_ns]').val(cookieValue.NLNS);
+                                form.find('[name=location_id]').val(cookieValue.NLID);
+                                form.find('[name=notice_data-geo]').prop('checked', cookieValue.NDG);
+
+                               SN.U.NoticeGeoStatus(form, cookieValue.NLN, cookieValue.NLat, cookieValue.NLon, cookieValue.NLNU);
+                                label
+                                    .attr('title', NoticeDataGeo_text.ShareDisable + ' (' + cookieValue.NLN + ')')
+                                    .addClass('checked');
+                            } catch (e) {
+                                console.log('Parsing error:', e);
+                            }
                         }
                     } else {
                         removeNoticeDataGeo();
@@ -1363,7 +1361,7 @@ var SN = { // StatusNet
 
             var profileLink = $('#nav_profile a').attr('href');
             if (profileLink) {
-                var authorUrl = $(notice).find('.vcard.author a.url').attr('href');
+                var authorUrl = $(notice).find('.h-card.u-url').attr('href');
                 if (authorUrl == profileLink) {
                     if (action == 'all' || action == 'showstream') {
                         // Posts always show on your own friends and profile streams.