1
0
Fork 0
pixelfed/public/js/profile.js

1 line
115 KiB
JavaScript
Raw Normal View History

2022-03-02 08:54:37 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[912],{14425:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>a});var o=s(19755);const a={props:["feed","status","profile","size","modal"],data:function(){return{activeSession:!1}},mounted:function(){var t=document.querySelector("body");this.activeSession=!!t.classList.contains("loggedIn")},methods:{reportUrl:function(t){return"/i/report?type="+(t.in_reply_to?"comment":"post")+"&id="+t.id},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},editUrl:function(t){return t.url+"/edit"},redirect:function(t){window.location.href=t},replyUrl:function(t){return"/p/"+this.profile.username+"/"+(t.account.id==this.profile.id?t.id:t.in_reply_to_id)},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},statusOwner:function(t){return parseInt(t.account.id)==parseInt(this.profile.id)},deletePost:function(){this.$emit("deletePost"),o("#mt_pid_"+this.status.id).modal("hide")},hidePost:function(t){t.sensitive=!0,o("#mt_pid_"+t.id).modal("hide")},moderatePost:function(t,e,s){var o=t.account.username;switch(e){case"autocw":var a="Are you sure you want to enforce CW for "+o+" ?";swal({title:"Confirm",text:a,icon:"warning",buttons:!0,dangerMode:!0});break;case"suspend":a="Are you sure you want to suspend the account of "+o+" ?",swal({title:"Confirm",text:a,icon:"warning",buttons:!0,dangerMode:!0})}},muteProfile:function(t){0!=o("body").hasClass("loggedIn")&&axios.post("/i/mute",{type:"user",item:t.account.id}).then((function(e){swal("Success","You have successfully muted "+t.account.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},blockProfile:function(t){0!=o("body").hasClass("loggedIn")&&axios.post("/i/block",{type:"user",item:t.account.id}).then((function(e){swal("Success","You have successfully blocked "+t.account.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},statusUrl:function(t){return 1==t.local?t.url:"/i/web/post/_/"+t.account.id+"/"+t.id},profileUrl:function(t){return 1==t.local?t.account.url:"/i/web/profile/_/"+t.account.id},closeModal:function(){o("#mt_pid_"+this.status.id).modal("hide")}}}},79466:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});s(82364);var o=s(19210),a=s(19755);function i(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,o=new Array(e);s<e;s++)o[s]=t[s];return o}const r={props:["profile-id","profile-layout","profile-settings","profile-username"],components:{StatusCard:o.default},data:function(){return{ids:[],profile:{},user:!1,timeline:[],timelinePage:2,min_id:0,max_id:0,loading:!0,owner:!1,layout:"metro",mode:"grid",modes:["grid","collections","bookmarks","archives"],modalStatus:!1,relationship:{},followers:[],followerCursor:1,followerMore:!0,followerLoading:!0,following:[],followingCursor:1,followingMore:!0,followingLoading:!0,warning:!1,sponsorList:[],bookmarks:[],bookmarksPage:2,collections:[],collectionsLoaded:!1,collectionsPage:2,isMobile:!1,ctxEmbedPayload:null,copiedEmbed:!1,hasStory:null,followingModalSearch:null,followingModalSearchCache:null,followingModalTab:"following",bookmarksLoading:!0,archives:[],archivesPage:2}},beforeMount:function(){var t=this;this.fetchProfile();var e=new URLSearchParams(window.location.search);if(this.layout="metro","metro"==this.layout&&e.has("t")&&-1!=this.modes.indexOf(e.g