X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fpacks%2Ffeatures%2Fnotifications.js;h=49f8289018e749c21fc76e8cd5231abe0b793b36;hb=4c02e049358441529c54a72cd11f1c81ee897d49;hp=2b8cf50ce143fde463ab0e26ea032fc0430951a2;hpb=f2fa09c50fde8db4e619872ef6121e90a69324a6;p=akkoma diff --git a/priv/static/packs/features/notifications.js b/priv/static/packs/features/notifications.js index 2b8cf50ce..49f828901 100644 --- a/priv/static/packs/features/notifications.js +++ b/priv/static/packs/features/notifications.js @@ -1,2 +1,2 @@ -webpackJsonp([5],{275:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var o,i,a=n(2),s=n.n(a),r=n(1),c=n.n(r),l=n(3),u=n.n(l),d=n(4),f=n.n(d),h=n(0),p=n.n(h),g=n(7),v=(i=o=function(e){function t(){return c()(this,t),u()(this,e.apply(this,arguments))}return f()(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()(g.b,{id:"status.load_more",defaultMessage:"Load more"}))},t}(p.a.PureComponent),o.defaultProps={visible:!0},i)},277:function(e,t,n){"use strict";var o=n(2),i=n.n(o),a=n(0),s=(n.n(a),n(9)),r=n(158),c=n(67),l=n(17),u=n(68),d=n(22),f=n(69),h=n(90),p=n(157),g=n(26),v=n(7),m=n(13),b=n(33),y=Object(v.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"}}),M=function(){var e=Object(c.e)();return function(t,n){return{status:e(t,n.id)}}},k=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||!m.b?this.onModalReblog(t):e(Object(g.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(g.d)("EMBED",{url:t.get("url"),onError:function(t){return e(Object(b.e)(t))}}))},onDelete:function(t){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(m.d?Object(g.d)("CONFIRM",{message:n.formatMessage(o?y.redraftMessage:y.deleteMessage),confirm:n.formatMessage(o?y.redraftConfirm:y.deleteConfirm),onConfirm:function(){return e(Object(f.g)(t.get("id"),o))}}):Object(f.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(g.d)("MEDIA",{media:t,index:n}))},onOpenVideo:function(t,n){e(Object(g.d)("VIDEO",{media:t,time:n}))},onBlock:function(t){e(Object(g.d)("CONFIRM",{message:i()(v.b,{id:"confirmations.block.message",defaultMessage:"Are you sure you want to block {name}?",values:{name:i()("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(h.g)(t))},onMuteConversation:function(t){e(t.get("muted")?Object(f.l)(t.get("id")):Object(f.j)(t.get("id")))},onToggleHidden:function(t){e(t.get("hidden")?Object(f.k)(t.get("id")):Object(f.i)(t.get("id")))}}};t.a=Object(v.g)(Object(s.connect)(M,k)(r.a))},278:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var o,i,a=n(2),s=n.n(a),r=n(1),c=n.n(r),l=n(3),u=n.n(l),d=n(4),f=n.n(d),h=n(93),p=n.n(h),g=n(0),v=n.n(g),m=n(156),b=n(5),y=n.n(b),M=n(279),k=n(275),C=n(284),O=n(8),_=(n.n(O),n(10)),w=n.n(_),j=n(159),I=(i=o=function(e){function t(){var n,o,i;c()(this,t);for(var a=arguments.length,s=Array(a),r=0;re.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(j.d)()})},o.setRef=function(e){o.node=e},o.handleLoadMore=function(e){e.preventDefault(),o.props.onLoadMore()},i=n,u()(o,i)}return f()(t,e),t.prototype.componentDidMount=function(){this.attachScrollListener(),this.attachIntersectionObserver(),Object(j.a)(this.onFullScreenChange),this.handleScroll()},t.prototype.getSnapshotBeforeUpdate=function(e){return v.a.Children.count(e.children)>0&&v.a.Children.count(e.children)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(j.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 O.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,i=t.trackScroll,a=t.shouldUpdateScroll,r=t.isLoading,c=t.hasMore,l=t.prepend,u=t.alwaysPrepend,d=t.emptyMessage,f=t.onLoadMore,h=this.state.fullscreen,p=v.a.Children.count(n),g=c&&p>0&&f?s()(k.a,{visible:!r,onClick:this.handleLoadMore}):null,b=null;return b=r||p>0||!d?v.a.createElement("div",{className:w()("scrollable",{fullscreen:h}),ref:this.setRef},s()("div",{role:"feed",className:"item-list"},void 0,l,v.a.Children.map(this.props.children,function(t,n){return s()(M.a,{id:t.key,index:n,listLength:p,intersectionObserverWrapper:e.intersectionObserverWrapper,saveHeightKey:i?e.context.router.route.location.key+":"+o:null},t.key,t)}),g)):s()("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column"}},void 0,u&&l,v.a.createElement("div",{className:"empty-column-indicator",ref:this.setRef},d)),i?s()(m.a,{scrollKey:o,shouldUpdateScroll:a},void 0,b):b},t}(g.PureComponent),o.contextTypes={router:y.a.object},o.defaultProps={trackScroll:!0},i)},279:function(e,t,n){"use strict";var o=n(9),i=n(280),a=n(94),s=function(e,t){return{cachedHeight:e.getIn(["height_cache",t.saveHeightKey,t.id])}},r=function(e){return{onHeightChange:function(t,n,o){e(Object(a.d)(t,n,o))}}};t.a=Object(o.connect)(s,r)(i.a)},280:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var o=n(1),i=n.n(o),a=n(3),s=n.n(a),r=n(4),c=n.n(r),l=n(0),u=n.n(l),d=n(281),f=n(283),h=n(8),p=(n.n(h),["id","index","listLength"]),g=["id","index","listLength","cachedHeight"],v=function(e){function t(){var n,o,a;i()(this,t);for(var r=arguments.length,c=Array(r),l=0;l0;)r.shift()();r.length?requestIdleCallback(o):c=!1}function i(e){r.push(e),c||(c=!0,requestIdleCallback(o))}var a=n(282),s=n.n(a),r=new s.a,c=!1;t.a=i},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,i=this.first;i&&!(--t<0);i=i.next)++o>e&&n.push(i.item);return n},e.exports=o},283:function(e,t,n){"use strict";function o(e){if("boolean"!=typeof i){var t=e.target.getBoundingClientRect(),n=e.boundingClientRect;i=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 i?e.target.getBoundingClientRect():e.boundingClientRect}var i=void 0;t.a=o},284:function(e,t,n){"use strict";var o=n(1),i=n.n(o),a=function(){function e(){i()(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],i=e[2];t.observe(n,o,i)}),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=a},285:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var o,i=n(2),a=n.n(i),s=n(1),r=n.n(s),c=n(3),l=n.n(c),u=n(4),d=n.n(u),f=n(0),h=n.n(f),p=n(7),g=Object(p.f)({load_more:{id:"status.load_more",defaultMessage:"Load more"}}),v=Object(p.g)(o=function(e){function t(){var n,o,i;r()(this,t);for(var a=arguments.length,s=Array(a),c=0;c0,hasMore:e.getIn(["notifications","hasMore"])}},E=(o=Object(y.connect)(R))(i=Object(w.g)((s=a=function(e){function t(){var n,o,i;u()(this,t);for(var a=arguments.length,s=Array(a),r=0;r0||u?o.map(function(t,n){return null===t?c()(S.a,{disabled:a,maxId:n>0?o.getIn([n-1,"id"]):null,onClick:e.handleLoadGap},"gap:"+o.getIn([n+1,"id"])):c()(_.a,{notification:t,accountId:t.get("account"),onMoveUp:e.handleMoveUp,onMoveDown:e.handleMoveDown},t.get("id"))}):null,this.scrollableContent=h;var p=c()(x.a,{scrollKey:"notifications-"+r,trackScroll:!d,isLoading:a,hasMore:u,emptyMessage:f,onLoadMore:this.handleLoadOlder,onScrollToTop:this.handleScrollToTop,onScroll:this.handleScroll,shouldUpdateScroll:i},void 0,h);return b.a.createElement(M.a,{ref:this.setColumnRef},c()(k.a,{icon:"bell",active:s,title:n.formatMessage(P.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:d,multiColumn:l},void 0,c()(j.a,{})),p)},t}(b.a.PureComponent),a.defaultProps={trackScroll:!0},i=s))||i)||i},864:function(e,t,n){"use strict";var o=n(2),i=n.n(o),a=n(0),s=(n.n(a),n(9)),r=n(7),c=n(67),l=n(865),u=n(22),d=n(26),f=n(90),h=n(13),p=Object(r.f)({unfollowConfirm:{id:"confirmations.unfollow.confirm",defaultMessage:"Unfollow"}}),g=function(){var e=Object(c.c)();return function(t,n){return{account:e(t,n.id)}}},v=function(e,t){var n=t.intl;return{onFollow:function(t){e(t.getIn(["relationship","following"])||t.getIn(["relationship","requested"])?h.l?Object(d.d)("CONFIRM",{message:i()(r.b,{id:"confirmations.unfollow.message",defaultMessage:"Are you sure you want to unfollow {name}?",values:{name:i()("strong",{},void 0,"@",t.get("acct"))}}),confirm:n.formatMessage(p.unfollowConfirm),onConfirm:function(){return e(Object(u.D)(t.get("id")))}}):Object(u.D)(t.get("id")):Object(u.z)(t.get("id")))},onBlock:function(t){e(t.getIn(["relationship","blocking"])?Object(u.C)(t.get("id")):Object(u.q)(t.get("id")))},onMute:function(t){e(t.getIn(["relationship","muting"])?Object(u.E)(t.get("id")):Object(f.g)(t))},onMuteNotifications:function(t,n){e(Object(u.A)(t.get("id"),n))}}};t.a=Object(r.g)(Object(s.connect)(g,v)(l.a))},865:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var o,i,a,s=n(2),r=n.n(s),c=n(1),l=n.n(c),u=n(3),d=n.n(u),f=n(4),h=n.n(f),p=n(0),g=(n.n(p),n(14)),v=n.n(g),m=n(5),b=n.n(m),y=n(54),M=n(53),k=n(287),C=n(23),O=n(7),_=n(12),w=n.n(_),j=n(13),I=Object(O.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}"},mute_notifications:{id:"account.mute_notifications",defaultMessage:"Mute notifications from @{name}"},unmute_notifications:{id:"account.unmute_notifications",defaultMessage:"Unmute notifications from @{name}"}}),N=Object(O.g)((a=i=function(e){function t(){var n,o,i;l()(this,t);for(var a=arguments.length,s=Array(a),r=0;r=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;tthis.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=tn?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-40){var n=t[0];return{x:n.clientX,y:n.clientY}}var o=e.pageX;if(void 0!==o)return{x:o,y:e.pageY}}return{x:0,y:0}}Object.defineProperty(t,"__esModule",{value:!0}),t.pointerCoord=o},876:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var o=n(2),i=n.n(o),a=n(1),s=n.n(a),r=n(3),c=n.n(r),l=n(4),u=n.n(l),d=n(0),f=n.n(d),h=n(867),p=n.n(h),g=function(e){function t(){var n,o,i;s()(this,t);for(var a=arguments.length,r=Array(a),l=0;l0||t.getIn(["notifications","pendingItems"]).size>0,hasMore:t.getIn(["notifications","hasMore"]),numPending:t.getIn(["notifications","pendingItems"],Object(ut.List)()).size}}))(d=Object(x.g)((f=u=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),a=0;ao.offsetTop?o.scrollIntoView(!0):!e&&i.scrollTop+i.clientHeight0||r?o.map((function(e,i){return null===e?Object(b.a)(bt.a,{disabled:n,maxId:i>0?o.getIn([i-1,"id"]):null,onClick:t.handleLoadGap},"gap:"+o.getIn([i+1,"id"])):Object(b.a)($,{notification:e,accountId:e.get("account"),onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown},e.get("id"))})):null,this.scrollableContent=g;var O=Object(b.a)(ft.a,{scrollKey:"notifications-"+c,trackScroll:!f,isLoading:n,showLoading:n&&0===o.size,hasMore:r,numPending:d,emptyMessage:h,onLoadMore:this.handleLoadOlder,onLoadPending:this.handleLoadPending,onScrollToTop:this.handleScrollToTop,onScroll:this.handleScroll,shouldUpdateScroll:a,bindToDocument:!l},void 0,g);return m.a.createElement(M.a,{bindToDocument:!l,ref:this.setColumnRef,label:i.formatMessage(ht.title)},Object(b.a)(w.a,{icon:"bell",active:s,title:i.formatMessage(ht.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:f,multiColumn:l},void 0,Object(b.a)(st,{})),p,O)},e}(m.a.PureComponent),Object(p.a)(u,"defaultProps",{trackScroll:!0}),d=f))||d)||d}}]); //# sourceMappingURL=notifications.js.map \ No newline at end of file