2018-11-05 01:48:58 +00:00
|
|
|
|
<template>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div>
|
2019-04-20 19:26:29 +00:00
|
|
|
|
<div v-if="!loaded" style="height: 80vh;" class="d-flex justify-content-center align-items-center">
|
|
|
|
|
<img src="/img/pixelfed-icon-grey.svg" class="">
|
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-if="loaded && warning" class="bg-white pt-3 border-bottom">
|
|
|
|
|
<div class="container">
|
|
|
|
|
<p class="text-center font-weight-bold">You are blocking this account</p>
|
|
|
|
|
<p class="text-center font-weight-bold">Click <a href="#" class="cursor-pointer" @click.prevent="warning = false; fetchData()">here</a> to view this status</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="loaded && warning == false" class="postComponent">
|
2019-04-18 00:58:21 +00:00
|
|
|
|
<div v-if="profileLayout == 'metro'" class="container px-0">
|
2019-07-21 05:30:13 +00:00
|
|
|
|
<div class="card card-md-rounded-0 status-container orientation-unknown shadow-none border">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div class="row px-0 mx-0">
|
|
|
|
|
<div class="d-flex d-md-none align-items-center justify-content-between card-header bg-white w-100">
|
2019-09-06 03:51:11 +00:00
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<div class="status-avatar mr-2" @click="redirect(statusProfileUrl)">
|
|
|
|
|
<img :src="statusAvatar" width="24px" height="24px" style="border-radius:12px;" class="cursor-pointer">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="username">
|
2019-09-06 03:51:11 +00:00
|
|
|
|
<span class="username-link font-weight-bold text-dark cursor-pointer" @click="redirect(statusProfileUrl)">{{ statusUsername }}</span>
|
|
|
|
|
<span v-if="status.account.is_admin" class="fa-stack" title="Admin Account" data-toggle="tooltip" style="height:1em; line-height:1em; max-width:19px;">
|
2019-09-09 04:06:23 +00:00
|
|
|
|
<i class="fas fa-certificate text-danger fa-stack-1x"></i>
|
|
|
|
|
<i class="fas fa-crown text-white fa-sm fa-stack-1x" style="font-size:7px;"></i>
|
2019-09-06 03:51:11 +00:00
|
|
|
|
</span>
|
|
|
|
|
<p v-if="loaded && status.place != null" class="small mb-0 cursor-pointer text-truncate" style="color:#718096" @click="redirect('/discover/places/' + status.place.id + '/' + status.place.slug)">{{status.place.name}}, {{status.place.country}}</p>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
2019-09-06 03:51:11 +00:00
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-if="user != false" class="float-right">
|
|
|
|
|
<div class="post-actions">
|
|
|
|
|
<div class="dropdown">
|
|
|
|
|
<button class="btn btn-link text-dark no-caret dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Post options">
|
|
|
|
|
<span class="fas fa-ellipsis-v text-muted"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
|
|
|
|
|
<div v-if="!owner()">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="reportUrl()">Report</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="muteProfile()">Mute Profile</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="blockProfile()">Block Profile</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="ownerOrAdmin()">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" href="#" v-on:click.prevent="toggleCommentVisibility">{{ showComments ? 'Disable' : 'Enable'}} Comments</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="editUrl()">Edit</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
|
|
|
|
|
</div>
|
2019-02-13 05:46:05 +00:00
|
|
|
|
</div>
|
2018-11-20 02:45:27 +00:00
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
2018-11-20 02:45:27 +00:00
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 col-md-8 px-0 mx-0">
|
2019-10-16 05:40:08 +00:00
|
|
|
|
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center" style="background: #000;">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-if="status.pf_type === 'photo'" class="w-100">
|
|
|
|
|
<photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
|
|
|
|
|
</div>
|
2018-12-16 05:25:00 +00:00
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
|
|
|
|
<video-presenter :status="status"></video-presenter>
|
|
|
|
|
</div>
|
2018-12-16 05:25:00 +00:00
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'photo:album'" class="w-100">
|
|
|
|
|
<photo-album-presenter :status="status" v-on:lightbox="lightbox"></photo-album-presenter>
|
|
|
|
|
</div>
|
2018-12-16 05:25:00 +00:00
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'video:album'" class="w-100">
|
|
|
|
|
<video-album-presenter :status="status"></video-album-presenter>
|
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
|
|
|
|
|
<mixed-album-presenter :status="status" v-on:lightbox="lightbox"></mixed-album-presenter>
|
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-else class="w-100">
|
|
|
|
|
<p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
|
|
|
|
<div class="col-12 col-md-4 px-0 d-flex flex-column border-left border-md-left-0">
|
|
|
|
|
<div class="d-md-flex d-none align-items-center justify-content-between card-header py-3 bg-white">
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<div class="d-flex align-items-center status-username text-truncate" data-toggle="tooltip" data-placement="bottom" :title="statusUsername">
|
|
|
|
|
<div class="status-avatar mr-2" @click="redirect(statusProfileUrl)">
|
|
|
|
|
<img :src="statusAvatar" width="24px" height="24px" style="border-radius:12px;" class="cursor-pointer">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="username">
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<span class="username-link font-weight-bold text-dark cursor-pointer" @click="redirect(statusProfileUrl)">{{ statusUsername }}</span>
|
2019-09-06 03:51:11 +00:00
|
|
|
|
<span v-if="status.account.is_admin" class="fa-stack" title="Admin Account" data-toggle="tooltip" style="height:1em; line-height:1em; max-width:19px;">
|
2019-09-09 04:06:23 +00:00
|
|
|
|
<i class="fas fa-certificate text-danger fa-stack-1x"></i>
|
|
|
|
|
<i class="fas fa-crown text-white fa-sm fa-stack-1x" style="font-size:7px;"></i>
|
2019-09-06 03:51:11 +00:00
|
|
|
|
</span>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<p v-if="loaded && status.place != null" class="small mb-0 cursor-pointer text-truncate" style="color:#718096" @click="redirect('/discover/places/' + status.place.id + '/' + status.place.slug)">{{status.place.name}}, {{status.place.country}}</p>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div class="float-right">
|
|
|
|
|
<div class="post-actions">
|
|
|
|
|
<div v-if="user != false" class="dropdown">
|
|
|
|
|
<button class="btn btn-link text-dark no-caret dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Post options">
|
|
|
|
|
<span class="fas fa-ellipsis-v text-muted"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
|
|
|
|
|
<span v-if="!owner()">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="reportUrl()">Report</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="muteProfile">Mute Profile</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="blockProfile">Block Profile</a>
|
2019-04-03 05:13:45 +00:00
|
|
|
|
</span>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<span v-if="ownerOrAdmin()">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" href="#" v-on:click.prevent="toggleCommentVisibility">{{ showComments ? 'Disable' : 'Enable'}} Comments</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="editUrl()">Edit</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost">Delete</a>
|
2019-04-03 05:13:45 +00:00
|
|
|
|
</span>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
2019-04-03 05:13:45 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
2019-06-16 21:42:30 +00:00
|
|
|
|
<div class="d-flex flex-md-column flex-column-reverse h-100" style="overflow-y: auto;">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div class="card-body status-comments pb-5">
|
|
|
|
|
<div class="status-comment">
|
2019-10-15 05:47:17 +00:00
|
|
|
|
<div v-if="showCaption != true">
|
|
|
|
|
<span class="py-3">
|
|
|
|
|
<a class="text-dark font-weight-bold mr-1" :href="status.account.url" v-bind:title="status.account.username">{{truncate(status.account.username,15)}}</a>
|
|
|
|
|
<span class="text-break">
|
|
|
|
|
<span class="font-italic text-muted">This comment may contain sensitive material</span>
|
|
|
|
|
<span class="text-primary cursor-pointer pl-1" @click="showCaption = true">Show</span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<p :class="[status.content.length > 620 ? 'mb-1 read-more' : 'mb-1']" style="overflow: hidden;">
|
|
|
|
|
<a class="font-weight-bold pr-1 text-dark text-decoration-none" :href="statusProfileUrl">{{statusUsername}}</a>
|
|
|
|
|
<span class="comment-text" :id="status.id + '-status-readmore'" v-html="status.content"></span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
|
|
|
|
<div v-if="showComments">
|
2019-06-19 07:26:44 +00:00
|
|
|
|
<hr>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div class="postCommentsLoader text-center">
|
|
|
|
|
<div class="spinner-border" role="status">
|
|
|
|
|
<span class="sr-only">Loading...</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-06-19 07:26:44 +00:00
|
|
|
|
<div class="postCommentsContainer d-none">
|
2019-04-15 18:32:19 +00:00
|
|
|
|
<p v-if="status.reply_count > 10"class="mb-1 text-center load-more-link d-none"><a href="#" class="text-muted" v-on:click="loadMore">Load more comments</a></p>
|
2019-05-21 01:47:12 +00:00
|
|
|
|
<div class="comments">
|
2019-05-21 03:11:38 +00:00
|
|
|
|
<div v-for="(reply, index) in results" class="pb-3" :key="'tl' + reply.id + '_' + index">
|
2019-06-19 07:26:44 +00:00
|
|
|
|
<div v-if="reply.sensitive == true">
|
2019-07-05 03:19:29 +00:00
|
|
|
|
<span class="py-3">
|
|
|
|
|
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a>
|
|
|
|
|
<span class="text-break">
|
|
|
|
|
<span class="font-italic text-muted">This comment may contain sensitive material</span>
|
|
|
|
|
<span class="text-primary cursor-pointer pl-1" @click="reply.sensitive = false;">Show</span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
2019-04-15 18:24:02 +00:00
|
|
|
|
</div>
|
2019-06-19 07:26:44 +00:00
|
|
|
|
<div v-else>
|
|
|
|
|
<p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;">
|
|
|
|
|
<span>
|
|
|
|
|
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a>
|
|
|
|
|
<span class="text-break" v-html="reply.content"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="pl-2" style="min-width:38px">
|
|
|
|
|
<span v-on:click="likeReply(reply, $event)"><i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span>
|
|
|
|
|
<post-menu :status="reply" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block pl-2" v-on:deletePost="deleteComment(reply.id, index)"></post-menu>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="">
|
|
|
|
|
<a v-once class="text-muted mr-3 text-decoration-none small" style="width: 20px;" v-text="timeAgo(reply.created_at)" :href="reply.url"></a>
|
|
|
|
|
<span v-if="reply.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3">{{reply.favourites_count == 1 ? '1 like' : reply.favourites_count + ' likes'}}</span>
|
|
|
|
|
<span class="text-muted comment-reaction font-weight-bold cursor-pointer" v-on:click="replyFocus(reply, index)">Reply</span>
|
|
|
|
|
</p>
|
|
|
|
|
<div v-if="reply.reply_count > 0" class="cursor-pointer" style="margin-left:30px;" v-on:click="toggleReplies(reply)">
|
|
|
|
|
<span class="show-reply-bar"></span>
|
|
|
|
|
<span class="comment-reaction font-weight-bold text-muted">{{reply.thread ? 'Hide' : 'View'}} Replies ({{reply.reply_count}})</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="reply.thread == true" class="comment-thread">
|
|
|
|
|
<div v-for="(s, sindex) in reply.replies" class="pb-3" :key="'cr' + s.id + '_' + index">
|
|
|
|
|
<p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;">
|
|
|
|
|
<span>
|
|
|
|
|
<a class="text-dark font-weight-bold mr-1" :href="s.account.url" :title="s.account.username">{{s.account.username}}</a>
|
|
|
|
|
<span class="text-break" v-html="s.content"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="pl-2" style="min-width:38px">
|
|
|
|
|
<span v-on:click="likeReply(s, $event)"><i v-bind:class="[s.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span>
|
|
|
|
|
<post-menu :status="s" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block pl-2" v-on:deletePost="deleteCommentReply(s.id, sindex, index) "></post-menu>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="">
|
|
|
|
|
<a v-once class="text-muted mr-3 text-decoration-none small" style="width: 20px;" v-text="timeAgo(s.created_at)" :href="s.url"></a>
|
|
|
|
|
<span v-if="s.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3">{{s.favourites_count == 1 ? '1 like' : s.favourites_count + ' likes'}}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2019-05-21 03:11:38 +00:00
|
|
|
|
</div>
|
2019-04-15 18:24:02 +00:00
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div class="card-body flex-grow-0 py-1">
|
|
|
|
|
<div class="reactions my-1">
|
|
|
|
|
<h3 v-bind:class="[reactions.liked ? 'fas fa-heart text-danger pr-3 m-0 cursor-pointer' : 'far fa-heart pr-3 m-0 like-btn cursor-pointer']" title="Like" v-on:click="likeStatus"></h3>
|
|
|
|
|
<h3 v-if="!status.comments_disabled" class="far fa-comment pr-3 m-0 cursor-pointer" title="Comment" v-on:click="replyFocus(status)"></h3>
|
2019-06-25 03:18:39 +00:00
|
|
|
|
<h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.shared ? 'far fa-share-square pr-3 m-0 text-primary cursor-pointer' : 'far fa-share-square pr-3 m-0 share-btn cursor-pointer']" title="Share" v-on:click="shareStatus"></h3>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<h3 @click="lightbox(status.media_attachments[0])" class="fas fa-expand m-0 cursor-pointer"></h3>
|
2019-06-25 03:18:39 +00:00
|
|
|
|
<h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.bookmarked ? 'fas fa-bookmark text-warning m-0 float-right cursor-pointer' : 'far fa-bookmark m-0 float-right cursor-pointer']" title="Bookmark" v-on:click="bookmarkStatus"></h3>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="reaction-counts font-weight-bold mb-0">
|
|
|
|
|
<span style="cursor:pointer;" v-on:click="likesModal">
|
|
|
|
|
<span class="like-count">{{status.favourites_count || 0}}</span> likes
|
|
|
|
|
</span>
|
2019-06-25 03:18:39 +00:00
|
|
|
|
<span v-if="status.visibility == 'public'" class="float-right" style="cursor:pointer;" v-on:click="sharesModal">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<span class="share-count pl-4">{{status.reblogs_count || 0}}</span> shares
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2019-04-13 05:09:27 +00:00
|
|
|
|
<div class="timestamp pt-2 d-flex align-items-bottom justify-content-between">
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<a v-bind:href="statusUrl" class="small text-muted">
|
|
|
|
|
{{timestampFormat()}}
|
|
|
|
|
</a>
|
2019-04-13 05:09:27 +00:00
|
|
|
|
<span class="small text-muted text-capitalize cursor-pointer" v-on:click="visibilityModal">{{status.visibility}}</span>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
<div v-if="showComments && user.length !== 0" class="card-footer bg-white px-2 py-0">
|
|
|
|
|
<ul class="nav align-items-center emoji-reactions" style="overflow-x: scroll;flex-wrap: unset;">
|
2019-05-21 04:26:49 +00:00
|
|
|
|
<li class="nav-item" v-on:click="emojiReaction" v-for="e in emoji">{{e}}</li>
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="showComments" class="card-footer bg-white sticky-md-bottom p-0">
|
|
|
|
|
<div v-if="user.length == 0" class="comment-form-guest p-3">
|
|
|
|
|
<a href="/login">Login</a> to like or comment.
|
|
|
|
|
</div>
|
|
|
|
|
<form v-else class="border-0 rounded-0 align-middle" method="post" action="/i/comment" :data-id="statusId" data-truncate="false">
|
|
|
|
|
<textarea class="form-control border-0 rounded-0" name="comment" placeholder="Add a comment…" autocomplete="off" autocorrect="off" style="height:56px;line-height: 18px;max-height:80px;resize: none; padding-right:4.2rem;" v-model="replyText"></textarea>
|
|
|
|
|
<input type="button" value="Post" class="d-inline-block btn btn-link font-weight-bold reply-btn text-decoration-none" v-on:click.prevent="postReply"/>
|
|
|
|
|
</form>
|
2018-11-20 02:45:27 +00:00
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2019-04-08 07:11:35 +00:00
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
|
|
|
|
|
<div v-if="profileLayout == 'moment'" class="momentui">
|
|
|
|
|
<div class="bg-dark mt-md-n4">
|
2019-05-07 03:26:12 +00:00
|
|
|
|
<div class="container" v-on:dblclick="likeStatus">
|
2019-04-20 19:26:29 +00:00
|
|
|
|
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center bg-dark">
|
2019-04-18 00:58:21 +00:00
|
|
|
|
<div v-if="status.pf_type === 'photo'" class="w-100">
|
|
|
|
|
<photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
|
|
|
|
<video-presenter :status="status"></video-presenter>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else-if="status.pf_type === 'photo:album'" class="w-100">
|
|
|
|
|
<photo-album-presenter :status="status" v-on:lightbox="lightbox"></photo-album-presenter>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else-if="status.pf_type === 'video:album'" class="w-100">
|
|
|
|
|
<video-album-presenter :status="status"></video-album-presenter>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
|
|
|
|
|
<mixed-album-presenter :status="status" v-on:lightbox="lightbox"></mixed-album-presenter>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else class="w-100">
|
|
|
|
|
<p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bg-white">
|
|
|
|
|
<div class="container">
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<div class="row pb-5">
|
|
|
|
|
<div class="col-12 col-md-8 py-4">
|
|
|
|
|
<div class="reactions d-flex align-items-center">
|
|
|
|
|
<div class="text-center mr-5">
|
|
|
|
|
<div v-bind:class="[reactions.liked ? 'fas fa-heart text-danger m-0 cursor-pointer' : 'far fa-heart m-0 like-btn cursor-pointer']" title="Like" v-on:click="likeStatus" style="font-size:1.575rem">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="like-count font-weight-bold mt-2 rounded border" style="cursor:pointer;" v-on:click="likesModal">{{status.favourites_count || 0}}</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
</div>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<div class="text-center">
|
|
|
|
|
<div v-if="status.visibility == 'public'" v-bind:class="[reactions.shared ? 'h3 far fa-share-square m-0 text-primary cursor-pointer' : 'h3 far fa-share-square m-0 share-btn cursor-pointer']" title="Share" v-on:click="shareStatus">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="share-count font-weight-bold mt-2 rounded border" v-if="status.visibility == 'public'" style="cursor:pointer;" v-on:click="sharesModal">{{status.reblogs_count || 0}}</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<!-- <div class="reaction-counts font-weight-bold mb-0">
|
|
|
|
|
<span class="like-count">{{status.favourites_count || 0}}</span> likes
|
|
|
|
|
<span v-if="status.visibility == 'public'" class="float-right" style="cursor:pointer;" v-on:click="sharesModal">
|
|
|
|
|
<span class="share-count pl-4">{{status.reblogs_count || 0}}</span> shares
|
|
|
|
|
</span>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="media align-items-center mt-3">
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<h2 class="font-weight-bold">
|
|
|
|
|
{{status.content.length < 100 ? status.content.slice(0,100) : 'Untitled Post'}}
|
|
|
|
|
</h2>
|
|
|
|
|
<p class="lead mb-0">
|
|
|
|
|
by <a :href="statusProfileUrl">{{statusUsername}}</a>
|
|
|
|
|
<!-- <span class="px-1 text-lighter">•</span>
|
|
|
|
|
<a class="font-weight-bold small" href="#">Follow</a> -->
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<img :src="statusAvatar" class="rounded-circle border mr-3" alt="avatar" width="72px" height="72px">
|
|
|
|
|
</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
<hr>
|
|
|
|
|
<div>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<p class="lead">
|
|
|
|
|
<span v-if="status.place" class="text-truncate">
|
|
|
|
|
<i class="fas fa-map-marker-alt text-lighter mr-3"></i> {{status.place.name}}, {{status.place.country}}
|
|
|
|
|
</span>
|
|
|
|
|
<span v-once class="float-right">
|
|
|
|
|
<i class="far fa-clock text-lighter mr-3"></i> {{timeAgo(status.created_at)}} ago
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<!-- <div v-if="status.content.length > 100" class="lead" v-html="status.content"></div> -->
|
|
|
|
|
<!-- <div class="pt-4">
|
|
|
|
|
<p class="lead">
|
|
|
|
|
<span class="mr-3"><i class="fas fa-camera text-lighter"></i></span>
|
|
|
|
|
<span>Nikon D850</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="lead">
|
|
|
|
|
<span class="mr-3"><i class="fas fa-ruler-horizontal text-lighter"></i></span>
|
|
|
|
|
<span>200-500mm</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="lead">
|
|
|
|
|
<span class="mr-3"><i class="fas fa-stream text-lighter"></i></span>
|
|
|
|
|
<span>500mm <span class="px-1"></span> ƒ/7.1 <span class="px-1"></span> 1/1600s <span class="px-1"></span> ISO 800</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div v-if="status.tags" class="pt-4">
|
|
|
|
|
<p class="lead">
|
|
|
|
|
<a v-for="(tag, index) in status.tags" class="btn btn-outline-dark mr-1 mb-1" :href="tag.url + '?src=mp'">{{tag.name}}</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<div class="col-12 col-md-4 pt-4 pl-md-3">
|
|
|
|
|
<p class="lead font-weight-bold">Comments</p>
|
|
|
|
|
<div v-if="user" class="moment-comments">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<textarea class="form-control" rows="3" placeholder="Add a comment ..." v-model="replyText"></textarea>
|
|
|
|
|
<p style="padding-top:4px;">
|
|
|
|
|
<span class="small text-lighter font-weight-bold">
|
|
|
|
|
{{replyText.length}}/{{config.uploader.max_caption_length}}
|
|
|
|
|
</span>
|
|
|
|
|
<button
|
|
|
|
|
:class="[replyText.length > 1 ? 'btn btn-sm font-weight-bold float-right btn-outline-dark ':'btn btn-sm font-weight-bold float-right btn-outline-lighter']"
|
|
|
|
|
:disabled="replyText.length < 2"
|
|
|
|
|
@click="postReply"
|
|
|
|
|
>Post</button>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<hr>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comment mt-3" style="max-height: 500px; overflow-y: auto;">
|
|
|
|
|
<div v-for="(reply, index) in results" :key="'tl' + reply.id + '_' + index" class="media mb-3">
|
|
|
|
|
<img :src="reply.account.avatar" class="rounded-circle border mr-3" alt="avatar" width="32px" height="32px">
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span class="font-weight-bold">{{reply.account.username}}</span>
|
|
|
|
|
<span class="small">
|
|
|
|
|
<a class="text-lighter text-decoration-none" :href="reply.url">{{timeAgo(reply.created_at)}}</a>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2019-09-13 16:39:17 +00:00
|
|
|
|
<p v-html="reply.content"></p>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="media mb-3">
|
|
|
|
|
<img :src="statusAvatar" class="rounded-circle border mr-3" alt="avatar" width="32px" height="32px">
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span class="font-weight-bold">mona</span>
|
|
|
|
|
<span class="text-lighter small">2h ago</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p>Stunning my friend!</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="media mb-3">
|
|
|
|
|
<img :src="statusAvatar" class="rounded-circle border mr-3" alt="avatar" width="32px" height="32px">
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span class="font-weight-bold">Andre</span>
|
|
|
|
|
<span class="text-lighter small">3h ago</span>
|
|
|
|
|
</div>
|
|
|
|
|
<p>Wow</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
2018-12-25 21:42:12 +00:00
|
|
|
|
<b-modal ref="likesModal"
|
2018-12-02 04:57:43 +00:00
|
|
|
|
id="l-modal"
|
2018-12-25 21:42:12 +00:00
|
|
|
|
hide-footer
|
|
|
|
|
centered
|
2018-12-02 04:57:43 +00:00
|
|
|
|
title="Likes"
|
|
|
|
|
body-class="list-group-flush p-0">
|
|
|
|
|
<div class="list-group">
|
2019-02-11 05:31:49 +00:00
|
|
|
|
<div class="list-group-item border-0" v-for="(user, index) in likes" :key="'modal_likes_'+index">
|
2018-12-02 04:57:43 +00:00
|
|
|
|
<div class="media">
|
|
|
|
|
<a :href="user.url">
|
2019-03-01 00:57:41 +00:00
|
|
|
|
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px">
|
2018-12-02 04:57:43 +00:00
|
|
|
|
</a>
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<p class="mb-0" style="font-size: 14px">
|
|
|
|
|
<a :href="user.url" class="font-weight-bold text-dark">
|
|
|
|
|
{{user.username}}
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="text-muted mb-0" style="font-size: 14px">
|
|
|
|
|
{{user.display_name}}
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<infinite-loading @infinite="infiniteLikesHandler" spinner="spiral">
|
|
|
|
|
<div slot="no-more"></div>
|
|
|
|
|
<div slot="no-results"></div>
|
|
|
|
|
</infinite-loading>
|
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
2018-12-25 21:42:12 +00:00
|
|
|
|
<b-modal ref="sharesModal"
|
2018-12-02 04:57:43 +00:00
|
|
|
|
id="s-modal"
|
2018-12-25 21:42:12 +00:00
|
|
|
|
hide-footer
|
|
|
|
|
centered
|
2018-12-02 04:57:43 +00:00
|
|
|
|
title="Shares"
|
|
|
|
|
body-class="list-group-flush p-0">
|
|
|
|
|
<div class="list-group">
|
2019-02-11 05:31:49 +00:00
|
|
|
|
<div class="list-group-item border-0" v-for="(user, index) in shares" :key="'modal_shares_'+index">
|
2018-12-02 04:57:43 +00:00
|
|
|
|
<div class="media">
|
|
|
|
|
<a :href="user.url">
|
2019-02-28 13:03:25 +00:00
|
|
|
|
<img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px">
|
2018-12-02 04:57:43 +00:00
|
|
|
|
</a>
|
|
|
|
|
<div class="media-body">
|
2019-02-11 05:31:49 +00:00
|
|
|
|
<div class="d-inline-block">
|
|
|
|
|
<p class="mb-0" style="font-size: 14px">
|
|
|
|
|
<a :href="user.url" class="font-weight-bold text-dark">
|
|
|
|
|
{{user.username}}
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="text-muted mb-0" style="font-size: 14px">
|
|
|
|
|
{{user.display_name}}
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2019-02-22 04:08:39 +00:00
|
|
|
|
<p class="float-right"><!-- <a class="btn btn-primary font-weight-bold py-1" href="#">Follow</a> --></p>
|
2018-12-02 04:57:43 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<infinite-loading @infinite="infiniteSharesHandler" spinner="spiral">
|
|
|
|
|
<div slot="no-more"></div>
|
|
|
|
|
<div slot="no-results"></div>
|
|
|
|
|
</infinite-loading>
|
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
2019-05-03 19:11:29 +00:00
|
|
|
|
<b-modal
|
|
|
|
|
id="lightbox"
|
2019-03-10 05:31:29 +00:00
|
|
|
|
ref="lightboxModal"
|
|
|
|
|
:hide-header="true"
|
|
|
|
|
:hide-footer="true"
|
|
|
|
|
centered
|
|
|
|
|
size="lg"
|
|
|
|
|
body-class="p-0"
|
|
|
|
|
>
|
2019-09-04 01:36:39 +00:00
|
|
|
|
<div v-if="lightboxMedia" >
|
|
|
|
|
<img :src="lightboxMedia.url" :class="lightboxMedia.filter_class + ' img-fluid'" style="min-height: 100%; min-width: 100%">
|
2019-03-10 05:31:29 +00:00
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
2018-11-05 01:48:58 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
<style type="text/css" scoped>
|
|
|
|
|
.status-comments,
|
2019-04-29 09:09:45 +00:00
|
|
|
|
.reactions {
|
2019-04-03 05:13:45 +00:00
|
|
|
|
background: #fff;
|
|
|
|
|
}
|
|
|
|
|
.postPresenterContainer {
|
|
|
|
|
background: #fff;
|
|
|
|
|
}
|
2019-06-29 20:45:44 +00:00
|
|
|
|
@media(min-width: 720px) {
|
|
|
|
|
.postPresenterContainer {
|
|
|
|
|
min-height: 600px;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-03 05:13:45 +00:00
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
width: 0px;
|
|
|
|
|
background: transparent;
|
|
|
|
|
}
|
|
|
|
|
.reply-btn {
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 12px;
|
|
|
|
|
right: 20px;
|
|
|
|
|
width: 60px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 0 3px 3px 0;
|
|
|
|
|
}
|
|
|
|
|
.text-lighter {
|
|
|
|
|
color:#B8C2CC !important;
|
|
|
|
|
}
|
|
|
|
|
.text-break {
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
}
|
|
|
|
|
.comments p {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
.comment-reaction {
|
|
|
|
|
font-size: 80%;
|
|
|
|
|
}
|
|
|
|
|
.show-reply-bar {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
border-bottom: 1px solid #999;
|
|
|
|
|
height: 0;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
width: 24px;
|
|
|
|
|
}
|
|
|
|
|
.comment-thread {
|
|
|
|
|
margin: 4px 0 0 40px;
|
|
|
|
|
width: calc(100% - 40px);
|
|
|
|
|
}
|
|
|
|
|
.emoji-reactions .nav-item {
|
|
|
|
|
font-size: 1.2rem;
|
2019-04-15 18:24:02 +00:00
|
|
|
|
padding: 9px;
|
2019-04-03 05:13:45 +00:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
.emoji-reactions::-webkit-scrollbar {
|
|
|
|
|
width: 0px;
|
|
|
|
|
height: 0px;
|
|
|
|
|
background: transparent;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2019-06-16 21:42:30 +00:00
|
|
|
|
<style type="text/css" scoped>
|
2019-04-18 00:58:21 +00:00
|
|
|
|
.momentui .bg-dark {
|
|
|
|
|
background: #000 !important;
|
|
|
|
|
}
|
|
|
|
|
.momentui .carousel.slide,
|
|
|
|
|
.momentui .carousel-item {
|
|
|
|
|
background: #000 !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2019-04-03 05:13:45 +00:00
|
|
|
|
|
2018-11-05 01:48:58 +00:00
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
pixelfed.postComponent = {};
|
2018-12-03 20:23:22 +00:00
|
|
|
|
|
2018-11-05 01:48:58 +00:00
|
|
|
|
export default {
|
2019-04-18 00:58:21 +00:00
|
|
|
|
props: [
|
2019-05-03 19:11:29 +00:00
|
|
|
|
'status-id',
|
|
|
|
|
'status-username',
|
|
|
|
|
'status-template',
|
|
|
|
|
'status-url',
|
|
|
|
|
'status-profile-url',
|
2019-04-18 00:58:21 +00:00
|
|
|
|
'status-avatar',
|
|
|
|
|
'status-profile-id',
|
|
|
|
|
'profile-layout'
|
|
|
|
|
],
|
2018-11-05 01:48:58 +00:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2019-09-04 01:36:39 +00:00
|
|
|
|
config: window.App.config,
|
2019-02-13 05:46:05 +00:00
|
|
|
|
status: false,
|
2018-11-20 02:45:27 +00:00
|
|
|
|
media: {},
|
2019-02-13 05:46:05 +00:00
|
|
|
|
user: false,
|
2018-12-03 20:23:22 +00:00
|
|
|
|
reactions: {
|
|
|
|
|
liked: false,
|
|
|
|
|
shared: false
|
|
|
|
|
},
|
2019-02-11 05:31:49 +00:00
|
|
|
|
likes: [],
|
2018-12-02 04:57:43 +00:00
|
|
|
|
likesPage: 1,
|
2019-02-11 05:31:49 +00:00
|
|
|
|
shares: [],
|
2018-12-02 04:57:43 +00:00
|
|
|
|
sharesPage: 1,
|
2019-04-03 05:13:45 +00:00
|
|
|
|
lightboxMedia: false,
|
|
|
|
|
replyText: '',
|
2019-04-08 07:11:35 +00:00
|
|
|
|
relationship: {},
|
2019-04-03 05:13:45 +00:00
|
|
|
|
results: [],
|
|
|
|
|
pagination: {},
|
|
|
|
|
min_id: 0,
|
|
|
|
|
max_id: 0,
|
|
|
|
|
reply_to_profile_id: 0,
|
|
|
|
|
thread: false,
|
2019-04-08 07:11:35 +00:00
|
|
|
|
showComments: false,
|
|
|
|
|
warning: false,
|
|
|
|
|
loaded: false,
|
2019-04-15 18:24:02 +00:00
|
|
|
|
loading: null,
|
|
|
|
|
replyingToId: this.statusId,
|
2019-05-21 01:47:12 +00:00
|
|
|
|
replyToIndex: 0,
|
2019-10-15 05:47:17 +00:00
|
|
|
|
emoji: window.App.util.emoji,
|
2019-07-23 00:31:48 +00:00
|
|
|
|
showReadMore: true,
|
2019-10-15 05:47:17 +00:00
|
|
|
|
showCaption: true,
|
2018-11-05 01:48:58 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
2019-05-25 06:32:22 +00:00
|
|
|
|
beforeMount() {
|
|
|
|
|
let u = new URLSearchParams(window.location.search);
|
|
|
|
|
if(u.has('ui') && u.get('ui') == 'moment' && this.profileLayout != 'moment') {
|
|
|
|
|
this.profileLayout = 'moment';
|
|
|
|
|
}
|
|
|
|
|
if(u.has('ui') && u.get('ui') == 'metro' && this.profileLayout != 'metro') {
|
|
|
|
|
this.profileLayout = 'metro';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2018-11-05 01:48:58 +00:00
|
|
|
|
mounted() {
|
2019-04-08 07:11:35 +00:00
|
|
|
|
this.fetchRelationships();
|
2019-07-23 00:31:48 +00:00
|
|
|
|
if(localStorage.getItem('pf_metro_ui.exp.rm') == 'false') {
|
|
|
|
|
this.showReadMore = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.showReadMore = true;
|
|
|
|
|
}
|
2018-11-05 01:48:58 +00:00
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
2018-11-25 05:36:17 +00:00
|
|
|
|
updated() {
|
|
|
|
|
$('.carousel').carousel();
|
2019-07-23 00:31:48 +00:00
|
|
|
|
if(this.showReadMore == true) {
|
|
|
|
|
window.pixelfed.readmore();
|
|
|
|
|
}
|
2018-11-25 05:36:17 +00:00
|
|
|
|
},
|
2018-12-25 21:42:12 +00:00
|
|
|
|
|
2018-11-05 01:48:58 +00:00
|
|
|
|
methods: {
|
2018-11-20 02:45:27 +00:00
|
|
|
|
showMuteBlock() {
|
|
|
|
|
let sid = this.status.account.id;
|
|
|
|
|
let uid = this.user.id;
|
2018-12-03 20:23:22 +00:00
|
|
|
|
if(sid == uid) {
|
|
|
|
|
$('.post-actions .menu-author').removeClass('d-none');
|
|
|
|
|
} else {
|
|
|
|
|
$('.post-actions .menu-user').removeClass('d-none');
|
2018-11-20 02:45:27 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
2018-11-20 02:45:27 +00:00
|
|
|
|
reportUrl() {
|
|
|
|
|
return '/i/report?type=post&id=' + this.status.id;
|
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
2018-12-03 20:23:22 +00:00
|
|
|
|
editUrl() {
|
|
|
|
|
return this.status.url + '/edit';
|
|
|
|
|
},
|
|
|
|
|
|
2018-11-20 01:05:50 +00:00
|
|
|
|
timestampFormat() {
|
|
|
|
|
let ts = new Date(this.status.created_at);
|
2018-11-25 05:36:17 +00:00
|
|
|
|
return ts.toDateString() + ' ' + ts.toLocaleTimeString();
|
2018-11-20 01:05:50 +00:00
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
2018-11-05 01:48:58 +00:00
|
|
|
|
fetchData() {
|
2018-12-02 04:57:43 +00:00
|
|
|
|
axios.get('/api/v2/profile/'+this.statusUsername+'/status/'+this.statusId)
|
2018-11-05 01:48:58 +00:00
|
|
|
|
.then(response => {
|
|
|
|
|
let self = this;
|
|
|
|
|
self.status = response.data.status;
|
2018-11-20 02:45:27 +00:00
|
|
|
|
self.user = response.data.user;
|
2018-11-05 01:48:58 +00:00
|
|
|
|
self.media = self.status.media_attachments;
|
2018-11-25 05:36:17 +00:00
|
|
|
|
self.reactions = response.data.reactions;
|
2018-12-02 04:57:43 +00:00
|
|
|
|
self.likes = response.data.likes;
|
|
|
|
|
self.shares = response.data.shares;
|
|
|
|
|
self.likesPage = 2;
|
|
|
|
|
self.sharesPage = 2;
|
2018-11-20 02:45:27 +00:00
|
|
|
|
this.showMuteBlock();
|
2019-10-15 05:47:17 +00:00
|
|
|
|
self.showCaption = !response.data.status.sensitive;
|
2019-04-03 05:13:45 +00:00
|
|
|
|
if(self.status.comments_disabled == false) {
|
|
|
|
|
self.showComments = true;
|
|
|
|
|
this.fetchComments();
|
|
|
|
|
}
|
2019-04-20 19:26:29 +00:00
|
|
|
|
this.loaded = true;
|
2019-03-04 02:34:45 +00:00
|
|
|
|
$('head title').text(this.status.account.username + ' posted a photo: ' + this.status.favourites_count + ' likes');
|
2018-11-05 01:48:58 +00:00
|
|
|
|
}).catch(error => {
|
|
|
|
|
if(!error.response) {
|
|
|
|
|
} else {
|
|
|
|
|
switch(error.response.status) {
|
|
|
|
|
case 401:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2018-12-02 04:57:43 +00:00
|
|
|
|
|
|
|
|
|
likesModal() {
|
|
|
|
|
if(this.status.favourites_count == 0 || $('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$refs.likesModal.show();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
sharesModal() {
|
|
|
|
|
if(this.status.reblogs_count == 0 || $('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$refs.sharesModal.show();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
infiniteLikesHandler($state) {
|
|
|
|
|
let api = '/api/v2/likes/profile/'+this.statusUsername+'/status/'+this.statusId;
|
|
|
|
|
axios.get(api, {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.likesPage,
|
|
|
|
|
},
|
|
|
|
|
}).then(({ data }) => {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
if (data.data.length > 0) {
|
2018-12-02 04:57:43 +00:00
|
|
|
|
this.likes.push(...data.data);
|
2019-02-11 05:31:49 +00:00
|
|
|
|
this.likesPage++;
|
2018-12-02 04:57:43 +00:00
|
|
|
|
$state.loaded();
|
|
|
|
|
} else {
|
|
|
|
|
$state.complete();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
infiniteSharesHandler($state) {
|
|
|
|
|
axios.get('/api/v2/shares/profile/'+this.statusUsername+'/status/'+this.statusId, {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.sharesPage,
|
|
|
|
|
},
|
|
|
|
|
}).then(({ data }) => {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
if (data.data.length > 0) {
|
2018-12-02 04:57:43 +00:00
|
|
|
|
this.shares.push(...data.data);
|
2019-02-11 05:31:49 +00:00
|
|
|
|
this.sharesPage++;
|
2018-12-02 04:57:43 +00:00
|
|
|
|
$state.loaded();
|
|
|
|
|
} else {
|
|
|
|
|
$state.complete();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2018-12-03 20:23:22 +00:00
|
|
|
|
likeStatus(event) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
2019-04-03 05:13:45 +00:00
|
|
|
|
window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/like', {
|
|
|
|
|
item: this.status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.status.favourites_count = res.data.count;
|
|
|
|
|
if(this.reactions.liked == true) {
|
|
|
|
|
this.reactions.liked = false;
|
2019-02-11 05:31:49 +00:00
|
|
|
|
let user = this.user.id;
|
|
|
|
|
this.likes = this.likes.filter(function(like) {
|
|
|
|
|
return like.id !== user;
|
|
|
|
|
});
|
2018-12-03 20:23:22 +00:00
|
|
|
|
} else {
|
|
|
|
|
this.reactions.liked = true;
|
2019-02-11 05:31:49 +00:00
|
|
|
|
let user = this.user;
|
|
|
|
|
this.likes.push(user);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
console.error(err);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
shareStatus() {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
2019-04-03 05:13:45 +00:00
|
|
|
|
window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/share', {
|
|
|
|
|
item: this.status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.status.reblogs_count = res.data.count;
|
|
|
|
|
if(this.reactions.shared == true) {
|
|
|
|
|
this.reactions.shared = false;
|
2019-02-11 05:31:49 +00:00
|
|
|
|
let user = this.user.id;
|
|
|
|
|
this.shares = this.shares.filter(function(reaction) {
|
|
|
|
|
return reaction.id !== user;
|
|
|
|
|
});
|
2018-12-03 20:23:22 +00:00
|
|
|
|
} else {
|
|
|
|
|
this.reactions.shared = true;
|
2019-02-11 05:31:49 +00:00
|
|
|
|
let user = this.user;
|
|
|
|
|
this.shares.push(user);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
console.error(err);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
bookmarkStatus() {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
2019-04-03 05:13:45 +00:00
|
|
|
|
window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname);
|
2018-12-03 20:23:22 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/bookmark', {
|
|
|
|
|
item: this.status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(this.reactions.bookmarked == true) {
|
|
|
|
|
this.reactions.bookmarked = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.reactions.bookmarked = true;
|
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
muteProfile() {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/mute', {
|
|
|
|
|
type: 'user',
|
|
|
|
|
item: this.status.account.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'You have successfully muted ' + this.status.account.acct, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
blockProfile() {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/block', {
|
|
|
|
|
type: 'user',
|
|
|
|
|
item: this.status.account.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'You have successfully blocked ' + this.status.account.acct, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2019-02-11 05:31:49 +00:00
|
|
|
|
deletePost(status) {
|
2019-04-03 05:13:45 +00:00
|
|
|
|
if(!this.ownerOrAdmin()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-12-29 22:55:47 +00:00
|
|
|
|
var result = confirm('Are you sure you want to delete this post?');
|
|
|
|
|
if (result) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
axios.post('/i/delete', {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
type: 'status',
|
2019-02-13 05:46:05 +00:00
|
|
|
|
item: this.status.id
|
2018-12-29 22:55:47 +00:00
|
|
|
|
}).then(res => {
|
2019-06-18 19:45:28 +00:00
|
|
|
|
swal('Success', 'You have successfully deleted this post', 'success');
|
2019-06-09 17:38:24 +00:00
|
|
|
|
setTimeout(function() {
|
|
|
|
|
window.location.href = '/';
|
2019-06-18 19:45:28 +00:00
|
|
|
|
}, 3000);
|
2018-12-29 22:55:47 +00:00
|
|
|
|
}).catch(err => {
|
2019-02-11 05:31:49 +00:00
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
2018-12-29 22:55:47 +00:00
|
|
|
|
});
|
2018-12-03 20:23:22 +00:00
|
|
|
|
}
|
2019-02-13 05:46:05 +00:00
|
|
|
|
},
|
2019-02-28 13:03:25 +00:00
|
|
|
|
|
2019-02-13 05:46:05 +00:00
|
|
|
|
owner() {
|
|
|
|
|
return this.user.id === this.status.account.id;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
admin() {
|
|
|
|
|
return this.user.is_admin == true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
ownerOrAdmin() {
|
|
|
|
|
return this.owner() || this.admin();
|
2019-03-10 05:31:29 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
lightbox(src) {
|
|
|
|
|
this.lightboxMedia = src;
|
|
|
|
|
this.$refs.lightboxModal.show();
|
2019-04-03 05:13:45 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
postReply() {
|
|
|
|
|
let self = this;
|
2019-05-03 19:11:29 +00:00
|
|
|
|
if(this.replyText.length == 0 ||
|
2019-04-03 05:13:45 +00:00
|
|
|
|
this.replyText.trim() == '@'+this.status.account.acct) {
|
|
|
|
|
self.replyText = null;
|
|
|
|
|
$('textarea[name="comment"]').blur();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let data = {
|
2019-04-15 18:24:02 +00:00
|
|
|
|
item: this.replyingToId,
|
2019-04-03 05:13:45 +00:00
|
|
|
|
comment: this.replyText
|
|
|
|
|
}
|
2019-09-04 01:36:39 +00:00
|
|
|
|
|
|
|
|
|
this.replyText = '';
|
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
axios.post('/i/comment', data)
|
|
|
|
|
.then(function(res) {
|
|
|
|
|
let entity = res.data.entity;
|
2019-04-15 18:24:02 +00:00
|
|
|
|
if(entity.in_reply_to_id == self.status.id) {
|
2019-09-04 01:36:39 +00:00
|
|
|
|
if(self.profileLayout == 'metro') {
|
|
|
|
|
self.results.push(entity);
|
|
|
|
|
} else {
|
|
|
|
|
self.results.unshift(entity);
|
|
|
|
|
}
|
2019-04-15 18:24:02 +00:00
|
|
|
|
let elem = $('.status-comments')[0];
|
|
|
|
|
elem.scrollTop = elem.clientHeight;
|
|
|
|
|
} else {
|
2019-05-21 01:47:12 +00:00
|
|
|
|
if(self.replyToIndex >= 0) {
|
|
|
|
|
let el = self.results[self.replyToIndex];
|
|
|
|
|
el.replies.push(entity);
|
|
|
|
|
el.reply_count = el.reply_count + 1;
|
|
|
|
|
}
|
2019-04-15 18:24:02 +00:00
|
|
|
|
}
|
2019-04-03 05:13:45 +00:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteComment(id, i) {
|
|
|
|
|
axios.post('/i/delete', {
|
|
|
|
|
type: 'comment',
|
|
|
|
|
item: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.results.splice(i, 1);
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Something went wrong!', 'Please try again later', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-05-21 03:11:38 +00:00
|
|
|
|
deleteCommentReply(id, i, pi) {
|
|
|
|
|
axios.post('/i/delete', {
|
|
|
|
|
type: 'comment',
|
|
|
|
|
item: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.results[pi].replies.splice(i, 1);
|
|
|
|
|
--this.results[pi].reply_count;
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Something went wrong!', 'Please try again later', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
l(e) {
|
|
|
|
|
let len = e.length;
|
2019-05-03 19:11:29 +00:00
|
|
|
|
if(len < 10) { return e; }
|
2019-04-03 05:13:45 +00:00
|
|
|
|
return e.substr(0, 10)+'...';
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-05-21 01:47:12 +00:00
|
|
|
|
replyFocus(e, index) {
|
|
|
|
|
this.replyToIndex = index;
|
2019-04-15 18:24:02 +00:00
|
|
|
|
this.replyingToId = e.id;
|
2019-04-03 05:13:45 +00:00
|
|
|
|
this.reply_to_profile_id = e.account.id;
|
|
|
|
|
this.replyText = '@' + e.account.username + ' ';
|
|
|
|
|
$('textarea[name="comment"]').focus();
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
fetchComments() {
|
|
|
|
|
let url = '/api/v2/comments/'+this.statusUsername+'/status/'+this.statusId;
|
|
|
|
|
axios.get(url)
|
|
|
|
|
.then(response => {
|
|
|
|
|
let self = this;
|
2019-09-04 01:36:39 +00:00
|
|
|
|
this.results = this.profileLayout == 'metro' ?
|
|
|
|
|
_.reverse(response.data.data) :
|
|
|
|
|
response.data.data;
|
2019-04-03 05:13:45 +00:00
|
|
|
|
this.pagination = response.data.meta.pagination;
|
|
|
|
|
if(this.results.length > 0) {
|
|
|
|
|
$('.load-more-link').removeClass('d-none');
|
|
|
|
|
}
|
|
|
|
|
$('.postCommentsLoader').addClass('d-none');
|
|
|
|
|
$('.postCommentsContainer').removeClass('d-none');
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
if(!error.response) {
|
|
|
|
|
$('.postCommentsLoader .lds-ring')
|
|
|
|
|
.attr('style','width:100%')
|
|
|
|
|
.addClass('pt-4 font-weight-bold text-muted')
|
|
|
|
|
.text('An error occurred, cannot fetch comments. Please try again later.');
|
|
|
|
|
} else {
|
|
|
|
|
switch(error.response.status) {
|
|
|
|
|
case 401:
|
|
|
|
|
$('.postCommentsLoader .lds-ring')
|
|
|
|
|
.attr('style','width:100%')
|
|
|
|
|
.addClass('pt-4 font-weight-bold text-muted')
|
|
|
|
|
.text('Please login to view.');
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
$('.postCommentsLoader .lds-ring')
|
|
|
|
|
.attr('style','width:100%')
|
|
|
|
|
.addClass('pt-4 font-weight-bold text-muted')
|
|
|
|
|
.text('An error occurred, cannot fetch comments. Please try again later.');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
loadMore(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
if(this.pagination.total_pages == 1 || this.pagination.current_page == this.pagination.total_pages) {
|
|
|
|
|
$('.load-more-link').addClass('d-none');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$('.postCommentsLoader').removeClass('d-none');
|
|
|
|
|
let next = this.pagination.links.next;
|
|
|
|
|
axios.get(next)
|
|
|
|
|
.then(response => {
|
|
|
|
|
let self = this;
|
|
|
|
|
let res = response.data.data;
|
|
|
|
|
$('.postCommentsLoader').addClass('d-none');
|
|
|
|
|
for(let i=0; i < res.length; i++) {
|
|
|
|
|
this.results.unshift(res[i]);
|
|
|
|
|
}
|
|
|
|
|
this.pagination = response.data.meta.pagination;
|
|
|
|
|
});
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
likeReply(status, $event) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-05-03 19:11:29 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
axios.post('/i/like', {
|
|
|
|
|
item: status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
status.favourites_count = res.data.count;
|
|
|
|
|
if(status.favourited == true) {
|
|
|
|
|
status.favourited = false;
|
|
|
|
|
} else {
|
|
|
|
|
status.favourited = true;
|
|
|
|
|
}
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
truncate(str,lim) {
|
|
|
|
|
return _.truncate(str,{
|
|
|
|
|
length: lim
|
|
|
|
|
});
|
|
|
|
|
},
|
2019-04-08 07:11:35 +00:00
|
|
|
|
|
2019-04-03 05:13:45 +00:00
|
|
|
|
timeAgo(ts) {
|
|
|
|
|
let date = Date.parse(ts);
|
|
|
|
|
let seconds = Math.floor((new Date() - date) / 1000);
|
|
|
|
|
let interval = Math.floor(seconds / 31536000);
|
|
|
|
|
if (interval >= 1) {
|
|
|
|
|
return interval + "y";
|
|
|
|
|
}
|
|
|
|
|
interval = Math.floor(seconds / 604800);
|
|
|
|
|
if (interval >= 1) {
|
|
|
|
|
return interval + "w";
|
|
|
|
|
}
|
|
|
|
|
interval = Math.floor(seconds / 86400);
|
|
|
|
|
if (interval >= 1) {
|
|
|
|
|
return interval + "d";
|
|
|
|
|
}
|
|
|
|
|
interval = Math.floor(seconds / 3600);
|
|
|
|
|
if (interval >= 1) {
|
|
|
|
|
return interval + "h";
|
|
|
|
|
}
|
|
|
|
|
interval = Math.floor(seconds / 60);
|
|
|
|
|
if (interval >= 1) {
|
|
|
|
|
return interval + "m";
|
|
|
|
|
}
|
|
|
|
|
return Math.floor(seconds) + "s";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
emojiReaction() {
|
|
|
|
|
let em = event.target.innerText;
|
|
|
|
|
if(this.replyText.length == 0) {
|
|
|
|
|
this.reply_to_profile_id = this.status.account.id;
|
2019-05-05 04:44:19 +00:00
|
|
|
|
this.replyText = em + ' ';
|
2019-04-03 05:13:45 +00:00
|
|
|
|
$('textarea[name="comment"]').focus();
|
|
|
|
|
} else {
|
|
|
|
|
this.reply_to_profile_id = this.status.account.id;
|
2019-05-05 04:44:19 +00:00
|
|
|
|
this.replyText += em + ' ';
|
2019-04-03 05:13:45 +00:00
|
|
|
|
$('textarea[name="comment"]').focus();
|
|
|
|
|
}
|
2019-05-03 19:11:29 +00:00
|
|
|
|
},
|
2019-04-03 05:13:45 +00:00
|
|
|
|
|
|
|
|
|
toggleCommentVisibility() {
|
|
|
|
|
if(this.ownerOrAdmin() == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let state = this.status.comments_disabled;
|
|
|
|
|
let self = this;
|
|
|
|
|
|
|
|
|
|
if(state == true) {
|
|
|
|
|
// re-enable comments
|
|
|
|
|
axios.post('/i/visibility', {
|
|
|
|
|
item: self.status.id,
|
|
|
|
|
disableComments: false
|
|
|
|
|
}).then(function(res) {
|
|
|
|
|
window.location.href = self.status.url;
|
|
|
|
|
}).catch(function(err) {
|
|
|
|
|
return;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// disable comments
|
|
|
|
|
axios.post('/i/visibility', {
|
|
|
|
|
item: self.status.id,
|
|
|
|
|
disableComments: true
|
|
|
|
|
}).then(function(res) {
|
|
|
|
|
self.status.comments_disabled = false;
|
|
|
|
|
self.showComments = false;
|
|
|
|
|
}).catch(function(err) {
|
|
|
|
|
return;
|
|
|
|
|
});
|
|
|
|
|
}
|
2019-04-08 07:11:35 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fetchRelationships() {
|
|
|
|
|
if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == false) {
|
|
|
|
|
this.fetchData();
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
2019-09-16 00:06:04 +00:00
|
|
|
|
axios.get('/api/pixelfed/v1/accounts/relationships', {
|
2019-04-08 07:11:35 +00:00
|
|
|
|
params: {
|
|
|
|
|
'id[]': this.statusProfileId
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res.data[0] == null) {
|
|
|
|
|
this.fetchData();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.relationship = res.data[0];
|
|
|
|
|
if(res.data[0].blocking == true) {
|
|
|
|
|
this.loaded = true;
|
|
|
|
|
this.warning = true;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
this.fetchData();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-02-13 05:46:05 +00:00
|
|
|
|
|
2019-04-13 05:09:27 +00:00
|
|
|
|
visibilityModal() {
|
|
|
|
|
switch(this.status.visibility) {
|
|
|
|
|
case 'public':
|
|
|
|
|
swal('Public Post', 'This post is visible to everyone.', 'info');
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'unlisted':
|
|
|
|
|
swal('Unlisted Post', 'This post is visible on profiles and with a direct links. It is not displayed on timelines.', 'info');
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'private':
|
|
|
|
|
swal('Private Post', 'This post is only visible to followers.', 'info');
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-04-15 18:24:02 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toggleReplies(reply) {
|
|
|
|
|
if(reply.thread) {
|
|
|
|
|
reply.thread = false;
|
|
|
|
|
} else {
|
|
|
|
|
if(reply.replies.length > 0) {
|
|
|
|
|
reply.thread = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let url = '/api/v2/comments/'+reply.account.username+'/status/'+reply.id;
|
|
|
|
|
axios.get(url)
|
|
|
|
|
.then(response => {
|
|
|
|
|
reply.replies = _.reverse(response.data.data);
|
|
|
|
|
reply.thread = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
2019-09-04 01:36:39 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
redirect(url) {
|
|
|
|
|
window.location.href = url;
|
2019-04-13 05:09:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-13 05:46:05 +00:00
|
|
|
|
},
|
2018-11-05 01:48:58 +00:00
|
|
|
|
}
|
2018-12-25 21:42:12 +00:00
|
|
|
|
</script>
|