* @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
*
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());
$(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;
}
}
} 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();
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.