pixelfed/public/js/profile.js

1 line
112 KiB
JavaScript
Raw Permalink Normal View History

2024-04-12 10:00:25 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[2737],{59488:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});var o=s(74692);const i={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 i="Are you sure you want to enforce CW for "+o+" ?";swal({title:"Confirm",text:i,icon:"warning",buttons:!0,dangerMode:!0});break;case"suspend":i="Are you sure you want to suspend the account of "+o+" ?",swal({title:"Confirm",text:i,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")}}}},20288:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>l});s(58942);var o=s(79984),i=s(24848),a=s(74692);function n(t){return function(t){if(Array.isArray(t))return r(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 r(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 r(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 r(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 l={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:null,followerMore:!0,followerLoading:!0,following:[],followingCursor:null,followingMore:!0,followingLoading:!0,warning:!1,sponsorList:[],bookmarks:[],bookmarksPage:2,collections:[],collectionsLoaded:!1,collectionsPage:2,isMobile:!1,ctxEmbedPayload:null,copiedEmbed:!1,hasStory: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.get("t"))){if("bookmarks"==e.get("t"))re