1
0
Fork 0
pixelfed/public/js/i18n.bundle.4a5ff18de549ac4...

1 line
26 KiB
JavaScript
Raw Normal View History

2023-06-12 11:31:23 +00:00
"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[8250],{1565:(t,a,e)=>{e.r(a),e.d(a,{default:()=>i});var s=e(42755),r=e(88231);const i={components:{drawer:s.default,sidebar:r.default},data:function(){return{isLoaded:!1,profile:void 0,locale:"en",langs:["en","ar","ca","de","el","es","eu","fr","he","gd","gl","id","it","ja","nl","pl","pt","ru","uk","vi"]}},mounted:function(){this.profile=window._sharedData.user,this.isLoaded=!0,this.locale=this.$i18n.locale},watch:{locale:function(t){this.loadLang(t)}},methods:{fullName:function(t){return new Intl.DisplayNames([t],{type:"language"}).of(t)},localeName:function(t){return new Intl.DisplayNames([this.$i18n.locale],{type:"language"}).of(t)},loadLang:function(t){var a=this;axios.post("/api/pixelfed/web/change-language.json",{v:.1,l:t}).then((function(e){a.$i18n.locale=t}))}}}},89250:(t,a,e)=>{e.r(a),e.d(a,{default:()=>s});const s={data:function(){return{user:window._sharedData.user}}}},29022:(t,a,e)=>{e.r(a),e.d(a,{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,a=event.target.files;Array.prototype.forEach.call(a,(function(a,e){t.avatarUpdateFile=a,t.avatarUpdatePreview=URL.createObjectURL(a),t.avatarUpdateIndex=1}))},handleDrop:function(t){t.preventDefault();var a=this;if(t.dataTransfer.items){for(var e=0;e<t.dataTransfer.items.length;e++)if("file"===t.dataTransfer.items[e].kind){var s=t.dataTransfer.items[e].getAsFile();if(!s)return;a.avatarUpdateFile=s,a.avatarUpdatePreview=URL.createObjectURL(s),a.avatarUpdateIndex=1}}else for(e=0;e<t.dataTransfer.files.length;e++){if(!t.dataTransfer.files[e].hasOwnProperty("name"))return;a.avatarUpdateFile=t.dataTransfer.files[e],a.avatarUpdatePreview=URL.createObjectURL(t.dataTransfer.files[e]),a.avatarUpdateIndex=1}},confirmUpload:function(){var t=this;if(window.confirm("Are you sure you want to change your avatar photo?")){var a=new FormData;a.append("_method","PATCH"),a.append("avatar",this.avatarUpdateFile),axios.post("/api/v1/accounts/update_credentials",a).then((function(a){window._sharedData.user.avatar=a.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")}))}}}}},11188:(t,a,e)=>{e.r(a),e.d(a,{default:()=>l});var s=e(20629),r=e(76429);function i(t){return i="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},i(t)}function n(t,a){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable}))),e.push.apply(e,s)}return e}function o(t,a,e){return(a=function(t){var a=function(t,a){if("object"!==i(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,a||"default");if("object"!==i(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(t)}(t,"string");return"symbol"===i(a)?a:String(a)}(a))in t?Object.defineProperty(t,a,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[a]=e,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:"