pixelfed/public/js/profile~followers.bundle.50...

1 wiersz
26 KiB
JavaScript

2024-04-06 08:47:39 +00:00
"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[8977],{80189:(t,e,r)=>{r.r(e),r.d(e,{default:()=>a});var o=r(5787),i=r(36470);const a={props:{id:{type:String},profileId:{type:String},username:{type:String},cachedProfile:{type:Object},cachedUser:{type:Object}},components:{drawer:o.default,"profile-followers":i.default},data:function(){return{isLoaded:!1,curUser:void 0,profile:void 0,relationship:void 0}},mounted:function(){this.init()},watch:{$route:"init"},methods:{init:function(){this.isLoaded=!1,this.relationship=void 0,this.owner=!1,this.cachedProfile&&this.cachedUser?(this.curUser=this.cachedUser,this.profile=this.cachedProfile,this.fetchRelationship()):(this.curUser=window._sharedData.user,this.fetchProfile())},fetchProfile:function(){var t=this,e=this.profileId?this.profileId:this.id;axios.get("/api/pixelfed/v1/accounts/"+e).then((function(e){t.profile=e.data,e.data.id==t.curUser.id?(t.owner=!0,t.fetchRelationship()):(t.owner=!1,t.fetchRelationship())})).catch((function(e){t.$router.push("/i/web/404")}))},fetchRelationship:function(){var t=this;if(this.owner)return this.relationship={},void(this.isLoaded=!0);axios.get("/api/v1/accounts/relationships",{params:{"id[]":this.profile.id}}).then((function(e){t.relationship=e.data[0],t.isLoaded=!0}))},goBack:function(){this.$router.push("/i/web/profile/"+this.profile.id)}}}},50371:(t,e,r)=>{r.r(e),r.d(e,{default:()=>o});const o={data:function(){return{user:window._sharedData.user}}}},6140:(t,e,r)=>{r.r(e),r.d(e,{default:()=>o});const o={props:{status:{type:Object},cursorLimit:{type:Number,default:200}},data:function(){return{preRender:void 0,fullContent:null,content:null,cursor:200}},mounted:function(){this.rewriteLinks()},methods:{readMore:function(){this.cursor=this.cursor+200,this.content=this.fullContent.substr(0,this.cursor)},rewriteLinks:function(){var t=this,e=this.status.content,r=document.createElement("div");r.innerHTML=e,r.querySelectorAll('a[class*="hashtag"]').forEach((function(t){var e=t.innerText;"#"==e.substr(0,1)&&(e=e.substr(1)),t.removeAttribute("target"),t.setAttribute("href","/i/web/hashtag/"+e)})),r.querySelectorAll('a:not(.hashtag)[class*="mention"], a:not(.hashtag)[class*="list-slug"]').forEach((function(e){var r=e.innerText;if("@"==r.substr(0,1)&&(r=r.substr(1)),0==t.status.account.local&&!r.includes("@")){var o=document.createElement("a");o.href=e.getAttribute("href"),r=r+"@"+o.hostname}e.removeAttribute("target"),e.setAttribute("href","/i/web/username/"+r)})),this.content=r.outerHTML,this.injectCustomEmoji()},injectCustomEmoji:function(){var t=this;this.status.emojis.forEach((function(e){var r='<img draggable="false" class="emojione custom-emoji" alt="'.concat(e.shortcode,'" title="').concat(e.shortcode,'" src="').concat(e.url,'" data-original="').concat(e.url,'" data-static="').concat(e.static_url,'" width="18" height="18" onerror="this.onerror=null;this.src=\'/storage/emoji/missing.png\';" />');t.content=t.content.replace(":".concat(e.shortcode,":"),r)}))}}}},19306:(t,e,r)=>{r.r(e),r.d(e,{default:()=>p});var o=r(25100),i=r(29787),a=r(34719),n=r(95353),s=r(24848);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t){return function(t){if(Array.isArray(t))return d(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 d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(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 d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r