mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
|
"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[9919],{87583:(t,e,a)=>{a.r(e),a.d(e,{default:()=>r});var s=a(5787),i=a(28772);const r={components:{drawer:s.default,sidebar:i.default},data:function(){return{isLoaded:!1,profile:void 0,instance:void 0,nodeinfo:void 0,config:window.App.config}},mounted:function(){this.profile=window._sharedData.user}}},50371:(t,e,a)=>{a.r(e),a.d(e,{default:()=>s});const s={data:function(){return{user:window._sharedData.user}}}},84154:(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"))return;e.avatarUpdateFile=t.dataTransfer.files[a],e.avatarUpdatePreview=URL.createObjectURL(t.dataTransfer.files[a]),e.avatarUpdateIndex=1}},confirmUpload:function(){var t=this;if(window.confirm("Are you sure you want to change your avatar photo?")){var e=new FormData;e.append("_method","PATCH"),e.append("avatar",this.avatarUpdateFile),axios.post("/api/v1/accounts/update_credentials",e).then((function(e){window._sharedData.user.avatar=e.data.avatar,t.avatarUpdateClose()})).catch((function(t){t.response.data&&t.response.data.errors&&t.response.data.errors.avatar&&t.response.data.errors.avatar.length&&swal("Oops!",t.response.data.errors.avatar[0],"error")}))}}}}},79318:(t,e,a)=>{a.r(e),a.d(e,{default:()=>l});var s=a(95353),i=a(90414);function r(t){return r="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},r(t)}function n(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function o(t,e,a){var s;return s=function(t,e){if("object"!=r(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var s=a.call(t,e||"default");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==r(s)?s:s+"")in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const l={props:{user:{type:Object,default:function(){return{avatar:"/storage/avatars/default.jpg",username:!1,display_name:"",following_count:0,followers_count:0}}},links:{type:Array,default:function(){return[{name:"Discover",path:"/i/web/discover",icon:"fas fa-compass"},{name:"Groups",path:"/i/web/groups",icon:"far fa-user-friends"},{name:"Videos",path:"/i/web/videos",icon:"far fa-video"}]}}},components:{UpdateAvatar:i.default},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?n(Object(a),!0).forEach((function(e){o(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},(0,s.mapGetters)(["getCustomEmoji"])),data:function(){ret
|