spc-pleroma/priv/static/packs/flavours/glitch/async/account_gallery.js

2 lines
4.9 KiB
JavaScript
Raw Normal View History

2019-06-26 19:06:28 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{718:function(a,e,t){"use strict";t.r(e);var l=t(0),n=t(2),o=t(6),s=t(1),c=t(3),i=t.n(c),r=t(21),d=t(26),p=t.n(d),u=t(5),b=t.n(u),h=t(23),m=t(34),O=t(271),j=t(625),f=t(913),g=t(25),v=t(191),I=t(317),y=t(29),_=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(s.a)(Object(n.a)(a),"state",{visible:"hide_all"!==y.f&&!a.props.media.getIn(["status","sensitive"])||"show_all"===y.f}),Object(s.a)(Object(n.a)(a),"handleClick",function(){return!a.state.visible&&(a.setState({visible:!0}),!0)}),a}return Object(o.a)(a,c),a.prototype.render=function(){var a,e,t,o=this.props.media,c=this.state.visible,n=o.get("status"),s=100*(o.getIn(["meta","focus","x"])/2+.5),i=100*(o.getIn(["meta","focus","y"])/-2+.5),r={};return"gifv"===o.get("type")&&(a=Object(l.a)("span",{className:"media-gallery__gifv__label"},void 0,"GIF")),t=c?(r.backgroundImage="url("+o.get("preview_url")+")",r.backgroundPosition=s+"% "+i+"%",o.get("description")):(e=Object(l.a)("span",{className:"account-gallery__item__icons"},void 0,Object(l.a)("i",{className:"fa fa-eye-slash"})),n.get("spoiler_text")||o.get("description")),Object(l.a)("div",{className:"account-gallery__item"},void 0,Object(l.a)(I.a,{to:"/statuses/"+n.get("id"),href:n.get("url"),style:r,title:t,onInterceptClick:this.handleClick},void 0,e,a))},a}(g.a);Object(s.a)(_,"propTypes",{media:p.a.map.isRequired});var M,L,k,w=t(916),S=t(427),C=t(912),R=t(896);t.d(e,"default",function(){return x});var T=function(c){function a(){for(var a,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return a=c.call.apply(c,[this].concat(t))||this,Object(s.a)(Object(n.a)(a),"handleLoadMore",function(){a.props.onLoadMore(a.props.maxId)}),a}return Object(o.a)(a,c),a.prototype.render=function(){return Object(l.a)(C.a,{disabled:this.props.disabled,onClick:this.handleLoadMore})},a}(g.a);Object(s.a)(T,"propTypes",{maxId:b.a.string,onLoadMore:b.a.func.isRequired});var x=Object(r.connect)(function(a,e){return{isAccount:!!a.getIn(["accounts",e.params.accountId]),medias:Object(v.a)(a,e.params.accountId),isLoading:a.getIn(["timelines","account:"+e.params.accountId+":media","isLoading"]),hasMore:a.getIn(["timelines","account:"+e.params.accountId+":media","hasMore"])}})((k=L=function(c){function a(){for(var o,a=arguments.length,e=new Array(a),t=0;t<a;t++)e[t]=arguments[t];return o=c.call.apply(c,[this].concat(e))||this,Object(s.a)(Object(n.a)(o),"handleHeaderClick",function(){o.column.scrollTop()}),Object(s.a)(Object(n.a)(o),"handleScrollToBottom",function(){o.props.hasMore&&o.handleLoadMore(0<o.props.medias.size?o.props.medias.last().getIn(["status","id"]):void 0)}),Object(s.a)(Object(n.a)(o),"handleScroll",function(a){var e=a.target,t=e.scrollTop;e.scrollHeight-t-e.clientHeight<150&&!o.props.isLoading&&o.handleScrollToBottom()}),Object(s.a)(Object(n.a)(o),"handleLoadMore",function(a){o.props.dispatch(Object(m.o)(o.props.params.accountId,{maxId:a}))}),Object(s.a)(Object(n.a)(o),"handleLoadOlder",function(a){a.preventDefault(),o.handleScrollToBottom()}),Object(s.a)(Object(n.a)(o),"shouldUpdateScroll",function(a,e){var t=e.location;return!(((a||{}).location||{}).state||{}).mastodonModalOpen&&!(t.state&&t.state.mastodonModalOpen)}),Object(s.a)(Object(n.a)(o),"setRef",function(a){o.column=a}),o}Object(o.a)(a,c);var e=a.prototype;return e.componentDidMount=function(){this.props.dispatch(Object(h.F)(this.props.params.accountId)),this.props.dispatch(Object(m.o)(this.props.params.accountId))},e.componentWillReceiveProps=function(a){a.params.accountId!==this.props.params.accountId&&a.params.accountId&&(this.props.dispatch(Object(h.F)(a.params.accountId)),this.props.dispatch(Object(m.o)(this.props.params.accountId)))},e.render=function(){var t=this,a=this.props,o=a.medias,e=a.isLoading,c=a.hasMore;if(!a.isAccount)return Object(l.a)(j.a,{},void 0,Object(l.a)(R.a,{}));var n=null;return!o&&e?Object(l.a)(j.a,{},void 0,Object(l.a)(O.a,{})):(!c||e&&0===o.size||(n=Object(l.a)(C.a,{visible:
2018-09-16 21:17:34 +00:00
//# sourceMappingURL=account_gallery.js.map