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

2 lines
27 KiB
JavaScript
Raw Normal View History

2020-02-29 05:41:13 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{760:function(e,t,a){"use strict";a.d(t,"a",(function(){return I}));var n=a(0),i=a(2),o=a(7),s=a(1),c=a(3),l=a.n(c),r=a(5),d=a.n(r),u=a(14),p=a.n(u),h=a(111),b=a(118),g=a(229),f=a(533),m=a(316),O=a(6),j=a(534),v=a(18),k=a(84),M=a(224),y=a(752),_=a(12),C=a.n(_),w=a(26),I=function(e){function t(){for(var t,a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return t=e.call.apply(e,[this].concat(n))||this,Object(s.a)(Object(i.a)(t),"state",{height:null}),Object(s.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(s.a)(Object(i.a)(t),"handleOpenVideo",(function(e,a){t.props.onOpenVideo(e,a)})),Object(s.a)(Object(i.a)(t),"handleExpandedToggle",(function(){t.props.onToggleHidden(t.props.status)})),Object(s.a)(Object(i.a)(t),"setRef",(function(e){t.node=e,t._measureHeight()})),Object(s.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(o.a)(t,e);var a=t.prototype;return a._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())},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="",o="",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]);i=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]);i=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 i=Object(n.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(n.a)(j.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)}));return e.get("application")&&(o=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"===e.get("visibility")?Object(n.a)(w.a,{id:c}):this.context.router?Object(n.a)(m.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)(O.c,{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)(O.c,{value:e.get("reblogs_count")}))),r=this.context.router?Object(n.a)(m.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(n.a)(w.a,{id:"star"}),Object(n.a)("span",{className:"detailed
//# sourceMappingURL=status.js.map