2018-12-09 22:58:37 +00:00
|
|
|
|
<template>
|
|
|
|
|
<div class="container" style="">
|
|
|
|
|
<div class="row">
|
2019-03-12 06:40:55 +00:00
|
|
|
|
<div class="col-md-8 col-lg-8 pt-sm-2 px-0 my-sm-3 timeline order-2 order-md-1">
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div style="padding-top:10px;">
|
|
|
|
|
<div v-if="loading" class="text-center">
|
|
|
|
|
<div class="spinner-border" role="status">
|
|
|
|
|
<span class="sr-only">Loading...</span>
|
|
|
|
|
</div>
|
2019-02-13 06:27:24 +00:00
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="card mb-sm-4 status-card card-md-rounded-0" :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
|
2018-12-09 22:58:37 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="card-header d-inline-flex align-items-center bg-white">
|
|
|
|
|
<img v-bind:src="status.account.avatar" width="32px" height="32px" style="border-radius: 32px;">
|
|
|
|
|
<a class="username font-weight-bold pl-2 text-dark" v-bind:href="status.account.url">
|
|
|
|
|
{{status.account.username}}
|
|
|
|
|
</a>
|
|
|
|
|
<div class="text-right" style="flex-grow:1;">
|
|
|
|
|
<button class="btn btn-link text-dark no-caret dropdown-toggle py-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Post options">
|
|
|
|
|
<span class="fas fa-ellipsis-v fa-lg text-muted"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="dropdown-menu dropdown-menu-right">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="status.url">Go to post</a>
|
|
|
|
|
<!-- <a class="dropdown-item font-weight-bold" href="#">Share</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" href="#">Embed</a> -->
|
|
|
|
|
<span v-if="statusOwner(status) == false">
|
|
|
|
|
<a class="dropdown-item font-weight-bold" :href="reportUrl(status)">Report</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="muteProfile(status)">Mute Profile</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="blockProfile(status)">Block Profile</a>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-if="statusOwner(status) == true">
|
|
|
|
|
<a class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-if="profile.is_admin == true && modes.mod == true">
|
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
|
<a v-if="!statusOwner(status)" class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
|
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
|
<h6 class="dropdown-header">Mod Tools</h6>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'autocw')">
|
|
|
|
|
<p class="mb-0" data-toggle="tooltip" data-placement="bottom" title="Adds a CW to every post made by this account.">Enforce CW</p>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'noautolink')">
|
|
|
|
|
<p class="mb-0" title="Do not transform mentions, hashtags or urls into HTML.">No Autolinking</p>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'unlisted')">
|
|
|
|
|
<p class="mb-0" title="Removes account from public/network timelines.">Unlisted Posts</p>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'disable')">
|
|
|
|
|
<p class="mb-0" title="Temporarily disable account until next time user log in.">Disable Account</p>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'suspend')">
|
|
|
|
|
<p class="mb-0" title="This prevents any new interactions, without deleting existing data.">Suspend Account</p>
|
|
|
|
|
</a>
|
2019-02-11 00:56:52 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-05-03 19:11:29 +00:00
|
|
|
|
<div class="postPresenterContainer" v-on:doubletap="likeStatus(status, $event)">
|
2019-04-30 04:04:42 +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-10 04:02:52 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
|
|
|
|
<video-presenter :status="status"></video-presenter>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +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-09 22:58:37 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-else-if="status.pf_type === 'video:album'" class="w-100">
|
|
|
|
|
<video-album-presenter :status="status"></video-album-presenter>
|
|
|
|
|
</div>
|
2018-12-10 05:43:47 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +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-12-10 05:43:47 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-else class="w-100">
|
|
|
|
|
<p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
|
|
|
|
</div>
|
2018-12-10 04:02:52 +00:00
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="reactions my-1">
|
|
|
|
|
<h3 v-bind:class="[status.favourited ? '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(status, $event)"></h3>
|
|
|
|
|
<h3 v-if="!status.comments_disabled" class="far fa-comment pr-3 m-0 cursor-pointer" title="Comment" v-on:click="commentFocus(status, $event)"></h3>
|
|
|
|
|
<h3 v-bind:class="[status.reblogged ? '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(status, $event)"></h3>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="likes font-weight-bold" v-if="expLc(status) == true">
|
|
|
|
|
<span class="like-count">{{status.favourites_count}}</span> {{status.favourites_count == 1 ? 'like' : 'likes'}}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="caption">
|
|
|
|
|
<p class="mb-2 read-more" style="overflow: hidden;">
|
|
|
|
|
<span class="username font-weight-bold">
|
|
|
|
|
<bdi><a class="text-dark" :href="status.account.url">{{status.account.username}}</a></bdi>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-html="status.content"></span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comments" v-if="status.id == replyId && !status.comments_disabled">
|
|
|
|
|
<p class="mb-0 d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;" v-for="(reply, index) in replies">
|
|
|
|
|
<span>
|
|
|
|
|
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url">{{reply.account.username}}</a>
|
|
|
|
|
<span v-html="reply.content"></span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="mb-0" style="min-width:38px">
|
|
|
|
|
<span v-on:click="likeStatus(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="profile" size="sm" :modal="'true'" :feed="feed" class="d-inline-flex pl-2"></post-menu>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="timestamp mt-2">
|
|
|
|
|
<p class="small text-uppercase mb-0">
|
|
|
|
|
<a :href="status.url" class="text-muted">
|
|
|
|
|
<timeago :datetime="status.created_at" :auto-update="60" :converter-options="{includeSeconds:true}" :title="timestampFormat(status.created_at)" v-b-tooltip.hover.bottom></timeago>
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="card-footer bg-white" v-if="status.id == replyId">
|
|
|
|
|
<form class="" v-on:submit.prevent="commentSubmit(status, $event)">
|
|
|
|
|
<input type="hidden" name="item" value="">
|
|
|
|
|
<input class="form-control status-reply-input" name="comment" placeholder="Add a comment…" autocomplete="off">
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-if="modes.infinite == true && !loading && feed.length > 0">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-body">
|
2019-05-01 04:38:14 +00:00
|
|
|
|
<infinite-loading @infinite="infiniteTimeline" :distance="800">
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div slot="no-more" class="font-weight-bold">No more posts to load</div>
|
|
|
|
|
<div slot="no-results" class="font-weight-bold">No posts found</div>
|
|
|
|
|
</infinite-loading>
|
|
|
|
|
</div>
|
2019-02-13 06:27:24 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-if="modes.infinite == false && !loading && feed.length > 0" class="pagination">
|
|
|
|
|
<p class="btn btn-outline-secondary font-weight-bold btn-block" v-on:click="loadMore">Load more posts</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!loading && scope == 'home' && feed.length == 0">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-body text-center">
|
|
|
|
|
<p class="h2 font-weight-lighter p-5">Hello, {{profile.acct}}</p>
|
|
|
|
|
<p class="text-lighter"><i class="fas fa-camera-retro fa-5x"></i></p>
|
|
|
|
|
<p class="h3 font-weight-lighter p-5">Start following people to build your timeline.</p>
|
|
|
|
|
<p><a href="/discover" class="btn btn-primary font-weight-bold py-0">Discover new people and posts</a></p>
|
|
|
|
|
</div>
|
2019-02-13 06:27:24 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
2018-12-11 03:47:55 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="col-md-4 col-lg-4 pt-2 my-3 order-1 order-md-2 d-none d-md-block">
|
|
|
|
|
<div class="position-sticky" style="top:68px;">
|
|
|
|
|
<div class="mb-4">
|
2019-04-30 03:33:55 +00:00
|
|
|
|
<div class="">
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div class="">
|
|
|
|
|
<div class="media d-flex align-items-center">
|
|
|
|
|
<a :href="profile.url">
|
|
|
|
|
<img class="mr-3 rounded-circle box-shadow" :src="profile.avatar || '/storage/avatars/default.png'" alt="avatar" width="64px" height="64px">
|
|
|
|
|
</a>
|
|
|
|
|
<div class="media-body d-flex justify-content-between word-break" >
|
|
|
|
|
<div>
|
|
|
|
|
<p class="mb-0 px-0 font-weight-bold"><a :href="profile.url" class="text-dark">{{profile.username || 'loading...'}}</a></p>
|
|
|
|
|
<p class="my-0 text-muted pb-0">{{profile.display_name || 'loading...'}}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ml-2">
|
2019-05-02 04:18:42 +00:00
|
|
|
|
<a :class="[optionMenuState == true ? 'text-primary' :'text-muted']" v-on:click="toggleOptionsMenu()"><i class="fas fa-cog fa-lg"></i></a>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
</div>
|
2019-02-11 00:56:52 +00:00
|
|
|
|
</div>
|
2018-12-11 03:47:55 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<!-- <div class="card-footer bg-white py-1 d-none">
|
|
|
|
|
<div class="d-flex justify-content-between text-center">
|
|
|
|
|
<span class="pl-3 cursor-pointer" v-on:click="redirect(profile.url)">
|
|
|
|
|
<p class="mb-0 font-weight-bold">{{profile.statuses_count}}</p>
|
|
|
|
|
<p class="mb-0 small text-muted">Posts</p>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="cursor-pointer" v-on:click="followersModal()">
|
|
|
|
|
<p class="mb-0 font-weight-bold">{{profile.followers_count}}</p>
|
|
|
|
|
<p class="mb-0 small text-muted">Followers</p>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="pr-3 cursor-pointer" v-on:click="followingModal()">
|
|
|
|
|
<p class="mb-0 font-weight-bold">{{profile.following_count}}</p>
|
|
|
|
|
<p class="mb-0 small text-muted">Following</p>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
2018-12-11 03:47:55 +00:00
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
2018-12-11 03:47:55 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-if="optionMenuState == true" class="mb-4">
|
|
|
|
|
<div class="card options-card">
|
|
|
|
|
<div class="card-body small">
|
|
|
|
|
<div v-if="profile.is_admin" class="custom-control custom-switch mb-3">
|
|
|
|
|
<input type="checkbox" class="custom-control-input" id="mode-mod" v-on:click="modeModToggle()" v-model="modes.mod">
|
|
|
|
|
<label class="custom-control-label font-weight-bold" for="mode-mod">Moderator Mode</label>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="custom-control custom-switch mb-3">
|
|
|
|
|
<input type="checkbox" class="custom-control-input" id="mode-notify" v-on:click="modeNotifyToggle()" v-model="!modes.notify">
|
|
|
|
|
<label class="custom-control-label font-weight-bold" for="mode-notify">Disable Notifications</label>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="custom-control custom-switch">
|
|
|
|
|
<input type="checkbox" class="custom-control-input" id="mode-infinite" v-on:click="modeInfiniteToggle()" v-model="modes.infinite">
|
|
|
|
|
<label class="custom-control-label font-weight-bold" for="mode-infinite">Enable Infinite Scroll</label>
|
|
|
|
|
</div>
|
|
|
|
|
<hr>
|
|
|
|
|
<p class="font-weight-bold">BETA FEATURES</p>
|
|
|
|
|
<div class="alert alert-primary font-weight-bold text-center">Experimental features have been moved to the <a href="/settings/labs">Labs</a> settings page.</div>
|
2019-02-11 00:56:52 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-show="modes.notify == true" class="mb-4">
|
|
|
|
|
<notification-card></notification-card>
|
|
|
|
|
</div>
|
2018-12-11 03:47:55 +00:00
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<div v-show="suggestions.length && config.ab && config.ab.rec == true" class="mb-4">
|
|
|
|
|
<div class="card">
|
2019-05-02 04:18:42 +00:00
|
|
|
|
<div class="card-header bg-white text-center">
|
|
|
|
|
<div class="small text-dark text-uppercase font-weight-bold">Suggestions</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body pt-0">
|
|
|
|
|
<div v-for="(rec, index) in suggestions" class="media align-items-center mt-3">
|
|
|
|
|
<a :href="'/'+rec.username">
|
|
|
|
|
<img :src="rec.avatar" width="32px" height="32px" class="rounded-circle mr-3">
|
|
|
|
|
</a>
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
<p class="mb-0 font-weight-bold small">
|
|
|
|
|
<a :href="'/'+rec.username" class="text-decoration-none text-dark">
|
|
|
|
|
{{rec.username}}
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="mb-0 small text-muted">{{rec.message}}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<a class="font-weight-bold small" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
|
2019-04-28 23:01:10 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<footer>
|
|
|
|
|
<div class="container pb-5">
|
|
|
|
|
<p class="mb-0 text-uppercase font-weight-bold text-muted small">
|
|
|
|
|
<a href="/site/about" class="text-dark pr-2">About Us</a>
|
|
|
|
|
<a href="/site/help" class="text-dark pr-2">Help</a>
|
|
|
|
|
<a href="/site/open-source" class="text-dark pr-2">Open Source</a>
|
|
|
|
|
<a href="/site/language" class="text-dark pr-2">Language</a>
|
|
|
|
|
<a href="/site/terms" class="text-dark pr-2">Terms</a>
|
|
|
|
|
<a href="/site/privacy" class="text-dark pr-2">Privacy</a>
|
|
|
|
|
<a href="/site/platform" class="text-dark pr-2">API</a>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="mb-0 text-uppercase font-weight-bold text-muted small">
|
|
|
|
|
<a href="http://pixelfed.org" class="text-muted" rel="noopener" title="" data-toggle="tooltip">Powered by PixelFed</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
<!-- <b-modal ref="followingModal"
|
2019-02-28 03:59:16 +00:00
|
|
|
|
id="following-modal"
|
|
|
|
|
hide-footer
|
|
|
|
|
centered
|
|
|
|
|
title="Following"
|
|
|
|
|
body-class="list-group-flush p-0">
|
|
|
|
|
<div class="list-group">
|
|
|
|
|
<div class="list-group-item border-0" v-for="(user, index) in following" :key="'following_'+index">
|
|
|
|
|
<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">
|
2019-02-28 03:59:16 +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}}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2019-04-29 04:37:04 +00:00
|
|
|
|
<a class="btn btn-outline-secondary btn-sm" href="#" @click.prevent="followModalAction(user.id, index, 'following')">Unfollow</a>
|
2019-02-28 03:59:16 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-29 04:37:04 +00:00
|
|
|
|
<div v-if="following.length == 0" class="list-group-item border-0">
|
|
|
|
|
<div class="list-group-item border-0">
|
|
|
|
|
<p class="p-3 text-center mb-0 lead">You are not following anyone.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="following.length != 0 && followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
|
2019-02-28 03:59:16 +00:00
|
|
|
|
<p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
|
|
|
|
<b-modal ref="followerModal"
|
|
|
|
|
id="follower-modal"
|
|
|
|
|
hide-footer
|
|
|
|
|
centered
|
|
|
|
|
title="Followers"
|
|
|
|
|
body-class="list-group-flush p-0">
|
|
|
|
|
<div class="list-group">
|
|
|
|
|
<div class="list-group-item border-0" v-for="(user, index) in followers" :key="'follower_'+index">
|
|
|
|
|
<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">
|
2019-02-28 03:59:16 +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}}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="followerMore" class="list-group-item text-center" v-on:click="followersLoadMore()">
|
|
|
|
|
<p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-30 04:04:42 +00:00
|
|
|
|
</b-modal> -->
|
2019-05-03 19:11:29 +00:00
|
|
|
|
<b-modal
|
|
|
|
|
id="lightbox"
|
2019-03-10 05:26:29 +00:00
|
|
|
|
ref="lightboxModal"
|
2019-03-26 00:53:20 +00:00
|
|
|
|
hide-header
|
|
|
|
|
hide-footer
|
2019-03-10 05:26:29 +00:00
|
|
|
|
centered
|
|
|
|
|
size="lg"
|
|
|
|
|
body-class="p-0"
|
|
|
|
|
>
|
|
|
|
|
<div v-if="lightboxMedia" :class="lightboxMedia.filter_class">
|
2019-03-19 07:06:10 +00:00
|
|
|
|
<img :src="lightboxMedia.url" class="img-fluid" style="min-height: 100%; min-width: 100%">
|
2019-03-10 05:26:29 +00:00
|
|
|
|
</div>
|
|
|
|
|
</b-modal>
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2018-12-31 04:31:57 +00:00
|
|
|
|
<style type="text/css" scoped>
|
2018-12-10 04:02:52 +00:00
|
|
|
|
.postPresenterContainer {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2018-12-16 05:21:32 +00:00
|
|
|
|
background: #fff;
|
2018-12-10 04:02:52 +00:00
|
|
|
|
}
|
2018-12-26 02:41:12 +00:00
|
|
|
|
.word-break {
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
}
|
2019-02-11 00:56:52 +00:00
|
|
|
|
.small .custom-control-label {
|
|
|
|
|
padding-top: 3px;
|
|
|
|
|
}
|
2018-12-09 22:58:37 +00:00
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
export default {
|
2019-03-10 05:26:29 +00:00
|
|
|
|
props: ['scope'],
|
2018-12-09 22:58:37 +00:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2019-04-21 02:18:24 +00:00
|
|
|
|
config: {},
|
2019-01-06 05:02:42 +00:00
|
|
|
|
page: 2,
|
2018-12-09 22:58:37 +00:00
|
|
|
|
feed: [],
|
|
|
|
|
profile: {},
|
|
|
|
|
min_id: 0,
|
|
|
|
|
max_id: 0,
|
2018-12-11 03:47:55 +00:00
|
|
|
|
stories: {},
|
|
|
|
|
suggestions: {},
|
2019-01-06 05:02:42 +00:00
|
|
|
|
loading: true,
|
2019-02-11 00:56:52 +00:00
|
|
|
|
replies: [],
|
|
|
|
|
replyId: null,
|
|
|
|
|
optionMenuState: false,
|
|
|
|
|
modes: {
|
|
|
|
|
'mod': false,
|
|
|
|
|
'dark': false,
|
|
|
|
|
'notify': true,
|
2019-02-25 07:12:15 +00:00
|
|
|
|
'infinite': true
|
2019-02-28 03:59:16 +00:00
|
|
|
|
},
|
|
|
|
|
followers: [],
|
|
|
|
|
followerCursor: 1,
|
|
|
|
|
followerMore: true,
|
|
|
|
|
following: [],
|
|
|
|
|
followingCursor: 1,
|
2019-03-10 05:26:29 +00:00
|
|
|
|
followingMore: true,
|
|
|
|
|
lightboxMedia: false
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
beforeMount() {
|
2019-04-21 02:18:24 +00:00
|
|
|
|
axios.get('/api/v2/config')
|
|
|
|
|
.then(res => {
|
|
|
|
|
this.config = res.data;
|
|
|
|
|
this.fetchTimelineApi();
|
2019-04-30 02:59:12 +00:00
|
|
|
|
if(window.outerWidth > 767) {
|
|
|
|
|
this.fetchProfile();
|
|
|
|
|
}
|
2019-04-21 02:18:24 +00:00
|
|
|
|
});
|
2018-12-09 22:58:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
2019-04-22 05:42:37 +00:00
|
|
|
|
if($('link[data-stylesheet="dark"]').length != 0) {
|
|
|
|
|
this.modes.dark = true;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-11 00:56:52 +00:00
|
|
|
|
this.$nextTick(function () {
|
|
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
|
|
|
});
|
2018-12-09 22:58:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
updated() {
|
2019-02-11 00:56:52 +00:00
|
|
|
|
pixelfed.readmore();
|
2018-12-09 22:58:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
fetchProfile() {
|
|
|
|
|
axios.get('/api/v1/accounts/verify_credentials').then(res => {
|
|
|
|
|
this.profile = res.data;
|
2018-12-11 03:47:55 +00:00
|
|
|
|
$('.profile-card .loader').addClass('d-none');
|
|
|
|
|
$('.profile-card .contents').removeClass('d-none');
|
|
|
|
|
$('.profile-card .card-footer').removeClass('d-none');
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Oops, something went wrong',
|
|
|
|
|
'Please reload the page.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fetchTimelineApi() {
|
2019-03-10 05:26:29 +00:00
|
|
|
|
let apiUrl = false;
|
|
|
|
|
switch(this.scope) {
|
|
|
|
|
case 'home':
|
|
|
|
|
apiUrl = '/api/v1/timelines/home';
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'local':
|
|
|
|
|
apiUrl = '/api/v1/timelines/public';
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'network':
|
|
|
|
|
apiUrl = '/api/v1/timelines/network';
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-03-04 02:32:31 +00:00
|
|
|
|
axios.get(apiUrl, {
|
|
|
|
|
params: {
|
2019-03-10 05:26:29 +00:00
|
|
|
|
max_id: this.max_id,
|
2019-04-30 06:10:45 +00:00
|
|
|
|
limit: 6
|
2019-03-04 02:32:31 +00:00
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
2018-12-09 22:58:37 +00:00
|
|
|
|
let data = res.data;
|
|
|
|
|
this.feed.push(...data);
|
|
|
|
|
let ids = data.map(status => status.id);
|
2019-03-04 02:32:31 +00:00
|
|
|
|
this.min_id = Math.max(...ids);
|
|
|
|
|
this.max_id = Math.min(...ids);
|
2019-01-11 20:40:15 +00:00
|
|
|
|
$('.timeline .pagination').removeClass('d-none');
|
2019-01-06 05:02:42 +00:00
|
|
|
|
this.loading = false;
|
2019-04-30 02:59:12 +00:00
|
|
|
|
if(window.outerWidth > 767) {
|
|
|
|
|
this.expRec();
|
|
|
|
|
}
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2019-01-03 04:56:44 +00:00
|
|
|
|
infiniteTimeline($state) {
|
2019-04-22 03:04:46 +00:00
|
|
|
|
if(this.loading) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-03-10 05:26:29 +00:00
|
|
|
|
let apiUrl = false;
|
|
|
|
|
switch(this.scope) {
|
|
|
|
|
case 'home':
|
|
|
|
|
apiUrl = '/api/v1/timelines/home';
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'local':
|
|
|
|
|
apiUrl = '/api/v1/timelines/public';
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'network':
|
|
|
|
|
apiUrl = '/api/v1/timelines/network';
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-01-03 04:56:44 +00:00
|
|
|
|
axios.get(apiUrl, {
|
|
|
|
|
params: {
|
2019-03-04 02:32:31 +00:00
|
|
|
|
max_id: this.max_id,
|
2019-04-30 06:15:43 +00:00
|
|
|
|
limit: 6
|
2019-01-03 04:56:44 +00:00
|
|
|
|
},
|
|
|
|
|
}).then(res => {
|
2019-01-06 05:02:42 +00:00
|
|
|
|
if (res.data.length && this.loading == false) {
|
2019-01-03 04:56:44 +00:00
|
|
|
|
let data = res.data;
|
|
|
|
|
this.feed.push(...data);
|
|
|
|
|
let ids = data.map(status => status.id);
|
2019-03-04 02:32:31 +00:00
|
|
|
|
this.min_id = Math.max(...ids);
|
|
|
|
|
this.max_id = Math.min(...ids);
|
2019-01-03 04:56:44 +00:00
|
|
|
|
this.page += 1;
|
|
|
|
|
$state.loaded();
|
2019-01-06 05:02:42 +00:00
|
|
|
|
this.loading = false;
|
2019-01-03 04:56:44 +00:00
|
|
|
|
} else {
|
|
|
|
|
$state.complete();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2019-02-13 19:24:07 +00:00
|
|
|
|
loadMore(event) {
|
2019-01-11 20:40:15 +00:00
|
|
|
|
let homeTimeline = '/api/v1/timelines/home';
|
|
|
|
|
let localTimeline = '/api/v1/timelines/public';
|
2019-02-13 06:35:05 +00:00
|
|
|
|
let apiUrl = this.scope == 'home' ? homeTimeline : localTimeline;
|
2019-02-13 19:24:07 +00:00
|
|
|
|
event.target.innerText = 'Loading...';
|
2019-01-11 20:40:15 +00:00
|
|
|
|
axios.get(apiUrl, {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.page,
|
|
|
|
|
},
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.data.length && this.loading == false) {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
let ids = data.map(status => status.id);
|
|
|
|
|
this.min_id = Math.min(...ids);
|
|
|
|
|
if(this.page == 1) {
|
|
|
|
|
this.max_id = Math.max(...ids);
|
|
|
|
|
}
|
2019-04-21 02:18:24 +00:00
|
|
|
|
this.feed.push(...data);
|
2019-01-11 20:40:15 +00:00
|
|
|
|
this.page += 1;
|
|
|
|
|
this.loading = false;
|
2019-02-13 19:24:07 +00:00
|
|
|
|
event.target.innerText = 'Load more posts';
|
2019-01-11 20:40:15 +00:00
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2018-12-09 22:58:37 +00:00
|
|
|
|
reportUrl(status) {
|
|
|
|
|
let type = status.in_reply_to ? 'comment' : 'post';
|
|
|
|
|
let id = status.id;
|
|
|
|
|
return '/i/report?type=' + type + '&id=' + id;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
commentFocus(status, $event) {
|
2019-04-03 06:04:15 +00:00
|
|
|
|
if(this.replyId == status.id || status.comments_disabled) {
|
2019-02-11 00:56:52 +00:00
|
|
|
|
return;
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}
|
2019-02-11 00:56:52 +00:00
|
|
|
|
this.replies = {};
|
|
|
|
|
this.replyId = status.id;
|
|
|
|
|
this.fetchStatusComments(status, '');
|
2018-12-09 22:58:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
likeStatus(status, $event) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-02-28 13:03:25 +00:00
|
|
|
|
|
2018-12-09 22:58:37 +00:00
|
|
|
|
axios.post('/i/like', {
|
|
|
|
|
item: status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
status.favourites_count = res.data.count;
|
2019-02-11 00:56:52 +00:00
|
|
|
|
status.favourited = !status.favourited;
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
shareStatus(status, $event) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/share', {
|
|
|
|
|
item: status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
status.reblogs_count = res.data.count;
|
2019-02-11 00:56:52 +00:00
|
|
|
|
status.reblogged = !status.reblogged;
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong, please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
timestampFormat(timestamp) {
|
|
|
|
|
let ts = new Date(timestamp);
|
|
|
|
|
return ts.toDateString() + ' ' + ts.toLocaleTimeString();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
editUrl(status) {
|
|
|
|
|
return status.url + '/edit';
|
|
|
|
|
},
|
|
|
|
|
|
2018-12-16 08:59:30 +00:00
|
|
|
|
redirect(url) {
|
|
|
|
|
window.location.href = url;
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
replyUrl(status) {
|
|
|
|
|
let username = this.profile.username;
|
|
|
|
|
let id = status.account.id == this.profile.id ? status.id : status.in_reply_to_id;
|
|
|
|
|
return '/p/' + username + '/' + id;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mentionUrl(status) {
|
|
|
|
|
let username = status.account.username;
|
|
|
|
|
let id = status.id;
|
|
|
|
|
return '/p/' + username + '/' + id;
|
|
|
|
|
},
|
|
|
|
|
|
2018-12-09 22:58:37 +00:00
|
|
|
|
statusOwner(status) {
|
|
|
|
|
let sid = status.account.id;
|
|
|
|
|
let uid = this.profile.id;
|
|
|
|
|
if(sid == uid) {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fetchStatusComments(status, card) {
|
|
|
|
|
axios.get('/api/v2/status/'+status.id+'/replies')
|
|
|
|
|
.then(res => {
|
|
|
|
|
let data = res.data;
|
2019-02-11 00:56:52 +00:00
|
|
|
|
this.replies = _.reverse(data);
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
muteProfile(status) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
axios.post('/i/mute', {
|
|
|
|
|
type: 'user',
|
|
|
|
|
item: status.account.id
|
|
|
|
|
}).then(res => {
|
2018-12-10 05:59:38 +00:00
|
|
|
|
this.feed = this.feed.filter(s => s.account.id !== status.account.id);
|
2018-12-09 22:58:37 +00:00
|
|
|
|
swal('Success', 'You have successfully muted ' + status.account.acct, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
blockProfile(status) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/block', {
|
|
|
|
|
type: 'user',
|
|
|
|
|
item: status.account.id
|
|
|
|
|
}).then(res => {
|
2018-12-10 05:59:38 +00:00
|
|
|
|
this.feed = this.feed.filter(s => s.account.id !== status.account.id);
|
|
|
|
|
swal('Success', 'You have successfully blocked ' + status.account.acct, 'success');
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deletePost(status, index) {
|
|
|
|
|
if($('body').hasClass('loggedIn') == false || status.account.id !== this.profile.id) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 01:07:25 +00:00
|
|
|
|
if(window.confirm('Are you sure you want to delete this post?') == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-05-03 19:11:29 +00:00
|
|
|
|
|
2018-12-09 22:58:37 +00:00
|
|
|
|
axios.post('/i/delete', {
|
|
|
|
|
type: 'status',
|
|
|
|
|
item: status.id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.feed.splice(index,1);
|
2018-12-10 05:59:38 +00:00
|
|
|
|
swal('Success', 'You have successfully deleted this post', 'success');
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
commentSubmit(status, $event) {
|
|
|
|
|
let id = status.id;
|
|
|
|
|
let form = $event.target;
|
|
|
|
|
let input = $(form).find('input[name="comment"]');
|
|
|
|
|
let comment = input.val();
|
|
|
|
|
let comments = form.parentElement.parentElement.getElementsByClassName('comments')[0];
|
|
|
|
|
axios.post('/i/comment', {
|
|
|
|
|
item: id,
|
|
|
|
|
comment: comment
|
|
|
|
|
}).then(res => {
|
2019-02-11 00:56:52 +00:00
|
|
|
|
form.reset();
|
|
|
|
|
form.blur();
|
|
|
|
|
this.replies.push(res.data.entity);
|
2018-12-09 22:58:37 +00:00
|
|
|
|
});
|
2019-02-11 00:56:52 +00:00
|
|
|
|
},
|
2018-12-09 22:58:37 +00:00
|
|
|
|
|
2019-02-11 00:56:52 +00:00
|
|
|
|
moderatePost(status, action, $event) {
|
|
|
|
|
let username = status.account.username;
|
|
|
|
|
console.log('action: ' + action + ' status id' + status.id);
|
|
|
|
|
switch(action) {
|
|
|
|
|
case 'autocw':
|
|
|
|
|
let msg = 'Are you sure you want to enforce CW for ' + username + ' ?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
|
icon: 'warning',
|
|
|
|
|
buttons: true,
|
|
|
|
|
dangerMode: true
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res) {
|
|
|
|
|
axios.post('/api/v2/moderator/action', {
|
|
|
|
|
action: action,
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully enforced CW for ' + username, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'noautolink':
|
|
|
|
|
msg = 'Are you sure you want to disable auto linking for ' + username + ' ?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
|
icon: 'warning',
|
|
|
|
|
buttons: true,
|
|
|
|
|
dangerMode: true
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res) {
|
|
|
|
|
axios.post('/api/v2/moderator/action', {
|
|
|
|
|
action: action,
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully disabled autolinking for ' + username, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case 'unlisted':
|
|
|
|
|
msg = 'Are you sure you want to unlist from timelines for ' + username + ' ?';
|
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
|
icon: 'warning',
|
|
|
|
|
buttons: true,
|
|
|
|
|
dangerMode: true
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res) {
|
|
|
|
|
axios.post('/api/v2/moderator/action', {
|
|
|
|
|
action: action,
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
swal('Success', 'Successfully unlisted for ' + username, 'success');
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'disable':
|
2019-02-28 13:03:25 +00:00
|
|
|
|
msg = 'Are you sure you want to disable ' + username + '’s account ?';
|
2019-02-11 00:56:52 +00:00
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
|
icon: 'warning',
|
|
|
|
|
buttons: true,
|
|
|
|
|
dangerMode: true
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res) {
|
|
|
|
|
axios.post('/api/v2/moderator/action', {
|
|
|
|
|
action: action,
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
2019-02-28 13:03:25 +00:00
|
|
|
|
swal('Success', 'Successfully disabled ' + username + '’s account', 'success');
|
2019-02-11 00:56:52 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'suspend':
|
2019-02-28 13:03:25 +00:00
|
|
|
|
msg = 'Are you sure you want to suspend ' + username + '’s account ?';
|
2019-02-11 00:56:52 +00:00
|
|
|
|
swal({
|
|
|
|
|
title: 'Confirm',
|
|
|
|
|
text: msg,
|
|
|
|
|
icon: 'warning',
|
|
|
|
|
buttons: true,
|
|
|
|
|
dangerMode: true
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res) {
|
|
|
|
|
axios.post('/api/v2/moderator/action', {
|
|
|
|
|
action: action,
|
|
|
|
|
item_id: status.id,
|
|
|
|
|
item_type: 'status'
|
|
|
|
|
}).then(res => {
|
2019-02-28 13:03:25 +00:00
|
|
|
|
swal('Success', 'Successfully suspend ' + username + '’s account', 'success');
|
2019-02-11 00:56:52 +00:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
swal(
|
|
|
|
|
'Error',
|
|
|
|
|
'Something went wrong, please try again later.',
|
|
|
|
|
'error'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toggleOptionsMenu() {
|
|
|
|
|
this.optionMenuState = !this.optionMenuState;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
modeModToggle() {
|
|
|
|
|
this.modes.mod = !this.modes.mod;
|
|
|
|
|
window.ls.set('pixelfed-classicui-settings', this.modes);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
modeNotifyToggle() {
|
|
|
|
|
this.modes.notify = !this.modes.notify;
|
|
|
|
|
window.ls.set('pixelfed-classicui-settings', this.modes);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
modeDarkToggle() {
|
|
|
|
|
// todo: more graceful stylesheet change
|
|
|
|
|
if(this.modes.dark == true) {
|
2019-04-22 05:42:37 +00:00
|
|
|
|
axios.post('/i/metro/dark-mode', {
|
|
|
|
|
mode: 'light'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
$('link[data-stylesheet=dark]')
|
|
|
|
|
.attr('data-stylesheet', 'light')
|
|
|
|
|
.attr('href', '/css/app.css?v=' + Date.now());
|
|
|
|
|
this.modes.dark = false;
|
|
|
|
|
});
|
2019-02-11 00:56:52 +00:00
|
|
|
|
} else {
|
2019-04-22 05:42:37 +00:00
|
|
|
|
axios.post('/i/metro/dark-mode', {
|
|
|
|
|
mode: 'dark'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
$('link[data-stylesheet=light]')
|
|
|
|
|
.attr('data-stylesheet', 'dark')
|
|
|
|
|
.attr('href', '/css/appdark.css?v=' + Date.now());
|
|
|
|
|
this.modes.dark = true;
|
|
|
|
|
});
|
2019-02-11 00:56:52 +00:00
|
|
|
|
}
|
|
|
|
|
window.ls.set('pixelfed-classicui-settings', this.modes);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
modeInfiniteToggle() {
|
|
|
|
|
this.modes.infinite = !this.modes.infinite
|
|
|
|
|
window.ls.set('pixelfed-classicui-settings', this.modes);
|
2019-02-28 03:59:16 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
followingModal() {
|
|
|
|
|
if(this.following.length > 0) {
|
|
|
|
|
this.$refs.followingModal.show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.followingCursor
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
this.following = res.data;
|
|
|
|
|
this.followingCursor++;
|
|
|
|
|
});
|
2019-03-10 05:26:29 +00:00
|
|
|
|
if(res.data.length < 10) {
|
2019-02-28 19:24:32 +00:00
|
|
|
|
this.followingMore = false;
|
|
|
|
|
}
|
2019-02-28 03:59:16 +00:00
|
|
|
|
this.$refs.followingModal.show();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
followersModal() {
|
|
|
|
|
if(this.followers.length > 0) {
|
|
|
|
|
this.$refs.followerModal.show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.followerCursor
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
this.followers = res.data;
|
|
|
|
|
this.followerCursor++;
|
2019-02-28 19:24:32 +00:00
|
|
|
|
})
|
2019-03-10 05:26:29 +00:00
|
|
|
|
if(res.data.length < 10) {
|
2019-02-28 19:24:32 +00:00
|
|
|
|
this.followerMore = false;
|
|
|
|
|
}
|
2019-02-28 03:59:16 +00:00
|
|
|
|
this.$refs.followerModal.show();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
followingLoadMore() {
|
|
|
|
|
axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.followingCursor
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if(res.data.length > 0) {
|
|
|
|
|
this.following.push(...res.data);
|
|
|
|
|
this.followingCursor++;
|
2019-02-28 17:34:52 +00:00
|
|
|
|
}
|
2019-03-10 05:26:29 +00:00
|
|
|
|
if(res.data.length < 10) {
|
2019-02-28 03:59:16 +00:00
|
|
|
|
this.followingMore = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
followersLoadMore() {
|
|
|
|
|
axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
|
|
|
|
|
params: {
|
|
|
|
|
page: this.followerCursor
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
if(res.data.length > 0) {
|
|
|
|
|
this.followers.push(...res.data);
|
|
|
|
|
this.followerCursor++;
|
2019-02-28 17:34:52 +00:00
|
|
|
|
}
|
2019-03-10 05:26:29 +00:00
|
|
|
|
if(res.data.length < 10) {
|
2019-02-28 03:59:16 +00:00
|
|
|
|
this.followerMore = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
2019-03-10 05:26:29 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
lightbox(src) {
|
|
|
|
|
this.lightboxMedia = src;
|
|
|
|
|
this.$refs.lightboxModal.show();
|
2019-04-21 02:18:24 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
expLc(status) {
|
|
|
|
|
if(this.config.ab.lc == false) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if(this.statusOwner(status) == true) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2019-04-28 23:01:10 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
expRec() {
|
|
|
|
|
if(this.config.ab.rec == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.get('/api/local/exp/rec')
|
|
|
|
|
.then(res => {
|
|
|
|
|
this.suggestions = res.data;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
expRecFollow(id, index) {
|
|
|
|
|
if(this.config.ab.rec == false) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post('/i/follow', {
|
|
|
|
|
item: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.suggestions.splice(index, 1);
|
|
|
|
|
})
|
2019-04-29 04:37:04 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
followModalAction(id, index, type = 'following') {
|
|
|
|
|
axios.post('/i/follow', {
|
|
|
|
|
item: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(type == 'following') {
|
|
|
|
|
this.following.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
})
|
2019-02-11 00:56:52 +00:00
|
|
|
|
}
|
2018-12-09 22:58:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-02-28 17:34:52 +00:00
|
|
|
|
</script>
|