pleroma/priv/static/packs/modals/report_modal.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2018-08-12 06:29:30 -07:00
webpackJsonp([21],{1007:function(e,t,n){"use strict";var a=n(9),o=n(1008),i=n(157),r=n(8),s=(n.n(r),function(e,t){var n=t.id;return{status:e.getIn(["statuses",n]),checked:e.getIn(["reports","new","status_ids"],Object(r.Set)()).includes(n)}}),c=function(e,t){var n=t.id;return{onToggle:function(t){e(Object(i.m)(n,t.target.checked))}}};t.a=Object(a.connect)(s,c)(o.a)},1008:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(2),o=n.n(a),i=n(1),r=n.n(i),s=n(3),c=n.n(s),l=n(4),d=n.n(l),u=n(0),h=n.n(u),f=n(867),p=n.n(f),v=n(1009),g=n.n(v),m=n(104),b=n(58),k=n(165),y=function(e){function t(){return r()(this,t),c()(this,e.apply(this,arguments))}return d()(t,e),t.prototype.render=function(){var e=this.props,t=e.status,n=e.checked,a=e.onToggle,i=e.disabled,r=null;if(t.get("reblog"))return null;if(t.get("media_attachments").size>0)if(t.get("media_attachments").some(function(e){return"unknown"===e.get("type")}));else if("video"===t.getIn(["media_attachments",0,"type"])){var s=t.getIn(["media_attachments",0]);r=o()(k.a,{fetchComponent:b.G,loading:this.renderLoadingVideoPlayer},void 0,function(e){return o()(e,{preview:s.get("preview_url"),src:s.get("url"),width:239,height:110,inline:!0,sensitive:t.get("sensitive"),onOpenVideo:g.a})})}else r=o()(k.a,{fetchComponent:b.w,loading:this.renderLoadingMediaGallery},void 0,function(e){return o()(e,{media:t.get("media_attachments"),sensitive:t.get("sensitive"),height:110,onOpenMedia:g.a})});return o()("div",{className:"status-check-box"},void 0,o()("div",{className:"status-check-box__status"},void 0,o()(m.a,{status:t}),r),o()("div",{className:"status-check-box-toggle"},void 0,o()(p.a,{checked:n,onChange:a,disabled:i})))},t}(h.a.PureComponent)},1009:function(e,t){function n(){}e.exports=n},836:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",function(){return X});var a,o,i,r,s=n(2),c=n.n(s),l=n(1),d=n.n(l),u=n(3),h=n.n(u),f=n(4),p=n.n(f),v=n(0),g=(n.n(v),n(9)),m=n(157),b=n(19),k=n(5),y=n.n(k),_=n(14),w=n.n(_),C=n(67),O=n(7),j=n(1007),M=n(8),S=(n.n(M),n(12)),T=n.n(S),x=n(100),E=n(867),N=n.n(E),P=n(23),I=Object(O.f)({close:{id:"lightbox.close",defaultMessage:"Close"},placeholder:{id:"report.placeholder",defaultMessage:"Additional comments"},submit:{id:"report.submit",defaultMessage:"Submit"}}),F=function(){var e=Object(C.c)();return function(t){var n=t.getIn(["reports","new","account_id"]);return{isSubmitting:t.getIn(["reports","new","isSubmitting"]),account:e(t,n),comment:t.getIn(["reports","new","comment"]),forward:t.getIn(["reports","new","forward"]),statusIds:Object(M.OrderedSet)(t.getIn(["timelines","account:"+n+":with_replies","items"])).union(t.getIn(["reports","new","status_ids"]))}}},X=(a=Object(g.connect)(F))(o=Object(O.g)((r=i=function(e){function t(){var n,a,o;d()(this,t);for(var i=arguments.length,r=Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=a=h()(this,e.call.apply(e,[this].concat(r))),a.handleCommentChange=function(e){a.props.dispatch(Object(m.i)(e.target.value))},a.handleForwardChange=function(e){a.props.dispatch(Object(m.j)(e.target.checked))},a.handleSubmit=function(){a.props.dispatch(Object(m.l)())},a.handleKeyDown=function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&a.handleSubmit()},o=n,h()(a,o)}return p()(t,e),t.prototype.componentDidMount=function(){this.props.dispatch(Object(b.l)(this.props.account.get("id"),{withReplies:!0}))},t.prototype.componentWillReceiveProps=function(e){this.props.account!==e.account&&e.account&&this.props.dispatch(Object(b.l)(e.account.get("id"),{withReplies:!0}))},t.prototype.render=function(){var e=this.props,t=e.account,n=e.comment,a=e.intl,o=e.statusIds,i=e.isSubmitting,r=e.forward,s=e.onClose;if(!t)return null;var l=t.get("acct").split("@")[1];return c()("div",{className:"modal-root__modal report-modal"},void 0,c()("div",{className:"report-modal__target"},void 0,c()(P.a,{className:"media-modal__close",title:a.formatMessage(I.close),icon:"times",onClick:s,size:16}),c()(O.b,{id:"report.target",defaultMessage:"Report {target}",values:{target:c()("strong",{},void 0,t.get("acct"))}})),
//# sourceMappingURL=report_modal.js.map