qb_akkoma/priv/static/packs/features/pinned_statuses.js
2018-08-12 18:02:43 +02:00

2 lines
No EOL
18 KiB
JavaScript

webpackJsonp([11],{155:function(e,t,n){"use strict";n.d(t,"a",function(){return b});var o=n(2),r=n.n(o),i=n(1),s=n.n(i),a=n(3),c=n.n(a),l=n(4),u=n.n(l),d=n(0),h=n.n(d),f=n(10),p=n.n(f),b=function(e){function t(){var n,o,r;s()(this,t);for(var i=arguments.length,a=Array(i),l=0;l<i;l++)a[l]=arguments[l];return n=o=c()(this,e.call.apply(e,[this].concat(a))),o.handleClick=function(){o.props.onClick()},r=n,c()(o,r)}return u()(t,e),t.prototype.render=function(){var e=this.props,t=e.icon,n=e.type,o=e.active,i=e.columnHeaderId,s="";return t&&(s=r()("i",{className:"fa fa-fw fa-"+t+" column-header__icon"})),r()("h1",{className:p()("column-header",{active:o}),id:i||null},void 0,r()("button",{onClick:this.handleClick},void 0,s,n))},t}(h.a.PureComponent)},274:function(e,t,n){"use strict";n.d(t,"a",function(){return m});var o=n(2),r=n.n(o),i=n(1),s=n.n(i),a=n(3),c=n.n(a),l=n(4),u=n.n(l),d=n(32),h=n.n(d),f=n(0),p=n.n(f),b=n(155),g=n(91),v=n(43),m=function(e){function t(){var n,o,r;s()(this,t);for(var i=arguments.length,a=Array(i),l=0;l<i;l++)a[l]=arguments[l];return n=o=c()(this,e.call.apply(e,[this].concat(a))),o.handleHeaderClick=function(){var e=o.node.querySelector(".scrollable");e&&(o._interruptScrollAnimation=Object(g.b)(e))},o.handleScroll=h()(function(){void 0!==o._interruptScrollAnimation&&o._interruptScrollAnimation()},200),o.setRef=function(e){o.node=e},r=n,c()(o,r)}return u()(t,e),t.prototype.scrollTop=function(){var e=this.node.querySelector(".scrollable");e&&(this._interruptScrollAnimation=Object(g.b)(e))},t.prototype.render=function(){var e=this.props,t=e.heading,n=e.icon,o=e.children,i=e.active,s=e.hideHeadingOnMobile,a=t&&(!s||s&&!Object(v.b)(window.innerWidth)),c=a&&t.replace(/ /g,"-"),l=a&&r()(b.a,{icon:n,active:i,type:t,onClick:this.handleHeaderClick,columnHeaderId:c});return p.a.createElement("div",{ref:this.setRef,role:"region","aria-labelledby":c,className:"column",onScroll:this.handleScroll},l,o)},t}(p.a.PureComponent)},275:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var o,r,i=n(2),s=n.n(i),a=n(1),c=n.n(a),l=n(3),u=n.n(l),d=n(4),h=n.n(d),f=n(0),p=n.n(f),b=n(7),g=(r=o=function(e){function t(){return c()(this,t),u()(this,e.apply(this,arguments))}return h()(t,e),t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.visible;return s()("button",{className:"load-more",disabled:t||!n,style:{visibility:n?"visible":"hidden"},onClick:this.props.onClick},void 0,s()(b.b,{id:"status.load_more",defaultMessage:"Load more"}))},t}(p.a.PureComponent),o.defaultProps={visible:!0},r)},276:function(e,t,n){"use strict";n.d(t,"a",function(){return m});var o,r,i=n(2),s=n.n(i),a=n(1),c=n.n(a),l=n(3),u=n.n(l),d=n(4),h=n.n(d),f=n(0),p=n.n(f),b=n(7),g=n(5),v=n.n(g),m=(r=o=function(e){function t(){var n,o,r;c()(this,t);for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=o=u()(this,e.call.apply(e,[this].concat(s))),o.handleClick=function(){window.history&&1===window.history.length?o.context.router.history.push("/"):o.context.router.history.goBack()},r=n,u()(o,r)}return h()(t,e),t.prototype.render=function(){return s()("button",{onClick:this.handleClick,className:"column-back-button"},void 0,s()("i",{className:"fa fa-fw fa-chevron-left column-back-button__icon"}),s()(b.b,{id:"column_back_button.label",defaultMessage:"Back"}))},t}(p.a.PureComponent),o.contextTypes={router:v.a.object},r)},277:function(e,t,n){"use strict";var o=n(2),r=n.n(o),i=n(0),s=(n.n(i),n(9)),a=n(158),c=n(67),l=n(17),u=n(68),d=n(22),h=n(69),f=n(90),p=n(157),b=n(26),g=n(7),v=n(13),m=n(33),y=Object(g.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? You will lose all replies, boosts and favourites to it."},blockConfirm:{id:"confirmations.block.confirm",defaultMessage:"Block"}}),O=function(){var e=Object(c.e)();return function(t,n){return{status:e(t,n.id)}}},M=function(e,t){var n=t.intl;return{onReply:function(t,n){e(Object(l.T)(t,n))},onModalReblog:function(t){e(Object(u.o)(t))},onReblog:function(t,n){t.get("reblogged")?e(Object(u.r)(t)):n.shiftKey||!v.b?this.onModalReblog(t):e(Object(b.d)("BOOST",{status:t,onReblog:this.onModalReblog}))},onFavourite:function(t){e(t.get("favourited")?Object(u.p)(t):Object(u.k)(t))},onPin:function(t){e(t.get("pinned")?Object(u.q)(t):Object(u.n)(t))},onEmbed:function(t){e(Object(b.d)("EMBED",{url:t.get("url"),onError:function(t){return e(Object(m.e)(t))}}))},onDelete:function(t){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(v.d?Object(b.d)("CONFIRM",{message:n.formatMessage(o?y.redraftMessage:y.deleteMessage),confirm:n.formatMessage(o?y.redraftConfirm:y.deleteConfirm),onConfirm:function(){return e(Object(h.g)(t.get("id"),o))}}):Object(h.g)(t.get("id"),o))},onDirect:function(t,n){e(Object(l.N)(t,n))},onMention:function(t,n){e(Object(l.R)(t,n))},onOpenMedia:function(t,n){e(Object(b.d)("MEDIA",{media:t,index:n}))},onOpenVideo:function(t,n){e(Object(b.d)("VIDEO",{media:t,time:n}))},onBlock:function(t){e(Object(b.d)("CONFIRM",{message:r()(g.b,{id:"confirmations.block.message",defaultMessage:"Are you sure you want to block {name}?",values:{name:r()("strong",{},void 0,"@",t.get("acct"))}}),confirm:n.formatMessage(y.blockConfirm),onConfirm:function(){return e(Object(d.q)(t.get("id")))}}))},onReport:function(t){e(Object(p.k)(t.get("account"),t))},onMute:function(t){e(Object(f.g)(t))},onMuteConversation:function(t){e(t.get("muted")?Object(h.l)(t.get("id")):Object(h.j)(t.get("id")))},onToggleHidden:function(t){e(t.get("hidden")?Object(h.k)(t.get("id")):Object(h.i)(t.get("id")))}}};t.a=Object(g.g)(Object(s.connect)(O,M)(a.a))},278:function(e,t,n){"use strict";n.d(t,"a",function(){return R});var o,r,i=n(2),s=n.n(i),a=n(1),c=n.n(a),l=n(3),u=n.n(l),d=n(4),h=n.n(d),f=n(93),p=n.n(f),b=n(0),g=n.n(b),v=n(156),m=n(5),y=n.n(m),O=n(279),M=n(275),C=n(284),k=n(8),I=(n.n(k),n(10)),j=n.n(I),S=n(159),R=(r=o=function(e){function t(){var n,o,r;c()(this,t);for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=o=u()(this,e.call.apply(e,[this].concat(s))),o.state={fullscreen:null},o.intersectionObserverWrapper=new C.a,o.handleScroll=p()(function(){if(o.node){var e=o.node,t=e.scrollTop;400>e.scrollHeight-t-e.clientHeight&&o.props.onLoadMore&&!o.props.isLoading&&o.props.onLoadMore(),t<100&&o.props.onScrollToTop?o.props.onScrollToTop():o.props.onScroll&&o.props.onScroll()}},150,{trailing:!0}),o.onFullScreenChange=function(){o.setState({fullscreen:Object(S.d)()})},o.setRef=function(e){o.node=e},o.handleLoadMore=function(e){e.preventDefault(),o.props.onLoadMore()},r=n,u()(o,r)}return h()(t,e),t.prototype.componentDidMount=function(){this.attachScrollListener(),this.attachIntersectionObserver(),Object(S.a)(this.onFullScreenChange),this.handleScroll()},t.prototype.getSnapshotBeforeUpdate=function(e){return g.a.Children.count(e.children)>0&&g.a.Children.count(e.children)<g.a.Children.count(this.props.children)&&this.getFirstChildKey(e)!==this.getFirstChildKey(this.props)&&this.node.scrollTop>0?this.node.scrollHeight-this.node.scrollTop:null},t.prototype.componentDidUpdate=function(e,t,n){if(null!==n){var o=this.node.scrollHeight-n;this.node.scrollTop!==o&&(this.node.scrollTop=o)}},t.prototype.componentWillUnmount=function(){this.detachScrollListener(),this.detachIntersectionObserver(),Object(S.b)(this.onFullScreenChange)},t.prototype.attachIntersectionObserver=function(){this.intersectionObserverWrapper.connect({root:this.node,rootMargin:"300% 0px"})},t.prototype.detachIntersectionObserver=function(){this.intersectionObserverWrapper.disconnect()},t.prototype.attachScrollListener=function(){this.node.addEventListener("scroll",this.handleScroll)},t.prototype.detachScrollListener=function(){this.node.removeEventListener("scroll",this.handleScroll)},t.prototype.getFirstChildKey=function(e){var t=e.children,n=t;return t instanceof k.List?n=t.get(0):Array.isArray(t)&&(n=t[0]),n&&n.key},t.prototype.render=function(){var e=this,t=this.props,n=t.children,o=t.scrollKey,r=t.trackScroll,i=t.shouldUpdateScroll,a=t.isLoading,c=t.hasMore,l=t.prepend,u=t.alwaysPrepend,d=t.emptyMessage,h=t.onLoadMore,f=this.state.fullscreen,p=g.a.Children.count(n),b=c&&p>0&&h?s()(M.a,{visible:!a,onClick:this.handleLoadMore}):null,m=null;return m=a||p>0||!d?g.a.createElement("div",{className:j()("scrollable",{fullscreen:f}),ref:this.setRef},s()("div",{role:"feed",className:"item-list"},void 0,l,g.a.Children.map(this.props.children,function(t,n){return s()(O.a,{id:t.key,index:n,listLength:p,intersectionObserverWrapper:e.intersectionObserverWrapper,saveHeightKey:r?e.context.router.route.location.key+":"+o:null},t.key,t)}),b)):s()("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column"}},void 0,u&&l,g.a.createElement("div",{className:"empty-column-indicator",ref:this.setRef},d)),r?s()(v.a,{scrollKey:o,shouldUpdateScroll:i},void 0,m):m},t}(b.PureComponent),o.contextTypes={router:y.a.object},o.defaultProps={trackScroll:!0},r)},279:function(e,t,n){"use strict";var o=n(9),r=n(280),i=n(94),s=function(e,t){return{cachedHeight:e.getIn(["height_cache",t.saveHeightKey,t.id])}},a=function(e){return{onHeightChange:function(t,n,o){e(Object(i.d)(t,n,o))}}};t.a=Object(o.connect)(s,a)(r.a)},280:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var o=n(1),r=n.n(o),i=n(3),s=n.n(i),a=n(4),c=n.n(a),l=n(0),u=n.n(l),d=n(281),h=n(283),f=n(8),p=(n.n(f),["id","index","listLength"]),b=["id","index","listLength","cachedHeight"],g=function(e){function t(){var n,o,i;r()(this,t);for(var a=arguments.length,c=Array(a),l=0;l<a;l++)c[l]=arguments[l];return n=o=s()(this,e.call.apply(e,[this].concat(c))),o.state={isHidden:!1},o.handleIntersection=function(e){o.entry=e,Object(d.a)(o.calculateHeight),o.setState(o.updateStateAfterIntersection)},o.updateStateAfterIntersection=function(e){return e.isIntersecting&&!o.entry.isIntersecting&&Object(d.a)(o.hideIfNotIntersecting),{isIntersecting:o.entry.isIntersecting,isHidden:!1}},o.calculateHeight=function(){var e=o.props,t=e.onHeightChange,n=e.saveHeightKey,r=e.id;o.height=Object(h.a)(o.entry).height,t&&n&&t(n,r,o.height)},o.hideIfNotIntersecting=function(){o.componentMounted&&o.setState(function(e){return{isHidden:!e.isIntersecting}})},o.handleRef=function(e){o.node=e},i=n,s()(o,i)}return c()(t,e),t.prototype.shouldComponentUpdate=function(e,t){var n=this,o=!this.state.isIntersecting&&(this.state.isHidden||this.props.cachedHeight);return!!o!=!(t.isIntersecting||!t.isHidden&&!e.cachedHeight)||!(o?b:p).every(function(t){return Object(f.is)(e[t],n.props[t])})},t.prototype.componentDidMount=function(){var e=this.props,t=e.intersectionObserverWrapper,n=e.id;t.observe(n,this.node,this.handleIntersection),this.componentMounted=!0},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.intersectionObserverWrapper,n=e.id;t.unobserve(n,this.node),this.componentMounted=!1},t.prototype.render=function(){var e=this.props,t=e.children,n=e.id,o=e.index,r=e.listLength,i=e.cachedHeight,s=this.state,a=s.isIntersecting,c=s.isHidden;return a||!c&&!i?u.a.createElement("article",{ref:this.handleRef,"aria-posinset":o,"aria-setsize":r,"data-id":n,tabIndex:"0"},t&&u.a.cloneElement(t,{hidden:!1})):u.a.createElement("article",{ref:this.handleRef,"aria-posinset":o,"aria-setsize":r,style:{height:(this.height||i)+"px",opacity:0,overflow:"hidden"},"data-id":n,tabIndex:"0"},t&&u.a.cloneElement(t,{hidden:!0}))},t}(u.a.Component)},281:function(e,t,n){"use strict";function o(e){for(;a.length&&e.timeRemaining()>0;)a.shift()();a.length?requestIdleCallback(o):c=!1}function r(e){a.push(e),c||(c=!0,requestIdleCallback(o))}var i=n(282),s=n.n(i),a=new s.a,c=!1;t.a=r},282:function(e,t,n){"use strict";function o(){this.length=0}o.prototype.push=function(e){var t={item:e};this.last?this.last=this.last.next=t:this.last=this.first=t,this.length++},o.prototype.shift=function(){var e=this.first;if(e)return this.first=e.next,--this.length||(this.last=void 0),e.item},o.prototype.slice=function(e,t){e=void 0===e?0:e,t=void 0===t?1/0:t;for(var n=[],o=0,r=this.first;r&&!(--t<0);r=r.next)++o>e&&n.push(r.item);return n},e.exports=o},283:function(e,t,n){"use strict";function o(e){if("boolean"!=typeof r){var t=e.target.getBoundingClientRect(),n=e.boundingClientRect;r=t.height!==n.height||t.top!==n.top||t.width!==n.width||t.bottom!==n.bottom||t.left!==n.left||t.right!==n.right}return r?e.target.getBoundingClientRect():e.boundingClientRect}var r=void 0;t.a=o},284:function(e,t,n){"use strict";var o=n(1),r=n.n(o),i=function(){function e(){r()(this,e),this.callbacks={},this.observerBacklog=[],this.observer=null}return e.prototype.connect=function(e){var t=this,n=function(e){e.forEach(function(e){var n=e.target.getAttribute("data-id");t.callbacks[n]&&t.callbacks[n](e)})};this.observer=new IntersectionObserver(n,e),this.observerBacklog.forEach(function(e){var n=e[0],o=e[1],r=e[2];t.observe(n,o,r)}),this.observerBacklog=null},e.prototype.observe=function(e,t,n){this.observer?(this.callbacks[e]=n,this.observer.observe(t)):this.observerBacklog.push([e,t,n])},e.prototype.unobserve=function(e,t){this.observer&&(delete this.callbacks[e],this.observer.unobserve(t))},e.prototype.disconnect=function(){this.observer&&(this.callbacks={},this.observer.disconnect(),this.observer=null)},e}();t.a=i},285:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var o,r=n(2),i=n.n(r),s=n(1),a=n.n(s),c=n(3),l=n.n(c),u=n(4),d=n.n(u),h=n(0),f=n.n(h),p=n(7),b=Object(p.f)({load_more:{id:"status.load_more",defaultMessage:"Load more"}}),g=Object(p.g)(o=function(e){function t(){var n,o,r;a()(this,t);for(var i=arguments.length,s=Array(i),c=0;c<i;c++)s[c]=arguments[c];return n=o=l()(this,e.call.apply(e,[this].concat(s))),o.handleClick=function(){o.props.onClick(o.props.maxId)},r=n,l()(o,r)}return d()(t,e),t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.intl;return i()("button",{className:"load-more load-gap",disabled:t,onClick:this.handleClick,"aria-label":n.formatMessage(b.load_more)},void 0,i()("i",{className:"fa fa-ellipsis-h"}))},t}(f.a.PureComponent))||o},286:function(e,t,n){"use strict";n.d(t,"a",function(){return H});var o,r,i=n(34),s=n.n(i),a=n(2),c=n.n(a),l=n(55),u=n.n(l),d=n(1),h=n.n(d),f=n(3),p=n.n(f),b=n(4),g=n.n(b),v=n(32),m=n.n(v),y=n(0),O=n.n(y),M=n(14),C=n.n(M),k=n(5),I=n.n(k),j=n(277),S=n(12),R=n.n(S),_=n(285),L=n(278),x=n(7),H=(r=o=function(e){function t(){var n,o,r;h()(this,t);for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=o=p()(this,e.call.apply(e,[this].concat(s))),o.getFeaturedStatusCount=function(){return o.props.featuredStatusIds?o.props.featuredStatusIds.size:0},o.getCurrentStatusIndex=function(e,t){return t?o.props.featuredStatusIds.indexOf(e):o.props.statusIds.indexOf(e)+o.getFeaturedStatusCount()},o.handleMoveUp=function(e,t){var n=o.getCurrentStatusIndex(e,t)-1;o._selectChild(n)},o.handleMoveDown=function(e,t){var n=o.getCurrentStatusIndex(e,t)+1;o._selectChild(n)},o.handleLoadOlder=m()(function(){o.props.onLoadMore(o.props.statusIds.last())},300,{leading:!0}),o.setRef=function(e){o.node=e},r=n,p()(o,r)}return g()(t,e),t.prototype._selectChild=function(e){var t=this.node.node.querySelector("article:nth-of-type("+(e+1)+") .focusable");t&&t.focus()},t.prototype.render=function(){var e=this,t=this.props,n=t.statusIds,o=t.featuredStatusIds,r=t.onLoadMore,i=u()(t,["statusIds","featuredStatusIds","onLoadMore"]),a=i.isLoading;if(i.isPartial)return c()("div",{className:"regeneration-indicator"},void 0,c()("div",{},void 0,c()("div",{className:"regeneration-indicator__figure"}),c()("div",{className:"regeneration-indicator__label"},void 0,c()(x.b,{id:"regeneration_indicator.label",tagName:"strong",defaultMessage:"Loading…"}),c()(x.b,{id:"regeneration_indicator.sublabel",defaultMessage:"Your home feed is being prepared!"}))));var l=a||n.size>0?n.map(function(t,o){return null===t?c()(_.a,{disabled:a,maxId:o>0?n.get(o-1):null,onClick:r},"gap:"+n.get(o+1)):c()(j.a,{id:t,onMoveUp:e.handleMoveUp,onMoveDown:e.handleMoveDown},t)}):null;return l&&o&&(l=o.map(function(t){return c()(j.a,{id:t,featured:!0,onMoveUp:e.handleMoveUp,onMoveDown:e.handleMoveDown},"f-"+t)}).concat(l)),O.a.createElement(L.a,s()({},i,{onLoadMore:r&&this.handleLoadOlder,ref:this.setRef}),l)},t}(R.a),o.propTypes={scrollKey:I.a.string.isRequired,statusIds:C.a.list.isRequired,featuredStatusIds:C.a.list,onLoadMore:I.a.func,onScrollToTop:I.a.func,onScroll:I.a.func,trackScroll:I.a.bool,shouldUpdateScroll:I.a.func,isLoading:I.a.bool,isPartial:I.a.bool,hasMore:I.a.bool,prepend:I.a.node,emptyMessage:I.a.node,alwaysPrepend:I.a.bool},o.defaultProps={trackScroll:!0},r)},288:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var o=n(2),r=n.n(o),i=n(1),s=n.n(i),a=n(3),c=n.n(a),l=n(4),u=n.n(l),d=n(0),h=(n.n(d),n(7)),f=n(276),p=function(e){function t(){return s()(this,t),c()(this,e.apply(this,arguments))}return u()(t,e),t.prototype.render=function(){return r()("div",{className:"column-back-button--slim"},void 0,r()("div",{role:"button",tabIndex:"0",onClick:this.handleClick,className:"column-back-button column-back-button--slim-button"},void 0,r()("i",{className:"fa fa-fw fa-chevron-left column-back-button__icon"}),r()(h.b,{id:"column_back_button.label",defaultMessage:"Back"})))},t}(f.a)},821:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",function(){return H});var o,r,i,s,a=n(2),c=n.n(a),l=n(1),u=n.n(l),d=n(3),h=n.n(d),f=n(4),p=n.n(f),b=n(0),g=n.n(b),v=n(9),m=n(5),y=n.n(m),O=n(14),M=n.n(O),C=n(323),k=n(274),I=n(288),j=n(286),S=n(7),R=n(12),_=n.n(R),L=Object(S.f)({heading:{id:"column.pins",defaultMessage:"Pinned toot"}}),x=function(e){return{statusIds:e.getIn(["status_lists","pins","items"]),hasMore:!!e.getIn(["status_lists","pins","next"])}},H=(o=Object(v.connect)(x))(r=Object(S.g)((s=i=function(e){function t(){var n,o,r;u()(this,t);for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=o=h()(this,e.call.apply(e,[this].concat(s))),o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(e){o.column=e},r=n,h()(o,r)}return p()(t,e),t.prototype.componentWillMount=function(){this.props.dispatch(Object(C.b)())},t.prototype.render=function(){var e=this.props,t=e.intl,n=e.statusIds,o=e.hasMore;return g.a.createElement(k.a,{icon:"thumb-tack",heading:t.formatMessage(L.heading),ref:this.setRef},c()(I.a,{}),c()(j.a,{statusIds:n,scrollKey:"pinned_statuses",hasMore:o}))},t}(_.a),i.propTypes={dispatch:y.a.func.isRequired,statusIds:M.a.list.isRequired,intl:y.a.object.isRequired,hasMore:y.a.bool.isRequired},r=s))||r)||r}});
//# sourceMappingURL=pinned_statuses.js.map