honkoma/priv/static/packs/features/glitch/async/directory.js

2 lines
9.4 KiB
JavaScript
Raw Normal View History

2020-02-29 05:41:13 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{822:function(e,t,a){"use strict";a.r(t);var o,n,c,i,s,r,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(734),_=a(732),M=a(249),w=a(200),y=a(4),k=a(18),C=a(14),I=a.n(C),N=a(103),L=a(91),E=a(93),R=a(210),P=a(98),q=a(39),A=a(16),F=a(417),S=a(22),T=a(42),U=a(119),B=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}"}}),D=(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.s?e(Object(T.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(B.unfollowConfirm),onConfirm:function(){return e(Object(S.S)(t.get("id")))}})):e(Object(S.S)(t.get("id"))):e(Object(S.M)(t.get("id")))},onBlock:function(t){t.getIn(["relationship","blocking"])?e(Object(S.R)(t.get("id"))):e(Object(S.z)(t.get("id")))},onMute:function(t){t.getIn(["relationship","muting"])?e(Object(S.T)(t.get("id"))):e(Object(U.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.m&&null!==a.get("relationship",null)){var n=a.getIn(["relationship","following"]),c=a.getIn(["relationship","requested"]),i=a.getIn(["relationship","blocking"]),s=a.getIn(["relationship","muting"]);c?e=Object(d.a)(q.a,{disabled:!0,icon:"hourglass",title:o.formatMessage(B.requested)}):i?e=Object(d.a)(q.a,{active:!0,icon:"unlock",title:o.formatMessage(B.unblock,{name:a.get("username")}),onClick:this.handleBlock}):s?e=Object(d.a)(q.a,{active:!0,icon:"volume-up",title:o.formatMessage(B.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?B.unfollow:B.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__ca
2020-01-22 15:00:23 +00:00
//# sourceMappingURL=directory.js.map