").attr("class","responsive_left").append($(".right_column").children()));
$(".right_column").remove();
}
else if($(window).width() >= 1200 && responsive_design == true) {
responsive_design = false;
$(".article_wrap").append($("
").attr("class","right_column").append($(".responsive_left").children()));
$(".responsive_left").remove();
}
});
$(function() {
$('input[type="file"]').val('');
});
$(function() {
$(document).on('click','a', function(e) {
e.stopPropagation();
});
$(document).on('keypress',"input.disallow_enter[type='text']", function(e) {
if((e.which == 13) || (e.keyCode == 13)){ return false; }
});
$(document).on('click','.follow_button', function(e) {
e.stopPropagation();
if ($(this).attr('mid') !== null) {
api.post('accounts/'+$(this).attr('mid')+'/follow', function (data) {
});
} else if ($(this).attr('data')!== null) {
api.post("follows", {uri:$(this).attr('data')}, function (data) {
});
}
$(this).toggleClass('follow_button');
$(this).toggleClass('following_button');
$(this).html('
'+__('Following')+'');
return false;
});
$(document).on('click','.following_button', function(e) {
e.stopPropagation();
if ($(this).attr('mid') !== null) {
api.post('accounts/'+$(this).attr('mid')+'/unfollow', function (data) {
});
}
$(this).toggleClass('following_button');
$(this).toggleClass('follow_button');
$(this).html('
'+__('Follow')+'');
return false;
});
$(document).on('click','.mute_button', function(e) {
e.stopPropagation();
const mid = $(this).attr('mid');
$("#js-overlay_content_wrap .temporary_object").empty();
$('#js-overlay_content_wrap').addClass('view');
$('#js-overlay_content_wrap').addClass('black_08');
$('.overlay_confirm').removeClass('invisible');
$('.overlay_confirm_text').text(__("Are you sure that you want to mute this user?"));
$('.overlay_confirm_yes').click(function() {
$('.close_button').click();
api.post('accounts/'+mid+'/mute', function (data) {
putMessage(__("You'll no longer receive notifications from this user"));
return false;
});
});
});
$(document).on('click','.muting_button', function(e) {
if($(this).attr('mid')!=null) {
api.post('accounts/'+$(this).attr('mid')+'/unmute', function (data) {
});
}
$(this).toggleClass('muting_button');
$(this).toggleClass('follow_button');
$(this).html('
'+__('Follow')+'');
putMessage(__("Unmuted this user"));
return false;
});
$(document).on('click','.block_button', function(e) {
e.stopPropagation();
const mid = $(this).attr('mid');
$("#js-overlay_content_wrap .temporary_object").empty();
$('#js-overlay_content_wrap').addClass('view');
$('#js-overlay_content_wrap').addClass('black_08');
$('.overlay_confirm').removeClass('invisible');
$('.overlay_confirm_text').text(__("Are you sure that you want to block this user?"));
$('.overlay_confirm_yes').click(function() {
$('.close_button').click();
api.post('accounts/'+mid+'/block', function (data) {
putMessage(__("This user has been blocked"));
return false;
});
});
});
$(document).on('click','.blocking_button', function(e) {
e.stopPropagation();
if ($(this).attr('mid') !== null) {
api.post('accounts/'+$(this).attr('mid')+'/unblock', function (data) {
});
}
$(this).toggleClass('blocking_button');
$(this).toggleClass('follow_button');
$(this).html('
'+__('Follow')+'');
putMessage(__("Unblocked this user"));
return false;
});
$(document).on('click','.boost_button',function(e) {
e.stopPropagation();
if($(this).attr('reblogged') !== 'true'){
api.post("statuses/"+$(this).attr('tid')+"/reblog",function(data) {
});
$(this).attr('reblogged',"true");
$(this).addClass('active');
$(".js_current_toots_count").html(++localStorage.current_statuses_count);
}
else {
api.post("statuses/"+$(this).attr('tid')+"/unreblog",function(data) {
});
$(this).attr('reblogged',"null");
$(this).removeClass('active');
$(".js_current_toots_count").html(--localStorage.current_statuses_count);
}
return false;
});
$(document).on('click','.fav_button',function(e) {
e.stopPropagation();
if($(this).attr('favourited') !== 'true'){
api.post("statuses/"+$(this).attr('tid')+"/favourite",function(data) {
});
$(this).attr('favourited',"true");
$(this).addClass('active');
}
else {
api.post("statuses/"+$(this).attr('tid')+"/unfavourite",function(data) {
});
$(this).attr('favourited',"null");
$(this).removeClass('active');
}
return false;
});
$(document).on('click','.bookmark_button',function(e) {
e.stopPropagation();
if($(this).attr('bookmarked') !== 'true') {
api.post("statuses/"+$(this).attr('tid')+"/bookmark",function(data) {
});
$(this).attr('bookmarked',"true");
$(this).addClass('active');
}
else {
api.post("statuses/"+$(this).attr('tid')+"/unbookmark",function(data) {
});
$(this).attr('bookmarked',"null");
$(this).removeClass('active');
}
return false;
});
$(document).on('click','.announcement .emoreact',function(e) {
e.stopPropagation();
if($(this).hasClass('active')) {
(function(that) {
api.delete("announcements/"+$(that).closest('.announcement').attr("aid")+"/reactions/"+$(that).attr("emoji"),function(data) {
$(that).removeClass('active');
});
})(this);
}
else {
(function(that) {
api.put("announcements/"+$(that).closest('.announcement').attr("aid")+"/reactions/"+$(that).attr("emoji"),function(data) {
$(that).addClass('active');
});
})(this);
}
return false;
});
$(document).on('click','.status_reactions .emoreact',function(e) {
e.stopPropagation();
if($(this).hasClass('active')) {
(function(that) {
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
else var sid = $(that).closest('.toot_entry').attr("sid");
api.delete("pleroma/statuses/"+sid+"/reactions/"+$(that).attr("emoji"),function(status) {
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
replace_emoji();
});
})(this);
}
else {
(function(that) {
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
else var sid = $(that).closest('.toot_entry').attr("sid");
api.put("pleroma/statuses/"+sid+"/reactions/"+$(that).attr("emoji"),function(status) {
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
replace_emoji();
});
})(this);
}
return false;
});
$(document).on('click','.status_reactions .emoreact_add',function(e) {
e.stopPropagation();
});
$(document).on('click','.status_reactions .emoreact_add:not(.active)',function() {
$(this).addClass("active");
(function(that) {
if($(that).closest('.toot_detail.main_status').length == 1) var sid = $(that).closest('.toot_detail.main_status').attr("sid");
else var sid = $(that).closest('.toot_entry').attr("sid");
$(that).lsxEmojiPicker({
closeOnSelect:true,
customEmojis:false,
twemoji:!checkEmojiSupport(),
onSelect:function(emoji) {
api.put("pleroma/statuses/"+sid+"/reactions/"+emoji.value,function(status) {
$(".toot_entry[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_entry[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").children().remove();
$(".toot_detail.main_status[sid="+sid+"]").find(".status_reactions").append(parse_reactions(status.pleroma.emoji_reactions));
replace_emoji();
});
},
onClose:function() {
$(that).lsxEmojiPicker("destroy");
setTimeout(function() {$(that).removeClass("active")},0);
}
}).click();
})(this);
});
$(document).on('click','.delete_button', function(e) {
const sid = $(this).attr('tid');
e.stopPropagation();
$("#js-overlay_content_wrap .temporary_object").empty();
$('#js-overlay_content_wrap').addClass('view');
$('#js-overlay_content_wrap').addClass('black_08');
$('.overlay_confirm').removeClass('invisible');
$('.overlay_confirm_text').text(__("Are you sure that you want to delete this toot?"));
$('.overlay_confirm_yes').click(function() {
$('.close_button').click();
api.delete("statuses/"+sid, function (data) {
if($('.toot_entry[sid="'+sid+'"] .reply_button').attr("privacy") != "direct") $(".js_current_toots_count").html(--localStorage.current_statuses_count);
$('.toot_entry[sid="'+sid+'"]').remove();
putMessage(__("Your Toot has been deleted"));
});
});
});
$(document).on('click','.pin_button', function(e) {
const sid = $(this).attr('tid');
api.post("statuses/"+sid+"/pin", function (data) {
$('.toot_entry[sid="'+sid+'"] .pin_button').removeClass("pin_button").addClass("unpin_button").text(__("Unpin Toot"));
putMessage(__("Your Toot has been pinned"));
});
});
$(document).on('click','.unpin_button', function(e) {
const sid = $(this).attr('tid');
api.post("statuses/"+sid+"/unpin", function (data) {
$('.toot_entry[sid="'+sid+'"] .unpin_button').removeClass("unpin_button").addClass("pin_button").text(__("Pin Toot"));
putMessage(__("Your Toot has been unpinned"));
});
});
$(document).on('click','.addlist_button',function(e) {
const mid = $(this).attr('mid');
e.stopPropagation();
$("#js-overlay_content_wrap .temporary_object").empty();
$('#js-overlay_content_wrap').addClass('view');
$('#js-overlay_content_wrap').addClass('black_08');
$('.overlay_addlist').removeClass('invisible');
$('.overlay_addlist .overlay_simple_header span').html(__('Add to list')+": "+$(this).attr('display_name'));
replace_emoji();
api.get("lists",function(data) {
api.get("accounts/"+mid+"/lists",function(data2) {
var inlists = new Array();
if(typeof data2 == "object") {
for(var i=0;i
").addClass("overlay_addlist_item").append(
$("").addClass("emoji_poss").text(data[i].title)).append(
$("