Timeline.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. <template>
  2. <div class="container" style="">
  3. <div class="row">
  4. <div :class="[modes.distractionFree ? 'col-md-8 col-lg-8 offset-md-2 px-0 my-sm-3 timeline order-2 order-md-1':'col-md-8 col-lg-8 px-0 my-sm-3 timeline order-2 order-md-1']">
  5. <div style="padding-top:10px;">
  6. <div v-if="loading" class="text-center">
  7. <div class="spinner-border" role="status">
  8. <span class="sr-only">Loading...</span>
  9. </div>
  10. </div>
  11. <div :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
  12. <div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
  13. <div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
  14. <h6 class="text-muted font-weight-bold mb-0">Suggestions For You</h6>
  15. <span class="cursor-pointer text-muted" v-on:click="hideSuggestions"><i class="fas fa-times"></i></span>
  16. </div>
  17. <div class="card-body row mx-0">
  18. <div class="col-12 col-md-4 mb-3" v-for="(rec, index) in suggestions">
  19. <div class="card">
  20. <div class="card-body text-center pt-3">
  21. <p class="mb-0">
  22. <a :href="'/'+rec.username">
  23. <img :src="rec.avatar" class="img-fluid rounded-circle cursor-pointer" width="45px" height="45px">
  24. </a>
  25. </p>
  26. <div class="py-3">
  27. <p class="font-weight-bold text-dark cursor-pointer mb-0">
  28. <a :href="'/'+rec.username" class="text-decoration-none text-dark">
  29. {{rec.username}}
  30. </a>
  31. </p>
  32. <p class="small text-muted mb-0">{{rec.message}}</p>
  33. </div>
  34. <p class="mb-0">
  35. <a class="btn btn-primary btn-block font-weight-bold py-0" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
  36. </p>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div v-if="index == 4 && showHashtagPosts && hashtagPosts.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
  43. <div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
  44. <span></span>
  45. <h6 class="text-muted font-weight-bold mb-0"><a :href="'/discover/tags/'+hashtagPostsName+'?src=tr'">#{{hashtagPostsName}}</a></h6>
  46. <span class="cursor-pointer text-muted" v-on:click="showHashtagPosts = false"><i class="fas fa-times"></i></span>
  47. </div>
  48. <div class="card-body row mx-0">
  49. <div v-for="(tag, index) in hashtagPosts" class="col-4 p-0 p-sm-2 p-md-3 hashtag-post-square">
  50. <a class="card info-overlay card-md-border-0" :href="tag.status.url">
  51. <div :class="[tag.status.filter ? 'square ' + tag.status.filter : 'square']">
  52. <div class="square-content" :style="'background-image: url('+tag.status.thumb+')'"></div>
  53. <div class="info-overlay-text">
  54. <h5 class="text-white m-auto font-weight-bold">
  55. <span class="pr-4">
  56. <span class="far fa-heart fa-lg pr-1"></span> {{tag.status.like_count}}
  57. </span>
  58. <span>
  59. <span class="fas fa-retweet fa-lg pr-1"></span> {{tag.status.share_count}}
  60. </span>
  61. </h5>
  62. </div>
  63. </div>
  64. </a>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
  69. <div v-if="!modes.distractionFree" class="card-header d-inline-flex align-items-center bg-white">
  70. <img v-bind:src="status.account.avatar" width="32px" height="32px" style="border-radius: 32px;">
  71. <a class="username font-weight-bold pl-2 text-dark" v-bind:href="status.account.url">
  72. {{status.account.username}}
  73. </a>
  74. <div class="text-right" style="flex-grow:1;">
  75. <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">
  76. <span class="fas fa-ellipsis-v fa-lg text-muted"></span>
  77. </button>
  78. <div class="dropdown-menu dropdown-menu-right">
  79. <a class="dropdown-item font-weight-bold" :href="status.url">Go to post</a>
  80. <!-- <a class="dropdown-item font-weight-bold" href="#">Share</a>
  81. <a class="dropdown-item font-weight-bold" href="#">Embed</a> -->
  82. <span v-if="statusOwner(status) == false">
  83. <a class="dropdown-item font-weight-bold" :href="reportUrl(status)">Report</a>
  84. <a class="dropdown-item font-weight-bold" v-on:click="muteProfile(status)">Mute Profile</a>
  85. <a class="dropdown-item font-weight-bold" v-on:click="blockProfile(status)">Block Profile</a>
  86. </span>
  87. <span v-if="statusOwner(status) == true">
  88. <a class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
  89. </span>
  90. <span v-if="profile.is_admin == true && modes.mod == true">
  91. <div class="dropdown-divider"></div>
  92. <a v-if="!statusOwner(status)" class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
  93. <div class="dropdown-divider"></div>
  94. <h6 class="dropdown-header">Mod Tools</h6>
  95. <a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'autocw')">
  96. <p class="mb-0" data-toggle="tooltip" data-placement="bottom" title="Adds a CW to every post made by this account.">Enforce CW</p>
  97. </a>
  98. <a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'noautolink')">
  99. <p class="mb-0" title="Do not transform mentions, hashtags or urls into HTML.">No Autolinking</p>
  100. </a>
  101. <a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'unlisted')">
  102. <p class="mb-0" title="Removes account from public/network timelines.">Unlisted Posts</p>
  103. </a>
  104. <a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'disable')">
  105. <p class="mb-0" title="Temporarily disable account until next time user log in.">Disable Account</p>
  106. </a>
  107. <a class="dropdown-item font-weight-bold" v-on:click="moderatePost(status, 'suspend')">
  108. <p class="mb-0" title="This prevents any new interactions, without deleting existing data.">Suspend Account</p>
  109. </a>
  110. </span>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="postPresenterContainer" v-on:dblclick="likeStatus(status)">
  115. <div v-if="status.pf_type === 'photo'" class="w-100">
  116. <photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
  117. </div>
  118. <div v-else-if="status.pf_type === 'video'" class="w-100">
  119. <video-presenter :status="status"></video-presenter>
  120. </div>
  121. <div v-else-if="status.pf_type === 'photo:album'" class="w-100">
  122. <photo-album-presenter :status="status" v-on:lightbox="lightbox"></photo-album-presenter>
  123. </div>
  124. <div v-else-if="status.pf_type === 'video:album'" class="w-100">
  125. <video-album-presenter :status="status"></video-album-presenter>
  126. </div>
  127. <div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
  128. <mixed-album-presenter :status="status" v-on:lightbox="lightbox"></mixed-album-presenter>
  129. </div>
  130. <div v-else class="w-100">
  131. <p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  132. </div>
  133. </div>
  134. <div class="card-body">
  135. <div v-if="!modes.distractionFree" class="reactions my-1">
  136. <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>
  137. <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>
  138. <h3 v-if="status.visibility == 'public'" 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>
  139. </div>
  140. <div class="likes font-weight-bold" v-if="expLc(status) == true && !modes.distractionFree">
  141. <span class="like-count">{{status.favourites_count}}</span> {{status.favourites_count == 1 ? 'like' : 'likes'}}
  142. </div>
  143. <div class="caption">
  144. <p class="mb-2 read-more" style="overflow: hidden;">
  145. <span class="username font-weight-bold">
  146. <bdi><a class="text-dark" :href="status.account.url">{{status.account.username}}</a></bdi>
  147. </span>
  148. <span v-html="status.content"></span>
  149. </p>
  150. </div>
  151. <div class="comments" v-if="status.id == replyId && !status.comments_disabled">
  152. <p class="mb-0 d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;" v-for="(reply, index) in replies">
  153. <span>
  154. <a class="text-dark font-weight-bold mr-1" :href="reply.account.url">{{reply.account.username}}</a>
  155. <span v-html="reply.content"></span>
  156. </span>
  157. <span class="mb-0" style="min-width:38px">
  158. <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>
  159. <post-menu :status="reply" :profile="profile" size="sm" :modal="'true'" :feed="feed" class="d-inline-flex pl-2"></post-menu>
  160. </span>
  161. </p>
  162. </div>
  163. <div class="timestamp mt-2">
  164. <p class="small text-uppercase mb-0">
  165. <a :href="status.url" class="text-muted">
  166. <timeago :datetime="status.created_at" :auto-update="60" :converter-options="{includeSeconds:true}" :title="timestampFormat(status.created_at)" v-b-tooltip.hover.bottom></timeago>
  167. </a>
  168. <a v-if="modes.distractionFree" class="float-right" :href="status.url">
  169. <i class="fas fa-ellipsis-h fa-lg text-muted"></i>
  170. </a>
  171. </p>
  172. </div>
  173. </div>
  174. <div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white px-2 py-0">
  175. <ul class="nav align-items-center emoji-reactions" style="overflow-x: scroll;flex-wrap: unset;">
  176. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜‚</li>
  177. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ’ฏ</li>
  178. <li class="nav-item" v-on:click="emojiReaction(status)">โค๏ธ</li>
  179. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ™Œ</li>
  180. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ‘</li>
  181. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ‘Œ</li>
  182. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜</li>
  183. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜ฏ</li>
  184. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜ข</li>
  185. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜…</li>
  186. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜</li>
  187. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ™‚</li>
  188. <li class="nav-item" v-on:click="emojiReaction(status)">๐Ÿ˜Ž</li>
  189. <li class="nav-item" v-on:click="emojiReaction(status)" v-for="e in emoji">{{e}}</li>
  190. </ul>
  191. </div>
  192. <div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white sticky-md-bottom p-0">
  193. <form class="border-0 rounded-0 align-middle" method="post" action="/i/comment" :data-id="status.id" data-truncate="false">
  194. <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>
  195. <input type="button" value="Post" class="d-inline-block btn btn-link font-weight-bold reply-btn text-decoration-none" v-on:click.prevent="commentSubmit(status, $event)"/>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. <div v-if="!loading && feed.length > 0">
  201. <div class="card">
  202. <div class="card-body">
  203. <infinite-loading @infinite="infiniteTimeline" :distance="800">
  204. <div slot="no-more" class="font-weight-bold">No more posts to load</div>
  205. <div slot="no-results" class="font-weight-bold">No posts found</div>
  206. </infinite-loading>
  207. </div>
  208. </div>
  209. </div>
  210. <div v-if="!loading && scope == 'home' && feed.length == 0">
  211. <div class="card">
  212. <div class="card-body text-center">
  213. <p class="h2 font-weight-lighter p-5">Hello, {{profile.acct}}</p>
  214. <p class="text-lighter"><i class="fas fa-camera-retro fa-5x"></i></p>
  215. <p class="h3 font-weight-lighter p-5">Start following people to build your timeline.</p>
  216. <p><a href="/discover" class="btn btn-primary font-weight-bold py-0">Discover new people and posts</a></p>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. <div v-if="!modes.distractionFree" class="col-md-4 col-lg-4 my-3 order-1 order-md-2 d-none d-md-block">
  223. <div class="position-sticky" style="top:68px;">
  224. <div class="mb-4">
  225. <div class="">
  226. <div class="">
  227. <div class="media d-flex align-items-center">
  228. <a :href="profile.url">
  229. <img class="mr-3 rounded-circle box-shadow" :src="profile.avatar || '/storage/avatars/default.png'" alt="avatar" width="64px" height="64px">
  230. </a>
  231. <div class="media-body d-flex justify-content-between word-break" >
  232. <div>
  233. <p class="mb-0 px-0 font-weight-bold"><a :href="profile.url" class="text-dark">{{profile.username || 'loading...'}}</a></p>
  234. <p class="my-0 text-muted pb-0">{{profile.display_name || 'loading...'}}</p>
  235. </div>
  236. <div class="ml-2">
  237. <a class="text-muted" href="/settings/home"><i class="fas fa-cog fa-lg"></i></a>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <!-- <div class="card-footer bg-white py-1 d-none">
  243. <div class="d-flex justify-content-between text-center">
  244. <span class="pl-3 cursor-pointer" v-on:click="redirect(profile.url)">
  245. <p class="mb-0 font-weight-bold">{{profile.statuses_count}}</p>
  246. <p class="mb-0 small text-muted">Posts</p>
  247. </span>
  248. <span class="cursor-pointer" v-on:click="followersModal()">
  249. <p class="mb-0 font-weight-bold">{{profile.followers_count}}</p>
  250. <p class="mb-0 small text-muted">Followers</p>
  251. </span>
  252. <span class="pr-3 cursor-pointer" v-on:click="followingModal()">
  253. <p class="mb-0 font-weight-bold">{{profile.following_count}}</p>
  254. <p class="mb-0 small text-muted">Following</p>
  255. </span>
  256. </div>
  257. </div> -->
  258. </div>
  259. </div>
  260. <div v-show="modes.notify == true" class="mb-4">
  261. <notification-card></notification-card>
  262. </div>
  263. <div v-show="showSuggestions == true && suggestions.length && config.ab && config.ab.rec == true" class="mb-4">
  264. <div class="card">
  265. <div class="card-header bg-white d-flex align-items-center justify-content-between">
  266. <a class="small text-muted cursor-pointer" href="#" @click.prevent="refreshSuggestions" ref="suggestionRefresh"><i class="fas fa-sync-alt"></i></a>
  267. <div class="small text-dark text-uppercase font-weight-bold">Suggestions</div>
  268. <div class="small text-muted cursor-pointer" v-on:click="hideSuggestions"><i class="fas fa-times"></i></div>
  269. </div>
  270. <div class="card-body pt-0">
  271. <div v-for="(rec, index) in suggestions" class="media align-items-center mt-3">
  272. <a :href="'/'+rec.username">
  273. <img :src="rec.avatar" width="32px" height="32px" class="rounded-circle mr-3">
  274. </a>
  275. <div class="media-body">
  276. <p class="mb-0 font-weight-bold small">
  277. <a :href="'/'+rec.username" class="text-decoration-none text-dark">
  278. {{rec.username}}
  279. </a>
  280. </p>
  281. <p class="mb-0 small text-muted">{{rec.message}}</p>
  282. </div>
  283. <a class="font-weight-bold small" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. <footer>
  289. <div class="container pb-5">
  290. <p class="mb-0 text-uppercase font-weight-bold text-muted small">
  291. <a href="/site/about" class="text-dark pr-2">About Us</a>
  292. <a href="/site/help" class="text-dark pr-2">Help</a>
  293. <a href="/site/open-source" class="text-dark pr-2">Open Source</a>
  294. <a href="/site/language" class="text-dark pr-2">Language</a>
  295. <a href="/site/terms" class="text-dark pr-2">Terms</a>
  296. <a href="/site/privacy" class="text-dark pr-2">Privacy</a>
  297. <a href="/site/platform" class="text-dark pr-2">API</a>
  298. </p>
  299. <p class="mb-0 text-uppercase font-weight-bold text-muted small">
  300. <a href="http://pixelfed.org" class="text-muted" rel="noopener" title="" data-toggle="tooltip">Powered by Pixelfed</a>
  301. </p>
  302. </div>
  303. </footer>
  304. </div>
  305. </div>
  306. </div>
  307. <!-- <b-modal ref="followingModal"
  308. id="following-modal"
  309. hide-footer
  310. centered
  311. title="Following"
  312. body-class="list-group-flush p-0">
  313. <div class="list-group">
  314. <div class="list-group-item border-0" v-for="(user, index) in following" :key="'following_'+index">
  315. <div class="media">
  316. <a :href="user.url">
  317. <img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + 'โ€™s avatar'" width="30px">
  318. </a>
  319. <div class="media-body">
  320. <p class="mb-0" style="font-size: 14px">
  321. <a :href="user.url" class="font-weight-bold text-dark">
  322. {{user.username}}
  323. </a>
  324. </p>
  325. <p class="text-muted mb-0" style="font-size: 14px">
  326. {{user.display_name}}
  327. </p>
  328. </div>
  329. <a class="btn btn-outline-secondary btn-sm" href="#" @click.prevent="followModalAction(user.id, index, 'following')">Unfollow</a>
  330. </div>
  331. </div>
  332. <div v-if="following.length == 0" class="list-group-item border-0">
  333. <div class="list-group-item border-0">
  334. <p class="p-3 text-center mb-0 lead">You are not following anyone.</p>
  335. </div>
  336. </div>
  337. <div v-if="following.length != 0 && followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
  338. <p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
  339. </div>
  340. </div>
  341. </b-modal>
  342. <b-modal ref="followerModal"
  343. id="follower-modal"
  344. hide-footer
  345. centered
  346. title="Followers"
  347. body-class="list-group-flush p-0">
  348. <div class="list-group">
  349. <div class="list-group-item border-0" v-for="(user, index) in followers" :key="'follower_'+index">
  350. <div class="media">
  351. <a :href="user.url">
  352. <img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + 'โ€™s avatar'" width="30px">
  353. </a>
  354. <div class="media-body">
  355. <p class="mb-0" style="font-size: 14px">
  356. <a :href="user.url" class="font-weight-bold text-dark">
  357. {{user.username}}
  358. </a>
  359. </p>
  360. <p class="text-muted mb-0" style="font-size: 14px">
  361. {{user.display_name}}
  362. </p>
  363. </div>
  364. </div>
  365. </div>
  366. <div v-if="followerMore" class="list-group-item text-center" v-on:click="followersLoadMore()">
  367. <p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
  368. </div>
  369. </div>
  370. </b-modal> -->
  371. <b-modal
  372. id="lightbox"
  373. ref="lightboxModal"
  374. hide-header
  375. hide-footer
  376. centered
  377. size="lg"
  378. body-class="p-0"
  379. >
  380. <div v-if="lightboxMedia" :class="lightboxMedia.filter_class">
  381. <img :src="lightboxMedia.url" class="img-fluid" style="min-height: 100%; min-width: 100%">
  382. </div>
  383. </b-modal>
  384. </div>
  385. </template>
  386. <style type="text/css" scoped>
  387. .postPresenterContainer {
  388. display: flex;
  389. align-items: center;
  390. background: #fff;
  391. }
  392. .word-break {
  393. word-break: break-all;
  394. }
  395. .small .custom-control-label {
  396. padding-top: 3px;
  397. }
  398. .reply-btn {
  399. position: absolute;
  400. bottom: 12px;
  401. right: 20px;
  402. width: 60px;
  403. text-align: center;
  404. border-radius: 0 3px 3px 0;
  405. }
  406. .emoji-reactions .nav-item {
  407. font-size: 1.2rem;
  408. padding: 9px;
  409. cursor: pointer;
  410. }
  411. .emoji-reactions::-webkit-scrollbar {
  412. width: 0px;
  413. height: 0px;
  414. background: transparent;
  415. }
  416. </style>
  417. <script type="text/javascript">
  418. export default {
  419. props: ['scope'],
  420. data() {
  421. return {
  422. ids: [],
  423. config: {},
  424. page: 2,
  425. feed: [],
  426. profile: {},
  427. min_id: 0,
  428. max_id: 0,
  429. stories: {},
  430. suggestions: {},
  431. loading: true,
  432. replies: [],
  433. replyId: null,
  434. modes: {
  435. 'mod': false,
  436. 'dark': false,
  437. 'notify': true,
  438. 'distractionFree': false
  439. },
  440. followers: [],
  441. followerCursor: 1,
  442. followerMore: true,
  443. following: [],
  444. followingCursor: 1,
  445. followingMore: true,
  446. lightboxMedia: false,
  447. showSuggestions: false,
  448. showReadMore: true,
  449. replyStatus: {},
  450. replyText: '',
  451. emoji: ['๐Ÿ˜€','๐Ÿคฃ','๐Ÿ˜ƒ','๐Ÿ˜„','๐Ÿ˜†','๐Ÿ˜‰','๐Ÿ˜Š','๐Ÿ˜‹','๐Ÿ˜˜','๐Ÿ˜—','๐Ÿ˜™','๐Ÿ˜š','๐Ÿค—','๐Ÿคฉ','๐Ÿค”','๐Ÿคจ','๐Ÿ˜','๐Ÿ˜‘','๐Ÿ˜ถ','๐Ÿ™„','๐Ÿ˜','๐Ÿ˜ฃ','๐Ÿ˜ฅ','๐Ÿ˜ฎ','๐Ÿค','๐Ÿ˜ช','๐Ÿ˜ซ','๐Ÿ˜ด','๐Ÿ˜Œ','๐Ÿ˜›','๐Ÿ˜œ','๐Ÿ˜','๐Ÿคค','๐Ÿ˜’','๐Ÿ˜“','๐Ÿ˜”','๐Ÿ˜•','๐Ÿ™ƒ','๐Ÿค‘','๐Ÿ˜ฒ','๐Ÿ™','๐Ÿ˜–','๐Ÿ˜ž','๐Ÿ˜Ÿ','๐Ÿ˜ค','๐Ÿ˜ญ','๐Ÿ˜ฆ','๐Ÿ˜ง','๐Ÿ˜จ','๐Ÿ˜ฉ','๐Ÿคฏ','๐Ÿ˜ฌ','๐Ÿ˜ฐ','๐Ÿ˜ฑ','๐Ÿ˜ณ','๐Ÿคช','๐Ÿ˜ต','๐Ÿ˜ก','๐Ÿ˜ ','๐Ÿคฌ','๐Ÿ˜ท','๐Ÿค’','๐Ÿค•','๐Ÿคข','๐Ÿคฎ','๐Ÿคง','๐Ÿ˜‡','๐Ÿค ','๐Ÿคก','๐Ÿคฅ','๐Ÿคซ','๐Ÿคญ','๐Ÿง','๐Ÿค“','๐Ÿ˜ˆ','๐Ÿ‘ฟ','๐Ÿ‘น','๐Ÿ‘บ','๐Ÿ’€','๐Ÿ‘ป','๐Ÿ‘ฝ','๐Ÿค–','๐Ÿ’ฉ','๐Ÿ˜บ','๐Ÿ˜ธ','๐Ÿ˜น','๐Ÿ˜ป','๐Ÿ˜ผ','๐Ÿ˜ฝ','๐Ÿ™€','๐Ÿ˜ฟ','๐Ÿ˜พ','๐Ÿคฒ','๐Ÿ‘','๐Ÿค','๐Ÿ‘','๐Ÿ‘Ž','๐Ÿ‘Š','โœŠ','๐Ÿค›','๐Ÿคœ','๐Ÿคž','โœŒ๏ธ','๐ŸคŸ','๐Ÿค˜','๐Ÿ‘ˆ','๐Ÿ‘‰','๐Ÿ‘†','๐Ÿ‘‡','โ˜๏ธ','โœ‹','๐Ÿคš','๐Ÿ–','๐Ÿ––','๐Ÿ‘‹','๐Ÿค™','๐Ÿ’ช','๐Ÿ–•','โœ๏ธ','๐Ÿ™','๐Ÿ’','๐Ÿ’„','๐Ÿ’‹','๐Ÿ‘„','๐Ÿ‘…','๐Ÿ‘‚','๐Ÿ‘ƒ','๐Ÿ‘ฃ','๐Ÿ‘','๐Ÿ‘€','๐Ÿง ','๐Ÿ—ฃ','๐Ÿ‘ค','๐Ÿ‘ฅ'],
  452. showHashtagPosts: false,
  453. hashtagPosts: [],
  454. hashtagPostsName: '',
  455. }
  456. },
  457. beforeMount() {
  458. axios.get('/api/v2/config')
  459. .then(res => {
  460. this.config = res.data;
  461. this.fetchProfile();
  462. this.fetchTimelineApi();
  463. // if(this.config.announcement.enabled == true) {
  464. // let msg = $('<div>')
  465. // .addClass('alert alert-warning mb-0 rounded-0 text-center font-weight-bold')
  466. // .html(this.config.announcement.message);
  467. // $('body').prepend(msg);
  468. // }
  469. });
  470. },
  471. mounted() {
  472. if($('link[data-stylesheet="dark"]').length != 0) {
  473. this.modes.dark = true;
  474. }
  475. if(localStorage.getItem('pf_metro_ui.exp.rec') == 'false') {
  476. this.showSuggestions = false;
  477. } else {
  478. this.showSuggestions = true;
  479. }
  480. if(localStorage.getItem('pf_metro_ui.exp.rm') == 'false') {
  481. this.showReadMore = false;
  482. } else {
  483. this.showReadMore = true;
  484. }
  485. if(localStorage.getItem('pf_metro_ui.exp.df') == 'true') {
  486. this.modes.distractionFree = true;
  487. } else {
  488. this.modes.distractionFree = false;
  489. }
  490. this.$nextTick(function () {
  491. $('[data-toggle="tooltip"]').tooltip()
  492. });
  493. },
  494. updated() {
  495. if(this.showReadMore == true) {
  496. pixelfed.readmore();
  497. }
  498. },
  499. methods: {
  500. fetchProfile() {
  501. axios.get('/api/v1/accounts/verify_credentials').then(res => {
  502. this.profile = res.data;
  503. if(this.profile.is_admin == true) {
  504. this.modes.mod = true;
  505. }
  506. $('.profile-card .loader').addClass('d-none');
  507. $('.profile-card .contents').removeClass('d-none');
  508. $('.profile-card .card-footer').removeClass('d-none');
  509. this.expRec();
  510. }).catch(err => {
  511. swal(
  512. 'Oops, something went wrong',
  513. 'Please reload the page.',
  514. 'error'
  515. );
  516. });
  517. },
  518. fetchTimelineApi() {
  519. let apiUrl = false;
  520. switch(this.scope) {
  521. case 'home':
  522. apiUrl = '/api/v1/timelines/home';
  523. break;
  524. case 'local':
  525. apiUrl = '/api/v1/timelines/public';
  526. break;
  527. case 'network':
  528. apiUrl = '/api/v1/timelines/network';
  529. break;
  530. }
  531. axios.get(apiUrl, {
  532. params: {
  533. max_id: this.max_id,
  534. limit: 6
  535. }
  536. }).then(res => {
  537. let data = res.data;
  538. this.feed.push(...data);
  539. let ids = data.map(status => status.id);
  540. this.ids = ids;
  541. this.min_id = Math.max(...ids);
  542. this.max_id = Math.min(...ids);
  543. $('.timeline .pagination').removeClass('d-none');
  544. this.loading = false;
  545. this.fetchHashtagPosts();
  546. }).catch(err => {
  547. });
  548. },
  549. infiniteTimeline($state) {
  550. if(this.loading) {
  551. return;
  552. }
  553. let apiUrl = false;
  554. switch(this.scope) {
  555. case 'home':
  556. apiUrl = '/api/v1/timelines/home';
  557. break;
  558. case 'local':
  559. apiUrl = '/api/v1/timelines/public';
  560. break;
  561. case 'network':
  562. apiUrl = '/api/v1/timelines/network';
  563. break;
  564. }
  565. axios.get(apiUrl, {
  566. params: {
  567. max_id: this.max_id,
  568. limit: 6
  569. },
  570. }).then(res => {
  571. if (res.data.length && this.loading == false) {
  572. let data = res.data;
  573. let self = this;
  574. data.forEach(d => {
  575. if(self.ids.indexOf(d.id) == -1) {
  576. self.feed.push(d);
  577. self.ids.push(d.id);
  578. }
  579. });
  580. this.min_id = Math.max(...this.ids);
  581. this.max_id = Math.min(...this.ids);
  582. this.page += 1;
  583. $state.loaded();
  584. this.loading = false;
  585. } else {
  586. $state.complete();
  587. }
  588. });
  589. },
  590. loadMore(event) {
  591. let homeTimeline = '/api/v1/timelines/home';
  592. let localTimeline = '/api/v1/timelines/public';
  593. let apiUrl = this.scope == 'home' ? homeTimeline : localTimeline;
  594. event.target.innerText = 'Loading...';
  595. axios.get(apiUrl, {
  596. params: {
  597. page: this.page,
  598. },
  599. }).then(res => {
  600. if (res.data.length && this.loading == false) {
  601. let data = res.data;
  602. let ids = data.map(status => status.id);
  603. this.min_id = Math.min(...ids);
  604. if(this.page == 1) {
  605. this.max_id = Math.max(...ids);
  606. }
  607. this.feed.push(...data);
  608. this.page += 1;
  609. this.loading = false;
  610. event.target.innerText = 'Load more posts';
  611. } else {
  612. }
  613. });
  614. },
  615. reportUrl(status) {
  616. let type = status.in_reply_to ? 'comment' : 'post';
  617. let id = status.id;
  618. return '/i/report?type=' + type + '&id=' + id;
  619. },
  620. commentFocus(status, $event) {
  621. if(this.replyId == status.id || status.comments_disabled) {
  622. return;
  623. }
  624. this.replies = {};
  625. this.replyStatus = {};
  626. this.replyText = '';
  627. this.replyId = status.id;
  628. this.replyStatus = status;
  629. this.fetchStatusComments(status, '');
  630. },
  631. likeStatus(status) {
  632. if($('body').hasClass('loggedIn') == false) {
  633. return;
  634. }
  635. axios.post('/i/like', {
  636. item: status.id
  637. }).then(res => {
  638. status.favourites_count = res.data.count;
  639. status.favourited = !status.favourited;
  640. }).catch(err => {
  641. swal('Error', 'Something went wrong, please try again later.', 'error');
  642. });
  643. },
  644. shareStatus(status, $event) {
  645. if($('body').hasClass('loggedIn') == false) {
  646. return;
  647. }
  648. axios.post('/i/share', {
  649. item: status.id
  650. }).then(res => {
  651. status.reblogs_count = res.data.count;
  652. status.reblogged = !status.reblogged;
  653. }).catch(err => {
  654. swal('Error', 'Something went wrong, please try again later.', 'error');
  655. });
  656. },
  657. timestampFormat(timestamp) {
  658. let ts = new Date(timestamp);
  659. return ts.toDateString() + ' ' + ts.toLocaleTimeString();
  660. },
  661. editUrl(status) {
  662. return status.url + '/edit';
  663. },
  664. redirect(url) {
  665. window.location.href = url;
  666. return;
  667. },
  668. replyUrl(status) {
  669. let username = this.profile.username;
  670. let id = status.account.id == this.profile.id ? status.id : status.in_reply_to_id;
  671. return '/p/' + username + '/' + id;
  672. },
  673. mentionUrl(status) {
  674. let username = status.account.username;
  675. let id = status.id;
  676. return '/p/' + username + '/' + id;
  677. },
  678. statusOwner(status) {
  679. let sid = status.account.id;
  680. let uid = this.profile.id;
  681. if(sid == uid) {
  682. return true;
  683. } else {
  684. return false;
  685. }
  686. },
  687. fetchStatusComments(status, card) {
  688. axios.get('/api/v2/status/'+status.id+'/replies')
  689. .then(res => {
  690. let data = res.data.filter(res => {
  691. return res.sensitive == false;
  692. });
  693. this.replies = _.reverse(data);
  694. }).catch(err => {
  695. })
  696. },
  697. muteProfile(status) {
  698. if($('body').hasClass('loggedIn') == false) {
  699. return;
  700. }
  701. axios.post('/i/mute', {
  702. type: 'user',
  703. item: status.account.id
  704. }).then(res => {
  705. this.feed = this.feed.filter(s => s.account.id !== status.account.id);
  706. swal('Success', 'You have successfully muted ' + status.account.acct, 'success');
  707. }).catch(err => {
  708. swal('Error', 'Something went wrong. Please try again later.', 'error');
  709. });
  710. },
  711. blockProfile(status) {
  712. if($('body').hasClass('loggedIn') == false) {
  713. return;
  714. }
  715. axios.post('/i/block', {
  716. type: 'user',
  717. item: status.account.id
  718. }).then(res => {
  719. this.feed = this.feed.filter(s => s.account.id !== status.account.id);
  720. swal('Success', 'You have successfully blocked ' + status.account.acct, 'success');
  721. }).catch(err => {
  722. swal('Error', 'Something went wrong. Please try again later.', 'error');
  723. });
  724. },
  725. deletePost(status, index) {
  726. if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) {
  727. return;
  728. }
  729. if(window.confirm('Are you sure you want to delete this post?') == false) {
  730. return;
  731. }
  732. axios.post('/i/delete', {
  733. type: 'status',
  734. item: status.id
  735. }).then(res => {
  736. this.feed = this.feed.filter(s => {
  737. return s.id != status.id;
  738. })
  739. swal('Success', 'You have successfully deleted this post', 'success');
  740. }).catch(err => {
  741. swal('Error', 'Something went wrong. Please try again later.', 'error');
  742. });
  743. },
  744. commentSubmit(status, $event) {
  745. let id = status.id;
  746. let comment = this.replyText;
  747. axios.post('/i/comment', {
  748. item: id,
  749. comment: comment
  750. }).then(res => {
  751. this.replyText = '';
  752. this.replies.push(res.data.entity);
  753. });
  754. },
  755. moderatePost(status, action, $event) {
  756. let username = status.account.username;
  757. console.log('action: ' + action + ' status id' + status.id);
  758. switch(action) {
  759. case 'autocw':
  760. let msg = 'Are you sure you want to enforce CW for ' + username + ' ?';
  761. swal({
  762. title: 'Confirm',
  763. text: msg,
  764. icon: 'warning',
  765. buttons: true,
  766. dangerMode: true
  767. }).then(res => {
  768. if(res) {
  769. axios.post('/api/v2/moderator/action', {
  770. action: action,
  771. item_id: status.id,
  772. item_type: 'status'
  773. }).then(res => {
  774. swal('Success', 'Successfully enforced CW for ' + username, 'success');
  775. }).catch(err => {
  776. swal(
  777. 'Error',
  778. 'Something went wrong, please try again later.',
  779. 'error'
  780. );
  781. });
  782. }
  783. });
  784. break;
  785. case 'noautolink':
  786. msg = 'Are you sure you want to disable auto linking for ' + username + ' ?';
  787. swal({
  788. title: 'Confirm',
  789. text: msg,
  790. icon: 'warning',
  791. buttons: true,
  792. dangerMode: true
  793. }).then(res => {
  794. if(res) {
  795. axios.post('/api/v2/moderator/action', {
  796. action: action,
  797. item_id: status.id,
  798. item_type: 'status'
  799. }).then(res => {
  800. swal('Success', 'Successfully disabled autolinking for ' + username, 'success');
  801. }).catch(err => {
  802. swal(
  803. 'Error',
  804. 'Something went wrong, please try again later.',
  805. 'error'
  806. );
  807. });
  808. }
  809. });
  810. break;
  811. case 'unlisted':
  812. msg = 'Are you sure you want to unlist from timelines for ' + username + ' ?';
  813. swal({
  814. title: 'Confirm',
  815. text: msg,
  816. icon: 'warning',
  817. buttons: true,
  818. dangerMode: true
  819. }).then(res => {
  820. if(res) {
  821. axios.post('/api/v2/moderator/action', {
  822. action: action,
  823. item_id: status.id,
  824. item_type: 'status'
  825. }).then(res => {
  826. swal('Success', 'Successfully unlisted for ' + username, 'success');
  827. }).catch(err => {
  828. swal(
  829. 'Error',
  830. 'Something went wrong, please try again later.',
  831. 'error'
  832. );
  833. });
  834. }
  835. });
  836. break;
  837. case 'disable':
  838. msg = 'Are you sure you want to disable ' + username + 'โ€™s account ?';
  839. swal({
  840. title: 'Confirm',
  841. text: msg,
  842. icon: 'warning',
  843. buttons: true,
  844. dangerMode: true
  845. }).then(res => {
  846. if(res) {
  847. axios.post('/api/v2/moderator/action', {
  848. action: action,
  849. item_id: status.id,
  850. item_type: 'status'
  851. }).then(res => {
  852. swal('Success', 'Successfully disabled ' + username + 'โ€™s account', 'success');
  853. }).catch(err => {
  854. swal(
  855. 'Error',
  856. 'Something went wrong, please try again later.',
  857. 'error'
  858. );
  859. });
  860. }
  861. });
  862. break;
  863. case 'suspend':
  864. msg = 'Are you sure you want to suspend ' + username + 'โ€™s account ?';
  865. swal({
  866. title: 'Confirm',
  867. text: msg,
  868. icon: 'warning',
  869. buttons: true,
  870. dangerMode: true
  871. }).then(res => {
  872. if(res) {
  873. axios.post('/api/v2/moderator/action', {
  874. action: action,
  875. item_id: status.id,
  876. item_type: 'status'
  877. }).then(res => {
  878. swal('Success', 'Successfully suspend ' + username + 'โ€™s account', 'success');
  879. }).catch(err => {
  880. swal(
  881. 'Error',
  882. 'Something went wrong, please try again later.',
  883. 'error'
  884. );
  885. });
  886. }
  887. });
  888. break;
  889. }
  890. },
  891. followingModal() {
  892. if(this.following.length > 0) {
  893. this.$refs.followingModal.show();
  894. return;
  895. }
  896. axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
  897. params: {
  898. page: this.followingCursor
  899. }
  900. })
  901. .then(res => {
  902. this.following = res.data;
  903. this.followingCursor++;
  904. });
  905. if(res.data.length < 10) {
  906. this.followingMore = false;
  907. }
  908. this.$refs.followingModal.show();
  909. },
  910. followersModal() {
  911. if(this.followers.length > 0) {
  912. this.$refs.followerModal.show();
  913. return;
  914. }
  915. axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
  916. params: {
  917. page: this.followerCursor
  918. }
  919. })
  920. .then(res => {
  921. this.followers = res.data;
  922. this.followerCursor++;
  923. })
  924. if(res.data.length < 10) {
  925. this.followerMore = false;
  926. }
  927. this.$refs.followerModal.show();
  928. },
  929. followingLoadMore() {
  930. axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
  931. params: {
  932. page: this.followingCursor
  933. }
  934. })
  935. .then(res => {
  936. if(res.data.length > 0) {
  937. this.following.push(...res.data);
  938. this.followingCursor++;
  939. }
  940. if(res.data.length < 10) {
  941. this.followingMore = false;
  942. }
  943. });
  944. },
  945. followersLoadMore() {
  946. axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
  947. params: {
  948. page: this.followerCursor
  949. }
  950. })
  951. .then(res => {
  952. if(res.data.length > 0) {
  953. this.followers.push(...res.data);
  954. this.followerCursor++;
  955. }
  956. if(res.data.length < 10) {
  957. this.followerMore = false;
  958. }
  959. });
  960. },
  961. lightbox(src) {
  962. this.lightboxMedia = src;
  963. this.$refs.lightboxModal.show();
  964. },
  965. expLc(status) {
  966. if(this.config.ab.lc == false) {
  967. return true;
  968. }
  969. if(this.statusOwner(status) == true) {
  970. return true;
  971. }
  972. return false;
  973. },
  974. expRec() {
  975. if(this.config.ab.rec == false) {
  976. return;
  977. }
  978. axios.get('/api/local/exp/rec')
  979. .then(res => {
  980. this.suggestions = res.data;
  981. })
  982. },
  983. expRecFollow(id, index) {
  984. if(this.config.ab.rec == false) {
  985. return;
  986. }
  987. axios.post('/i/follow', {
  988. item: id
  989. }).then(res => {
  990. this.suggestions.splice(index, 1);
  991. }).catch(err => {
  992. if(err.response.data.message) {
  993. swal('Error', err.response.data.message, 'error');
  994. }
  995. });
  996. },
  997. followModalAction(id, index, type = 'following') {
  998. axios.post('/i/follow', {
  999. item: id
  1000. }).then(res => {
  1001. if(type == 'following') {
  1002. this.following.splice(index, 1);
  1003. }
  1004. }).catch(err => {
  1005. if(err.response.data.message) {
  1006. swal('Error', err.response.data.message, 'error');
  1007. }
  1008. });
  1009. },
  1010. owner(status) {
  1011. return this.profile.id === status.account.id;
  1012. },
  1013. admin() {
  1014. return this.profile.is_admin == true;
  1015. },
  1016. ownerOrAdmin(status) {
  1017. return this.owner(status) || this.admin();
  1018. },
  1019. hideSuggestions() {
  1020. localStorage.setItem('pf_metro_ui.exp.rec', false);
  1021. this.showSuggestions = false;
  1022. },
  1023. emojiReaction(status) {
  1024. let em = event.target.innerText;
  1025. if(this.replyText.length == 0) {
  1026. this.replyText = em + ' ';
  1027. $('textarea[name="comment"]').focus();
  1028. } else {
  1029. this.replyText += em + ' ';
  1030. $('textarea[name="comment"]').focus();
  1031. }
  1032. },
  1033. refreshSuggestions() {
  1034. let el = event.target.parentNode;
  1035. if(el.classList.contains('disabled') == true) {
  1036. return;
  1037. }
  1038. axios.get('/api/local/exp/rec', {
  1039. params: {
  1040. refresh: true
  1041. }
  1042. })
  1043. .then(res => {
  1044. this.suggestions = res.data;
  1045. if (el.classList) {
  1046. el.classList.add('disabled');
  1047. el.classList.add('text-light');
  1048. }
  1049. else {
  1050. el.className += ' ' + 'disabled text-light';
  1051. }
  1052. setTimeout(function() {
  1053. el.setAttribute('href', '#');
  1054. if (el.classList) {
  1055. el.classList.remove('disabled');
  1056. el.classList.remove('text-light');
  1057. }
  1058. else {
  1059. el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), 'disabled text-light');
  1060. }
  1061. }, 10000);
  1062. });
  1063. },
  1064. fetchHashtagPosts() {
  1065. axios.get('/api/local/discover/tag/list')
  1066. .then(res => {
  1067. let tags = res.data;
  1068. if(tags.length == 0) {
  1069. return;
  1070. }
  1071. let hashtag = tags[0];
  1072. this.hashtagPostsName = hashtag;
  1073. axios.get('/api/v2/discover/tag', {
  1074. params: {
  1075. hashtag: hashtag
  1076. }
  1077. }).then(res => {
  1078. if(res.data.tags.length) {
  1079. this.showHashtagPosts = true;
  1080. this.hashtagPosts = res.data.tags.splice(0,3);
  1081. }
  1082. })
  1083. })
  1084. }
  1085. }
  1086. }
  1087. </script>