2 lines
No EOL
23 KiB
JavaScript
2 lines
No EOL
23 KiB
JavaScript
(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 0,Object(s.a)(m.c,{value:e.get("favourites_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(w.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void 0,Object(s.a)(m.c,{value:e.get("favourites_count")}))),Object(s.a)("div",{style:t},void 0,l.a.createElement("div",{ref:this.setRef,className:k()("detailed-status",{compact:a})},Object(s.a)("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,Object(s.a)("div",{className:"detailed-status__display-avatar"},void 0,Object(s.a)(h.a,{account:e.get("account"),size:48})),Object(s.a)(b.a,{account:e.get("account"),localDomain:this.props.domain})),Object(s.a)(g.a,{status:e,expanded:!e.get("hidden"),onExpandedToggle:this.handleExpandedToggle}),i,Object(s.a)("div",{className:"detailed-status__meta"},void 0,Object(s.a)("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener"},void 0,Object(s.a)(m.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),n," · ",o," · ",r)))},t}(v.a);Object(o.a)(I,"contextTypes",{router:d.a.object}),Object(o.a)(I,"propTypes",{status:p.a.map,onOpenMedia:d.a.func.isRequired,onOpenVideo:d.a.func.isRequired,onToggleHidden:d.a.func.isRequired,measureHeight:d.a.bool,onHeightChange:d.a.func,domain:d.a.string.isRequired,compact:d.a.bool,showMedia:d.a.bool,onToggleMediaVisibility:d.a.func})},767:function(e,t,a){"use strict";a.r(t);var s,i,n,o,c,l,r,d=a(0),u=a(2),p=a(7),h=a(1),b=a(4),g=a.n(b),f=a(3),O=a.n(f),m=a(12),j=a(5),v=a.n(j),M=a(10),y=a.n(M),_=a(18),C=a.n(_),k=a(53),w=a(93),I=a(970),x=a(692),R=a(51),H=a(637),D=a(6),T=a(20),N=Object(D.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_reblog_private",defaultMessage:"Unboost"},cannot_reblog:{id:"status.cannot_reblog",defaultMessage:"This post cannot be boosted"},favourite:{id:"status.favourite",defaultMessage:"Favourite"},mute:{id:"status.mute",defaultMessage:"Mute @{name}"},muteConversation:{id:"status.mute_conversation",defaultMessage:"Mute conversation"},unmuteConversation:{id:"status.unmute_conversation",defaultMessage:"Unmute conversation"},block:{id:"status.block",defaultMessage:"Block @{name}"},report:{id:"status.report",defaultMessage:"Report @{name}"},share:{id:"status.share",defaultMessage:"Share"},pin:{id:"status.pin",defaultMessage:"Pin on profile"},unpin:{id:"status.unpin",defaultMessage:"Unpin from profile"},embed:{id:"status.embed",defaultMessage:"Embed"},admin_account:{id:"status.admin_account",defaultMessage:"Open moderation interface for @{name}"},admin_status:{id:"status.admin_status",defaultMessage:"Open this status in the moderation interface"},copy:{id:"status.copy",defaultMessage:"Copy link to status"}}),S=Object(D.g)((n=i=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(h.a)(Object(u.a)(t),"handleReplyClick",function(){t.props.onReply(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleReblogClick",function(e){t.props.onReblog(t.props.status,e)}),Object(h.a)(Object(u.a)(t),"handleFavouriteClick",function(){t.props.onFavourite(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleDeleteClick",function(){t.props.onDelete(t.props.status,t.context.router.history)}),Object(h.a)(Object(u.a)(t),"handleRedraftClick",function(){t.props.onDelete(t.props.status,t.context.router.history,!0)}),Object(h.a)(Object(u.a)(t),"handleDirectClick",function(){t.props.onDirect(t.props.status.get("account"),t.context.router.history)}),Object(h.a)(Object(u.a)(t),"handleMentionClick",function(){t.props.onMention(t.props.status.get("account"),t.context.router.history)}),Object(h.a)(Object(u.a)(t),"handleMuteClick",function(){t.props.onMute(t.props.status.get("account"))}),Object(h.a)(Object(u.a)(t),"handleConversationMuteClick",function(){t.props.onMuteConversation(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleBlockClick",function(){t.props.onBlock(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleReport",function(){t.props.onReport(t.props.status)}),Object(h.a)(Object(u.a)(t),"handlePinClick",function(){t.props.onPin(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleShare",function(){navigator.share({text:t.props.status.get("search_index"),url:t.props.status.get("url")})}),Object(h.a)(Object(u.a)(t),"handleEmbed",function(){t.props.onEmbed(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleCopy",function(){var e=t.props.status.get("url"),a=document.createElement("textarea");a.textContent=e,a.style.position="fixed",document.body.appendChild(a);try{a.select(),document.execCommand("copy")}catch(e){}finally{document.body.removeChild(a)}}),t}return Object(p.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.status,a=e.intl,s=["public","unlisted"].includes(t.get("visibility")),i=t.get("muted"),n=[];s&&(n.push({text:a.formatMessage(N.copy),action:this.handleCopy}),n.push({text:a.formatMessage(N.embed),action:this.handleEmbed}),n.push(null)),T.m===t.getIn(["account","id"])?(s?n.push({text:a.formatMessage(t.get("pinned")?N.unpin:N.pin),action:this.handlePinClick}):"private"===t.get("visibility")&&n.push({text:a.formatMessage(t.get("reblogged")?N.cancel_reblog_private:N.reblog_private),action:this.handleReblogClick}),n.push(null),n.push({text:a.formatMessage(i?N.unmuteConversation:N.muteConversation),action:this.handleConversationMuteClick}),n.push(null),n.push({text:a.formatMessage(N.delete),action:this.handleDeleteClick}),n.push({text:a.formatMessage(N.redraft),action:this.handleRedraftClick})):(n.push({text:a.formatMessage(N.mention,{name:t.getIn(["account","username"])}),action:this.handleMentionClick}),n.push({text:a.formatMessage(N.direct,{name:t.getIn(["account","username"])}),action:this.handleDirectClick}),n.push(null),n.push({text:a.formatMessage(N.mute,{name:t.getIn(["account","username"])}),action:this.handleMuteClick}),n.push({text:a.formatMessage(N.block,{name:t.getIn(["account","username"])}),action:this.handleBlockClick}),n.push({text:a.formatMessage(N.report,{name:t.getIn(["account","username"])}),action:this.handleReport}),T.j&&(n.push(null),n.push({text:a.formatMessage(N.admin_account,{name:t.getIn(["account","username"])}),href:"/admin/accounts/"+t.getIn(["account","id"])}),n.push({text:a.formatMessage(N.admin_status),href:"/admin/accounts/"+t.getIn(["account","id"])+"/statuses/"+t.get("id")})));var o,c="share"in navigator&&"public"===t.get("visibility")&&Object(d.a)("div",{className:"detailed-status__button"},void 0,Object(d.a)(R.a,{title:a.formatMessage(N.share),icon:"share-alt",onClick:this.handleShare}));o=null===t.get("in_reply_to_id",null)?"reply":"reply-all";var l="retweet";"direct"===t.get("visibility")?l="envelope":"private"===t.get("visibility")&&(l="lock");var r="direct"===t.get("visibility")||"private"===t.get("visibility");return Object(d.a)("div",{className:"detailed-status__action-bar"},void 0,Object(d.a)("div",{className:"detailed-status__button"},void 0,Object(d.a)(R.a,{title:a.formatMessage(N.reply),icon:t.get("in_reply_to_account_id")===t.getIn(["account","id"])?"reply":o,onClick:this.handleReplyClick})),Object(d.a)("div",{className:"detailed-status__button"},void 0,Object(d.a)(R.a,{disabled:r,active:t.get("reblogged"),title:r?a.formatMessage(N.cannot_reblog):a.formatMessage(N.reblog),icon:l,onClick:this.handleReblogClick})),Object(d.a)("div",{className:"detailed-status__button"},void 0,Object(d.a)(R.a,{className:"star-icon",animate:!0,active:t.get("favourited"),title:a.formatMessage(N.favourite),icon:"star",onClick:this.handleFavouriteClick})),c,Object(d.a)("div",{className:"detailed-status__action-bar-dropdown"},void 0,Object(d.a)(H.a,{size:18,icon:"ellipsis-h",items:n,direction:"left",title:"More"})))},t}(O.a.PureComponent),Object(h.a)(i,"contextTypes",{router:v.a.object}),s=n))||s,V=a(663),A=a(66),E=a(21),F=a(206),B=a(220),U=a(99),z=a(204),P=a(460),q=a(666),L=a(665),K=a(993),J=a(47),W=a(19),X=a(287),G=a(252),Q=a(830),Y=a(27);a.d(t,"default",function(){return $});var Z=Object(D.f)({deleteConfirm:{id:"confirmations.delete.confirm",defaultMessage:"Delete"},deleteMessage:{id:"confirmations.delete.message",defaultMessage:"Are you sure you want to delete this status?"},redraftConfirm:{id:"confirmations.redraft.confirm",defaultMessage:"Delete & redraft"},redraftMessage:{id:"confirmations.redraft.message",defaultMessage:"Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned."},revealAll:{id:"status.show_more_all",defaultMessage:"Show more for all"},hideAll:{id:"status.show_less_all",defaultMessage:"Show less for all"},detailedStatus:{id:"status.detailed_status",defaultMessage:"Detailed conversation view"},replyConfirm:{id:"confirmations.reply.confirm",defaultMessage:"Reply"},replyMessage:{id:"confirmations.reply.message",defaultMessage:"Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?"}}),$=(o=Object(m.connect)(function(){var e=Object(z.f)(),t=Object(k.a)([function(e,t){return t.id},function(e){return e.getIn(["contexts","inReplyTos"])}],function(e,t){var a=g.a.List();return a=a.withMutations(function(a){for(var s=e;s;)a.unshift(s),s=t.get(s)})}),a=Object(k.a)([function(e,t){return t.id},function(e){return e.getIn(["contexts","replies"])},function(e){return e.get("statuses")}],function(e,t,a){for(var s=[],i=[e];i.length>0;){var n=i.shift(),o=t.get(n);e!==n&&s.push(n),o&&o.reverse().forEach(function(e){i.unshift(e)})}var c=s.findIndex(function(e){return a.get(e).get("in_reply_to_account_id")!==a.get(e).get("account")});return-1!==c&&s.forEach(function(e,t){t>c&&a.get(e).get("in_reply_to_account_id")===a.get(e).get("account")&&(s.splice(t,1),s.splice(c,0,e),c+=1)}),g.a.List(s)});return function(s,i){var n=e(s,{id:i.params.statusId}),o=g.a.List(),c=g.a.List();return n&&(o=t(s,{id:n.get("in_reply_to_id")}),c=a(s,{id:n.get("id")})),{status:n,ancestorsIds:o,descendantsIds:c,askReplyConfirmation:0!==s.getIn(["compose","text"]).trim().length,domain:s.getIn(["meta","domain"])}}}),Object(D.g)(c=o((r=l=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(h.a)(Object(u.a)(t),"state",{fullscreen:!1,showMedia:Object(Q.b)(t.props.status),loadedStatusId:void 0}),Object(h.a)(Object(u.a)(t),"handleToggleMediaVisibility",function(){t.setState({showMedia:!t.state.showMedia})}),Object(h.a)(Object(u.a)(t),"handleFavouriteClick",function(e){e.get("favourited")?t.props.dispatch(Object(A.p)(e)):t.props.dispatch(Object(A.k)(e))}),Object(h.a)(Object(u.a)(t),"handlePin",function(e){e.get("pinned")?t.props.dispatch(Object(A.q)(e)):t.props.dispatch(Object(A.n)(e))}),Object(h.a)(Object(u.a)(t),"handleReplyClick",function(e){var a=t.props,s=a.askReplyConfirmation,i=a.dispatch,n=a.intl;i(s?Object(J.d)("CONFIRM",{message:n.formatMessage(Z.replyMessage),confirm:n.formatMessage(Z.replyConfirm),onConfirm:function(){return i(Object(E.gb)(e,t.context.router.history))}}):Object(E.gb)(e,t.context.router.history))}),Object(h.a)(Object(u.a)(t),"handleModalReblog",function(e){t.props.dispatch(Object(A.o)(e))}),Object(h.a)(Object(u.a)(t),"handleReblogClick",function(e,a){e.get("reblogged")?t.props.dispatch(Object(A.r)(e)):a&&a.shiftKey||!T.b?t.handleModalReblog(e):t.props.dispatch(Object(J.d)("BOOST",{status:e,onReblog:t.handleModalReblog}))}),Object(h.a)(Object(u.a)(t),"handleDeleteClick",function(e,a,s){void 0===s&&(s=!1);var i=t.props,n=i.dispatch,o=i.intl;T.d?n(Object(J.d)("CONFIRM",{message:o.formatMessage(s?Z.redraftMessage:Z.deleteMessage),confirm:o.formatMessage(s?Z.redraftConfirm:Z.deleteConfirm),onConfirm:function(){return n(Object(w.g)(e.get("id"),a,s))}})):n(Object(w.g)(e.get("id"),a,s))}),Object(h.a)(Object(u.a)(t),"handleDirectClick",function(e,a){t.props.dispatch(Object(E.X)(e,a))}),Object(h.a)(Object(u.a)(t),"handleMentionClick",function(e,a){t.props.dispatch(Object(E.cb)(e,a))}),Object(h.a)(Object(u.a)(t),"handleOpenMedia",function(e,a){t.props.dispatch(Object(J.d)("MEDIA",{media:e,index:a}))}),Object(h.a)(Object(u.a)(t),"handleOpenVideo",function(e,a){t.props.dispatch(Object(J.d)("VIDEO",{media:e,time:a}))}),Object(h.a)(Object(u.a)(t),"handleMuteClick",function(e){t.props.dispatch(Object(F.g)(e))}),Object(h.a)(Object(u.a)(t),"handleConversationMuteClick",function(e){e.get("muted")?t.props.dispatch(Object(w.l)(e.get("id"))):t.props.dispatch(Object(w.j)(e.get("id")))}),Object(h.a)(Object(u.a)(t),"handleToggleHidden",function(e){e.get("hidden")?t.props.dispatch(Object(w.k)(e.get("id"))):t.props.dispatch(Object(w.i)(e.get("id")))}),Object(h.a)(Object(u.a)(t),"handleToggleAll",function(){var e=t.props,a=e.status,s=e.ancestorsIds,i=e.descendantsIds,n=[a.get("id")].concat(s.toJS(),i.toJS());a.get("hidden")?t.props.dispatch(Object(w.k)(n)):t.props.dispatch(Object(w.i)(n))}),Object(h.a)(Object(u.a)(t),"handleBlockClick",function(e){var a=t.props.dispatch,s=e.get("account");a(Object(B.f)(s))}),Object(h.a)(Object(u.a)(t),"handleReport",function(e){t.props.dispatch(Object(U.k)(e.get("account"),e))}),Object(h.a)(Object(u.a)(t),"handleEmbed",function(e){t.props.dispatch(Object(J.d)("EMBED",{url:e.get("url")}))}),Object(h.a)(Object(u.a)(t),"handleHotkeyMoveUp",function(){t.handleMoveUp(t.props.status.get("id"))}),Object(h.a)(Object(u.a)(t),"handleHotkeyMoveDown",function(){t.handleMoveDown(t.props.status.get("id"))}),Object(h.a)(Object(u.a)(t),"handleHotkeyReply",function(e){e.preventDefault(),t.handleReplyClick(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleHotkeyFavourite",function(){t.handleFavouriteClick(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleHotkeyBoost",function(){t.handleReblogClick(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleHotkeyMention",function(e){e.preventDefault(),t.handleMentionClick(t.props.status.get("account"))}),Object(h.a)(Object(u.a)(t),"handleHotkeyOpenProfile",function(){t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]))}),Object(h.a)(Object(u.a)(t),"handleHotkeyToggleHidden",function(){t.handleToggleHidden(t.props.status)}),Object(h.a)(Object(u.a)(t),"handleHotkeyToggleSensitive",function(){t.handleToggleMediaVisibility()}),Object(h.a)(Object(u.a)(t),"handleMoveUp",function(e){var a=t.props,s=a.status,i=a.ancestorsIds,n=a.descendantsIds;if(e===s.get("id"))t._selectChild(i.size-1,!0);else{var o=i.indexOf(e);-1===o?(o=n.indexOf(e),t._selectChild(i.size+o,!0)):t._selectChild(o-1,!0)}}),Object(h.a)(Object(u.a)(t),"handleMoveDown",function(e){var a=t.props,s=a.status,i=a.ancestorsIds,n=a.descendantsIds;if(e===s.get("id"))t._selectChild(i.size+1,!1);else{var o=i.indexOf(e);-1===o?(o=n.indexOf(e),t._selectChild(i.size+o+2,!1)):t._selectChild(o+1,!1)}}),Object(h.a)(Object(u.a)(t),"setRef",function(e){t.node=e}),Object(h.a)(Object(u.a)(t),"onFullScreenChange",function(){t.setState({fullscreen:Object(G.d)()})}),t}Object(p.a)(t,e);var a=t.prototype;return a.componentWillMount=function(){this.props.dispatch(Object(w.h)(this.props.params.statusId))},a.componentDidMount=function(){Object(G.a)(this.onFullScreenChange)},a.componentWillReceiveProps=function(e){e.params.statusId!==this.props.params.statusId&&e.params.statusId&&(this._scrolledIntoView=!1,this.props.dispatch(Object(w.h)(e.params.statusId))),e.status&&e.status.get("id")!==this.state.loadedStatusId&&this.setState({showMedia:Object(Q.b)(e.status),loadedStatusId:e.status.get("id")})},a._selectChild=function(e,t){var a=this.node,s=a.querySelectorAll(".focusable")[e];s&&(t&&a.scrollTop>s.offsetTop?s.scrollIntoView(!0):!t&&a.scrollTop+a.clientHeight<s.offsetTop+s.offsetHeight&&s.scrollIntoView(!1),s.focus())},a.renderChildren=function(e){var t=this;return e.map(function(e){return Object(d.a)(K.a,{id:e,onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown,contextType:"thread"},e)})},a.componentDidUpdate=function(){if(!this._scrolledIntoView){var e=this.props,t=e.status,a=e.ancestorsIds;if(t&&a&&a.size>0){var s=this.node.querySelectorAll(".focusable")[a.size-1];window.requestAnimationFrame(function(){s.scrollIntoView(!0)}),this._scrolledIntoView=!0}}},a.componentWillUnmount=function(){Object(G.b)(this.onFullScreenChange)},a.render=function(){var e,t,a=this.props,s=a.shouldUpdateScroll,i=a.status,n=a.ancestorsIds,o=a.descendantsIds,c=a.intl,l=a.domain,r=a.multiColumn,u=this.state.fullscreen;if(null===i)return Object(d.a)(V.a,{},void 0,Object(d.a)(q.a,{multiColumn:r}),Object(d.a)(I.a,{}));n&&n.size>0&&(e=Object(d.a)("div",{},void 0,this.renderChildren(n))),o&&o.size>0&&(t=Object(d.a)("div",{},void 0,this.renderChildren(o)));var p={moveUp:this.handleHotkeyMoveUp,moveDown:this.handleHotkeyMoveDown,reply:this.handleHotkeyReply,favourite:this.handleHotkeyFavourite,boost:this.handleHotkeyBoost,mention:this.handleHotkeyMention,openProfile:this.handleHotkeyOpenProfile,toggleHidden:this.handleHotkeyToggleHidden,toggleSensitive:this.handleHotkeyToggleSensitive};return Object(d.a)(V.a,{bindToDocument:!r,label:c.formatMessage(Z.detailedStatus)},void 0,Object(d.a)(L.a,{showBackButton:!0,multiColumn:r,extraButton:Object(d.a)("button",{className:"column-header__button",title:c.formatMessage(i.get("hidden")?Z.revealAll:Z.hideAll),"aria-label":c.formatMessage(i.get("hidden")?Z.revealAll:Z.hideAll),onClick:this.handleToggleAll,"aria-pressed":i.get("hidden")?"false":"true"},void 0,Object(d.a)(Y.a,{id:i.get("hidden")?"eye-slash":"eye"}))}),Object(d.a)(P.a,{scrollKey:"thread",shouldUpdateScroll:s},void 0,O.a.createElement("div",{className:y()("scrollable",{fullscreen:u}),ref:this.setRef},e,Object(d.a)(X.HotKeys,{handlers:p},void 0,Object(d.a)("div",{className:y()("focusable","detailed-status__wrapper"),tabIndex:"0","aria-label":Object(Q.c)(c,i,!1)},void 0,Object(d.a)(x.a,{status:i,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,onToggleHidden:this.handleToggleHidden,domain:l,showMedia:this.state.showMedia,onToggleMediaVisibility:this.handleToggleMediaVisibility}),Object(d.a)(S,{status:i,onReply:this.handleReplyClick,onFavourite:this.handleFavouriteClick,onReblog:this.handleReblogClick,onDelete:this.handleDeleteClick,onDirect:this.handleDirectClick,onMention:this.handleMentionClick,onMute:this.handleMuteClick,onMuteConversation:this.handleConversationMuteClick,onBlock:this.handleBlockClick,onReport:this.handleReport,onPin:this.handlePin,onEmbed:this.handleEmbed}))),t)))},t}(W.a),Object(h.a)(l,"contextTypes",{router:v.a.object}),Object(h.a)(l,"propTypes",{params:v.a.object.isRequired,dispatch:v.a.func.isRequired,status:C.a.map,ancestorsIds:C.a.list,descendantsIds:C.a.list,intl:v.a.object.isRequired,askReplyConfirmation:v.a.bool,multiColumn:v.a.bool,domain:v.a.string.isRequired}),c=r))||c)||c)}}]);
|
|
//# sourceMappingURL=status.js.map
|