Pleroma/priv/static/packs/features/status.js

2 lines
23 KiB
JavaScript
Raw Normal View History

2020-01-22 16:00:23 +01:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{692:function(e,t,a){"use strict";a.d(t,"a",function(){return I});var s=a(0),i=a(2),n=a(7),o=a(1),c=a(3),l=a.n(c),r=a(5),d=a.n(r),u=a(18),p=a.n(u),h=a(107),b=a(116),g=a(223),f=a(529),O=a(310),m=a(6),j=a(530),v=a(19),M=a(84),y=a(290),_=a(683),C=a(10),k=a.n(C),w=a(27),I=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),n=0;n<a;n++)s[n]=arguments[n];return t=e.call.apply(e,[this].concat(s))||this,Object(o.a)(Object(i.a)(t),"state",{height:null}),Object(o.a)(Object(i.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(o.a)(Object(i.a)(t),"handleOpenVideo",function(e,a){t.props.onOpenVideo(e,a)}),Object(o.a)(Object(i.a)(t),"handleExpandedToggle",function(){t.props.onToggleHidden(t.props.status)}),Object(o.a)(Object(i.a)(t),"setRef",function(e){t.node=e,t._measureHeight()}),Object(o.a)(Object(i.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}Object(n.a)(t,e);var a=t.prototype;return a._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(_.a)(function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})}),this.props.onHeightChange&&e&&this.props.onHeightChange())},a.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},a.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 i="",n="",o="",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]);i=Object(s.a)(y.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]);i=Object(s.a)(M.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 i=Object(s.a)(f.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&&(i=Object(s.a)(j.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)}));return e.get("application")&&(n=Object(s.a)("span",{},void 0," · ",Object(s.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?c="envelope":"private"===e.get("visibility")&&(c="lock"),o="private"===e.get("visibility")?Object(s.a)(w.a,{id:c}):this.context.router?Object(s.a)(O.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(s.a)(w.a,{id:c}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(m.c,{value:e.get("reblogs_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(w.a,{id:c}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(m.c,{value:e.get("reblogs_count")}))),r=this.context.router?Object(s.a)(O.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(s.a)(w.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void
//# sourceMappingURL=status.js.map