mirror of https://github.com/pixelfed/pixelfed.git
1 line
35 KiB
JavaScript
1 line
35 KiB
JavaScript
|
"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[3365],{79932:(t,e,a)=>{a.r(e),a.d(e,{default:()=>o});var s=a(42755),i=a(88231),r=a(33795),n=a(78423);const o={components:{drawer:s.default,sidebar:i.default,intersect:n.default,"dm-placeholder":r.default},data:function(){return{isLoaded:!1,profile:void 0,canLoadMore:!0,threadsLoaded:!1,composeLoading:!1,threads:[],tabIndex:0,tabs:["inbox","sent","requests"],page:1,ids:[],isIntersecting:!1}},mounted:function(){this.profile=window._sharedData.user,this.isLoaded=!0,this.fetchThreads()},methods:{fetchThreads:function(){var t=this;axios.get("/api/v1/conversations",{params:{scope:this.tabs[this.tabIndex]}}).then((function(e){var a=e.data.filter((function(t){return t&&t.hasOwnProperty("last_status")&&t.last_status})),s=a.map((function(t){return t.accounts[0].id}));t.ids=s,t.threads=a,t.threadsLoaded=!0,t.page++}))},timeago:function(t){return App.util.format.timeAgo(t)},enterIntersect:function(){var t=this;this.isIntersecting||(this.isIntersecting=!0,axios.get("/api/v1/conversations",{params:{scope:this.tabs[this.tabIndex],page:this.page}}).then((function(e){if(e.data.filter((function(t){return t&&t.hasOwnProperty("last_status")&&t.last_status})).forEach((function(e){-1==t.ids.indexOf(e.accounts[0].id)&&(t.ids.push(e.accounts[0].id),t.threads.push(e))})),!e.data.length||e.data.length<5)return t.canLoadMore=!1,void(t.isIntersecting=!1);t.page++,t.isIntersecting=!1})))},toggleTab:function(t){event.currentTarget.blur(),this.threadsLoaded=!1,this.page=1,this.tabIndex=t,this.fetchThreads()},threadSummary:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if("photo"==t.pf_type){var a=this.profile.id==t.account.id,s='<div class="'+(a?"text-muted":"text-primary")+' border px-2 py-1 mt-1 rounded" style="font-size:11px;width: fit-content"><i class="far fa-image mr-1"></i> <span>';return(s+=a?"Sent a photo":"Received a photo")+"</span></div>"}if("video"==t.pf_type){var i=this.profile.id==t.account.id,r='<div class="'+(i?"text-muted":"text-primary")+' border px-2 py-1 mt-1 rounded" style="font-size:11px;width: fit-content"><i class="far fa-video mr-1"></i> <span>';return(r+=i?"Sent a video":"Received a video")+"</span></div>"}var n="";this.profile.id==t.account.id&&(n+='<i class="far fa-reply-all fa-flip-both"></i> ');var o=t.content,l=o.replace(/(<([^>]+)>)/gi,"");return l.length>e?n+l.slice(0,e)+"...":n+l},openCompose:function(){this.$refs.compose.show()},composeSearch:function(t){if(t.length<1)return[];return axios.post("/api/direct/lookup",{q:t}).then((function(t){return t.data}))},getTagResultValue:function(t){return t.local?"@"+t.name:t.name},onTagSubmitLocation:function(t){this.composeLoading=!0,window.location.href="/i/web/direct/thread/"+t.id},closeCompose:function(){this.$refs.compose.hide()}}}},89250:(t,e,a)=>{a.r(e),a.d(e,{default:()=>s});const s={data:function(){return{user:window._sharedData.user}}}},29022:(t,e,a)=>{a.r(e),a.d(e,{default:()=>s});const s={props:["user"],data:function(){return{loaded:!1,avatarUpdateIndex:0,avatarUpdateFile:void 0,avatarUpdatePreview:void 0}},methods:{open:function(){this.$refs.avatarUpdateModal.show()},avatarUpdateClose:function(){this.$refs.avatarUpdateModal.hide(),this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateClear:function(){this.avatarUpdateIndex=0,this.avatarUpdateFile=void 0},avatarUpdateStep:function(t){this.$refs.avatarUpdateRef.click(),this.avatarUpdateIndex=t},handleAvatarUpdate:function(){var t=this,e=event.target.files;Array.prototype.forEach.call(e,(function(e,a){t.avatarUpdateFile=e,t.avatarUpdatePreview=URL.createObjectURL(e),t.avatarUpdateIndex=1}))},handleDrop:function(t){t.preventDefault();var e=this;if(t.dataTransfer.items){for(var a=0;a<t.dataTransfer.items.length;a++)if("file"===t.dataTransfer.items[a].kind){var s=t.dataTransfer.items[a].getAsFile();if(!s)return;e.avatarUpdateFile=s,e.avatarUpdatePreview=URL.createObjectURL(s),e.avatarUpdateIndex=1}}else for(a=0;a<t.dataTransfer.files.length;a++){if(!t.dataTransfer.files[a].hasOwnProperty("name"))retur
|