distraction.party/priv/static/packs/features/status.js

2 lines
17 KiB
JavaScript
Raw Normal View History

2018-09-20 16:10:13 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{710:function(e,t,a){"use strict";a.r(t);var s,n,i,o,l,d,r,c,u,p=a(0),h=a.n(p),g=a(6),f=a.n(g),v=a(3),m=a.n(v),b=a(7),M=a.n(b),k=a(5),y=a.n(k),C=a(1),_=a.n(C),O=a(12),I=a(2),j=a.n(I),R=a(14),w=a.n(R),x=a(17),D=a.n(x),N=a(31),H=a(198),T=a(40),A=a(39),S=a(96),B=a(383),F=a(228),E=a(810),U=a(4),P=a(696),V=Object(O.connect)(function(e,t){var a=t.statusId;return{card:e.getIn(["cards",a],null)}})(P.a),q=a(18),z=a(78),K=(n=s=function(e){function t(){var a,s,n;f()(this,t);for(var i=arguments.length,o=Array(i),l=0;l<i;l++)o[l]=arguments[l];return a=s=m()(this,e.call.apply(e,[this].concat(o))),s.handleAccountClick=function(e){0!==e.button||e.ctrlKey||e.metaKey||(e.preventDefault(),s.context.router.history.push("/accounts/"+s.props.status.getIn(["account","id"]))),e.stopPropagation()},s.handleOpenVideo=function(e,t){s.props.onOpenVideo(e,t)},s.handleExpandedToggle=function(){s.props.onToggleHidden(s.props.status)},n=a,m()(s,n)}return M()(t,e),t.prototype.render=function(){var e=this.props.status.get("reblog")?this.props.status.get("reblog"):this.props.status,t="",a="",s="",n="retweet";if(e.get("media_attachments").size>0)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))t=h()(F.a,{media:e.get("media_attachments")});else if("video"===e.getIn(["media_attachments",0,"type"])){var i=e.getIn(["media_attachments",0]);t=h()(z.default,{preview:i.get("preview_url"),src:i.get("url"),alt:i.get("description"),width:300,height:150,inline:!0,onOpenVideo:this.handleOpenVideo,sensitive:e.get("sensitive")})}else t=h()(B.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&&(t=h()(V,{onOpenMedia:this.props.onOpenMedia,statusId:e.get("id")}));return e.get("application")&&(a=h()("span",{},void 0," · ",h()("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?n="envelope":"private"===e.get("visibility")&&(n="lock"),s="private"===e.get("visibility")?h()("i",{className:"fa fa-"+n}):h()(E.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,h()("i",{className:"fa fa-"+n}),h()("span",{className:"detailed-status__reblogs"},void 0,h()(U.c,{value:e.get("reblogs_count")}))),h()("div",{className:"detailed-status"},void 0,h()("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,h()("div",{className:"detailed-status__display-avatar"},void 0,h()(T.a,{account:e.get("account"),size:48})),h()(A.a,{account:e.get("account")})),h()(S.a,{status:e,expanded:!e.get("hidden"),onExpandedToggle:this.handleExpandedToggle}),t,h()("div",{className:"detailed-status__meta"},void 0,h()("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener"},void 0,h()(U.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),a," · ",s," · ",h()(E.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,h()("i",{className:"fa fa-star"}),h()("span",{className:"detailed-status__favorites"},void 0,h()(U.c,{value:e.get("favourites_count")})))))},t}(q.a),s.contextTypes={router:j.a.object},s.propTypes={status:D.a.map.isRequired,onOpenMedia:j.a.func.isRequired,onOpenVideo:j.a.func.isRequired,onToggleHidden:j.a.func.isRequired},n),J=a(20),W=a(97),L=a(10),G=Object(U.f)({delete:{id:"status.delete",defaultMessage:"Delete"},redraft:{id:"status.redraft",defaultMessage:"Delete & re-draft"},direct:{id:"status.direct",defaultMessage:"Direct message @{name}"},mention:{id:"status.mention",defaultMessage:"Mention @{name}"},reply:{id:"status.reply",defaultMessage:"Reply"},reblog:{id:"status.reblog",defaultMessage:"Boost"},reblog_private:{id:"status.reblog_private",defaultMessage:"Boost to original audience"},cancel_reblog_private:{id:"status.cancel_r
//# sourceMappingURL=status.js.map