');
- let text = $('').addClass('mb-0 lead font-weight-bold').text(spoilerText);
- let direction = $('
').addClass('font-weight-light').text('(click to show)');
- summary.append(text, direction);
- cw.append(summary, wrapper);
- container.append(cw);
- } else {
- container.append(wrapper);
- }
- }
- }
-};
-
export default {
props: ['status-id', 'status-username', 'status-template', 'status-url', 'status-profile-url', 'status-avatar'],
data() {
@@ -454,10 +330,13 @@ export default {
self.shares = response.data.shares;
self.likesPage = 2;
self.sharesPage = 2;
- this.buildPresenter();
+ //this.buildPresenter();
this.showMuteBlock();
loader.hide();
+ pixelfed.readmore();
$('.postComponent').removeClass('d-none');
+ $('.postPresenterLoader').addClass('d-none');
+ $('.postPresenterContainer').removeClass('d-none');
}).catch(error => {
if(!error.response) {
$('.postPresenterLoader .lds-ring').attr('style','width:100%').addClass('pt-4 font-weight-bold text-muted').text('An error occured, cannot fetch media. Please try again later.');
@@ -529,56 +408,6 @@ export default {
});
},
- buildPresenter() {
- let container = $('.postPresenterContainer');
- let status = this.status;
- let media = this.media;
-
- $('input[name="item"]').each(function(k, v) {
- let el = $(v);
- el.val(status.account.id);
- });
-
- if(container.children().length != 0) {
- return;
- }
-
- let template = this.status.pf_type ? this.status.pf_type : this.statusTemplate;
- switch(template) {
- case 'image':
- case 'photo':
- pixelfed.presenter.show.image(container, media, this.status);
- break;
-
- case 'album':
- case 'photo:album':
- pixelfed.presenter.show.imageAlbum(container, media, this.status);
- break;
-
- case 'video':
- pixelfed.presenter.show.video(container, media, this.status);
- break;
-
- case 'video:album':
- case 'photo:video:album':
- $('.postPresenterLoader .lds-ring').attr('style','width:100%').addClass('pt-4 font-weight-bold text-muted').text('We cannot load this post properly. We\'re working on a fix!');
- return;
- break;
-
- default:
- $('.postPresenterLoader .lds-ring').attr('style','width:100%').addClass('pt-4 font-weight-bold text-muted').text('An error occured, cannot fetch media. Please try again later.');
- break;
-
- }
- if(container.children().length == 0) {
- $('.postPresenterLoader .lds-ring').attr('style','width:100%').addClass('pt-4 font-weight-bold text-muted').text('An error occured, cannot fetch media. Please try again later.');
- return;
- }
- pixelfed.readmore();
- $('.postPresenterLoader').addClass('d-none');
- $('.postPresenterContainer').removeClass('d-none');
- },
-
likeStatus(event) {
if($('body').hasClass('loggedIn') == false) {
return;