pleroma/priv/static/packs/flavours/glitch/async/status.js

2 lines
27 KiB
JavaScript
Raw Normal View History

2020-01-22 07:00:23 -08:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{689:function(e,t,a){"use strict";a.d(t,"a",function(){return B});var s=a(0),n=a(13),o=a(2),i=a(7),c=a(1),r=a(3),l=a.n(r),d=a(5),u=a.n(d),p=a(18),h=a.n(p),b=a(92),g=a(94),f=a(150),m=a(464),O=a(256),j=a(310),v=a(6),k=a(465),y=a(19),M=a(83),_=a(289),C=a(531),x=a(677),I=a(10),w=a.n(I),R=a(533),D=a(25),B=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return t=e.call.apply(e,[this].concat(s))||this,Object(c.a)(Object(o.a)(t),"state",{height:null}),Object(c.a)(Object(o.a)(t),"handleAccountClick",function(e){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&t.context.router){e.preventDefault();var a=Object(n.default)({},t.context.router.history.location.state);a.mastodonBackSteps=(a.mastodonBackSteps||0)+1,t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]),a)}e.stopPropagation()}),Object(c.a)(Object(o.a)(t),"parseClick",function(e,a){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&t.context.router){e.preventDefault();var s=Object(n.default)({},t.context.router.history.location.state);s.mastodonBackSteps=(s.mastodonBackSteps||0)+1,t.context.router.history.push(a,s)}e.stopPropagation()}),Object(c.a)(Object(o.a)(t),"handleOpenVideo",function(e,a){t.props.onOpenVideo(e,a)}),Object(c.a)(Object(o.a)(t),"setRef",function(e){t.node=e,t._measureHeight()}),Object(c.a)(Object(o.a)(t),"handleChildUpdate",function(){t._measureHeight()}),Object(c.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}Object(i.a)(t,e);var a=t.prototype;return a._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(x.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=this.props,a=t.expanded,n=t.onToggleHidden,o=t.settings,i={boxSizing:"border-box"},c=this.props.compact;if(!e)return null;var r=null,d=null,u="",p="",h="retweet",y="";if(this.props.measureHeight&&(i.height=this.state.height+"px"),e.get("poll"))r=Object(s.a)(R.a,{pollId:e.get("poll")}),d="tasks";else if(e.get("media_attachments").size>0)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))r=Object(s.a)(O.a,{media:e.get("media_attachments")});else if("audio"===e.getIn(["media_attachments",0,"type"])){var x=e.getIn(["media_attachments",0]);r=Object(s.a)(_.default,{src:x.get("url"),alt:x.get("description"),duration:x.getIn(["meta","original","duration"],0),height:110,preload:!0}),d="music"}else if("video"===e.getIn(["media_attachments",0,"type"])){var I=e.getIn(["media_attachments",0]);r=Object(s.a)(M.default,{preview:I.get("preview_url"),blurhash:I.get("blurhash"),src:I.get("url"),alt:I.get("description"),inline:!0,sensitive:e.get("sensitive"),letterbox:o.getIn(["media","letterbox"]),fullwidth:o.getIn(["media","fullwidth"]),preventPlayback:!a,onOpenVideo:this.handleOpenVideo,autoplay:!0,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="video-camera"}else r=Object(s.a)(m.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),letterbox:o.getIn(["media","letterbox"]),fullwidth:o.getIn(["media","fullwidth"]),hidden:!a,onOpenMedia:this.props.onOpenMedia,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="picture-o";else e.get("card")&&(r=Object(s.a)(k.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card")}),d="link");return e.get("application")&&(u=Object(s.a)("span",{},void 0," · ",Object(s.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener"
2018-09-16 14:17:34 -07:00
//# sourceMappingURL=status.js.map