pixelfed/public/js/profile.js

1 line
28 KiB
JavaScript
Raw Normal View History

2019-03-04 05:21:23 +00:00
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(o,a,function(e){return t[e]}.bind(null,a));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=4)}({"2wtg":function(t,e,n){Vue.component("profile",n("EHjT").default)},4:function(t,e,n){t.exports=n("2wtg")},"6+gp":function(t,e,n){var o=n("A1UF");"string"==typeof o&&(o=[[t.i,o,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(o,a);o.locals&&(t.exports=o.locals)},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var a,s=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(s)?t:(a=0===s.indexOf("//")?s:0===s.indexOf("/")?n+s:o+s.replace(/^\.\//,""),"url("+JSON.stringify(a)+")")})}},A1UF:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.o-square[data-v-1c73d9ce] {\n\tmax-width: 320px;\n}\n.o-portrait[data-v-1c73d9ce] {\n\tmax-width: 320px;\n}\n.o-landscape[data-v-1c73d9ce] {\n\tmax-width: 320px;\n}\n.post-icon[data-v-1c73d9ce] {\n\tcolor: #fff;\n\tposition:relative;\n\tmargin-top: 10px;\n\tz-index: 9;\n\topacity: 0.6;\n\ttext-shadow: 3px 3px 16px #272634;\n}\n",""])},EHjT:function(t,e,n){"use strict";n.r(e);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a={props:["profile-id"],data:function(){return{profile:{},user:{},timeline:[],timelinePage:2,min_id:0,max_id:0,loading:!0,owner:!1,mode:"grid",modes:["grid","list","masonry"],modalStatus:!1,relationship:{},followers:[],followerCursor:1,followerMore:!0,following:[],followingCursor:1,followingMore:!0}},beforeMount:function(){this.fetchProfile()},mounted:function(){},updated:function(){},methods:{fetchProfile:function(){var t=this;axios.get("/api/v1/accounts/"+this.profileId).then(function(e){t.profile=e.data}),axios.get("/api/v1/accounts/verify_credentials").then(function(e){t.user=e.data}),axios.get("/api/v1/accounts/relationships",{params:{"id[]":this.profileId}}).then(function(e){t.relationship=e.data[0]});var e="/api/v1/accounts/"+this.profileId+"/statuses";axios.get(e,{params:{only_media:!0,min_id:1}}).then(function(e){var n=e.data;t.timeline=n;var a=n.map(function(t){return t.id});t.min_id=Math.max.apply(Math,o(a)),t.max_id=Math.min.apply(Math,o(a)),t.modalStatus=_.first(e.data),t.loading=!1,t.ownerCheck()}).catch(function(t){swal("Oops, something went wrong","Please release the page.","error")})},ownerCheck:function(){this.owner=this.profile.id===this.user.id},infiniteTimeline:function(t){var e=this,n="/api/v1/accounts/"+this.profileId+"/statuses";axios.get(n,{params:{only_media:!0,max_id:this.max_id}}).then(function(n){if(n.data.length&&0==e.loading){var a,s=n.data;(a=e.timeline).push.apply(a,o(s));var i=s.map(function(t){return t.id});e.max_id=Math.min.apply(Math,o(i))