Pleroma/priv/static/packs/features/direct_timeline.js

2 lines
5.2 KiB
JavaScript
Raw Normal View History

2019-06-26 21:06:28 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{695:function(e,t,n){"use strict";n.r(t);var i=n(0),c=n(2),r=n(6),s=n(1),o=n(3),u=n.n(o),a=n(21),d=n(633),l=n(628),p=n(102),h=n(222),b=n(7),f=n(635),v=n(43),j=n(68),O=n(56),M=n.n(O),g=n(5),m=n.n(g),y=n(26),I=n.n(y),w=n(25),k=n(903),C=function(o){function e(){for(var a,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a=o.call.apply(o,[this].concat(t))||this,Object(s.a)(Object(c.a)(a),"handleClick",function(){if(a.context.router){var e=a.props,t=e.lastStatusId,n=e.unread,o=e.markRead;n&&o(),a.context.router.history.push("/statuses/"+t)}}),Object(s.a)(Object(c.a)(a),"handleHotkeyMoveUp",function(){a.props.onMoveUp(a.props.conversationId)}),Object(s.a)(Object(c.a)(a),"handleHotkeyMoveDown",function(){a.props.onMoveDown(a.props.conversationId)}),a}return Object(r.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.accounts,n=e.lastStatusId,o=e.unread;return null===n?null:Object(i.a)(k.a,{id:n,unread:o,otherAccounts:t,onMoveUp:this.handleHotkeyMoveUp,onMoveDown:this.handleHotkeyMoveDown,onClick:this.handleClick})},e}(w.a);Object(s.a)(C,"contextTypes",{router:m.a.object}),Object(s.a)(C,"propTypes",{conversationId:m.a.string.isRequired,accounts:I.a.list.isRequired,lastStatusId:m.a.string,unread:m.a.bool.isRequired,onMoveUp:m.a.func,onMoveDown:m.a.func,markRead:m.a.func.isRequired});var L=Object(a.connect)(function(t,e){var n=e.conversationId,o=t.getIn(["conversations","items"]).find(function(e){return e.get("id")===n});return{accounts:o.get("accounts").map(function(e){return t.getIn(["accounts",e],null)}),unread:o.get("unread"),lastStatusId:o.get("last_status",null)}},function(e,t){var n=t.conversationId;return{markRead:function(){return e(Object(p.i)(n))}}})(C),R=n(893),U=function(a){function e(){for(var n,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return n=a.call.apply(a,[this].concat(t))||this,Object(s.a)(Object(c.a)(n),"getCurrentIndex",function(t){return n.props.conversations.findIndex(function(e){return e.get("id")===t})}),Object(s.a)(Object(c.a)(n),"handleMoveUp",function(e){var t=n.getCurrentIndex(e)-1;n._selectChild(t)}),Object(s.a)(Object(c.a)(n),"handleMoveDown",function(e){var t=n.getCurrentIndex(e)+1;n._selectChild(t)}),Object(s.a)(Object(c.a)(n),"setRef",function(e){n.node=e}),Object(s.a)(Object(c.a)(n),"handleLoadOlder",M()(function(){var e=n.props.conversations.last();e&&e.get("last_status")&&n.props.onLoadMore(e.get("last_status"))},300,{leading:!0})),n}Object(r.a)(e,a);var t=e.prototype;return t._selectChild=function(e){var t=this.node.node.querySelector("article:nth-of-type("+(e+1)+") .focusable");t&&t.focus()},t.render=function(){var t=this,e=this.props,n=e.conversations,o=e.onLoadMore,a=Object(j.a)(e,["conversations","onLoadMore"]);return u.a.createElement(R.a,Object(v.a)({},a,{onLoadMore:o&&this.handleLoadOlder,scrollKey:"direct",ref:this.setRef}),n.map(function(e){return Object(i.a)(L,{conversationId:e.get("id"),onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown},e.get("id"))}))},e}(w.a);Object(s.a)(U,"propTypes",{conversations:I.a.list.isRequired,hasMore:m.a.bool,isLoading:m.a.bool,onLoadMore:m.a.func,shouldUpdateScroll:m.a.func});var D,x=Object(a.connect)(function(e){return{conversations:e.getIn(["conversations","items"]),isLoading:e.getIn(["conversations","isLoading"],!0),hasMore:e.getIn(["conversations","hasMore"],!1)}},function(t){return{onLoadMore:function(e){return t(Object(p.h)({maxId:e}))}}})(U);n.d(t,"default",function(){return _});var S=Object(b.f)({title:{id:"column.direct",defaultMessage:"Direct messages"}}),_=Object(a.connect)()(D=Object(b.g)(D=function(a){function e(){for(var o,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o=a.call.apply(a,[this].concat(t))||this,Object(s.a)(Object(c.a)(o),"handlePin",function(){var e=o.props,t=e.columnId,n=e.dispatch;n(t?Object(h.h)(t):Object(h.e)("DIRECT",{}))}),Object(s.a)(Object(c.a)(o),"handleMove",function(e){var t=o.props,n=t.columnId;(0,t.dispatch)(Object(h.g)(n,e))}),Object(s.a)(Object(c.a)(o),"handleHeaderClick",func
2018-08-12 15:29:30 +02:00
//# sourceMappingURL=direct_timeline.js.map