2020-05-20 05:55:14 +00:00
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{786:function(e,t,a){"use strict";a.d(t,"a",(function(){return x}));var n=a(0),o=a(2),i=(a(9),a(6),a(8)),s=a(1),c=a(3),l=a.n(c),r=a(5),d=a.n(r),u=a(16),p=a.n(u),h=a(115),b=a(122),g=a(234),m=a(539),f=a(322),O=a(7),j=a(540),v=a(21),k=a(88),M=a(228),y=a(778),_=a(14),C=a.n(_),w=a(27),I=a(590);var x=function(e){Object(i.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return t=e.call.apply(e,[this].concat(n))||this,Object(s.a)(Object(o.a)(t),"state",{height:null}),Object(s.a)(Object(o.a)(t),"handleAccountClick",(function(e){0!==e.button||e.ctrlKey||e.metaKey||!t.context.router||(e.preventDefault(),t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]))),e.stopPropagation()})),Object(s.a)(Object(o.a)(t),"handleOpenVideo",(function(e,a){t.props.onOpenVideo(e,a)})),Object(s.a)(Object(o.a)(t),"handleExpandedToggle",(function(){t.props.onToggleHidden(t.props.status)})),Object(s.a)(Object(o.a)(t),"setRef",(function(e){t.node=e,t._measureHeight()})),Object(s.a)(Object(o.a)(t),"handleModalLink",(function(e){var t;e.preventDefault(),t="A"!==e.target.nodeName?e.target.parentNode.href:e.target.href,window.open(t,"mastodon-intent","width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes")})),t}var c=a.prototype;return c._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(y.a)((function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})})),this.props.onHeightChange&&e&&this.props.onHeightChange())},c.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},c.render=function(){var e=this.props.status&&this.props.status.get("reblog")?this.props.status.get("reblog"):this.props.status,t={boxSizing:"border-box"},a=this.props.compact;if(!e)return null;var o="",i="",s="",c="retweet",r="";if(this.props.measureHeight&&(t.height=this.state.height+"px"),e.get("media_attachments").size>0)if("audio"===e.getIn(["media_attachments",0,"type"])){var d=e.getIn(["media_attachments",0]);o=Object(n.a)(M.default,{src:d.get("url"),alt:d.get("description"),duration:d.getIn(["meta","original","duration"],0),height:110,preload:!0})}else if("video"===e.getIn(["media_attachments",0,"type"])){var u=e.getIn(["media_attachments",0]);o=Object(n.a)(k.default,{preview:u.get("preview_url"),blurhash:u.get("blurhash"),src:u.get("url"),alt:u.get("description"),width:300,height:150,inline:!0,onOpenVideo:this.handleOpenVideo,sensitive:e.get("sensitive"),visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility})}else o=Object(n.a)(m.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),height:300,onOpenMedia:this.props.onOpenMedia,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility});else 0===e.get("spoiler_text").length&&(o=Object(n.a)(j.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)}));return e.get("application")&&(i=Object(n.a)("span",{},void 0," ยท ",Object(n.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener noreferrer"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?c="envelope":"private"===e.get("visibility")&&(c="lock"),s=["private","direct"].includes(e.get("visibility"))?Object(n.a)(w.a,{id:c}):this.context.router?Object(n.a)(f.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(n.a)(w.a,{id:c}),Object(n.a)("span",{className:"detailed-status__reblogs"},void 0,Object(n.a)(I.a,{value:e.get("reblogs_count")}))):Object(n.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(n.a)(w.a,{id:c}),Object(n.a)("span",{className:"detailed-status__reblogs"},void 0,Object(n.a)(I.a,{value:e.get("reblogs_count")}))),r=this.context.router?Object(n.a)(f.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(n.a)(w.
|