Timeline.vue 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253
  1. <template>
  2. <div>
  3. <div v-if="currentLayout === 'feed'" class="container">
  4. <div class="row">
  5. <div v-if="morePostsAvailable == true" class="col-12 mt-5 pt-3 mb-3 fixed-top">
  6. <p class="text-center">
  7. <button class="btn btn-dark px-4 rounded-pill font-weight-bold shadow" @click="syncNewPosts">Load New Posts</button>
  8. </p>
  9. </div>
  10. <div class="d-none col-12 pl-3 pl-md-0 pt-3 pl-0">
  11. <div class="d-none d-md-flex justify-content-between align-items-center">
  12. <p class="lead text-muted mb-0"><i :class="[scope == 'home' ? 'fas fa-home':'fas fa-stream']"></i> &nbsp; {{scope == 'local' ? 'Public' : 'Home'}} Timeline</p>
  13. <p class="mb-0">
  14. <span class="btn-group">
  15. <a href="#" :class="[layout=='feed'?'btn btn-sm btn-outline-primary font-weight-bold text-decoration-none':'btn btn-sm btn-outline-lighter font-weight-light text-decoration-none']" @click.prevent="switchFeedLayout('feed')"><i class="fas fa-list"></i></a>
  16. <a href="#" :class="[layout!=='feed'?'btn btn-sm btn-outline-primary font-weight-bold text-decoration-none':'btn btn-sm btn-outline-lighter font-weight-light text-decoration-none']" @click.prevent="switchFeedLayout('grid')"><i class="fas fa-th"></i></a>
  17. </span>
  18. </p>
  19. <p class="mb-0 d-none d-md-block">
  20. <a class="btn btn-block btn-primary btn-sm font-weight-bold" href="/i/compose" data-toggle="modal" data-target="#composeModal">
  21. New Post
  22. </a>
  23. </p>
  24. </div>
  25. <hr>
  26. </div>
  27. <div class="col-md-8 col-lg-8 px-0 mb-sm-3 timeline order-2 order-md-1">
  28. <div style="margin-top:-2px;">
  29. <story-component v-if="config.features.stories"></story-component>
  30. </div>
  31. <div>
  32. <div v-if="loading" class="text-center" style="padding-top:10px;">
  33. <div class="spinner-border" role="status">
  34. <span class="sr-only">Loading...</span>
  35. </div>
  36. </div>
  37. <div :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
  38. <div v-if="index == 0 && showTips && !loading" class="my-4 card-tips">
  39. <announcements-card v-on:show-tips="showTips = $event"></announcements-card>
  40. </div>
  41. <div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
  42. <div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
  43. <h6 class="text-muted font-weight-bold mb-0">Suggestions For You</h6>
  44. <span class="cursor-pointer text-muted" v-on:click="hideSuggestions"><i class="fas fa-times"></i></span>
  45. </div>
  46. <div class="card-body row mx-0">
  47. <div class="col-12 col-md-4 mb-3" v-for="(rec, index) in suggestions">
  48. <div class="card">
  49. <div class="card-body text-center pt-3">
  50. <p class="mb-0">
  51. <a :href="'/'+rec.username">
  52. <img :src="rec.avatar" class="img-fluid rounded-circle cursor-pointer" width="45px" height="45px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
  53. </a>
  54. </p>
  55. <div class="py-3">
  56. <p class="font-weight-bold text-dark cursor-pointer mb-0">
  57. <a :href="'/'+rec.username" class="text-decoration-none text-dark">
  58. {{rec.username}}
  59. </a>
  60. </p>
  61. <p class="small text-muted mb-0">{{rec.message}}</p>
  62. </div>
  63. <p class="mb-0">
  64. <a class="btn btn-primary btn-block font-weight-bold py-0" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
  65. </p>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <div v-if="index == 4 && showHashtagPosts && hashtagPosts.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
  72. <div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
  73. <span></span>
  74. <h6 class="text-muted font-weight-bold mb-0"><a :href="'/discover/tags/'+hashtagPostsName+'?src=tr'">#{{hashtagPostsName}}</a></h6>
  75. <span class="cursor-pointer text-muted" v-on:click="showHashtagPosts = false"><i class="fas fa-times"></i></span>
  76. </div>
  77. <div class="card-body row mx-0">
  78. <div v-for="(tag, index) in hashtagPosts" class="col-4 p-0 p-sm-2 p-md-3 hashtag-post-square">
  79. <a class="card info-overlay card-md-border-0" :href="tag.status.url">
  80. <div :class="[tag.status.filter ? 'square ' + tag.status.filter : 'square']">
  81. <div v-if="tag.status.sensitive" class="square-content">
  82. <div class="info-overlay-text-label">
  83. <h5 class="text-white m-auto font-weight-bold">
  84. <span>
  85. <span class="far fa-eye-slash fa-lg p-2 d-flex-inline"></span>
  86. </span>
  87. </h5>
  88. </div>
  89. <blur-hash-canvas
  90. width="32"
  91. height="32"
  92. :hash="tag.status.media_attachments[0].blurhash"
  93. />
  94. </div>
  95. <div v-else class="square-content">
  96. <blur-hash-image
  97. width="32"
  98. height="32"
  99. :hash="tag.status.media_attachments[0].blurhash"
  100. :src="tag.status.media_attachments[0].preview_url"
  101. />
  102. </div>
  103. <div class="info-overlay-text">
  104. <h5 class="text-white m-auto font-weight-bold">
  105. <span class="pr-4">
  106. <span class="far fa-heart fa-lg pr-1"></span> {{formatCount(tag.status.favourites_count)}}
  107. </span>
  108. <span>
  109. <span class="far fa-comment fa-lg pr-1"></span> {{formatCount(tag.status.reply_count)}}
  110. </span>
  111. </h5>
  112. </div>
  113. </div>
  114. </a>
  115. </div>
  116. </div>
  117. </div>
  118. <div :class="index == 0 ? 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border mt-md-4' : 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border'">
  119. <div v-if="status" class="card-header d-inline-flex align-items-center bg-white">
  120. <!-- <img v-bind:src="status.account.avatar" width="38px" height="38px" class="cursor-pointer" style="border-radius: 38px;" @click="profileUrl(status)" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
  121. <!-- <div v-if="hasStory" class="has-story has-story-sm cursor-pointer shadow-sm" @click="profileUrl(status)">
  122. <img class="rounded-circle box-shadow" :src="status.account.avatar" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'">
  123. </div>
  124. <div v-else> -->
  125. <div>
  126. <img class="rounded-circle box-shadow" :src="status.account.avatar" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
  127. </div>
  128. <div class="pl-2">
  129. <!-- <a class="d-block username font-weight-bold text-dark" v-bind:href="status.account.url" style="line-height:0.5;"> -->
  130. <a class="username font-weight-bold text-dark text-decoration-none text-break" v-bind:href="profileUrl(status)" v-html="statusCardUsernameFormat(status)">
  131. Loading...
  132. </a>
  133. <span v-if="status.account.is_admin" class="fa-stack" title="Admin Account" data-toggle="tooltip" style="height:1em; line-height:1em; max-width:19px;">
  134. <i class="fas fa-certificate text-danger fa-stack-1x"></i>
  135. <i class="fas fa-crown text-white fa-sm fa-stack-1x" style="font-size:7px;"></i>
  136. </span>
  137. <!-- <span v-if="scope != 'home' && status.account.id != profile.id && status.account.relationship">
  138. <span class="px-1">•</span>
  139. <span :class="'font-weight-bold cursor-pointer ' + [status.account.relationship.following == true ? 'text-muted' : 'text-primary']" @click="followAction(status)">{{status.account.relationship.following == true ? 'Following' : 'Follow'}}</span>
  140. </span> -->
  141. <!-- <span v-if="status.account.id != profile.id">
  142. <span class="px-1">•</span>
  143. <span class="font-weight-bold cursor-pointer text-primary">Follow</span>
  144. </span> -->
  145. <div class="d-flex align-items-center">
  146. <a v-if="status.place" class="small text-decoration-none text-muted" :href="'/discover/places/'+status.place.id+'/'+status.place.slug" title="Location" data-toggle="tooltip"><i class="fas fa-map-marked-alt"></i> {{status.place.name}}, {{status.place.country}}</a>
  147. </div>
  148. </div>
  149. <div class="text-right" style="flex-grow:1;">
  150. <button class="btn btn-link text-dark py-0" type="button" @click="ctxMenu(status)">
  151. <span class="fas fa-ellipsis-h text-lighter"></span>
  152. <span class="sr-only">Post Menu</span>
  153. </button>
  154. </div>
  155. </div>
  156. <div class="postPresenterContainer" style="background: #000;">
  157. <div v-if="config.ab.top && status.pf_type === 'text'" class="w-100">
  158. <div class="w-100 card-img-top border-bottom rounded-0" style="background-image: url(/storage/textimg/bg_1.jpg);background-size: cover;width: 100%;height: 540px;">
  159. <div class="w-100 h-100 d-flex justify-content-center align-items-center">
  160. <p class="text-center text-break h3 px-5 font-weight-bold" v-html="status.content"></p>
  161. </div>
  162. </div>
  163. </div>
  164. <div v-else-if="status.pf_type === 'photo'" class="w-100">
  165. <photo-presenter :status="status" v-on:lightbox="lightbox" v-on:togglecw="status.sensitive = false"></photo-presenter>
  166. </div>
  167. <div v-else-if="status.pf_type === 'video'" class="w-100">
  168. <video-presenter :status="status"></video-presenter>
  169. </div>
  170. <div v-else-if="status.pf_type === 'photo:album'" class="w-100">
  171. <photo-album-presenter :status="status" v-on:lightbox="lightbox"></photo-album-presenter>
  172. </div>
  173. <div v-else-if="status.pf_type === 'video:album'" class="w-100">
  174. <video-album-presenter :status="status"></video-album-presenter>
  175. </div>
  176. <div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
  177. <mixed-album-presenter :status="status" v-on:lightbox="lightbox"></mixed-album-presenter>
  178. </div>
  179. <div v-else class="w-100">
  180. <p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  181. </div>
  182. </div>
  183. <div v-if="config.features.label.covid.enabled && status.label && status.label.covid == true" class="card-body border-top border-bottom py-2 cursor-pointer pr-2" @click="labelRedirect()">
  184. <p class="font-weight-bold d-flex justify-content-between align-items-center mb-0">
  185. <span>
  186. <i class="fas fa-info-circle mr-2"></i>
  187. For information about COVID-19, {{config.features.label.covid.org}}
  188. </span>
  189. <span>
  190. <i class="fas fa-chevron-right text-lighter"></i>
  191. </span>
  192. </p>
  193. </div>
  194. <div class="card-body">
  195. <div class="reactions my-1 pb-2">
  196. <h3 v-if="status.favourited" class="fas fa-heart text-danger pr-3 m-0 cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3>
  197. <h3 v-else class="far fa-heart pr-3 m-0 like-btn text-dark cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3>
  198. <h3 v-if="!status.comments_disabled" class="far fa-comment text-dark pr-3 m-0 cursor-pointer" title="Comment" v-on:click="commentFocus(status, $event)"></h3>
  199. <!-- <h3 v-if="status.visibility == 'public'" v-bind:class="[status.reblogged ? 'fas fa-retweet pr-3 m-0 text-primary cursor-pointer' : 'fas fa-retweet pr-3 m-0 text-dark share-btn cursor-pointer']" title="Share" v-on:click="shareStatus(status, $event)"></h3> -->
  200. <!-- <h3 class="fas fa-expand pr-3 m-0 cursor-pointer text-dark" v-on:click="lightbox(status)"></h3> -->
  201. <span v-if="status.taggedPeople.length" class="float-right">
  202. <span class="font-weight-light small" style="color:#718096">
  203. <i class="far fa-user" data-toggle="tooltip" title="Tagged People"></i>
  204. <span v-for="(tag, index) in status.taggedPeople" class="mr-n2">
  205. <a :href="'/'+tag.username">
  206. <img :src="tag.avatar" width="20px" height="20px" class="border rounded-circle" data-toggle="tooltip" :title="'@'+tag.username" alt="Avatar">
  207. </a>
  208. </span>
  209. </span>
  210. </span>
  211. </div>
  212. <div v-if="status.liked_by.username && status.liked_by.username !== profile.username" class="likes mb-1">
  213. <span class="like-count">Liked by
  214. <a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a>
  215. <span v-if="status.liked_by.others == true">
  216. and <span class="font-weight-bold" v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> <span class="font-weight-bold">others</span>
  217. </span>
  218. </span>
  219. </div>
  220. <div v-if="status.pf_type != 'text'" class="caption">
  221. <p v-if="!status.sensitive" class="mb-2 read-more" style="overflow: hidden;">
  222. <span class="username font-weight-bold">
  223. <bdi><a class="text-dark" :href="profileUrl(status)">{{status.account.username}}</a></bdi>
  224. </span>
  225. <span class="status-content" v-html="status.content"></span>
  226. </p>
  227. </div>
  228. <!-- <div class="comments" v-if="status.id == replyId && !status.comments_disabled">
  229. <p class="mb-0 d-flex justify-content-between align-items-top read-more mt-2" style="overflow-y: hidden;" v-for="(reply, index) in replies">
  230. <span>
  231. <a class="text-dark font-weight-bold mr-1" :href="profileUrl(reply)">{{reply.account.username}}</a>
  232. <span v-html="reply.content" style="word-break: break-all;" class="comment-body"></span>
  233. </span>
  234. <span class="mb-0" style="min-width:38px">
  235. <span v-on:click="likeStatus(reply, $event);">
  236. <i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger cursor-pointer':'far fa-heart fa-sm text-lighter cursor-pointer']"></i>
  237. </span>
  238. <!-- <post-menu :status="reply" :profile="profile" size="sm" :modal="'true'" :feed="feed" class="d-inline-flex pl-2"></post-menu> - ->
  239. <span class="text-lighter pl-2 cursor-pointer" @click="ctxMenu(reply)">
  240. <span class="fas fa-ellipsis-v text-lighter"></span>
  241. </span>
  242. </span>
  243. </p>
  244. </div> -->
  245. <div class="timestamp mt-2">
  246. <p class="small text-uppercase mb-0">
  247. <a :href="statusUrl(status)" class="text-muted">
  248. <timeago :datetime="status.created_at" :auto-update="60" :converter-options="{includeSeconds:true}" :title="timestampFormat(status.created_at)" v-b-tooltip.hover.bottom></timeago>
  249. </a>
  250. </p>
  251. </div>
  252. </div>
  253. <!--<div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white px-2 py-0">
  254. <ul class="nav align-items-center emoji-reactions" style="overflow-x: scroll;flex-wrap: unset;">
  255. <li class="nav-item" v-on:click="emojiReaction(status)" v-for="e in emoji">{{e}}</li>
  256. </ul>
  257. </div>-->
  258. <!--<div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white sticky-md-bottom p-0">
  259. <form class="border-0 rounded-0 align-middle" method="post" action="/i/comment" :data-id="status.id" data-truncate="false">
  260. <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>
  261. <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)" :disabled="replyText.length == 0" />
  262. </form>
  263. </div>-->
  264. </div>
  265. </div>
  266. <div v-if="!loading && feed.length">
  267. <div class="card shadow-none">
  268. <div class="card-body">
  269. <infinite-loading @infinite="infiniteTimeline" :distance="800">
  270. <div slot="no-more" class="font-weight-bold">No more posts to load</div>
  271. <div slot="no-results" class="font-weight-bold">No more posts to load</div>
  272. </infinite-loading>
  273. </div>
  274. </div>
  275. </div>
  276. <div v-if="!loading && scope == 'home' && feed.length == 0">
  277. <div class="card shadow-none border">
  278. <div class="card-body text-center">
  279. <p class="h2 font-weight-lighter p-5">Hello, {{profile.acct}}</p>
  280. <p class="text-lighter"><i class="fas fa-camera-retro fa-5x"></i></p>
  281. <p class="h3 font-weight-lighter p-5">Start following people to build your timeline.</p>
  282. <p><a href="/discover" class="btn btn-primary font-weight-bold py-0">Discover new people and posts</a></p>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. <div class="col-md-4 col-lg-4 my-4 order-1 order-md-2 d-none d-md-block">
  289. <div>
  290. <!-- <div class="mb-4">
  291. <a class="btn btn-block btn-primary btn-sm font-weight-bold mb-3 border" href="/i/compose" data-toggle="modal" data-target="#composeModal">
  292. <i class="far fa-plus-square pr-3 fa-lg pt-1"></i> New Post
  293. </a>
  294. </div> -->
  295. <div class="mb-4">
  296. <div v-show="!loading" class="">
  297. <div class="pb-2">
  298. <div class="media d-flex align-items-center">
  299. <a :href="!userStory ? profile.url : '/stories/' + profile.acct" class="mr-3">
  300. <!-- <img class="mr-3 rounded-circle box-shadow" :src="profile.avatar || '/storage/avatars/default.png'" alt="avatar" width="64px" height="64px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
  301. <div v-if="userStory" class="has-story cursor-pointer shadow-sm" @click="storyRedirect()">
  302. <img class="rounded-circle box-shadow" :src="profile.avatar" width="64px" height="64px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
  303. </div>
  304. <div v-else>
  305. <img class="rounded-circle box-shadow" :src="profile.avatar" width="64px" height="64px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
  306. </div>
  307. </a>
  308. <div class="media-body d-flex justify-content-between word-break" >
  309. <div>
  310. <p class="mb-0 px-0 font-weight-bold"><a :href="profile.url" class="text-dark">{{profile.username || 'loading...'}}</a></p>
  311. <p class="my-0 text-muted pb-0">{{profile.display_name || 'loading...'}}</p>
  312. </div>
  313. <div class="ml-2">
  314. <a class="text-muted" href="/settings/home">
  315. <i class="fas fa-cog fa-lg"></i>
  316. <span class="sr-only">User Settings</span>
  317. </a>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. <!-- <div class="card-footer bg-transparent border-top mt-2 py-1">
  323. <div class="d-flex justify-content-between text-center">
  324. <span class="cursor-pointer" @click="redirect(profile.url)">
  325. <p class="mb-0 font-weight-bold">{{formatCount(profile.statuses_count)}}</p>
  326. <p class="mb-0 small text-muted">Posts</p>
  327. </span>
  328. <span class="cursor-pointer" @click="redirect(profile.url+'?md=followers')">
  329. <p class="mb-0 font-weight-bold">{{formatCount(profile.followers_count)}}</p>
  330. <p class="mb-0 small text-muted">Followers</p>
  331. </span>
  332. <span class="cursor-pointer" @click="redirect(profile.url+'?md=following')">
  333. <p class="mb-0 font-weight-bold">{{formatCount(profile.following_count)}}</p>
  334. <p class="mb-0 small text-muted">Following</p>
  335. </span>
  336. </div>
  337. </div> -->
  338. </div>
  339. <div class="card-footer bg-transparent border-0 pt-0 pb-1">
  340. <div class="d-flex justify-content-between text-center">
  341. <span class="cursor-pointer" @click="redirect(profile.url)">
  342. <p class="mb-0 font-weight-bold">{{formatCount(profile.statuses_count)}}</p>
  343. <p class="mb-0 small text-muted">Posts</p>
  344. </span>
  345. <span class="cursor-pointer" @click="redirect(profile.url+'?md=followers')">
  346. <p class="mb-0 font-weight-bold">{{formatCount(profile.followers_count)}}</p>
  347. <p class="mb-0 small text-muted">Followers</p>
  348. </span>
  349. <span class="cursor-pointer" @click="redirect(profile.url+'?md=following')">
  350. <p class="mb-0 font-weight-bold">{{formatCount(profile.following_count)}}</p>
  351. <p class="mb-0 small text-muted">Following</p>
  352. </span>
  353. </div>
  354. </div>
  355. </div>
  356. <div v-show="modes.notify == true && !loading" class="mb-4">
  357. <notification-card></notification-card>
  358. </div>
  359. <div v-show="showSuggestions == true && suggestions.length && config.ab && config.ab.rec == true" class="mb-4">
  360. <div class="card shadow-none border">
  361. <div class="card-header bg-white d-flex align-items-center justify-content-between">
  362. <a class="small text-muted cursor-pointer" href="#" @click.prevent="refreshSuggestions" ref="suggestionRefresh"><i class="fas fa-sync-alt"></i></a>
  363. <div class="small text-dark text-uppercase font-weight-bold">Suggestions</div>
  364. <div class="small text-muted cursor-pointer" v-on:click="hideSuggestions"><i class="fas fa-times"></i></div>
  365. </div>
  366. <div class="card-body pt-0">
  367. <div v-for="(rec, index) in suggestions" class="media align-items-center mt-3">
  368. <a :href="'/'+rec.username">
  369. <img :src="rec.avatar" width="32px" height="32px" class="rounded-circle mr-3" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
  370. </a>
  371. <div class="media-body">
  372. <p class="mb-0 font-weight-bold small">
  373. <a :href="'/'+rec.username" class="text-decoration-none text-dark">
  374. {{rec.username}}
  375. </a>
  376. </p>
  377. <p class="mb-0 small text-muted">{{rec.message}}</p>
  378. </div>
  379. <a class="font-weight-bold small" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. <footer>
  385. <div class="container px-0 pb-5">
  386. <p class="mb-2 small text-justify">
  387. <a href="/site/about" class="text-lighter pr-2">About</a>
  388. <a href="/site/help" class="text-lighter pr-2">Help</a>
  389. <a href="/site/language" class="text-lighter pr-2">Language</a>
  390. <a href="/discover/places" class="text-lighter pr-2">Places</a>
  391. <a href="/site/privacy" class="text-lighter pr-2">Privacy</a>
  392. <a href="/site/terms" class="text-lighter pr-2">Terms</a>
  393. </p>
  394. <p class="mb-0 text-uppercase text-muted small">
  395. <a href="http://pixelfed.org" class="text-lighter" rel="noopener" title="" data-toggle="tooltip">Powered by Pixelfed</a>
  396. </p>
  397. </div>
  398. </footer>
  399. </div>
  400. </div>
  401. </div>
  402. </div>
  403. <div v-if="currentLayout === 'comments'" class="container p-0 overflow-hidden">
  404. <div class="row">
  405. <div class="col-12 col-md-6 offset-md-3">
  406. <div class="card shadow-none border" style="height:100vh;">
  407. <div class="card-header d-flex justify-content-between align-items-center">
  408. <div
  409. @click="commentNavigateBack(status.id)"
  410. class="cursor-pointer"
  411. >
  412. <i class="fas fa-chevron-left fa-lg px-2"></i>
  413. </div>
  414. <div>
  415. <p class="font-weight-bold mb-0 h5">Comments</p>
  416. </div>
  417. <div>
  418. <i class="fas fa-cog fa-lg text-white"></i>
  419. </div>
  420. </div>
  421. <div class="card-body" style="overflow-y: auto !important">
  422. <div class="media">
  423. <img :src="status.account.avatar" class="rounded-circle border mr-3" width="32px" height="32px">
  424. <div class="media-body">
  425. <p class="d-flex justify-content-between align-items-top mb-0" style="overflow-y: hidden;">
  426. <span class="mr-2" style="font-size: 13px;">
  427. <a class="text-dark font-weight-bold mr-1 text-break" :href="status.account.url" v-bind:title="status.account.username">{{trimCaption(status.account.username,15)}}</a>
  428. <span class="text-break comment-body" style="word-break: break-all;" v-html="status.content"></span>
  429. </span>
  430. </p>
  431. </div>
  432. </div>
  433. <hr>
  434. <div class="postCommentsLoader text-center py-2">
  435. <div class="spinner-border" role="status">
  436. <span class="sr-only">Loading...</span>
  437. </div>
  438. </div>
  439. <div class="postCommentsContainer d-none">
  440. <p v-if="replies.length" class="mb-1 text-center load-more-link my-4">
  441. <a
  442. href="#"
  443. class="text-dark"
  444. title="Load more comments"
  445. @click.prevent="loadMoreComments"
  446. >
  447. <svg class="bi bi-plus-circle" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" style="font-size:2em;"> <path fill-rule="evenodd" d="M8 3.5a.5.5 0 01.5.5v4a.5.5 0 01-.5.5H4a.5.5 0 010-1h3.5V4a.5.5 0 01.5-.5z" clip-rule="evenodd"/> <path fill-rule="evenodd" d="M7.5 8a.5.5 0 01.5-.5h4a.5.5 0 010 1H8.5V12a.5.5 0 01-1 0V8z" clip-rule="evenodd"/> <path fill-rule="evenodd" d="M8 15A7 7 0 108 1a7 7 0 000 14zm0 1A8 8 0 108 0a8 8 0 000 16z" clip-rule="evenodd"/></svg>
  448. </a>
  449. </p>
  450. <div v-for="(reply, index) in replies" class="pb-3 media" :key="'tl' + reply.id + '_' + index">
  451. <img :src="reply.account.avatar" class="rounded-circle border mr-3" width="32px" height="32px">
  452. <div class="media-body">
  453. <div v-if="reply.sensitive == true">
  454. <span class="py-3">
  455. <a class="text-dark font-weight-bold mr-3" style="font-size: 13px;" :href="reply.account.url" v-bind:title="reply.account.username">{{trimCaption(reply.account.username,15)}}</a>
  456. <span class="text-break" style="font-size: 13px;">
  457. <span class="font-italic text-muted">This comment may contain sensitive material</span>
  458. <span class="text-primary cursor-pointer pl-1" @click="reply.sensitive = false;">Show</span>
  459. </span>
  460. </span>
  461. </div>
  462. <div v-else>
  463. <p class="d-flex justify-content-between align-items-top read-more mb-0" style="overflow-y: hidden;">
  464. <span class="mr-3" style="font-size: 13px;">
  465. <a class="text-dark font-weight-bold mr-1 text-break" :href="reply.account.url" v-bind:title="reply.account.username">{{trimCaption(reply.account.username,15)}}</a>
  466. <span class="text-break comment-body" style="word-break: break-all;" v-html="reply.content"></span>
  467. </span>
  468. <span class="text-right" style="min-width: 30px;">
  469. <span v-on:click="likeReply(reply, $event)"><i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span>
  470. <span class="pl-2 text-lighter cursor-pointer" @click="ctxMenu(reply)">
  471. <span class="fas fa-ellipsis-v text-lighter"></span>
  472. </span>
  473. <!-- <post-menu :status="reply" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block px-2" v-on:deletePost=""></post-menu> -->
  474. </span>
  475. </p>
  476. <p class="mb-0">
  477. <a v-once class="text-muted mr-3 text-decoration-none small" style="width: 20px;" v-text="timeAgo(reply.created_at)" :href="reply.url"></a>
  478. <span v-if="reply.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3 small">{{reply.favourites_count == 1 ? '1 like' : reply.favourites_count + ' likes'}}</span>
  479. <span class="small text-muted comment-reaction font-weight-bold cursor-pointer" v-on:click="replyFocus(reply, index, true)">Reply</span>
  480. </p>
  481. <div v-if="reply.reply_count > 0" class="cursor-pointer pb-2" v-on:click="toggleReplies(reply)">
  482. <span class="show-reply-bar"></span>
  483. <span class="comment-reaction small font-weight-bold">{{reply.thread ? 'Hide' : 'View'}} Replies ({{reply.reply_count}})</span>
  484. </div>
  485. <div v-if="reply.thread == true" class="comment-thread">
  486. <div v-for="(s, sindex) in reply.replies" class="py-1 media" :key="'cr' + s.id + '_' + index">
  487. <img :src="s.account.avatar" class="rounded-circle border mr-3" width="25px" height="25px">
  488. <div class="media-body">
  489. <p class="d-flex justify-content-between align-items-top read-more mb-0" style="overflow-y: hidden;">
  490. <span class="mr-2" style="font-size: 13px;">
  491. <a class="text-dark font-weight-bold mr-1" :href="s.account.url" :title="s.account.username">{{s.account.username}}</a>
  492. <span class="text-break comment-body" style="word-break: break-all;" v-html="s.content"></span>
  493. </span>
  494. <span>
  495. <span v-on:click="likeReply(s, $event)"><i v-bind:class="[s.favourited ? 'fas fa-heart fa-sm text-danger':'far fa-heart fa-sm text-lighter']"></i></span>
  496. <!-- <post-menu :status="s" :profile="user" :size="'sm'" :modal="'true'" class="d-inline-block pl-2" v-on:deletePost="deleteCommentReply(s.id, sindex, index) "></post-menu> -->
  497. </span>
  498. </p>
  499. <p class="mb-0">
  500. <a v-once class="text-muted mr-3 text-decoration-none small" style="width: 20px;" v-text="timeAgo(s.created_at)" :href="s.url"></a>
  501. <span v-if="s.favourites_count" class="text-muted comment-reaction font-weight-bold mr-3">{{s.favourites_count == 1 ? '1 like' : s.favourites_count + ' likes'}}</span>
  502. </p>
  503. </div>
  504. </div>
  505. </div>
  506. </div>
  507. </div>
  508. </div>
  509. <div v-if="!replies.length">
  510. <p class="text-center text-muted font-weight-bold small">No comments yet</p>
  511. </div>
  512. </div>
  513. </div>
  514. <div class="card-footer mb-3">
  515. <div class="align-middle d-flex">
  516. <img
  517. :src="profile.avatar"
  518. width="36"
  519. height="36"
  520. class="rounded-circle border mr-3">
  521. <textarea
  522. class="form-control rounded-pill"
  523. name="comment"
  524. placeholder="Add a comment…"
  525. autocomplete="off"
  526. autocorrect="off"
  527. rows="1"
  528. maxlength="0"
  529. style="resize: none;overflow-y: hidden"
  530. @click="replyFocus(status)">
  531. </textarea>
  532. </div>
  533. </div>
  534. </div>
  535. </div>
  536. </div>
  537. </div>
  538. <div class="modal-stack">
  539. <b-modal ref="ctxModal"
  540. id="ctx-modal"
  541. hide-header
  542. hide-footer
  543. centered
  544. rounded
  545. size="sm"
  546. body-class="list-group-flush p-0 rounded">
  547. <div class="list-group text-center">
  548. <!-- <div v-if="ctxMenuStatus && ctxMenuStatus.account.id != profile.id && ctxMenuRelationship && ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-danger" @click="ctxMenuUnfollow()">Unfollow</div>
  549. <div v-if="ctxMenuStatus && ctxMenuStatus.account.id != profile.id && ctxMenuRelationship && !ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-primary" @click="ctxMenuFollow()">Follow</div> -->
  550. <div class="list-group-item rounded cursor-pointer" @click="ctxMenuGoToPost()">View Post</div>
  551. <!-- <div v-if="ctxMenuStatus && ctxMenuStatus.local == true && !ctxMenuStatus.in_reply_to_id" class="list-group-item rounded cursor-pointer" @click="ctxMenuEmbed()">Embed</div>
  552. <div class="list-group-item rounded cursor-pointer" @click="ctxMenuCopyLink()">Copy Link</div> -->
  553. <div class="list-group-item rounded cursor-pointer" @click="ctxMenuShare()">Share</div>
  554. <div v-if="ctxMenuStatus && profile && profile.is_admin == true" class="list-group-item rounded cursor-pointer" @click="ctxModMenuShow()">Moderation Tools</div>
  555. <div v-if="ctxMenuStatus && ctxMenuStatus.account.id != profile.id" class="list-group-item rounded cursor-pointer text-danger" @click="ctxMenuReportPost()">Report</div>
  556. <div v-if="ctxMenuStatus && (profile.is_admin || profile.id == ctxMenuStatus.account.id)" class="list-group-item rounded cursor-pointer text-danger" @click="deletePost(ctxMenuStatus)">Delete</div>
  557. <div class="list-group-item rounded cursor-pointer text-lighter" @click="closeCtxMenu()">Cancel</div>
  558. </div>
  559. </b-modal>
  560. <b-modal ref="ctxModModal"
  561. id="ctx-mod-modal"
  562. hide-header
  563. hide-footer
  564. centered
  565. rounded
  566. size="sm"
  567. body-class="list-group-flush p-0 rounded">
  568. <div class="list-group text-center">
  569. <p class="py-2 px-3 mb-0">
  570. <div class="text-center font-weight-bold text-danger">Moderation Tools</div>
  571. <div class="small text-center text-muted">Select one of the following options</div>
  572. </p>
  573. <div class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'unlist')">Unlist from Timelines</div>
  574. <div v-if="ctxMenuStatus.sensitive" class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'remcw')">Remove Content Warning</div>
  575. <div v-else class="list-group-item rounded cursor-pointer" @click="moderatePost(ctxMenuStatus, 'addcw')">Add Content Warning</div>
  576. <!-- <div class="list-group-item rounded cursor-pointer" @click="ctxModOtherMenuShow()">Other</div> -->
  577. <div class="list-group-item rounded cursor-pointer text-lighter" @click="ctxModMenuClose()">Cancel</div>
  578. </div>
  579. </b-modal>
  580. <b-modal ref="ctxModOtherModal"
  581. id="ctx-mod-other-modal"
  582. hide-header
  583. hide-footer
  584. centered
  585. rounded
  586. size="sm"
  587. body-class="list-group-flush p-0 rounded">
  588. <div class="list-group text-center">
  589. <p class="py-2 px-3 mb-0">
  590. <div class="text-center font-weight-bold text-danger">Moderation Tools</div>
  591. <div class="small text-center text-muted">Select one of the following options</div>
  592. </p>
  593. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="confirmModal()">Unlist Posts</div>
  594. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="confirmModal()">Moderation Log</div>
  595. <div class="list-group-item rounded cursor-pointer text-lighter" @click="ctxModOtherMenuClose()">Cancel</div>
  596. </div>
  597. </b-modal>
  598. <b-modal ref="ctxShareModal"
  599. id="ctx-share-modal"
  600. title="Share"
  601. hide-footer
  602. hide-header
  603. centered
  604. rounded
  605. size="sm"
  606. body-class="list-group-flush p-0 rounded text-center">
  607. <div class="list-group-item rounded cursor-pointer" @click="shareStatus(ctxMenuStatus, $event)">{{ctxMenuStatus.reblogged ? 'Unshare' : 'Share'}} to Followers</div>
  608. <div class="list-group-item rounded cursor-pointer" @click="ctxMenuCopyLink()">Copy Link</div>
  609. <div v-if="ctxMenuStatus && ctxMenuStatus.local == true && !ctxMenuStatus.in_reply_to_id" class="list-group-item rounded cursor-pointer" @click="ctxMenuEmbed()">Embed</div>
  610. <!-- <div class="list-group-item rounded cursor-pointer border-top-0">Email</div>
  611. <div class="list-group-item rounded cursor-pointer">Facebook</div>
  612. <div class="list-group-item rounded cursor-pointer">Mastodon</div>
  613. <div class="list-group-item rounded cursor-pointer">Pinterest</div>
  614. <div class="list-group-item rounded cursor-pointer">Pixelfed</div>
  615. <div class="list-group-item rounded cursor-pointer">Twitter</div>
  616. <div class="list-group-item rounded cursor-pointer">VK</div> -->
  617. <div class="list-group-item rounded cursor-pointer text-lighter" @click="closeCtxShareMenu()">Cancel</div>
  618. </b-modal>
  619. <b-modal ref="ctxEmbedModal"
  620. id="ctx-embed-modal"
  621. hide-header
  622. hide-footer
  623. centered
  624. rounded
  625. size="md"
  626. body-class="p-2 rounded">
  627. <div>
  628. <div class="form-group">
  629. <textarea class="form-control disabled text-monospace" rows="8" style="overflow-y:hidden;border: 1px solid #efefef; font-size: 12px; line-height: 18px; margin: 0 0 7px;resize:none;" v-model="ctxEmbedPayload" disabled=""></textarea>
  630. </div>
  631. <div class="form-group pl-2 d-flex justify-content-center">
  632. <div class="form-check mr-3">
  633. <input class="form-check-input" type="checkbox" v-model="ctxEmbedShowCaption" :disabled="ctxEmbedCompactMode == true">
  634. <label class="form-check-label font-weight-light">
  635. Show Caption
  636. </label>
  637. </div>
  638. <div class="form-check mr-3">
  639. <input class="form-check-input" type="checkbox" v-model="ctxEmbedShowLikes" :disabled="ctxEmbedCompactMode == true">
  640. <label class="form-check-label font-weight-light">
  641. Show Likes
  642. </label>
  643. </div>
  644. <div class="form-check">
  645. <input class="form-check-input" type="checkbox" v-model="ctxEmbedCompactMode">
  646. <label class="form-check-label font-weight-light">
  647. Compact Mode
  648. </label>
  649. </div>
  650. </div>
  651. <hr>
  652. <button :class="copiedEmbed ? 'btn btn-primary btn-block btn-sm py-1 font-weight-bold disabed': 'btn btn-primary btn-block btn-sm py-1 font-weight-bold'" @click="ctxCopyEmbed" :disabled="copiedEmbed">{{copiedEmbed ? 'Embed Code Copied!' : 'Copy Embed Code'}}</button>
  653. <p class="mb-0 px-2 small text-muted">By using this embed, you agree to our <a href="/site/terms">Terms of Use</a></p>
  654. </div>
  655. </b-modal>
  656. <b-modal ref="ctxReport"
  657. id="ctx-report"
  658. hide-header
  659. hide-footer
  660. centered
  661. rounded
  662. size="sm"
  663. body-class="list-group-flush p-0 rounded">
  664. <p class="py-2 px-3 mb-0">
  665. <div class="text-center font-weight-bold text-danger">Report</div>
  666. <div class="small text-center text-muted">Select one of the following options</div>
  667. </p>
  668. <div class="list-group text-center">
  669. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('spam')">Spam</div>
  670. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('sensitive')">Sensitive Content</div>
  671. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('abusive')">Abusive or Harmful</div>
  672. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="openCtxReportOtherMenu()">Other</div>
  673. <!-- <div class="list-group-item rounded cursor-pointer" @click="ctxReportMenuGoBack()">Go Back</div> -->
  674. <div class="list-group-item rounded cursor-pointer text-lighter" @click="ctxReportMenuGoBack()">Cancel</div>
  675. </div>
  676. </b-modal>
  677. <b-modal ref="ctxReportOther"
  678. id="ctx-report-other"
  679. hide-header
  680. hide-footer
  681. centered
  682. rounded
  683. size="sm"
  684. body-class="list-group-flush p-0 rounded">
  685. <p class="py-2 px-3 mb-0">
  686. <div class="text-center font-weight-bold text-danger">Report</div>
  687. <div class="small text-center text-muted">Select one of the following options</div>
  688. </p>
  689. <div class="list-group text-center">
  690. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('underage')">Underage Account</div>
  691. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('copyright')">Copyright Infringement</div>
  692. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('impersonation')">Impersonation</div>
  693. <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('scam')">Scam or Fraud</div>
  694. <!-- <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('terrorism')">Terrorism Related</div> -->
  695. <!-- <div class="list-group-item rounded cursor-pointer font-weight-bold" @click="sendReport('other')">Other or Not listed</div> -->
  696. <!-- <div class="list-group-item rounded cursor-pointer" @click="ctxReportOtherMenuGoBack()">Go Back</div> -->
  697. <div class="list-group-item rounded cursor-pointer text-lighter" @click="ctxReportOtherMenuGoBack()">Cancel</div>
  698. </div>
  699. </b-modal>
  700. <b-modal ref="ctxConfirm"
  701. id="ctx-confirm"
  702. hide-header
  703. hide-footer
  704. centered
  705. rounded
  706. size="sm"
  707. body-class="list-group-flush p-0 rounded">
  708. <div class="d-flex align-items-center justify-content-center py-3">
  709. <div>{{ this.confirmModalTitle }}</div>
  710. </div>
  711. <div class="d-flex border-top btn-group btn-group-block rounded-0" role="group">
  712. <button type="button" class="btn btn-outline-lighter border-left-0 border-top-0 border-bottom-0 border-right py-2" style="color: rgb(0,122,255) !important;" @click.prevent="confirmModalCancel()">Cancel</button>
  713. <button type="button" class="btn btn-outline-lighter border-0" style="color: rgb(0,122,255) !important;" @click.prevent="confirmModalConfirm()">Confirm</button>
  714. </div>
  715. </b-modal>
  716. <b-modal ref="lightboxModal"
  717. id="lightbox"
  718. hide-header
  719. hide-footer
  720. centered
  721. size="lg"
  722. body-class="p-0"
  723. >
  724. <div v-if="lightboxMedia" :class="lightboxMedia.filter_class" class="w-100 h-100">
  725. <img :src="lightboxMedia.url" style="max-height: 100%; max-width: 100%" alt="lightbox media">
  726. </div>
  727. </b-modal>
  728. <b-modal ref="replyModal"
  729. id="ctx-reply-modal"
  730. hide-footer
  731. centered
  732. rounded
  733. :title-html="replyStatus.account ? 'Reply to <span class=text-dark>' + replyStatus.account.username + '</span>' : ''"
  734. title-tag="p"
  735. title-class="font-weight-bold text-muted"
  736. size="md"
  737. body-class="p-2 rounded">
  738. <div>
  739. <vue-tribute :options="tributeSettings">
  740. <textarea
  741. class="form-control replyModalTextarea"
  742. rows="4"
  743. v-model="replyText">
  744. </textarea>
  745. </vue-tribute>
  746. <div class="border-top border-bottom my-2">
  747. <ul class="nav align-items-center emoji-reactions" style="overflow-x: scroll;flex-wrap: unset;">
  748. <li class="nav-item" v-on:click="emojiReaction(status)" v-for="e in emoji">{{e}}</li>
  749. </ul>
  750. </div>
  751. <div class="d-flex justify-content-between align-items-center">
  752. <div>
  753. <span class="pl-2 small text-muted font-weight-bold text-monospace">
  754. <span :class="[replyText.length > config.uploader.max_caption_length ? 'text-danger':'text-dark']">{{replyText.length > config.uploader.max_caption_length ? config.uploader.max_caption_length - replyText.length : replyText.length}}</span>/{{config.uploader.max_caption_length}}
  755. </span>
  756. </div>
  757. <div class="d-flex align-items-center">
  758. <div class="custom-control custom-switch mr-3">
  759. <input type="checkbox" class="custom-control-input" id="replyModalCWSwitch" v-model="replyNsfw">
  760. <label :class="[replyNsfw ? 'custom-control-label font-weight-bold text-dark':'custom-control-label text-lighter']" for="replyModalCWSwitch">Mark as NSFW</label>
  761. </div>
  762. <button class="btn btn-primary btn-sm py-2 px-4 lead text-uppercase font-weight-bold" v-on:click.prevent="commentSubmit(status, $event)" :disabled="replyText.length == 0">
  763. {{replySending == true ? 'POSTING' : 'POST'}}
  764. </button>
  765. </div>
  766. </div>
  767. </div>
  768. </b-modal>
  769. <b-modal ref="ctxStatusModal"
  770. id="ctx-status-modal"
  771. hide-header
  772. hide-footer
  773. centered
  774. rounded
  775. size="xl"
  776. body-class="list-group-flush p-0 m-0 rounded">
  777. <!-- <post-component
  778. v-if="ctxMenuStatus"
  779. :status-template="ctxMenuStatus.pf_type"
  780. :status-id="ctxMenuStatus.id"
  781. :status-username="ctxMenuStatus.account.username"
  782. :status-url="ctxMenuStatus.url"
  783. :status-profile-url="ctxMenuStatus.account.url"
  784. :status-avatar="ctxMenuStatus.account.avatar"
  785. :status-profile-id="ctxMenuStatus.account.id"
  786. profile-layout="metro">
  787. </post-component> -->
  788. </b-modal>
  789. </div>
  790. </div>
  791. </template>
  792. <script type="text/javascript">
  793. import VueTribute from 'vue-tribute'
  794. export default {
  795. props: ['scope', 'layout'],
  796. components: {
  797. VueTribute
  798. },
  799. data() {
  800. return {
  801. ids: [],
  802. config: window.App.config,
  803. page: 2,
  804. feed: [],
  805. profile: {},
  806. min_id: 0,
  807. max_id: 0,
  808. suggestions: {},
  809. loading: true,
  810. replies: [],
  811. replyId: null,
  812. modes: {
  813. 'mod': false,
  814. 'dark': false,
  815. 'notify': true,
  816. 'distractionFree': false
  817. },
  818. followers: [],
  819. followerCursor: 1,
  820. followerMore: true,
  821. following: [],
  822. followingCursor: 1,
  823. followingMore: true,
  824. lightboxMedia: false,
  825. showSuggestions: true,
  826. showReadMore: true,
  827. replyStatus: {},
  828. replyText: '',
  829. replyNsfw: false,
  830. emoji: window.App.util.emoji,
  831. showHashtagPosts: false,
  832. hashtagPosts: [],
  833. hashtagPostsName: '',
  834. ctxMenuStatus: false,
  835. ctxMenuRelationship: false,
  836. ctxEmbedPayload: false,
  837. copiedEmbed: false,
  838. showTips: true,
  839. userStory: false,
  840. replySending: false,
  841. ctxEmbedShowCaption: true,
  842. ctxEmbedShowLikes: false,
  843. ctxEmbedCompactMode: false,
  844. morePostsAvailable: false,
  845. mpCount: 0,
  846. mpData: false,
  847. mpInterval: 15000,
  848. mpEnabled: false,
  849. mpPoller: null,
  850. confirmModalTitle: 'Are you sure?',
  851. confirmModalIdentifer: null,
  852. confirmModalType: false,
  853. currentLayout: 'feed',
  854. pagination: {},
  855. tributeSettings: {
  856. collection: [
  857. {
  858. trigger: '@',
  859. menuShowMinLength: 2,
  860. values: (function (text, cb) {
  861. let url = '/api/compose/v0/search/mention';
  862. axios.get(url, { params: { q: text }})
  863. .then(res => {
  864. cb(res.data);
  865. })
  866. .catch(err => {
  867. console.log(err);
  868. })
  869. })
  870. },
  871. {
  872. trigger: '#',
  873. menuShowMinLength: 2,
  874. values: (function (text, cb) {
  875. let url = '/api/compose/v0/search/hashtag';
  876. axios.get(url, { params: { q: text }})
  877. .then(res => {
  878. cb(res.data);
  879. })
  880. .catch(err => {
  881. console.log(err);
  882. })
  883. })
  884. }
  885. ]
  886. },
  887. discover_min_id: 0,
  888. discover_max_id: 0,
  889. discover_feed: []
  890. }
  891. },
  892. watch: {
  893. ctxEmbedShowCaption: function (n,o) {
  894. if(n == true) {
  895. this.ctxEmbedCompactMode = false;
  896. }
  897. let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
  898. this.ctxEmbedPayload = window.App.util.embed.post(this.ctxMenuStatus.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
  899. },
  900. ctxEmbedShowLikes: function (n,o) {
  901. if(n == true) {
  902. this.ctxEmbedCompactMode = false;
  903. }
  904. let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
  905. this.ctxEmbedPayload = window.App.util.embed.post(this.ctxMenuStatus.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
  906. },
  907. ctxEmbedCompactMode: function (n,o) {
  908. if(n == true) {
  909. this.ctxEmbedShowCaption = false;
  910. this.ctxEmbedShowLikes = false;
  911. }
  912. let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
  913. this.ctxEmbedPayload = window.App.util.embed.post(this.ctxMenuStatus.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
  914. }
  915. },
  916. beforeMount() {
  917. this.fetchProfile();
  918. this.fetchTimelineApi();
  919. },
  920. mounted() {
  921. // todo: release after dark mode updates
  922. /* if(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches || $('link[data-stylesheet="dark"]').length != 0) {
  923. this.modes.dark = true;
  924. let el = document.querySelector('link[data-stylesheet="light"]');
  925. el.setAttribute('href', '/css/appdark.css?id=' + Date.now());
  926. el.setAttribute('data-stylesheet', 'dark');
  927. }*/
  928. if(localStorage.getItem('pf_metro_ui.exp.rec') == 'false') {
  929. this.showSuggestions = false;
  930. } else {
  931. this.showSuggestions = true;
  932. }
  933. if(localStorage.getItem('pf_metro_ui.exp.rm') == 'false') {
  934. this.showReadMore = false;
  935. } else {
  936. this.showReadMore = true;
  937. }
  938. if(localStorage.getItem('metro-tips') == 'false') {
  939. this.showTips = false;
  940. }
  941. this.$nextTick(function () {
  942. $('[data-toggle="tooltip"]').tooltip();
  943. let u = new URLSearchParams(window.location.search);
  944. if(u.has('a') && u.get('a') == 'co') {
  945. $('#composeModal').modal('show');
  946. }
  947. });
  948. },
  949. updated() {
  950. if(this.showReadMore == true) {
  951. pixelfed.readmore();
  952. }
  953. },
  954. methods: {
  955. fetchProfile() {
  956. axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => {
  957. this.profile = res.data;
  958. if(this.profile.is_admin == true) {
  959. this.modes.mod = true;
  960. }
  961. window._sharedData.curUser = res.data;
  962. window.App.util.navatar();
  963. this.hasStory();
  964. // this.expRec();
  965. }).catch(err => {
  966. swal(
  967. 'Oops, something went wrong',
  968. 'Please reload the page.',
  969. 'error'
  970. );
  971. });
  972. },
  973. fetchTimelineApi() {
  974. let apiUrl = false;
  975. switch(this.scope) {
  976. case 'home':
  977. apiUrl = '/api/pixelfed/v1/timelines/home';
  978. break;
  979. case 'local':
  980. apiUrl = '/api/pixelfed/v1/timelines/public';
  981. break;
  982. case 'network':
  983. apiUrl = '/api/pixelfed/v1/timelines/network';
  984. break;
  985. }
  986. axios.get(apiUrl, {
  987. params: {
  988. max_id: this.max_id,
  989. limit: 3
  990. }
  991. }).then(res => {
  992. let data = res.data;
  993. this.feed.push(...data);
  994. let ids = data.map(status => status.id);
  995. this.ids = ids;
  996. this.min_id = Math.max(...ids).toString();
  997. this.max_id = Math.min(...ids).toString();
  998. this.loading = false;
  999. $('.timeline .pagination').removeClass('d-none');
  1000. // if(this.feed.length == 4) {
  1001. // this.fetchTimelineApi();
  1002. // }
  1003. if(this.hashtagPosts.length == 0) {
  1004. this.fetchHashtagPosts();
  1005. }
  1006. // this.fetchStories();
  1007. this.rtw();
  1008. setTimeout(function() {
  1009. document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) {
  1010. i.href = App.util.format.rewriteLinks(i);
  1011. });
  1012. }, 500);
  1013. }).catch(err => {
  1014. swal(
  1015. 'Oops, something went wrong',
  1016. 'Please reload the page.',
  1017. 'error'
  1018. );
  1019. });
  1020. },
  1021. infiniteTimeline($state) {
  1022. if(this.loading) {
  1023. $state.complete();
  1024. return;
  1025. }
  1026. if(this.page > 40) {
  1027. this.loading = false;
  1028. $state.complete();
  1029. }
  1030. let apiUrl = false;
  1031. switch(this.scope) {
  1032. case 'home':
  1033. apiUrl = '/api/pixelfed/v1/timelines/home';
  1034. break;
  1035. case 'local':
  1036. apiUrl = '/api/pixelfed/v1/timelines/public';
  1037. break;
  1038. case 'network':
  1039. apiUrl = '/api/pixelfed/v1/timelines/network';
  1040. break;
  1041. }
  1042. axios.get(apiUrl, {
  1043. params: {
  1044. max_id: this.max_id,
  1045. limit: 6
  1046. },
  1047. }).then(res => {
  1048. if (res.data.length && this.loading == false) {
  1049. let data = res.data;
  1050. let self = this;
  1051. let vids = [];
  1052. data.forEach((d, index) => {
  1053. if(self.ids.indexOf(d.id) == -1) {
  1054. self.feed.push(d);
  1055. self.ids.push(d.id);
  1056. vids.push({
  1057. sid: d.id,
  1058. pid: d.account.id
  1059. });
  1060. }
  1061. });
  1062. this.min_id = Math.max(...this.ids).toString();
  1063. this.max_id = Math.min(...this.ids).toString();
  1064. this.page += 1;
  1065. $state.loaded();
  1066. this.loading = false;
  1067. axios.post('/api/status/view', {
  1068. '_v': vids,
  1069. });
  1070. } else {
  1071. $state.complete();
  1072. }
  1073. }).catch(err => {
  1074. this.loading = false;
  1075. $state.complete();
  1076. });
  1077. },
  1078. reportUrl(status) {
  1079. let type = status.in_reply_to ? 'comment' : 'post';
  1080. let id = status.id;
  1081. return '/i/report?type=' + type + '&id=' + id;
  1082. },
  1083. commentFocus(status, $event) {
  1084. if(status.comments_disabled) {
  1085. return;
  1086. }
  1087. // if(this.status && this.status.id == status.id) {
  1088. // this.$refs.replyModal.show();
  1089. // return;
  1090. // }
  1091. this.status = status;
  1092. this.replies = {};
  1093. this.replyStatus = {};
  1094. this.replyText = '';
  1095. this.replyId = status.id;
  1096. this.replyStatus = status;
  1097. // this.$refs.replyModal.show();
  1098. this.fetchStatusComments(status, '');
  1099. $('nav').hide();
  1100. $('footer').hide();
  1101. $('.mobile-footer-spacer').attr('style', 'display:none !important');
  1102. $('.mobile-footer').attr('style', 'display:none !important');
  1103. this.currentLayout = 'comments';
  1104. window.history.pushState({}, '', status.url);
  1105. return;
  1106. },
  1107. commentNavigateBack(id) {
  1108. $('nav').show();
  1109. $('footer').show();
  1110. $('.mobile-footer-spacer').attr('style', 'display:block');
  1111. $('.mobile-footer').attr('style', 'display:block');
  1112. this.currentLayout = 'feed';
  1113. setTimeout(function() {
  1114. $([document.documentElement, document.body]).animate({
  1115. scrollTop: $(`div[data-status-id="${id}"]`).offset().top
  1116. }, 1000);
  1117. }, 500);
  1118. let path = this.scope == 'home' ? '/' : '/timeline/public';
  1119. window.history.pushState({}, '', path);
  1120. },
  1121. likeStatus(status, event) {
  1122. if($('body').hasClass('loggedIn') == false) {
  1123. return;
  1124. }
  1125. let count = status.favourites_count;
  1126. status.favourited = !status.favourited;
  1127. axios.post('/i/like', {
  1128. item: status.id
  1129. }).then(res => {
  1130. status.favourites_count = res.data.count;
  1131. }).catch(err => {
  1132. status.favourited = !status.favourited;
  1133. status.favourites_count = count;
  1134. swal('Error', 'Something went wrong, please try again later.', 'error');
  1135. });
  1136. window.navigator.vibrate(200);
  1137. if(status.favourited) {
  1138. setTimeout(function() {
  1139. event.target.classList.add('animate__animated', 'animate__bounce');
  1140. },100);
  1141. }
  1142. },
  1143. shareStatus(status, $event) {
  1144. if($('body').hasClass('loggedIn') == false) {
  1145. return;
  1146. }
  1147. this.closeModals();
  1148. axios.post('/i/share', {
  1149. item: status.id
  1150. }).then(res => {
  1151. status.reblogs_count = res.data.count;
  1152. status.reblogged = !status.reblogged;
  1153. if(status.reblogged) {
  1154. swal('Success', 'You shared this post', 'success');
  1155. } else {
  1156. swal('Success', 'You unshared this post', 'success');
  1157. }
  1158. }).catch(err => {
  1159. swal('Error', 'Something went wrong, please try again later.', 'error');
  1160. });
  1161. },
  1162. timestampFormat(timestamp) {
  1163. let ts = new Date(timestamp);
  1164. return ts.toDateString() + ' ' + ts.toLocaleTimeString();
  1165. },
  1166. redirect(url) {
  1167. window.location.href = url;
  1168. return;
  1169. },
  1170. statusOwner(status) {
  1171. let sid = status.account.id;
  1172. let uid = this.profile.id;
  1173. if(sid == uid) {
  1174. return true;
  1175. } else {
  1176. return false;
  1177. }
  1178. },
  1179. fetchStatusComments(status, card) {
  1180. // axios.get('/api/v2/status/'+status.id+'/replies',
  1181. // {
  1182. // params: {
  1183. // limit: 6
  1184. // }
  1185. // })
  1186. // .then(res => {
  1187. // let data = res.data.filter(res => {
  1188. // return res.sensitive == false;
  1189. // });
  1190. // this.replies = _.reverse(data);
  1191. // setTimeout(function() {
  1192. // document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) {
  1193. // i.href = App.util.format.rewriteLinks(i);
  1194. // });
  1195. // }, 500);
  1196. // }).catch(err => {
  1197. // })
  1198. let url = '/api/v2/comments/'+status.account.id+'/status/'+status.id;
  1199. axios.get(url)
  1200. .then(response => {
  1201. let self = this;
  1202. // this.results = this.layout == 'metro' ?
  1203. // _.reverse(response.data.data) :
  1204. // response.data.data;
  1205. this.replies = _.reverse(response.data.data);
  1206. this.pagination = response.data.meta.pagination;
  1207. if(this.replies.length > 0) {
  1208. $('.load-more-link').removeClass('d-none');
  1209. }
  1210. $('.postCommentsLoader').addClass('d-none');
  1211. $('.postCommentsContainer').removeClass('d-none');
  1212. // setTimeout(function() {
  1213. // document.querySelectorAll('.status-comment .postCommentsContainer .comment-body a').forEach(function(i, e) {
  1214. // i.href = App.util.format.rewriteLinks(i);
  1215. // });
  1216. // }, 500);
  1217. }).catch(error => {
  1218. if(!error.response) {
  1219. $('.postCommentsLoader .lds-ring')
  1220. .attr('style','width:100%')
  1221. .addClass('pt-4 font-weight-bold text-muted')
  1222. .text('An error occurred, cannot fetch comments. Please try again later.');
  1223. } else {
  1224. switch(error.response.status) {
  1225. case 401:
  1226. $('.postCommentsLoader .lds-ring')
  1227. .attr('style','width:100%')
  1228. .addClass('pt-4 font-weight-bold text-muted')
  1229. .text('Please login to view.');
  1230. break;
  1231. default:
  1232. $('.postCommentsLoader .lds-ring')
  1233. .attr('style','width:100%')
  1234. .addClass('pt-4 font-weight-bold text-muted')
  1235. .text('An error occurred, cannot fetch comments. Please try again later.');
  1236. break;
  1237. }
  1238. }
  1239. });
  1240. },
  1241. muteProfile(status) {
  1242. if($('body').hasClass('loggedIn') == false) {
  1243. return;
  1244. }
  1245. axios.post('/i/mute', {
  1246. type: 'user',
  1247. item: status.account.id
  1248. }).then(res => {
  1249. this.feed = this.feed.filter(s => s.account.id !== status.account.id);
  1250. swal('Success', 'You have successfully muted ' + status.account.acct, 'success');
  1251. }).catch(err => {
  1252. swal('Error', 'Something went wrong. Please try again later.', 'error');
  1253. });
  1254. },
  1255. blockProfile(status) {
  1256. if($('body').hasClass('loggedIn') == false) {
  1257. return;
  1258. }
  1259. axios.post('/i/block', {
  1260. type: 'user',
  1261. item: status.account.id
  1262. }).then(res => {
  1263. this.feed = this.feed.filter(s => s.account.id !== status.account.id);
  1264. swal('Success', 'You have successfully blocked ' + status.account.acct, 'success');
  1265. }).catch(err => {
  1266. swal('Error', 'Something went wrong. Please try again later.', 'error');
  1267. });
  1268. },
  1269. deletePost(status) {
  1270. if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) {
  1271. return;
  1272. }
  1273. if(window.confirm('Are you sure you want to delete this post?') == false) {
  1274. return;
  1275. }
  1276. axios.post('/i/delete', {
  1277. type: 'status',
  1278. item: status.id
  1279. }).then(res => {
  1280. this.feed = this.feed.filter(s => {
  1281. return s.id != status.id;
  1282. });
  1283. this.closeModals();
  1284. }).catch(err => {
  1285. swal('Error', 'Something went wrong. Please try again later.', 'error');
  1286. });
  1287. },
  1288. commentSubmit(status, $event) {
  1289. this.replySending = true;
  1290. let id = status.id;
  1291. let comment = this.replyText;
  1292. let limit = this.config.uploader.max_caption_length;
  1293. if(comment.length > limit) {
  1294. this.replySending = false;
  1295. swal('Comment Too Long', 'Please make sure your comment is '+limit+' characters or less.', 'error');
  1296. return;
  1297. }
  1298. axios.post('/i/comment', {
  1299. item: id,
  1300. comment: comment,
  1301. sensitive: this.replyNsfw
  1302. }).then(res => {
  1303. this.replyText = '';
  1304. this.replies.push(res.data.entity);
  1305. this.$refs.replyModal.hide();
  1306. });
  1307. this.replySending = false;
  1308. },
  1309. moderatePost(status, action, $event) {
  1310. let username = status.account.username;
  1311. let msg = '';
  1312. let self = this;
  1313. switch(action) {
  1314. case 'addcw':
  1315. msg = 'Are you sure you want to add a content warning to this post?';
  1316. swal({
  1317. title: 'Confirm',
  1318. text: msg,
  1319. icon: 'warning',
  1320. buttons: true,
  1321. dangerMode: true
  1322. }).then(res => {
  1323. if(res) {
  1324. axios.post('/api/v2/moderator/action', {
  1325. action: action,
  1326. item_id: status.id,
  1327. item_type: 'status'
  1328. }).then(res => {
  1329. swal('Success', 'Successfully added content warning', 'success');
  1330. status.sensitive = true;
  1331. self.ctxModMenuClose();
  1332. }).catch(err => {
  1333. swal(
  1334. 'Error',
  1335. 'Something went wrong, please try again later.',
  1336. 'error'
  1337. );
  1338. self.ctxModMenuClose();
  1339. });
  1340. }
  1341. });
  1342. break;
  1343. case 'remcw':
  1344. msg = 'Are you sure you want to remove the content warning on this post?';
  1345. swal({
  1346. title: 'Confirm',
  1347. text: msg,
  1348. icon: 'warning',
  1349. buttons: true,
  1350. dangerMode: true
  1351. }).then(res => {
  1352. if(res) {
  1353. axios.post('/api/v2/moderator/action', {
  1354. action: action,
  1355. item_id: status.id,
  1356. item_type: 'status'
  1357. }).then(res => {
  1358. swal('Success', 'Successfully added content warning', 'success');
  1359. status.sensitive = false;
  1360. self.ctxModMenuClose();
  1361. }).catch(err => {
  1362. swal(
  1363. 'Error',
  1364. 'Something went wrong, please try again later.',
  1365. 'error'
  1366. );
  1367. self.ctxModMenuClose();
  1368. });
  1369. }
  1370. });
  1371. break;
  1372. case 'unlist':
  1373. msg = 'Are you sure you want to unlist this post?';
  1374. swal({
  1375. title: 'Confirm',
  1376. text: msg,
  1377. icon: 'warning',
  1378. buttons: true,
  1379. dangerMode: true
  1380. }).then(res => {
  1381. if(res) {
  1382. axios.post('/api/v2/moderator/action', {
  1383. action: action,
  1384. item_id: status.id,
  1385. item_type: 'status'
  1386. }).then(res => {
  1387. this.feed = this.feed.filter(f => {
  1388. return f.id != status.id;
  1389. });
  1390. swal('Success', 'Successfully unlisted post', 'success');
  1391. self.ctxModMenuClose();
  1392. }).catch(err => {
  1393. self.ctxModMenuClose();
  1394. swal(
  1395. 'Error',
  1396. 'Something went wrong, please try again later.',
  1397. 'error'
  1398. );
  1399. });
  1400. }
  1401. });
  1402. break;
  1403. }
  1404. },
  1405. followingModal() {
  1406. if(this.following.length > 0) {
  1407. this.$refs.followingModal.show();
  1408. return;
  1409. }
  1410. axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/following', {
  1411. params: {
  1412. page: this.followingCursor
  1413. }
  1414. })
  1415. .then(res => {
  1416. this.following = res.data;
  1417. this.followingCursor++;
  1418. });
  1419. if(res.data.length < 10) {
  1420. this.followingMore = false;
  1421. }
  1422. this.$refs.followingModal.show();
  1423. },
  1424. followersModal() {
  1425. if(this.followers.length > 0) {
  1426. this.$refs.followerModal.show();
  1427. return;
  1428. }
  1429. axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/followers', {
  1430. params: {
  1431. page: this.followerCursor
  1432. }
  1433. })
  1434. .then(res => {
  1435. this.followers = res.data;
  1436. this.followerCursor++;
  1437. })
  1438. if(res.data.length < 10) {
  1439. this.followerMore = false;
  1440. }
  1441. this.$refs.followerModal.show();
  1442. },
  1443. followingLoadMore() {
  1444. axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/following', {
  1445. params: {
  1446. page: this.followingCursor
  1447. }
  1448. })
  1449. .then(res => {
  1450. if(res.data.length > 0) {
  1451. this.following.push(...res.data);
  1452. this.followingCursor++;
  1453. }
  1454. if(res.data.length < 10) {
  1455. this.followingMore = false;
  1456. }
  1457. });
  1458. },
  1459. followersLoadMore() {
  1460. axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/followers', {
  1461. params: {
  1462. page: this.followerCursor
  1463. }
  1464. })
  1465. .then(res => {
  1466. if(res.data.length > 0) {
  1467. this.followers.push(...res.data);
  1468. this.followerCursor++;
  1469. }
  1470. if(res.data.length < 10) {
  1471. this.followerMore = false;
  1472. }
  1473. });
  1474. },
  1475. lightbox(status) {
  1476. window.location.href = status.media_attachments[0].url;
  1477. return;
  1478. this.lightboxMedia = status.media_attachments[0];
  1479. this.$refs.lightboxModal.show();
  1480. },
  1481. expLc(status) {
  1482. if(this.config.ab.lc == false) {
  1483. return true;
  1484. }
  1485. if(this.statusOwner(status) == true) {
  1486. return true;
  1487. }
  1488. return false;
  1489. },
  1490. expRec() {
  1491. //return;
  1492. if(this.config.ab.rec == false) {
  1493. return;
  1494. }
  1495. axios.get('/api/local/exp/rec')
  1496. .then(res => {
  1497. this.suggestions = res.data;
  1498. })
  1499. },
  1500. expRecFollow(id, index) {
  1501. return;
  1502. if(this.config.ab.rec == false) {
  1503. return;
  1504. }
  1505. axios.post('/i/follow', {
  1506. item: id
  1507. }).then(res => {
  1508. this.suggestions.splice(index, 1);
  1509. }).catch(err => {
  1510. if(err.response.data.message) {
  1511. swal('Error', err.response.data.message, 'error');
  1512. }
  1513. });
  1514. },
  1515. followAction(status) {
  1516. let id = status.account.id;
  1517. axios.post('/i/follow', {
  1518. item: id
  1519. }).then(res => {
  1520. this.feed.forEach(s => {
  1521. if(s.account.id == id) {
  1522. s.account.relationship.following = !s.account.relationship.following;
  1523. }
  1524. });
  1525. let username = status.account.acct;
  1526. if(status.account.relationship.following) {
  1527. swal('Follow successful!', 'You are now following ' + username, 'success');
  1528. } else {
  1529. swal('Unfollow successful!', 'You are no longer following ' + username, 'success');
  1530. }
  1531. }).catch(err => {
  1532. if(err.response.data.message) {
  1533. swal('Error', err.response.data.message, 'error');
  1534. }
  1535. });
  1536. },
  1537. owner(status) {
  1538. return this.profile.id === status.account.id;
  1539. },
  1540. admin() {
  1541. return this.profile.is_admin == true;
  1542. },
  1543. ownerOrAdmin(status) {
  1544. return this.owner(status) || this.admin();
  1545. },
  1546. hideSuggestions() {
  1547. localStorage.setItem('pf_metro_ui.exp.rec', false);
  1548. this.showSuggestions = false;
  1549. },
  1550. emojiReaction(status) {
  1551. let em = event.target.innerText;
  1552. if(this.replyText.length == 0) {
  1553. this.replyText = em + ' ';
  1554. $('textarea[name="comment"]').focus();
  1555. } else {
  1556. this.replyText += em + ' ';
  1557. $('textarea[name="comment"]').focus();
  1558. }
  1559. },
  1560. refreshSuggestions() {
  1561. return;
  1562. let el = event.target.parentNode;
  1563. if(el.classList.contains('disabled') == true) {
  1564. return;
  1565. }
  1566. axios.get('/api/local/exp/rec', {
  1567. params: {
  1568. refresh: true
  1569. }
  1570. })
  1571. .then(res => {
  1572. this.suggestions = res.data;
  1573. if (el.classList) {
  1574. el.classList.add('disabled');
  1575. el.classList.add('text-light');
  1576. }
  1577. else {
  1578. el.className += ' ' + 'disabled text-light';
  1579. }
  1580. setTimeout(function() {
  1581. el.setAttribute('href', '#');
  1582. if (el.classList) {
  1583. el.classList.remove('disabled');
  1584. el.classList.remove('text-light');
  1585. }
  1586. else {
  1587. el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), 'disabled text-light');
  1588. }
  1589. }, 10000);
  1590. });
  1591. },
  1592. fetchHashtagPosts() {
  1593. axios.get('/api/local/discover/tag/list')
  1594. .then(res => {
  1595. let tags = res.data;
  1596. if(tags.length == 0) {
  1597. return;
  1598. }
  1599. let hashtag = tags[Math.floor(Math.random(), tags.length)];
  1600. this.hashtagPostsName = hashtag;
  1601. axios.get('/api/v2/discover/tag', {
  1602. params: {
  1603. hashtag: hashtag
  1604. }
  1605. }).then(res => {
  1606. if(res.data.tags.length > 3) {
  1607. this.showHashtagPosts = true;
  1608. this.hashtagPosts = res.data.tags.splice(0,3);
  1609. }
  1610. })
  1611. })
  1612. },
  1613. ctxMenu(status) {
  1614. this.ctxMenuStatus = status;
  1615. this.ctxEmbedPayload = window.App.util.embed.post(status.url);
  1616. if(status.account.id == this.profile.id) {
  1617. this.ctxMenuRelationship = false;
  1618. this.$refs.ctxModal.show();
  1619. } else {
  1620. axios.get('/api/pixelfed/v1/accounts/relationships', {
  1621. params: {
  1622. 'id[]': status.account.id
  1623. }
  1624. }).then(res => {
  1625. this.ctxMenuRelationship = res.data[0];
  1626. this.$refs.ctxModal.show();
  1627. });
  1628. }
  1629. },
  1630. closeCtxMenu(truncate) {
  1631. this.copiedEmbed = false;
  1632. this.ctxMenuStatus = false;
  1633. this.ctxMenuRelationship = false;
  1634. this.$refs.ctxModal.hide();
  1635. this.$refs.ctxReport.hide();
  1636. this.$refs.ctxReportOther.hide();
  1637. this.closeModals();
  1638. },
  1639. ctxMenuCopyLink() {
  1640. let status = this.ctxMenuStatus;
  1641. navigator.clipboard.writeText(status.url);
  1642. this.closeModals();
  1643. return;
  1644. },
  1645. ctxMenuGoToPost() {
  1646. let status = this.ctxMenuStatus;
  1647. window.location.href = this.statusUrl(status);
  1648. this.closeCtxMenu();
  1649. return;
  1650. },
  1651. ctxMenuFollow() {
  1652. let id = this.ctxMenuStatus.account.id;
  1653. axios.post('/i/follow', {
  1654. item: id
  1655. }).then(res => {
  1656. let username = this.ctxMenuStatus.account.acct;
  1657. this.closeCtxMenu();
  1658. setTimeout(function() {
  1659. swal('Follow successful!', 'You are now following ' + username, 'success');
  1660. }, 500);
  1661. });
  1662. },
  1663. ctxMenuUnfollow() {
  1664. let id = this.ctxMenuStatus.account.id;
  1665. axios.post('/i/follow', {
  1666. item: id
  1667. }).then(res => {
  1668. let username = this.ctxMenuStatus.account.acct;
  1669. if(this.scope == 'home') {
  1670. this.feed = this.feed.filter(s => {
  1671. return s.account.id != this.ctxMenuStatus.account.id;
  1672. });
  1673. }
  1674. this.closeCtxMenu();
  1675. setTimeout(function() {
  1676. swal('Unfollow successful!', 'You are no longer following ' + username, 'success');
  1677. }, 500);
  1678. });
  1679. },
  1680. ctxMenuReportPost() {
  1681. this.$refs.ctxModal.hide();
  1682. this.$refs.ctxReport.show();
  1683. return;
  1684. // window.location.href = '/i/report?type=post&id=' + this.ctxMenuStatus.id;
  1685. },
  1686. ctxMenuEmbed() {
  1687. this.closeModals();
  1688. this.$refs.ctxEmbedModal.show();
  1689. },
  1690. ctxMenuShare() {
  1691. this.$refs.ctxModal.hide();
  1692. this.$refs.ctxShareModal.show();
  1693. },
  1694. closeCtxShareMenu() {
  1695. this.$refs.ctxShareModal.hide();
  1696. this.$refs.ctxModal.show();
  1697. },
  1698. ctxCopyEmbed() {
  1699. navigator.clipboard.writeText(this.ctxEmbedPayload);
  1700. this.ctxEmbedShowCaption = true;
  1701. this.ctxEmbedShowLikes = false;
  1702. this.ctxEmbedCompactMode = false;
  1703. this.$refs.ctxEmbedModal.hide();
  1704. },
  1705. ctxModMenuShow() {
  1706. this.$refs.ctxModal.hide();
  1707. this.$refs.ctxModModal.show();
  1708. },
  1709. ctxModOtherMenuShow() {
  1710. this.$refs.ctxModal.hide();
  1711. this.$refs.ctxModModal.hide();
  1712. this.$refs.ctxModOtherModal.show();
  1713. },
  1714. ctxModMenu() {
  1715. this.$refs.ctxModal.hide();
  1716. },
  1717. ctxModMenuClose() {
  1718. this.closeModals();
  1719. this.$refs.ctxModal.show();
  1720. },
  1721. ctxModOtherMenuClose() {
  1722. this.closeModals();
  1723. this.$refs.ctxModModal.show();
  1724. },
  1725. formatCount(count) {
  1726. return App.util.format.count(count);
  1727. },
  1728. statusUrl(status) {
  1729. if(status.local == true) {
  1730. return status.url;
  1731. }
  1732. return '/i/web/post/_/' + status.account.id + '/' + status.id;
  1733. },
  1734. profileUrl(status) {
  1735. if(status.local == true) {
  1736. return status.account.url;
  1737. }
  1738. return '/i/web/profile/_/' + status.account.id;
  1739. },
  1740. statusCardUsernameFormat(status) {
  1741. if(status.account.local == true) {
  1742. return status.account.username;
  1743. }
  1744. let fmt = window.App.config.username.remote.format;
  1745. let txt = window.App.config.username.remote.custom;
  1746. let usr = status.account.username;
  1747. let dom = document.createElement('a');
  1748. dom.href = status.account.url;
  1749. dom = dom.hostname;
  1750. switch(fmt) {
  1751. case '@':
  1752. return usr + '<span class="text-lighter font-weight-bold">@' + dom + '</span>';
  1753. break;
  1754. case 'from':
  1755. return usr + '<span class="text-lighter font-weight-bold"> <span class="font-weight-normal">from</span> ' + dom + '</span>';
  1756. break;
  1757. case 'custom':
  1758. return usr + '<span class="text-lighter font-weight-bold"> ' + txt + ' ' + dom + '</span>';
  1759. break;
  1760. default:
  1761. return usr + '<span class="text-lighter font-weight-bold">@' + dom + '</span>';
  1762. break;
  1763. }
  1764. },
  1765. previewUrl(status) {
  1766. return status.sensitive ? '/storage/no-preview.png?v=' + new Date().getTime() : status.media_attachments[0].preview_url;
  1767. },
  1768. previewBackground(status) {
  1769. let preview = this.previewUrl(status);
  1770. return 'background-image: url(' + preview + ');';
  1771. },
  1772. trimCaption(caption, len = 60) {
  1773. return _.truncate(caption, {
  1774. length: len
  1775. });
  1776. },
  1777. hasStory() {
  1778. axios.get('/api/stories/v0/exists/'+this.profile.id)
  1779. .then(res => {
  1780. this.userStory = res.data;
  1781. })
  1782. },
  1783. // real time watcher
  1784. rtw() {
  1785. this.mpPoller = setInterval(() => {
  1786. let apiUrl = false;
  1787. this.mpCount++;
  1788. if(this.mpCount > 10) {
  1789. this.mpInterval = 30000;
  1790. }
  1791. if(this.mpCount > 50) {
  1792. this.mpInterval = (5 * 60 * 1000);
  1793. }
  1794. switch(this.scope) {
  1795. case 'home':
  1796. apiUrl = '/api/pixelfed/v1/timelines/home';
  1797. break;
  1798. case 'local':
  1799. apiUrl = '/api/pixelfed/v1/timelines/public';
  1800. break;
  1801. case 'network':
  1802. apiUrl = '/api/pixelfed/v1/timelines/network';
  1803. break;
  1804. }
  1805. axios.get(apiUrl, {
  1806. params: {
  1807. max_id: 0,
  1808. limit: 20
  1809. }
  1810. }).then(res => {
  1811. let self = this;
  1812. let tids = this.feed.map(status => status.id);
  1813. let data = res.data.filter(d => {
  1814. return d.id > self.min_id && tids.indexOf(d.id) == -1;
  1815. });
  1816. let ids = data.map(status => status.id);
  1817. let max = Math.max(...ids).toString();
  1818. let newer = max > this.min_id;
  1819. if(newer) {
  1820. this.morePostsAvailable = true;
  1821. this.mpData = data;
  1822. }
  1823. });
  1824. }, this.mpInterval);
  1825. },
  1826. syncNewPosts() {
  1827. let self = this;
  1828. let data = this.mpData;
  1829. let ids = data.map(s => s.id);
  1830. this.min_id = Math.max(...ids).toString();
  1831. this.max_id = Math.min(...ids).toString();
  1832. this.feed.unshift(...data);
  1833. this.morePostsAvailable = false;
  1834. this.mpData = null;
  1835. },
  1836. switchFeedLayout(toggle) {
  1837. this.loading = true;
  1838. this.layout = toggle;
  1839. let self = this;
  1840. setTimeout(function() {
  1841. self.loading = false;
  1842. }, 500);
  1843. },
  1844. labelRedirect(type) {
  1845. let url = '/i/redirect?url=' + encodeURI(this.config.features.label.covid.url);
  1846. window.location.href = url;
  1847. },
  1848. openCtxReportOtherMenu() {
  1849. let s = this.ctxMenuStatus;
  1850. this.closeCtxMenu();
  1851. this.ctxMenuStatus = s;
  1852. this.$refs.ctxReportOther.show();
  1853. },
  1854. ctxReportMenuGoBack() {
  1855. this.$refs.ctxReportOther.hide();
  1856. this.$refs.ctxReport.hide();
  1857. this.$refs.ctxModal.show();
  1858. },
  1859. ctxReportOtherMenuGoBack() {
  1860. this.$refs.ctxReportOther.hide();
  1861. this.$refs.ctxModal.hide();
  1862. this.$refs.ctxReport.show();
  1863. },
  1864. sendReport(type) {
  1865. let id = this.ctxMenuStatus.id;
  1866. swal({
  1867. 'title': 'Confirm Report',
  1868. 'text': 'Are you sure you want to report this post?',
  1869. 'icon': 'warning',
  1870. 'buttons': true,
  1871. 'dangerMode': true
  1872. }).then((res) => {
  1873. if(res) {
  1874. axios.post('/i/report/', {
  1875. 'report': type,
  1876. 'type': 'post',
  1877. 'id': id,
  1878. }).then(res => {
  1879. this.closeCtxMenu();
  1880. swal('Report Sent!', 'We have successfully received your report.', 'success');
  1881. }).catch(err => {
  1882. swal('Oops!', 'There was an issue reporting this post.', 'error');
  1883. })
  1884. } else {
  1885. this.closeCtxMenu();
  1886. }
  1887. });
  1888. },
  1889. closeModals() {
  1890. this.$refs.ctxModal.hide();
  1891. this.$refs.ctxModModal.hide();
  1892. this.$refs.ctxModOtherModal.hide();
  1893. this.$refs.ctxShareModal.hide();
  1894. this.$refs.ctxEmbedModal.hide();
  1895. this.$refs.ctxReport.hide();
  1896. this.$refs.ctxReportOther.hide();
  1897. this.$refs.ctxConfirm.hide();
  1898. this.$refs.lightboxModal.hide();
  1899. this.$refs.replyModal.hide();
  1900. this.$refs.ctxStatusModal.hide();
  1901. },
  1902. openCtxStatusModal() {
  1903. this.closeModals();
  1904. this.$refs.ctxStatusModal.show();
  1905. },
  1906. openConfirmModal() {
  1907. this.closeModals();
  1908. this.$refs.ctxConfirm.show();
  1909. },
  1910. closeConfirmModal() {
  1911. this.closeModals();
  1912. this.confirmModalTitle = 'Are you sure?';
  1913. this.confirmModalType = false;
  1914. this.confirmModalIdentifer = null;
  1915. },
  1916. confirmModalConfirm() {
  1917. switch(this.confirmModalType) {
  1918. case 'post.delete':
  1919. axios.post('/i/delete', {
  1920. type: 'status',
  1921. item: this.confirmModalIdentifer
  1922. }).then(res => {
  1923. this.feed = this.feed.filter(s => {
  1924. return s.id != this.confirmModalIdentifer;
  1925. });
  1926. this.closeConfirmModal();
  1927. }).catch(err => {
  1928. this.closeConfirmModal();
  1929. swal('Error', 'Something went wrong. Please try again later.', 'error');
  1930. });
  1931. break;
  1932. }
  1933. this.closeConfirmModal();
  1934. },
  1935. confirmModalCancel() {
  1936. this.closeConfirmModal();
  1937. },
  1938. timeAgo(ts) {
  1939. return App.util.format.timeAgo(ts);
  1940. },
  1941. toggleReplies(reply) {
  1942. if(reply.thread) {
  1943. reply.thread = false;
  1944. } else {
  1945. if(reply.replies.length > 0) {
  1946. reply.thread = true;
  1947. return;
  1948. }
  1949. let url = '/api/v2/comments/'+reply.account.id+'/status/'+reply.id;
  1950. axios.get(url)
  1951. .then(response => {
  1952. reply.replies = _.reverse(response.data.data);
  1953. reply.thread = true;
  1954. });
  1955. }
  1956. },
  1957. likeReply(status, $event) {
  1958. if($('body').hasClass('loggedIn') == false) {
  1959. swal('Login', 'Please login to perform this action.', 'info');
  1960. return;
  1961. }
  1962. axios.post('/i/like', {
  1963. item: status.id
  1964. }).then(res => {
  1965. status.favourites_count = res.data.count;
  1966. if(status.favourited == true) {
  1967. status.favourited = false;
  1968. } else {
  1969. status.favourited = true;
  1970. }
  1971. }).catch(err => {
  1972. swal('Error', 'Something went wrong, please try again later.', 'error');
  1973. });
  1974. },
  1975. replyFocus(e, index, prependUsername = false) {
  1976. if($('body').hasClass('loggedIn') == false) {
  1977. this.redirect('/login?next=' + encodeURIComponent(window.location.pathname));
  1978. return;
  1979. }
  1980. if(this.status.comments_disabled) {
  1981. return;
  1982. }
  1983. this.replyToIndex = index;
  1984. this.replyingToId = e.id;
  1985. this.replyingToUsername = e.account.username;
  1986. this.reply_to_profile_id = e.account.id;
  1987. let username = e.account.local ? '@' + e.account.username + ' '
  1988. : '@' + e.account.acct + ' ';
  1989. if(prependUsername == true) {
  1990. this.replyText = username;
  1991. }
  1992. this.$refs.replyModal.show();
  1993. setTimeout(function() {
  1994. $('.replyModalTextarea').focus();
  1995. }, 500);
  1996. },
  1997. loadMoreComments() {
  1998. if(this.pagination.total_pages == 1 || this.pagination.current_page == this.pagination.total_pages) {
  1999. $('.load-more-link').addClass('d-none');
  2000. return;
  2001. }
  2002. $('.load-more-link').addClass('d-none');
  2003. $('.postCommentsLoader').removeClass('d-none');
  2004. let next = this.pagination.links.next;
  2005. axios.get(next)
  2006. .then(response => {
  2007. let self = this;
  2008. let res = response.data.data;
  2009. $('.postCommentsLoader').addClass('d-none');
  2010. for(let i=0; i < res.length; i++) {
  2011. this.replies.unshift(res[i]);
  2012. }
  2013. this.pagination = response.data.meta.pagination;
  2014. $('.load-more-link').removeClass('d-none');
  2015. });
  2016. }
  2017. },
  2018. beforeDestroy () {
  2019. clearInterval(this.mpInterval);
  2020. }
  2021. }
  2022. </script>
  2023. <style type="text/css" scoped>
  2024. .postPresenterContainer {
  2025. display: flex;
  2026. align-items: center;
  2027. background: #fff;
  2028. }
  2029. .word-break {
  2030. word-break: break-all;
  2031. }
  2032. .small .custom-control-label {
  2033. padding-top: 3px;
  2034. }
  2035. /*.reply-btn {
  2036. position: absolute;
  2037. bottom: 30px;
  2038. right: 20px;
  2039. width: 60px;
  2040. text-align: center;
  2041. font-size: 13px;
  2042. border-radius: 0 3px 3px 0;
  2043. }*/
  2044. .emoji-reactions .nav-item {
  2045. font-size: 1.2rem;
  2046. padding: 9px;
  2047. cursor: pointer;
  2048. }
  2049. .emoji-reactions::-webkit-scrollbar {
  2050. width: 0px;
  2051. height: 0px;
  2052. background: transparent;
  2053. }
  2054. .reply-btn[disabled] {
  2055. opacity: .3;
  2056. color: #3897f0;
  2057. }
  2058. .replyModalTextarea {
  2059. border: none;
  2060. font-size: 18px;
  2061. resize: none;
  2062. white-space: pre-wrap;
  2063. outline: none;
  2064. }
  2065. .has-story {
  2066. width: 64px;
  2067. height: 64px;
  2068. border-radius: 50%;
  2069. padding: 2px;
  2070. background: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);
  2071. }
  2072. .has-story img {
  2073. width: 60px;
  2074. height: 60px;
  2075. border-radius: 50%;
  2076. padding: 3px;
  2077. background: #fff;
  2078. }
  2079. .has-story.has-story-sm {
  2080. width: 32px;
  2081. height: 32px;
  2082. border-radius: 50%;
  2083. padding: 2px;
  2084. background: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);
  2085. }
  2086. .has-story.has-story-sm img {
  2087. width: 28px;
  2088. height: 28px;
  2089. border-radius: 50%;
  2090. padding: 3px;
  2091. background: #fff;
  2092. }
  2093. #ctx-reply-modal .form-control:focus {
  2094. border: none;
  2095. outline: 0;
  2096. box-shadow: none;
  2097. }
  2098. </style>