pixelfed/public/js/profile.js

1 line
121 KiB
JavaScript
Raw Normal View History

2022-12-07 08:10:46 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[912],{49720:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>o});var i=s(19755);const o={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"),i("#mt_pid_"+this.status.id).modal("hide")},hidePost:function(t){t.sensitive=!0,i("#mt_pid_"+t.id).modal("hide")},moderatePost:function(t,e,s){var i=t.account.username;switch(e){case"autocw":var o="Are you sure you want to enforce CW for "+i+" ?";swal({title:"Confirm",text:o,icon:"warning",buttons:!0,dangerMode:!0});break;case"suspend":o="Are you sure you want to suspend the account of "+i+" ?",swal({title:"Confirm",text:o,icon:"warning",buttons:!0,dangerMode:!0})}},muteProfile:function(t){0!=i("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!=i("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(){i("#mt_pid_"+this.status.id).modal("hide")}}}},9179:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});s(82364);var i=s(19210),o=s(19755);function a(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,i=new Array(e);s<e;s++)i[s]=t[s];return i}const r={props:["profile-id","profile-layout","profile-settings","profile-username"],components:{StatusCard:i.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.ge