pleroma/priv/static/packs/features/directory.js

2 lines
9.4 KiB
JavaScript
Raw Normal View History

2020-02-29 00:41:13 -05:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{829:function(e,t,a){"use strict";a.r(t);var o,n,c,i,r,s,l,d=a(0),u=a(2),b=a(7),m=a(1),j=a(3),f=a.n(j),g=a(13),h=a(6),p=a(5),O=a.n(p),v=a(736),_=a(733),M=a(250),w=a(203),y=a(4),k=a(18),C=a(14),I=a.n(C),N=a(206),L=a(111),E=a(118),R=a(294),P=a(104),q=a(50),A=a(20),F=a(418),T=a(25),U=a(47),B=a(208),D=Object(h.f)({follow:{id:"account.follow",defaultMessage:"Follow"},unfollow:{id:"account.unfollow",defaultMessage:"Unfollow"},requested:{id:"account.requested",defaultMessage:"Awaiting approval"},unblock:{id:"account.unblock",defaultMessage:"Unblock @{name}"},unmute:{id:"account.unmute",defaultMessage:"Unmute @{name}"}}),S=(o=Object(g.connect)((function(){var e=Object(N.d)();return function(t,a){var o=a.id;return{account:e(t,o)}}}),(function(e,t){var a=t.intl;return{onFollow:function(t){t.getIn(["relationship","following"])||t.getIn(["relationship","requested"])?A.v?e(Object(U.d)("CONFIRM",{message:Object(d.a)(h.b,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:Object(d.a)("strong",{},void 0,"@",t.get("acct"))}}),confirm:a.formatMessage(D.unfollowConfirm),onConfirm:function(){return e(Object(T.K)(t.get("id")))}})):e(Object(T.K)(t.get("id"))):e(Object(T.F)(t.get("id")))},onBlock:function(t){t.getIn(["relationship","blocking"])?e(Object(T.J)(t.get("id"))):e(Object(T.w)(t.get("id")))},onMute:function(t){t.getIn(["relationship","muting"])?e(Object(T.L)(t.get("id"))):e(Object(B.g)(t))}}})),Object(h.g)(n=o((i=c=function(e){function t(){for(var t,a=arguments.length,o=new Array(a),n=0;n<a;n++)o[n]=arguments[n];return t=e.call.apply(e,[this].concat(o))||this,Object(m.a)(Object(u.a)(t),"handleEmojiMouseEnter",(function(e){var t=e.target;t.src=t.getAttribute("data-original")})),Object(m.a)(Object(u.a)(t),"handleEmojiMouseLeave",(function(e){var t=e.target;t.src=t.getAttribute("data-static")})),Object(m.a)(Object(u.a)(t),"handleFollow",(function(){t.props.onFollow(t.props.account)})),Object(m.a)(Object(u.a)(t),"handleBlock",(function(){t.props.onBlock(t.props.account)})),Object(m.a)(Object(u.a)(t),"handleMute",(function(){t.props.onMute(t.props.account)})),Object(m.a)(Object(u.a)(t),"setRef",(function(e){t.node=e})),t}Object(b.a)(t,e);var a=t.prototype;return a._updateEmojis=function(){var e=this.node;if(e&&!A.a)for(var t=e.querySelectorAll(".custom-emoji"),a=0;a<t.length;a++){var o=t[a];o.classList.contains("status-emoji")||(o.classList.add("status-emoji"),o.addEventListener("mouseenter",this.handleEmojiMouseEnter,!1),o.addEventListener("mouseleave",this.handleEmojiMouseLeave,!1))}},a.componentDidMount=function(){this._updateEmojis()},a.componentDidUpdate=function(){this._updateEmojis()},a.render=function(){var e,t=this.props,a=t.account,o=t.intl;if(a.get("id")!==A.n&&null!==a.get("relationship",null)){var n=a.getIn(["relationship","following"]),c=a.getIn(["relationship","requested"]),i=a.getIn(["relationship","blocking"]),r=a.getIn(["relationship","muting"]);c?e=Object(d.a)(q.a,{disabled:!0,icon:"hourglass",title:o.formatMessage(D.requested)}):i?e=Object(d.a)(q.a,{active:!0,icon:"unlock",title:o.formatMessage(D.unblock,{name:a.get("username")}),onClick:this.handleBlock}):r?e=Object(d.a)(q.a,{active:!0,icon:"volume-up",title:o.formatMessage(D.unmute,{name:a.get("username")}),onClick:this.handleMute}):a.get("moved")&&!n||(e=Object(d.a)(q.a,{icon:n?"user-times":"user-plus",title:o.formatMessage(n?D.unfollow:D.follow),onClick:this.handleFollow,active:n}))}return Object(d.a)("div",{className:"directory__card"},void 0,Object(d.a)("div",{className:"directory__card__img"},void 0,Object(d.a)("img",{src:A.a?a.get("header"):a.get("header_static"),alt:""})),Object(d.a)("div",{className:"directory__card__bar"},void 0,Object(d.a)(R.a,{className:"directory__card__bar__name",href:a.get("url"),to:"/accounts/"+a.get("id")},void 0,Object(d.a)(L.a,{account:a,size:48}),Object(d.a)(E.a,{account:a})),Object(d.a)("div",{className:"directory__card__bar__relationship account__relationship"},void 0,e)),f.a.createElement("div",{className:"directory_
2020-01-22 10:00:23 -05:00
//# sourceMappingURL=directory.js.map