akkoma/priv/static/packs/features/domain_blocks.js
2018-06-02 16:11:38 +02:00

2 lines
15 KiB
JavaScript

webpackJsonp([12],{1013:function(t,n,e){"use strict";var o=e(2),i=e.n(o),r=e(1014),a=e.n(r),s=e(0),c=(e.n(s),e(9)),l=e(158),u=e(7),d=e(1015),h=e(26),p=Object(u.f)({blockDomainConfirm:{id:"confirmations.domain_block.confirm",defaultMessage:"Hide entire domain"}}),f=function(){return function(t,n){return a()(n),{}}},b=function(t,n){var e=n.intl;return{onBlockDomain:function(n){t(Object(h.d)("CONFIRM",{message:i()(u.b,{id:"confirmations.domain_block.message",defaultMessage:"Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable.",values:{domain:i()("strong",{},void 0,n)}}),confirm:e.formatMessage(p.blockDomainConfirm),onConfirm:function(){return t(Object(l.e)(n))}}))},onUnblockDomain:function(n){t(Object(l.h)(n))}}};n.a=Object(u.g)(Object(c.connect)(f,b)(d.a))},1014:function(t,n,e){"use strict";n.__esModule=!0,n.default=function(t){if(null==t)throw new TypeError("Cannot destructure undefined")}},1015:function(t,n,e){"use strict";e.d(n,"a",function(){return O});var o,i,r,a=e(2),s=e.n(a),c=e(1),l=e.n(c),u=e(3),d=e.n(u),h=e(4),p=e.n(h),f=e(0),b=(e.n(f),e(5)),v=e.n(b),m=e(23),g=e(7),y=e(12),k=e.n(y),C=Object(g.f)({unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),O=Object(g.g)((r=i=function(t){function n(){var e,o,i;l()(this,n);for(var r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];return e=o=d()(this,t.call.apply(t,[this].concat(a))),o.handleDomainUnblock=function(){o.props.onUnblockDomain(o.props.domain)},i=e,d()(o,i)}return p()(n,t),n.prototype.render=function(){var t=this.props,n=t.domain,e=t.intl;return s()("div",{className:"domain"},void 0,s()("div",{className:"domain__wrapper"},void 0,s()("span",{className:"domain__domain-name"},void 0,s()("strong",{},void 0,n)),s()("div",{className:"domain__buttons"},void 0,s()(m.a,{active:!0,icon:"unlock-alt",title:e.formatMessage(C.unblockDomain,{domain:n}),onClick:this.handleDomainUnblock}))))},n}(k.a),i.propTypes={domain:v.a.string,onUnblockDomain:v.a.func.isRequired,intl:v.a.object.isRequired},o=r))||o},153:function(t,n,e){"use strict";e.d(n,"a",function(){return b});var o=e(2),i=e.n(o),r=e(1),a=e.n(r),s=e(3),c=e.n(s),l=e(4),u=e.n(l),d=e(0),h=e.n(d),p=e(10),f=e.n(p),b=function(t){function n(){var e,o,i;a()(this,n);for(var r=arguments.length,s=Array(r),l=0;l<r;l++)s[l]=arguments[l];return e=o=c()(this,t.call.apply(t,[this].concat(s))),o.handleClick=function(){o.props.onClick()},i=e,c()(o,i)}return u()(n,t),n.prototype.render=function(){var t=this.props,n=t.icon,e=t.type,o=t.active,r=t.columnHeaderId,a="";return n&&(a=i()("i",{className:"fa fa-fw fa-"+n+" column-header__icon"})),i()("h1",{className:f()("column-header",{active:o}),id:r||null},void 0,i()("button",{onClick:this.handleClick},void 0,a,e))},n}(h.a.PureComponent)},283:function(t,n,e){"use strict";e.d(n,"a",function(){return g});var o=e(2),i=e.n(o),r=e(1),a=e.n(r),s=e(3),c=e.n(s),l=e(4),u=e.n(l),d=e(32),h=e.n(d),p=e(0),f=e.n(p),b=e(153),v=e(90),m=e(43),g=function(t){function n(){var e,o,i;a()(this,n);for(var r=arguments.length,s=Array(r),l=0;l<r;l++)s[l]=arguments[l];return e=o=c()(this,t.call.apply(t,[this].concat(s))),o.handleHeaderClick=function(){var t=o.node.querySelector(".scrollable");t&&(o._interruptScrollAnimation=Object(v.b)(t))},o.handleScroll=h()(function(){void 0!==o._interruptScrollAnimation&&o._interruptScrollAnimation()},200),o.setRef=function(t){o.node=t},i=e,c()(o,i)}return u()(n,t),n.prototype.scrollTop=function(){var t=this.node.querySelector(".scrollable");t&&(this._interruptScrollAnimation=Object(v.b)(t))},n.prototype.render=function(){var t=this.props,n=t.heading,e=t.icon,o=t.children,r=t.active,a=t.hideHeadingOnMobile,s=n&&(!a||a&&!Object(m.b)(window.innerWidth)),c=s&&n.replace(/ /g,"-"),l=s&&i()(b.a,{icon:e,active:r,type:n,onClick:this.handleHeaderClick,columnHeaderId:c});return f.a.createElement("div",{ref:this.setRef,role:"region","aria-labelledby":c,className:"column",onScroll:this.handleScroll},l,o)},n}(f.a.PureComponent)},284:function(t,n,e){"use strict";e.d(n,"a",function(){return v});var o,i,r=e(2),a=e.n(r),s=e(1),c=e.n(s),l=e(3),u=e.n(l),d=e(4),h=e.n(d),p=e(0),f=e.n(p),b=e(7),v=(i=o=function(t){function n(){return c()(this,n),u()(this,t.apply(this,arguments))}return h()(n,t),n.prototype.render=function(){var t=this.props,n=t.disabled,e=t.visible;return a()("button",{className:"load-more",disabled:n||!e,style:{visibility:e?"visible":"hidden"},onClick:this.props.onClick},void 0,a()(b.b,{id:"status.load_more",defaultMessage:"Load more"}))},n}(f.a.PureComponent),o.defaultProps={visible:!0},i)},285:function(t,n,e){"use strict";e.d(n,"a",function(){return g});var o,i,r=e(2),a=e.n(r),s=e(1),c=e.n(s),l=e(3),u=e.n(l),d=e(4),h=e.n(d),p=e(0),f=e.n(p),b=e(7),v=e(5),m=e.n(v),g=(i=o=function(t){function n(){var e,o,i;c()(this,n);for(var r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];return e=o=u()(this,t.call.apply(t,[this].concat(a))),o.handleClick=function(){window.history&&1===window.history.length?o.context.router.history.push("/"):o.context.router.history.goBack()},i=e,u()(o,i)}return h()(n,t),n.prototype.render=function(){return a()("button",{onClick:this.handleClick,className:"column-back-button"},void 0,a()("i",{className:"fa fa-fw fa-chevron-left column-back-button__icon"}),a()(b.b,{id:"column_back_button.label",defaultMessage:"Back"}))},n}(f.a.PureComponent),o.contextTypes={router:m.a.object},i)},287:function(t,n,e){"use strict";e.d(n,"a",function(){return j});var o,i,r=e(2),a=e.n(r),s=e(1),c=e.n(s),l=e(3),u=e.n(l),d=e(4),h=e.n(d),p=e(93),f=e.n(p),b=e(0),v=e.n(b),m=e(154),g=e(5),y=e.n(g),k=e(288),C=e(284),O=e(293),S=e(8),M=(e.n(S),e(10)),_=e.n(M),I=e(157),j=(i=o=function(t){function n(){var e,o,i;c()(this,n);for(var r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];return e=o=u()(this,t.call.apply(t,[this].concat(a))),o.state={fullscreen:null},o.intersectionObserverWrapper=new O.a,o.handleScroll=f()(function(){if(o.node){var t=o.node,n=t.scrollTop;400>t.scrollHeight-n-t.clientHeight&&o.props.onLoadMore&&!o.props.isLoading&&o.props.onLoadMore(),n<100&&o.props.onScrollToTop?o.props.onScrollToTop():o.props.onScroll&&o.props.onScroll()}},150,{trailing:!0}),o.onFullScreenChange=function(){o.setState({fullscreen:Object(I.d)()})},o.setRef=function(t){o.node=t},o.handleLoadMore=function(t){t.preventDefault(),o.props.onLoadMore()},i=e,u()(o,i)}return h()(n,t),n.prototype.componentDidMount=function(){this.attachScrollListener(),this.attachIntersectionObserver(),Object(I.a)(this.onFullScreenChange),this.handleScroll()},n.prototype.getSnapshotBeforeUpdate=function(t){return v.a.Children.count(t.children)>0&&v.a.Children.count(t.children)<v.a.Children.count(this.props.children)&&this.getFirstChildKey(t)!==this.getFirstChildKey(this.props)&&this.node.scrollTop>0?this.node.scrollHeight-this.node.scrollTop:null},n.prototype.componentDidUpdate=function(t,n,e){if(null!==e){var o=this.node.scrollHeight-e;this.node.scrollTop!==o&&(this.node.scrollTop=o)}},n.prototype.componentWillUnmount=function(){this.detachScrollListener(),this.detachIntersectionObserver(),Object(I.b)(this.onFullScreenChange)},n.prototype.attachIntersectionObserver=function(){this.intersectionObserverWrapper.connect({root:this.node,rootMargin:"300% 0px"})},n.prototype.detachIntersectionObserver=function(){this.intersectionObserverWrapper.disconnect()},n.prototype.attachScrollListener=function(){this.node.addEventListener("scroll",this.handleScroll)},n.prototype.detachScrollListener=function(){this.node.removeEventListener("scroll",this.handleScroll)},n.prototype.getFirstChildKey=function(t){var n=t.children,e=n;return n instanceof S.List?e=n.get(0):Array.isArray(n)&&(e=n[0]),e&&e.key},n.prototype.render=function(){var t=this,n=this.props,e=n.children,o=n.scrollKey,i=n.trackScroll,r=n.shouldUpdateScroll,s=n.isLoading,c=n.hasMore,l=n.prepend,u=n.emptyMessage,d=n.onLoadMore,h=this.state.fullscreen,p=v.a.Children.count(e),f=c&&p>0&&d?a()(C.a,{visible:!s,onClick:this.handleLoadMore}):null,b=null;return b=s||p>0||!u?v.a.createElement("div",{className:_()("scrollable",{fullscreen:h}),ref:this.setRef},a()("div",{role:"feed",className:"item-list"},void 0,l,v.a.Children.map(this.props.children,function(n,e){return a()(k.a,{id:n.key,index:e,listLength:p,intersectionObserverWrapper:t.intersectionObserverWrapper,saveHeightKey:i?t.context.router.route.location.key+":"+o:null},n.key,n)}),f)):v.a.createElement("div",{className:"empty-column-indicator",ref:this.setRef},u),i?a()(m.a,{scrollKey:o,shouldUpdateScroll:r},void 0,b):b},n}(b.PureComponent),o.contextTypes={router:y.a.object},o.defaultProps={trackScroll:!0},i)},288:function(t,n,e){"use strict";var o=e(9),i=e(289),r=e(94),a=function(t,n){return{cachedHeight:t.getIn(["height_cache",n.saveHeightKey,n.id])}},s=function(t){return{onHeightChange:function(n,e,o){t(Object(r.d)(n,e,o))}}};n.a=Object(o.connect)(a,s)(i.a)},289:function(t,n,e){"use strict";e.d(n,"a",function(){return v});var o=e(1),i=e.n(o),r=e(3),a=e.n(r),s=e(4),c=e.n(s),l=e(0),u=e.n(l),d=e(290),h=e(292),p=e(8),f=(e.n(p),["id","index","listLength"]),b=["id","index","listLength","cachedHeight"],v=function(t){function n(){var e,o,r;i()(this,n);for(var s=arguments.length,c=Array(s),l=0;l<s;l++)c[l]=arguments[l];return e=o=a()(this,t.call.apply(t,[this].concat(c))),o.state={isHidden:!1},o.handleIntersection=function(t){o.entry=t,Object(d.a)(o.calculateHeight),o.setState(o.updateStateAfterIntersection)},o.updateStateAfterIntersection=function(t){return t.isIntersecting&&!o.entry.isIntersecting&&Object(d.a)(o.hideIfNotIntersecting),{isIntersecting:o.entry.isIntersecting,isHidden:!1}},o.calculateHeight=function(){var t=o.props,n=t.onHeightChange,e=t.saveHeightKey,i=t.id;o.height=Object(h.a)(o.entry).height,n&&e&&n(e,i,o.height)},o.hideIfNotIntersecting=function(){o.componentMounted&&o.setState(function(t){return{isHidden:!t.isIntersecting}})},o.handleRef=function(t){o.node=t},r=e,a()(o,r)}return c()(n,t),n.prototype.shouldComponentUpdate=function(t,n){var e=this,o=!this.state.isIntersecting&&(this.state.isHidden||this.props.cachedHeight);return!!o!=!(n.isIntersecting||!n.isHidden&&!t.cachedHeight)||!(o?b:f).every(function(n){return Object(p.is)(t[n],e.props[n])})},n.prototype.componentDidMount=function(){var t=this.props,n=t.intersectionObserverWrapper,e=t.id;n.observe(e,this.node,this.handleIntersection),this.componentMounted=!0},n.prototype.componentWillUnmount=function(){var t=this.props,n=t.intersectionObserverWrapper,e=t.id;n.unobserve(e,this.node),this.componentMounted=!1},n.prototype.render=function(){var t=this.props,n=t.children,e=t.id,o=t.index,i=t.listLength,r=t.cachedHeight,a=this.state,s=a.isIntersecting,c=a.isHidden;return s||!c&&!r?u.a.createElement("article",{ref:this.handleRef,"aria-posinset":o,"aria-setsize":i,"data-id":e,tabIndex:"0"},n&&u.a.cloneElement(n,{hidden:!1})):u.a.createElement("article",{ref:this.handleRef,"aria-posinset":o,"aria-setsize":i,style:{height:(this.height||r)+"px",opacity:0,overflow:"hidden"},"data-id":e,tabIndex:"0"},n&&u.a.cloneElement(n,{hidden:!0}))},n}(u.a.Component)},290:function(t,n,e){"use strict";function o(t){for(;s.length&&t.timeRemaining()>0;)s.shift()();s.length?requestIdleCallback(o):c=!1}function i(t){s.push(t),c||(c=!0,requestIdleCallback(o))}var r=e(291),a=e.n(r),s=new a.a,c=!1;n.a=i},291:function(t,n,e){"use strict";function o(){this.length=0}o.prototype.push=function(t){var n={item:t};this.last?this.last=this.last.next=n:this.last=this.first=n,this.length++},o.prototype.shift=function(){var t=this.first;if(t)return this.first=t.next,--this.length||(this.last=void 0),t.item},o.prototype.slice=function(t,n){t=void 0===t?0:t,n=void 0===n?1/0:n;for(var e=[],o=0,i=this.first;i&&!(--n<0);i=i.next)++o>t&&e.push(i.item);return e},t.exports=o},292:function(t,n,e){"use strict";function o(t){if("boolean"!=typeof i){var n=t.target.getBoundingClientRect(),e=t.boundingClientRect;i=n.height!==e.height||n.top!==e.top||n.width!==e.width||n.bottom!==e.bottom||n.left!==e.left||n.right!==e.right}return i?t.target.getBoundingClientRect():t.boundingClientRect}var i=void 0;n.a=o},293:function(t,n,e){"use strict";var o=e(1),i=e.n(o),r=function(){function t(){i()(this,t),this.callbacks={},this.observerBacklog=[],this.observer=null}return t.prototype.connect=function(t){var n=this,e=function(t){t.forEach(function(t){var e=t.target.getAttribute("data-id");n.callbacks[e]&&n.callbacks[e](t)})};this.observer=new IntersectionObserver(e,t),this.observerBacklog.forEach(function(t){var e=t[0],o=t[1],i=t[2];n.observe(e,o,i)}),this.observerBacklog=null},t.prototype.observe=function(t,n,e){this.observer?(this.callbacks[t]=e,this.observer.observe(n)):this.observerBacklog.push([t,n,e])},t.prototype.unobserve=function(t,n){this.observer&&(delete this.callbacks[t],this.observer.unobserve(n))},t.prototype.disconnect=function(){this.observer&&(this.callbacks={},this.observer.disconnect(),this.observer=null)},t}();n.a=r},297:function(t,n,e){"use strict";e.d(n,"a",function(){return f});var o=e(2),i=e.n(o),r=e(1),a=e.n(r),s=e(3),c=e.n(s),l=e(4),u=e.n(l),d=e(0),h=(e.n(d),e(7)),p=e(285),f=function(t){function n(){return a()(this,n),c()(this,t.apply(this,arguments))}return u()(n,t),n.prototype.render=function(){return i()("div",{className:"column-back-button--slim"},void 0,i()("div",{role:"button",tabIndex:"0",onClick:this.handleClick,className:"column-back-button column-back-button--slim-button"},void 0,i()("i",{className:"fa fa-fw fa-chevron-left column-back-button__icon"}),i()(h.b,{id:"column_back_button.label",defaultMessage:"Back"})))},n}(p.a)},847:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),e.d(n,"default",function(){return A});var o,i,r,a,s=e(2),c=e.n(s),l=e(1),u=e.n(l),d=e(3),h=e.n(d),p=e(4),f=e.n(p),b=e(32),v=e.n(b),m=e(0),g=(e.n(m),e(9)),y=e(14),k=e.n(y),C=e(5),O=e.n(C),S=e(298),M=e(283),_=e(297),I=e(1013),j=e(158),H=e(7),L=e(12),w=e.n(L),N=e(287),R=Object(H.f)({heading:{id:"column.domain_blocks",defaultMessage:"Hidden domains"},unblockDomain:{id:"account.unblock_domain",defaultMessage:"Unhide {domain}"}}),x=function(t){return{domains:t.getIn(["domain_lists","blocks","items"])}},A=(o=Object(g.connect)(x))(i=Object(H.g)((a=r=function(t){function n(){var e,o,i;u()(this,n);for(var r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];return e=o=h()(this,t.call.apply(t,[this].concat(a))),o.handleLoadMore=v()(function(){o.props.dispatch(Object(j.f)())},300,{leading:!0}),i=e,h()(o,i)}return f()(n,t),n.prototype.componentWillMount=function(){this.props.dispatch(Object(j.g)())},n.prototype.render=function(){var t=this.props,n=t.intl,e=t.domains;return e?c()(M.a,{icon:"minus-circle",heading:n.formatMessage(R.heading)},void 0,c()(_.a,{}),c()(N.a,{scrollKey:"domain_blocks",onLoadMore:this.handleLoadMore},void 0,e.map(function(t){return c()(I.a,{domain:t},t)}))):c()(M.a,{},void 0,c()(S.a,{}))},n}(w.a),r.propTypes={params:O.a.object.isRequired,dispatch:O.a.func.isRequired,domains:k.a.list,intl:O.a.object.isRequired},i=a))||i)||i}});
//# sourceMappingURL=domain_blocks.js.map