pixelfed/public/js/profile-directory.js

1 line
3.3 KiB
JavaScript
Raw Normal View History

2022-02-18 05:31:41 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[470],{156:(t,s,e)=>{"use strict";e.r(s),e.d(s,{default:()=>a});const a={data:function(){return{loaded:!1,showLoadMore:!0,profiles:[],page:1}},beforeMount:function(){this.fetchData()},methods:{fetchData:function(){var t=this;axios.get("/api/pixelfed/v2/discover/profiles",{params:{page:this.page}}).then((function(s){if(0==s.data.length)return t.showLoadMore=!1,void(t.loaded=!0);t.profiles=s.data,t.showLoadMore=8==t.profiles.length,t.loaded=!0}))},prettyCount:function(t){return App.util.format.count(t)},loadMore:function(){this.loaded=!1,this.page++,this.fetchData()},thumbUrl:function(t){return t.media_attachments[0].url}}}},98107:(t,s,e)=>{Vue.component("profile-directory",e(82909).default)},82909:(t,s,e)=>{"use strict";e.r(s),e.d(s,{default:()=>i});var a=e(17286),r=e(72100),o={};for(const t in r)"default"!==t&&(o[t]=()=>r[t]);e.d(s,o);const i=(0,e(51900).default)(r.default,a.render,a.staticRenderFns,!1,null,"7b3eea1c",null).exports},72100:(t,s,e)=>{"use strict";e.r(s),e.d(s,{default:()=>o});var a=e(156),r={};for(const t in a)"default"!==t&&(r[t]=()=>a[t]);e.d(s,r);const o=a.default},17286:(t,s,e)=>{"use strict";e.r(s);var a=e(5608),r={};for(const t in a)"default"!==t&&(r[t]=()=>a[t]);e.d(s,r)},5608:(t,s,e)=>{"use strict";e.r(s),e.d(s,{render:()=>a,staticRenderFns:()=>r});var a=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("div",{staticClass:"col-12"},[e("p",{staticClass:"font-weight-bold text-lighter text-uppercase"},[t._v("Profiles Directory")]),t._v(" "),t.loaded?e("div",{},[e("div",{staticClass:"row"},[t._l(t.profiles,(function(s,a){return e("div",{staticClass:"col-12 col-md-6 p-1"},[e("div",{staticClass:"card card-body border shadow-none py-2"},[e("div",{staticClass:"media"},[e("a",{attrs:{href:s.url}},[e("img",{staticClass:"rounded-circle border mr-3",attrs:{src:s.avatar,alt:"...",width:"40px",height:"40px"}})]),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"mt-0 mb-0 font-weight-bold"},[e("a",{staticClass:"text-dark",attrs:{href:s.url}},[t._v(t._s(s.username))])]),t._v(" "),e("p",{staticClass:"mb-1 small text-lighter d-flex justify-content-between font-weight-bold"},[e("span",[e("span",[t._v(t._s(t.prettyCount(s.statuses_count)))]),t._v(" POSTS\n\t\t\t\t\t\t\t\t\t")]),t._v(" "),e("span",[e("span",[t._v(t._s(t.prettyCount(s.followers_count)))]),t._v(" FOLLOWERS\n\t\t\t\t\t\t\t\t\t")])]),t._v(" "),e("p",{staticClass:"mb-1"},t._l(s.posts,(function(s,a){return e("span",{key:"profile_posts_"+a,staticClass:"shadow-sm"},[e("a",{staticClass:"text-decoration-none mr-1",attrs:{href:s.url}},[e("img",{staticClass:"border rounded",attrs:{src:t.thumbUrl(s),width:"62.3px",height:"62.3px"}})])])})),0)])])])])})),t._v(" "),t.showLoadMore?e("div",{staticClass:"col-12"},[e("p",{staticClass:"text-center mb-0 pt-3"},[e("button",{staticClass:"btn btn-outline-secondary btn-sm px-4 py-1 font-weight-bold",on:{click:function(s){return t.loadMore()}}},[t._v("Load More")])])]):t._e()],2)]):e("div",[t._m(0)])])])},r=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"row"},[e("div",{staticClass:"col-12 d-flex justify-content-center align-items-center"},[e("div",{staticClass:"spinner-border",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[t._v("Loading...")])])])])}]}},t=>{t.O(0,[898],(()=>{return s=98107,t(t.s=s);var s}));t.O()}]);