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

2 lines
22 KiB
JavaScript
Raw Normal View History

2019-06-26 19:06:28 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{649:function(e,t,a){"use strict";a.d(t,"a",function(){return x});var r=a(0),i=a(2),s=a(6),o=a(1),n=a(3),d=a.n(n),c=a(5),l=a.n(c),u=a(26),p=a.n(u),h=a(194),b=a(195),g=a(209),f=a(496),O=a(502),m=a(358),j=a(7),v=a(497),M=a(25),y=a(132),k=a(642),_=a(12),C=a.n(_),R=a(30),w=a(503),x=function(n){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=n.call.apply(n,[this].concat(t))||this,Object(o.a)(Object(i.a)(a),"state",{height:null}),Object(o.a)(Object(i.a)(a),"handleAccountClick",function(e){0!==e.button||e.ctrlKey||e.metaKey||!a.context.router||(e.preventDefault(),a.context.router.history.push("/accounts/"+a.props.status.getIn(["account","id"]))),e.stopPropagation()}),Object(o.a)(Object(i.a)(a),"handleOpenVideo",function(e,t){a.props.onOpenVideo(e,t)}),Object(o.a)(Object(i.a)(a),"handleExpandedToggle",function(){a.props.onToggleHidden(a.props.status)}),Object(o.a)(Object(i.a)(a),"setRef",function(e){a.node=e,a._measureHeight()}),Object(o.a)(Object(i.a)(a),"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")}),a}Object(s.a)(e,n);var t=e.prototype;return t._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(k.a)(function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})}),this.props.onHeightChange&&e&&this.props.onHeightChange())},t.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},t.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 s="",n="",i="",o="retweet",c="";if(this.props.measureHeight&&(t.height=this.state.height+"px"),e.get("poll"))s=Object(r.a)(w.a,{pollId:e.get("poll")});else if(0<e.get("media_attachments").size)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))s=Object(r.a)(O.a,{media:e.get("media_attachments")});else if("video"===e.getIn(["media_attachments",0,"type"])){var l=e.getIn(["media_attachments",0]);s=Object(r.a)(y.default,{preview:l.get("preview_url"),src:l.get("url"),alt:l.get("description"),width:300,height:150,inline:!0,onOpenVideo:this.handleOpenVideo,sensitive:e.get("sensitive")})}else s=Object(r.a)(f.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),height:300,onOpenMedia:this.props.onOpenMedia});else 0===e.get("spoiler_text").length&&(s=Object(r.a)(v.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)}));return e.get("application")&&(n=Object(r.a)("span",{},void 0," · ",Object(r.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")?o="envelope":"private"===e.get("visibility")&&(o="lock"),i="private"===e.get("visibility")?Object(r.a)(R.a,{id:o}):this.context.router?Object(r.a)(m.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(r.a)(R.a,{id:o}),Object(r.a)("span",{className:"detailed-status__reblogs"},void 0,Object(r.a)(j.c,{value:e.get("reblogs_count")}))):Object(r.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(r.a)(R.a,{id:o}),Object(r.a)("span",{className:"detailed-status__reblogs"},void 0,Object(r.a)(j.c,{value:e.get("reblogs_count")}))),c=this.context.router?Object(r.a)(m.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(r.a)(R.a,{id:"star"}),Object(r.a)("span",{className:"detailed-status__favorites"},void 0,Object(r.a)(j.c,{value:e.get("favourites_count")}))):Object(r.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(r.a)(R.a,{id:"star"}
//# sourceMappingURL=status.js.map