spc-pleroma/priv/static/packs/features/home_timeline.js

2 lines
17 KiB
JavaScript
Raw Normal View History

2020-05-20 05:55:14 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{1325:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return K}));var a,i,o,s=n(0),c=n(2),r=n(9),u=n(6),l=n(8),d=n(1),m=n(3),p=n.n(m),h=n(21),b=n(216),f=n.n(b),j=n(16),g=n.n(j),v=n(5),O=n.n(v),_=n(53),y=n(27),R=n(7),M=n(22),k=n(83),C=n.n(k),x=n(14),w=n.n(x),A=n(546),I=n(590),E=n(473),N=n.n(E),L=n(35),P=n.n(L);function S(e){return function(){var t,n=Object(u.a)(e);if(q()){var a=Object(u.a)(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Object(r.a)(this,t)}}function q(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var D=Object(R.f)({close:{id:"lightbox.close",defaultMessage:"Close"},previous:{id:"lightbox.previous",defaultMessage:"Previous"},next:{id:"lightbox.next",defaultMessage:"Next"}}),z=function(e){Object(l.a)(t,e);S(t);function t(){for(var t,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return t=e.call.apply(e,[this].concat(a))||this,Object(d.a)(Object(c.a)(t),"setRef",(function(e){t.node=e})),Object(d.a)(Object(c.a)(t),"onMentionClick",(function(e,n){!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/accounts/"+e.get("id")))})),Object(d.a)(Object(c.a)(t),"onHashtagClick",(function(e,n){e=e.replace(/^#/,""),!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/timelines/tag/"+e))})),Object(d.a)(Object(c.a)(t),"onStatusClick",(function(e,n){!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/statuses/"+e.get("id")))})),Object(d.a)(Object(c.a)(t),"handleEmojiMouseEnter",(function(e){var t=e.target;t.src=t.getAttribute("data-original")})),Object(d.a)(Object(c.a)(t),"handleEmojiMouseLeave",(function(e){var t=e.target;t.src=t.getAttribute("data-static")})),t}var n=t.prototype;return n.componentDidMount=function(){this._updateLinks(),this._updateEmojis()},n.componentDidUpdate=function(){this._updateLinks(),this._updateEmojis()},n._updateEmojis=function(){var e=this.node;if(e&&!M.a)for(var t=e.querySelectorAll(".custom-emoji"),n=0;n<t.length;n++){var a=t[n];a.classList.contains("status-emoji")||(a.classList.add("status-emoji"),a.addEventListener("mouseenter",this.handleEmojiMouseEnter,!1),a.addEventListener("mouseleave",this.handleEmojiMouseLeave,!1))}},n._updateLinks=function(){var e=this,t=this.node;if(t)for(var n=t.querySelectorAll("a"),a=function(){var t=n[i];if(t.classList.contains("status-link"))return"continue";t.classList.add("status-link");var a=e.props.announcement.get("mentions").find((function(e){return t.href===e.get("url")}));if(a)t.addEventListener("click",e.onMentionClick.bind(e,a),!1),t.setAttribute("title",a.get("acct"));else if("#"===t.textContent[0]||t.previousSibling&&t.previousSibling.textContent&&"#"===t.previousSibling.textContent[t.previousSibling.textContent.length-1])t.addEventListener("click",e.onHashtagClick.bind(e,t.text),!1);else{var o=e.props.announcement.get("statuses").find((function(e){return t.href===e.get("url")}));o&&t.addEventListener("click",e.onStatusClick.bind(e,o),!1),t.setAttribute("title",t.href),t.classList.add("unhandled-link")}t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer")},i=0;i<n.length;++i)a()},n.render=function(){var e=this.props.announcement;return(p.a.createElement("div",{className:"announcements__item__content",ref:this.setRef,dangerouslySetInnerHTML:{__html:e.get("contentHtml")}}))},t}(h.a);Object(d.a)(z,"contextTypes",{router:O.a.object}),Object(d.a)(z,"propTypes",{announcement:g.a.map.isRequired});var T=e.env.CDN_HOST||"",H=function(e){Object(l.a)(t,e);S(t);function t(){return e.apply(this,arguments)||this}return t.prototype.render=function(){var e=this.props,t=e.emoji,n=e.emojiMap,a=e.hovered;if(C.a[t]){var i=C.a[this.props.emoji],o=i.filename,c=i.shor
//# sourceMappingURL=home_timeline.js.map