mirror of https://github.com/pixelfed/pixelfed
commit
d23ffac21e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(()=>{"use strict";var e,r,o,a={},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={id:e,loaded:!1,exports:{}};return a[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=a,e=[],n.O=(r,o,a,t)=>{if(!o){var d=1/0;for(u=0;u<e.length;u++){for(var[o,a,t]=e[u],s=!0,c=0;c<o.length;c++)(!1&t||d>=t)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(s=!1,t<d&&(d=t));if(s){e.splice(u--,1);var i=a();void 0!==i&&(r=i)}}return r}t=t||0;for(var u=e.length;u>0&&e[u-1][2]>t;u--)e[u]=e[u-1];e[u]=[o,a,t]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,o)=>(n.f[o](e,r),r)),[])),n.u=e=>"js/"+{529:"groups-page",1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2822:"group.create",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6438:"groups-page-media",6535:"discover.chunk",6740:"discover~memories.chunk",6791:"groups-page-members",7206:"groups-page-topics",7342:"groups-post",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8257:"groups-page-about",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9231:"groups-profile",9919:"changelog.bundle"}[e]+"."+{529:"d484dab549a033ca",1179:"61b540b1630f8445",1240:"e2ca0db60346d0c2",1645:"1c64fbecaa81a368",2156:"1a2a644df5c78346",2822:"72c3a1e5c1dc00dc",2966:"93ce902dca5b65e3",3688:"138d9d53d1debac1",4951:"acf96f52790bffa6",6250:"b1b5642ccef06123",6438:"056a7bbc46b79034",6535:"00d9b5656d32080e",6740:"9541b66de9d5d907",6791:"a8ea4f209fcbe238",7206:"f69667c933f7d122",7342:"4c3d4860b029bbaf",7399:"4e68bb824f396d86",7413:"e2f43f5006962e80",7521:"6d494abb9e464081",7744:"a882b19f4469ed55",8087:"5a5ea597e5286899",8119:"951c52d1740442f6",8257:"76a616aa7e1a367b",8408:"0757a6f1391ea041",8977:"a595bbddf5b02150",9124:"b06beb250e24db17",9231:"1bb8be935d1f108a",9919:"d40f01eba00c9885"}[e]+".js",n.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",4370:"css/profile",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},o="pixelfed:",n.l=(e,a,t,d)=>{if(r[e])r[e].push(a);else{var s,c;if(void 0!==t)for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var l=i[u];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+t){s=l;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",o+t),s.src=e),r[e]=[a];var f=(o,a)=>{s.onerror=s.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],s.parentNode&&s.parentNode.removeChild(s),t&&t.forEach((e=>e(a))),o)return o(a)},b=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),c&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,4370:0,8759:0};n.f.j=(r,o)=>{var a=n.o(e,r)?e[r]:void 0;if(0!==a)if(a)o.push(a[2]);else if(/^((69|82)52|2305|2540|3364|4370|461|8759)$/.test(r))e[r]=0;else{var t=new Promise(((o,t)=>a=e[r]=[o,t]));o.push(a[2]=t);var d=n.p+n.u(r),s=new Error;n.l(d,(o=>{if(n.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var t=o&&("load"===o.type?"missing":o.type),d=o&&o.target&&o.target.src;s.message="Loading chunk "+r+" failed.\n("+t+": "+d+")",s.name="ChunkLoadError",s.type=t,s.request=d,a[1](s)}}),"chunk-"+r,r)}},n.O.j=r=>0===e[r];var r=(r,o)=>{var a,t,[d,s,c]=o,i=0;if(d.some((r=>0!==e[r]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(c)var u=c(n)}for(r&&r(o);i<d.length;i++)t=d[i],n.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return n.O(u)},o=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),n.nc=void 0})();
|
||||
(()=>{"use strict";var e,r,o,a={},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={id:e,loaded:!1,exports:{}};return a[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=a,e=[],n.O=(r,o,a,t)=>{if(!o){var d=1/0;for(u=0;u<e.length;u++){for(var[o,a,t]=e[u],c=!0,s=0;s<o.length;s++)(!1&t||d>=t)&&Object.keys(n.O).every((e=>n.O[e](o[s])))?o.splice(s--,1):(c=!1,t<d&&(d=t));if(c){e.splice(u--,1);var i=a();void 0!==i&&(r=i)}}return r}t=t||0;for(var u=e.length;u>0&&e[u-1][2]>t;u--)e[u]=e[u-1];e[u]=[o,a,t]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,o)=>(n.f[o](e,r),r)),[])),n.u=e=>"js/"+{529:"groups-page",1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2822:"group.create",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6438:"groups-page-media",6535:"discover.chunk",6740:"discover~memories.chunk",6791:"groups-page-members",7206:"groups-page-topics",7342:"groups-post",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8257:"groups-page-about",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9231:"groups-profile",9919:"changelog.bundle"}[e]+"."+{529:"d484dab549a033ca",1179:"61b540b1630f8445",1240:"e2ca0db60346d0c2",1645:"1c64fbecaa81a368",2156:"e7e428d4df2a00a6",2822:"72c3a1e5c1dc00dc",2966:"93ce902dca5b65e3",3688:"138d9d53d1debac1",4951:"acf96f52790bffa6",6250:"b1b5642ccef06123",6438:"056a7bbc46b79034",6535:"00d9b5656d32080e",6740:"9541b66de9d5d907",6791:"a8ea4f209fcbe238",7206:"f69667c933f7d122",7342:"4c3d4860b029bbaf",7399:"4e68bb824f396d86",7413:"e2f43f5006962e80",7521:"6d494abb9e464081",7744:"a882b19f4469ed55",8087:"5c642d2321d67652",8119:"951c52d1740442f6",8257:"76a616aa7e1a367b",8408:"70d3758a59ef3742",8977:"a595bbddf5b02150",9124:"a98574fc749d74ec",9231:"1bb8be935d1f108a",9919:"d40f01eba00c9885"}[e]+".js",n.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",4370:"css/profile",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},o="pixelfed:",n.l=(e,a,t,d)=>{if(r[e])r[e].push(a);else{var c,s;if(void 0!==t)for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var l=i[u];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+t){c=l;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,n.nc&&c.setAttribute("nonce",n.nc),c.setAttribute("data-webpack",o+t),c.src=e),r[e]=[a];var f=(o,a)=>{c.onerror=c.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),t&&t.forEach((e=>e(a))),o)return o(a)},b=setTimeout(f.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),s&&document.head.appendChild(c)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,4370:0,8759:0};n.f.j=(r,o)=>{var a=n.o(e,r)?e[r]:void 0;if(0!==a)if(a)o.push(a[2]);else if(/^((69|82)52|2305|2540|3364|4370|461|8759)$/.test(r))e[r]=0;else{var t=new Promise(((o,t)=>a=e[r]=[o,t]));o.push(a[2]=t);var d=n.p+n.u(r),c=new Error;n.l(d,(o=>{if(n.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var t=o&&("load"===o.type?"missing":o.type),d=o&&o.target&&o.target.src;c.message="Loading chunk "+r+" failed.\n("+t+": "+d+")",c.name="ChunkLoadError",c.type=t,c.request=d,a[1](c)}}),"chunk-"+r,r)}},n.O.j=r=>0===e[r];var r=(r,o)=>{var a,t,[d,c,s]=o,i=0;if(d.some((r=>0!==e[r]))){for(a in c)n.o(c,a)&&(n.m[a]=c[a]);if(s)var u=s(n)}for(r&&r(o);i<d.length;i++)t=d[i],n.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return n.O(u)},o=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),n.nc=void 0})();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,443 +1,444 @@
|
||||
<template>
|
||||
<div class="post-timeline-component web-wrapper">
|
||||
<div v-if="isLoaded" class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3 d-md-block">
|
||||
<sidebar :user="user" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-lg-6">
|
||||
<div v-if="isReply" class="p-3 rounded-top mb-n3" style="background-color: var(--card-header-accent)">
|
||||
<p>
|
||||
<i class="fal fa-reply mr-1"></i> In reply to
|
||||
|
||||
<a
|
||||
:href="'/i/web/profile/' + reply.account.id"
|
||||
class="font-weight-bold primary"
|
||||
@click.prevent="goToProfile(reply.account)">
|
||||
@{{ reply.account.acct }}
|
||||
</a>
|
||||
|
||||
<button
|
||||
@click.prevent="goToPost(reply)"
|
||||
class="btn btn-primary font-weight-bold btn-sm px-3 float-right rounded-pill">
|
||||
View Post
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<status
|
||||
:key="post.id + ':fui:' + forceUpdateIdx"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
v-on:menu="openContextMenu()"
|
||||
v-on:like="likeStatus()"
|
||||
v-on:unlike="unlikeStatus()"
|
||||
v-on:likes-modal="openLikesModal()"
|
||||
v-on:shares-modal="openSharesModal()"
|
||||
v-on:bookmark="handleBookmark()"
|
||||
v-on:share="shareStatus()"
|
||||
v-on:unshare="unshareStatus()"
|
||||
v-on:follow="follow()"
|
||||
v-on:unfollow="unfollow()"
|
||||
v-on:counter-change="counterChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="d-none d-lg-block col-lg-3">
|
||||
<rightbar />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="postStateError" class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3 d-md-block">
|
||||
<sidebar :user="user" />
|
||||
</div>
|
||||
<div class="col-md-8 col-lg-6">
|
||||
<div class="card card-body shadow-none border">
|
||||
<div class="d-flex align-self-center flex-column" style="max-width: 500px;">
|
||||
<p class="text-center">
|
||||
<i class="far fa-exclamation-triangle fa-3x text-lighter"></i>
|
||||
</p>
|
||||
<p class="text-center lead font-weight-bold">Error displaying post</p>
|
||||
<p class="mb-0">This can happen for a few reasons:</p>
|
||||
<ul class="text-lighter">
|
||||
<li>The url is invalid or has a typo</li>
|
||||
<li>The page has been flagged for review by our automated abuse detection systems</li>
|
||||
<li>The content may have been deleted</li>
|
||||
<li>You do not have permission to view this content</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-none d-lg-block col-lg-3">
|
||||
<rightbar />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<context-menu
|
||||
v-if="isLoaded"
|
||||
ref="contextMenu"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
@report-modal="handleReport()"
|
||||
@delete="deletePost()"
|
||||
v-on:edit="handleEdit"
|
||||
/>
|
||||
|
||||
<likes-modal
|
||||
v-if="showLikesModal"
|
||||
ref="likesModal"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
/>
|
||||
|
||||
<shares-modal
|
||||
v-if="showSharesModal"
|
||||
ref="sharesModal"
|
||||
:status="post"
|
||||
:profile="profile"
|
||||
/>
|
||||
|
||||
<report-modal
|
||||
v-if="post"
|
||||
ref="reportModal"
|
||||
:status="post"
|
||||
/>
|
||||
|
||||
<post-edit-modal
|
||||
ref="editModal"
|
||||
v-on:update="mergeUpdatedPost"
|
||||
/>
|
||||
|
||||
<drawer />
|
||||
</div>
|
||||
<div class="post-timeline-component web-wrapper">
|
||||
<div v-if="isLoaded" class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3 d-md-block">
|
||||
<sidebar :user="user" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-lg-6">
|
||||
<div v-if="isReply" class="p-3 rounded-top mb-n3" style="background-color: var(--card-header-accent)">
|
||||
<p>
|
||||
<i class="fal fa-reply mr-1"></i> In reply to
|
||||
|
||||
<a
|
||||
:href="'/i/web/profile/' + reply.account.id"
|
||||
class="font-weight-bold primary"
|
||||
@click.prevent="goToProfile(reply.account)">
|
||||
@{{ reply.account.acct }}
|
||||
</a>
|
||||
|
||||
<button
|
||||
@click.prevent="goToPost(reply)"
|
||||
class="btn btn-primary font-weight-bold btn-sm px-3 float-right rounded-pill">
|
||||
View Post
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<status
|
||||
:key="post.id + ':fui:' + forceUpdateIdx"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
v-on:menu="openContextMenu()"
|
||||
v-on:like="likeStatus()"
|
||||
v-on:unlike="unlikeStatus()"
|
||||
v-on:likes-modal="openLikesModal()"
|
||||
v-on:shares-modal="openSharesModal()"
|
||||
v-on:bookmark="handleBookmark()"
|
||||
v-on:share="shareStatus()"
|
||||
v-on:unshare="unshareStatus()"
|
||||
v-on:follow="follow()"
|
||||
v-on:unfollow="unfollow()"
|
||||
v-on:counter-change="counterChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="d-none d-lg-block col-lg-3">
|
||||
<rightbar />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="postStateError" class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3 d-md-block">
|
||||
<sidebar :user="user" />
|
||||
</div>
|
||||
<div class="col-md-8 col-lg-6">
|
||||
<div class="card card-body shadow-none border">
|
||||
<div class="d-flex align-self-center flex-column" style="max-width: 500px;">
|
||||
<p class="text-center">
|
||||
<i class="far fa-exclamation-triangle fa-3x text-lighter"></i>
|
||||
</p>
|
||||
<p class="text-center lead font-weight-bold">Error displaying post</p>
|
||||
<p class="mb-0">This can happen for a few reasons:</p>
|
||||
<ul class="text-lighter">
|
||||
<li>The url is invalid or has a typo</li>
|
||||
<li>The page has been flagged for review by our automated abuse detection systems</li>
|
||||
<li>The content may have been deleted</li>
|
||||
<li>You do not have permission to view this content</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-none d-lg-block col-lg-3">
|
||||
<rightbar />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<context-menu
|
||||
v-if="isLoaded"
|
||||
ref="contextMenu"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
@report-modal="handleReport()"
|
||||
@delete="deletePost()"
|
||||
v-on:edit="handleEdit"
|
||||
/>
|
||||
|
||||
<likes-modal
|
||||
v-if="showLikesModal"
|
||||
ref="likesModal"
|
||||
:status="post"
|
||||
:profile="user"
|
||||
/>
|
||||
|
||||
<shares-modal
|
||||
v-if="showSharesModal"
|
||||
ref="sharesModal"
|
||||
:status="post"
|
||||
:profile="profile"
|
||||
/>
|
||||
|
||||
<report-modal
|
||||
v-if="post"
|
||||
ref="reportModal"
|
||||
:status="post"
|
||||
/>
|
||||
|
||||
<post-edit-modal
|
||||
ref="editModal"
|
||||
v-on:update="mergeUpdatedPost"
|
||||
/>
|
||||
|
||||
<drawer />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script type="text/javascript">
|
||||
import Drawer from './partials/drawer.vue';
|
||||
import Rightbar from './partials/rightbar.vue';
|
||||
import Sidebar from './partials/sidebar.vue';
|
||||
import Status from './partials/TimelineStatus.vue';
|
||||
import ContextMenu from './partials/post/ContextMenu.vue';
|
||||
import MediaContainer from './partials/post/MediaContainer.vue';
|
||||
import LikesModal from './partials/post/LikeModal.vue';
|
||||
import SharesModal from './partials/post/ShareModal.vue';
|
||||
import ReportModal from './partials/modal/ReportPost.vue';
|
||||
import PostEditModal from './partials/post/PostEditModal.vue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
cachedStatus: {
|
||||
type: Object
|
||||
},
|
||||
|
||||
cachedProfile: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
"drawer": Drawer,
|
||||
"sidebar": Sidebar,
|
||||
"status": Status,
|
||||
"context-menu": ContextMenu,
|
||||
"media-container": MediaContainer,
|
||||
"likes-modal": LikesModal,
|
||||
"shares-modal": SharesModal,
|
||||
"rightbar": Rightbar,
|
||||
"report-modal": ReportModal,
|
||||
import Drawer from './partials/drawer.vue';
|
||||
import Rightbar from './partials/rightbar.vue';
|
||||
import Sidebar from './partials/sidebar.vue';
|
||||
import Status from './partials/TimelineStatus.vue';
|
||||
import ContextMenu from './partials/post/ContextMenu.vue';
|
||||
import MediaContainer from './partials/post/MediaContainer.vue';
|
||||
import LikesModal from './partials/post/LikeModal.vue';
|
||||
import SharesModal from './partials/post/ShareModal.vue';
|
||||
import ReportModal from './partials/modal/ReportPost.vue';
|
||||
import PostEditModal from './partials/post/PostEditModal.vue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
cachedStatus: {
|
||||
type: Object
|
||||
},
|
||||
|
||||
cachedProfile: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
"drawer": Drawer,
|
||||
"sidebar": Sidebar,
|
||||
"status": Status,
|
||||
"context-menu": ContextMenu,
|
||||
"media-container": MediaContainer,
|
||||
"likes-modal": LikesModal,
|
||||
"shares-modal": SharesModal,
|
||||
"rightbar": Rightbar,
|
||||
"report-modal": ReportModal,
|
||||
"post-edit-modal": PostEditModal
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
isLoaded: false,
|
||||
user: undefined,
|
||||
profile: undefined,
|
||||
post: undefined,
|
||||
relationship: {},
|
||||
media: undefined,
|
||||
mediaIndex: 0,
|
||||
showLikesModal: false,
|
||||
isReply: false,
|
||||
reply: {},
|
||||
showSharesModal: false,
|
||||
postStateError: false,
|
||||
forceUpdateIdx: 0
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$route': 'init'
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.fetchSelf();
|
||||
},
|
||||
|
||||
fetchSelf() {
|
||||
this.user = window._sharedData.user;
|
||||
this.fetchPost();
|
||||
},
|
||||
|
||||
fetchPost() {
|
||||
axios.get('/api/pixelfed/v1/statuses/'+this.$route.params.id)
|
||||
.then(res => {
|
||||
if(!res.data || !res.data.hasOwnProperty('id')) {
|
||||
this.$router.push('/i/web/404');
|
||||
}
|
||||
if(!res.data.hasOwnProperty('account') || !res.data.account) {
|
||||
this.postStateError = true;
|
||||
return;
|
||||
}
|
||||
this.post = res.data;
|
||||
this.media = this.post.media_attachments;
|
||||
this.profile = this.post.account;
|
||||
if(this.post.in_reply_to_id) {
|
||||
this.fetchReply();
|
||||
} else {
|
||||
this.fetchRelationship();
|
||||
}
|
||||
}).catch(err => {
|
||||
switch(err.response.status) {
|
||||
case 403:
|
||||
case 404:
|
||||
this.$router.push('/i/web/404');
|
||||
break;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
fetchReply() {
|
||||
axios.get('/api/pixelfed/v1/statuses/' + this.post.in_reply_to_id)
|
||||
.then(res => {
|
||||
this.reply = res.data;
|
||||
this.isReply = true;
|
||||
this.fetchRelationship();
|
||||
})
|
||||
.catch(err => {
|
||||
this.fetchRelationship();
|
||||
})
|
||||
},
|
||||
|
||||
fetchRelationship() {
|
||||
if(this.profile.id == this.user.id) {
|
||||
this.relationship = {};
|
||||
this.fetchState();
|
||||
return;
|
||||
}
|
||||
|
||||
axios.get('/api/pixelfed/v1/accounts/relationships', {
|
||||
params: {
|
||||
'id[]': this.profile.id
|
||||
}
|
||||
}).then(res => {
|
||||
this.relationship = res.data[0];
|
||||
this.fetchState();
|
||||
});
|
||||
},
|
||||
|
||||
fetchState() {
|
||||
axios.get('/api/v2/statuses/'+this.post.id+'/state')
|
||||
.then(res => {
|
||||
this.post.favourited = res.data.liked;
|
||||
this.post.reblogged = res.data.shared;
|
||||
this.post.bookmarked = res.data.bookmarked;
|
||||
if(!this.post.favourites_count && this.post.favourited) {
|
||||
this.post.favourites_count = 1;
|
||||
}
|
||||
this.isLoaded = true;
|
||||
}).catch(err => {
|
||||
this.isLoaded = false;
|
||||
this.postStateError = true;
|
||||
})
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$router.push('/i/web');
|
||||
},
|
||||
|
||||
likeStatus() {
|
||||
let count = this.post.favourites_count;
|
||||
this.post.favourites_count = count + 1;
|
||||
this.post.favourited = !this.post.favourited;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/favourite')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.favourites_count = count;
|
||||
this.post.favourited = false;
|
||||
})
|
||||
},
|
||||
|
||||
unlikeStatus() {
|
||||
let count = this.post.favourites_count;
|
||||
this.post.favourites_count = count - 1;
|
||||
this.post.favourited = !this.post.favourited;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/unfavourite')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.favourites_count = count;
|
||||
this.post.favourited = false;
|
||||
})
|
||||
},
|
||||
|
||||
shareStatus() {
|
||||
let count = this.post.reblogs_count;
|
||||
this.post.reblogs_count = count + 1;
|
||||
this.post.reblogged = !this.post.reblogged;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/reblog')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.reblogs_count = count;
|
||||
this.post.reblogged = false;
|
||||
})
|
||||
},
|
||||
|
||||
unshareStatus() {
|
||||
let count = this.post.reblogs_count;
|
||||
this.post.reblogs_count = count - 1;
|
||||
this.post.reblogged = !this.post.reblogged;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/unreblog')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.reblogs_count = count;
|
||||
this.post.reblogged = false;
|
||||
})
|
||||
},
|
||||
|
||||
follow() {
|
||||
axios.post('/api/v1/accounts/' + this.post.account.id + '/follow')
|
||||
.then(res => {
|
||||
this.$store.commit('updateRelationship', [res.data]);
|
||||
this.user.following_count++;
|
||||
this.post.account.followers_count++;
|
||||
}).catch(err => {
|
||||
swal('Oops!', 'An error occurred when attempting to follow this account.', 'error');
|
||||
this.post.relationship.following = false;
|
||||
});
|
||||
},
|
||||
|
||||
unfollow() {
|
||||
axios.post('/api/v1/accounts/' + this.post.account.id + '/unfollow')
|
||||
.then(res => {
|
||||
this.$store.commit('updateRelationship', [res.data]);
|
||||
this.user.following_count--;
|
||||
this.post.account.followers_count--;
|
||||
}).catch(err => {
|
||||
swal('Oops!', 'An error occurred when attempting to unfollow this account.', 'error');
|
||||
this.post.relationship.following = true;
|
||||
});
|
||||
},
|
||||
|
||||
openContextMenu() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.contextMenu.open();
|
||||
});
|
||||
},
|
||||
|
||||
openLikesModal() {
|
||||
this.showLikesModal = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.likesModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
openSharesModal() {
|
||||
this.showSharesModal = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.sharesModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
deletePost() {
|
||||
this.$router.push('/i/web');
|
||||
},
|
||||
|
||||
goToPost(post) {
|
||||
this.$router.push({
|
||||
name: 'post',
|
||||
path: `/i/web/post/${post.id}`,
|
||||
params: {
|
||||
id: post.id,
|
||||
cachedStatus: post,
|
||||
cachedProfile: this.user
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
goToProfile(account) {
|
||||
this.$router.push({
|
||||
name: 'profile',
|
||||
path: `/i/web/profile/${account.id}`,
|
||||
params: {
|
||||
id: account.id,
|
||||
cachedProfile: account,
|
||||
cachedUser: this.user
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleBookmark() {
|
||||
axios.post('/i/bookmark', {
|
||||
item: this.post.id
|
||||
})
|
||||
.then(res => {
|
||||
this.post.bookmarked = !this.post.bookmarked;
|
||||
})
|
||||
.catch(err => {
|
||||
this.$bvToast.toast('Cannot bookmark post at this time.', {
|
||||
title: 'Bookmark Error',
|
||||
variant: 'danger',
|
||||
autoHideDelay: 5000
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
handleReport() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.reportModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
counterChange(type) {
|
||||
switch(type) {
|
||||
case 'comment-increment':
|
||||
this.post.reply_count = this.post.reply_count + 1;
|
||||
break;
|
||||
|
||||
case 'comment-decrement':
|
||||
this.post.reply_count = this.post.reply_count - 1;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleEdit(status) {
|
||||
this.$refs.editModal.show(status);
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
isLoaded: false,
|
||||
user: undefined,
|
||||
profile: undefined,
|
||||
post: undefined,
|
||||
relationship: {},
|
||||
media: undefined,
|
||||
mediaIndex: 0,
|
||||
showLikesModal: false,
|
||||
isReply: false,
|
||||
reply: {},
|
||||
showSharesModal: false,
|
||||
postStateError: false,
|
||||
forceUpdateIdx: 0
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$route': 'init'
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.fetchSelf();
|
||||
},
|
||||
|
||||
fetchSelf() {
|
||||
this.user = window._sharedData.user;
|
||||
this.isReply = false;
|
||||
this.fetchPost();
|
||||
},
|
||||
|
||||
fetchPost() {
|
||||
axios.get('/api/pixelfed/v1/statuses/'+this.$route.params.id)
|
||||
.then(res => {
|
||||
if(!res.data || !res.data.hasOwnProperty('id')) {
|
||||
this.$router.push('/i/web/404');
|
||||
}
|
||||
if(!res.data.hasOwnProperty('account') || !res.data.account) {
|
||||
this.postStateError = true;
|
||||
return;
|
||||
}
|
||||
this.post = res.data;
|
||||
this.media = this.post.media_attachments;
|
||||
this.profile = this.post.account;
|
||||
if(this.post.in_reply_to_id) {
|
||||
this.fetchReply();
|
||||
} else {
|
||||
this.fetchRelationship();
|
||||
}
|
||||
}).catch(err => {
|
||||
switch(err.response.status) {
|
||||
case 403:
|
||||
case 404:
|
||||
this.$router.push('/i/web/404');
|
||||
break;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
fetchReply() {
|
||||
axios.get('/api/pixelfed/v1/statuses/' + this.post.in_reply_to_id)
|
||||
.then(res => {
|
||||
this.reply = res.data;
|
||||
this.isReply = true;
|
||||
this.fetchRelationship();
|
||||
})
|
||||
.catch(err => {
|
||||
this.fetchRelationship();
|
||||
})
|
||||
},
|
||||
|
||||
fetchRelationship() {
|
||||
if(this.profile.id == this.user.id) {
|
||||
this.relationship = {};
|
||||
this.fetchState();
|
||||
return;
|
||||
}
|
||||
|
||||
axios.get('/api/pixelfed/v1/accounts/relationships', {
|
||||
params: {
|
||||
'id[]': this.profile.id
|
||||
}
|
||||
}).then(res => {
|
||||
this.relationship = res.data[0];
|
||||
this.fetchState();
|
||||
});
|
||||
},
|
||||
|
||||
fetchState() {
|
||||
axios.get('/api/v2/statuses/'+this.post.id+'/state')
|
||||
.then(res => {
|
||||
this.post.favourited = res.data.liked;
|
||||
this.post.reblogged = res.data.shared;
|
||||
this.post.bookmarked = res.data.bookmarked;
|
||||
if(!this.post.favourites_count && this.post.favourited) {
|
||||
this.post.favourites_count = 1;
|
||||
}
|
||||
this.isLoaded = true;
|
||||
}).catch(err => {
|
||||
this.isLoaded = false;
|
||||
this.postStateError = true;
|
||||
})
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$router.push('/i/web');
|
||||
},
|
||||
|
||||
likeStatus() {
|
||||
let count = this.post.favourites_count;
|
||||
this.post.favourites_count = count + 1;
|
||||
this.post.favourited = !this.post.favourited;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/favourite')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.favourites_count = count;
|
||||
this.post.favourited = false;
|
||||
})
|
||||
},
|
||||
|
||||
unlikeStatus() {
|
||||
let count = this.post.favourites_count;
|
||||
this.post.favourites_count = count - 1;
|
||||
this.post.favourited = !this.post.favourited;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/unfavourite')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.favourites_count = count;
|
||||
this.post.favourited = false;
|
||||
})
|
||||
},
|
||||
|
||||
shareStatus() {
|
||||
let count = this.post.reblogs_count;
|
||||
this.post.reblogs_count = count + 1;
|
||||
this.post.reblogged = !this.post.reblogged;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/reblog')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.reblogs_count = count;
|
||||
this.post.reblogged = false;
|
||||
})
|
||||
},
|
||||
|
||||
unshareStatus() {
|
||||
let count = this.post.reblogs_count;
|
||||
this.post.reblogs_count = count - 1;
|
||||
this.post.reblogged = !this.post.reblogged;
|
||||
|
||||
axios.post('/api/v1/statuses/' + this.post.id + '/unreblog')
|
||||
.then(res => {
|
||||
//
|
||||
}).catch(err => {
|
||||
this.post.reblogs_count = count;
|
||||
this.post.reblogged = false;
|
||||
})
|
||||
},
|
||||
|
||||
follow() {
|
||||
axios.post('/api/v1/accounts/' + this.post.account.id + '/follow')
|
||||
.then(res => {
|
||||
this.$store.commit('updateRelationship', [res.data]);
|
||||
this.user.following_count++;
|
||||
this.post.account.followers_count++;
|
||||
}).catch(err => {
|
||||
swal('Oops!', 'An error occurred when attempting to follow this account.', 'error');
|
||||
this.post.relationship.following = false;
|
||||
});
|
||||
},
|
||||
|
||||
unfollow() {
|
||||
axios.post('/api/v1/accounts/' + this.post.account.id + '/unfollow')
|
||||
.then(res => {
|
||||
this.$store.commit('updateRelationship', [res.data]);
|
||||
this.user.following_count--;
|
||||
this.post.account.followers_count--;
|
||||
}).catch(err => {
|
||||
swal('Oops!', 'An error occurred when attempting to unfollow this account.', 'error');
|
||||
this.post.relationship.following = true;
|
||||
});
|
||||
},
|
||||
|
||||
openContextMenu() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.contextMenu.open();
|
||||
});
|
||||
},
|
||||
|
||||
openLikesModal() {
|
||||
this.showLikesModal = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.likesModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
openSharesModal() {
|
||||
this.showSharesModal = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.sharesModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
deletePost() {
|
||||
this.$router.push('/i/web');
|
||||
},
|
||||
|
||||
goToPost(post) {
|
||||
this.$router.push({
|
||||
name: 'post',
|
||||
path: `/i/web/post/${post.id}`,
|
||||
params: {
|
||||
id: post.id,
|
||||
cachedStatus: post,
|
||||
cachedProfile: this.user
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
goToProfile(account) {
|
||||
this.$router.push({
|
||||
name: 'profile',
|
||||
path: `/i/web/profile/${account.id}`,
|
||||
params: {
|
||||
id: account.id,
|
||||
cachedProfile: account,
|
||||
cachedUser: this.user
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleBookmark() {
|
||||
axios.post('/i/bookmark', {
|
||||
item: this.post.id
|
||||
})
|
||||
.then(res => {
|
||||
this.post.bookmarked = !this.post.bookmarked;
|
||||
})
|
||||
.catch(err => {
|
||||
this.$bvToast.toast('Cannot bookmark post at this time.', {
|
||||
title: 'Bookmark Error',
|
||||
variant: 'danger',
|
||||
autoHideDelay: 5000
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
handleReport() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.reportModal.open();
|
||||
});
|
||||
},
|
||||
|
||||
counterChange(type) {
|
||||
switch(type) {
|
||||
case 'comment-increment':
|
||||
this.post.reply_count = this.post.reply_count + 1;
|
||||
break;
|
||||
|
||||
case 'comment-decrement':
|
||||
this.post.reply_count = this.post.reply_count - 1;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleEdit(status) {
|
||||
this.$refs.editModal.show(status);
|
||||
},
|
||||
|
||||
mergeUpdatedPost(post) {
|
||||
this.post = post;
|
||||
this.$nextTick(() => {
|
||||
this.forceUpdateIdx++;
|
||||
});
|
||||
this.post = post;
|
||||
this.$nextTick(() => {
|
||||
this.forceUpdateIdx++;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue