2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
|
webpackJsonp([16,26],{150:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var a=n(2),i=n.n(a),o=n(1),s=n.n(o),r=n(3),l=n.n(r),c=n(4),d=n.n(c),u=n(0),p=n.n(u),h=n(10),f=n.n(h),g=function(e){function t(){var n,a,i;s()(this,t);for(var o=arguments.length,r=Array(o),c=0;c<o;c++)r[c]=arguments[c];return n=a=l()(this,e.call.apply(e,[this].concat(r))),a.handleClick=function(){a.props.onClick()},i=n,l()(a,i)}return d()(t,e),t.prototype.render=function(){var e=this.props,t=e.icon,n=e.type,a=e.active,o=e.columnHeaderId,s="";return t&&(s=i()("i",{className:"fa fa-fw fa-"+t+" column-header__icon"})),i()("h1",{className:f()("column-header",{active:a}),id:o||null},void 0,i()("button",{onClick:this.handleClick},void 0,s,n))},t}(p.a.PureComponent)},155:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",function(){return I});var a,i,o,s,r,l=n(2),c=n.n(l),d=n(1),u=n.n(d),p=n(3),h=n.n(p),f=n(4),g=n.n(f),v=n(0),m=n.n(v),b=n(8),y=(n.n(b),n(23)),_=n(6),k=n(35),M=n(10),C=n.n(M),O=n(11),j=Object(_.f)({toggle_visible:{id:"media_gallery.toggle_visible",defaultMessage:"Toggle visibility"}}),w=(i=a=function(e){function t(){var n,a,i;u()(this,t);for(var o=arguments.length,s=Array(o),r=0;r<o;r++)s[r]=arguments[r];return n=a=h()(this,e.call.apply(e,[this].concat(s))),a.handleMouseEnter=function(e){a.hoverToPlay()&&e.target.play()},a.handleMouseLeave=function(e){a.hoverToPlay()&&(e.target.pause(),e.target.currentTime=0)},a.handleClick=function(e){var t=a.props,n=t.index,i=t.onClick;0===e.button&&(e.preventDefault(),i(n)),e.stopPropagation()},i=n,h()(a,i)}return g()(t,e),t.prototype.hoverToPlay=function(){var e=this.props.attachment;return!O.a&&"gifv"===e.get("type")},t.prototype.render=function(){var e=this.props,t=e.attachment,n=e.index,a=e.size,i=e.standalone,o=50,s=100,r="auto",l="auto",d="auto",u="auto";1===a&&(o=100),(4===a||3===a&&n>0)&&(s=50),2===a?0===n?u="2px":l="2px":3===a?(0===n?u="2px":n>0&&(l="2px"),1===n?d="2px":n>1&&(r="2px")):4===a&&(0!==n&&2!==n||(u="2px"),1!==n&&3!==n||(l="2px"),n<2?d="2px":r="2px");var p="";if("image"===t.get("type")){var h=t.get("preview_url"),f=t.getIn(["meta","small","width"]),g=t.get("url"),v=t.getIn(["meta","original","width"]),m="number"==typeof v&&"number"==typeof f,b=m?g+" "+v+"w, "+h+" "+f+"w":null,y=m?"(min-width: 1025px) "+o/100*320+"px, "+o+"vw":null,_=t.getIn(["meta","focus","x"])||0,M=t.getIn(["meta","focus","y"])||0,j=100*(_/2+.5),w=100*(M/-2+.5);p=c()("a",{className:"media-gallery__item-thumbnail",href:t.get("remote_url")||g,onClick:this.handleClick,target:"_blank"},void 0,c()("img",{src:h,srcSet:b,sizes:y,alt:t.get("description"),title:t.get("description"),style:{objectPosition:j+"% "+w+"%"}}))}else if("gifv"===t.get("type")){var I=!Object(k.a)()&&O.a;p=c()("div",{className:C()("media-gallery__gifv",{autoplay:I})},void 0,c()("video",{className:"media-gallery__item-gifv-thumbnail","aria-label":t.get("description"),role:"application",src:t.get("url"),onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,autoPlay:I,loop:!0,muted:!0}),c()("span",{className:"media-gallery__gifv__label"},void 0,"GIF"))}return c()("div",{className:C()("media-gallery__item",{standalone:i}),style:{left:l,top:r,right:u,bottom:d,width:o+"%",height:s+"%"}},t.get("id"),p)},t}(m.a.PureComponent),a.defaultProps={standalone:!1,index:0,size:1},i),I=Object(_.g)((r=s=function(e){function t(){var n,a,i;u()(this,t);for(var o=arguments.length,s=Array(o),r=0;r<o;r++)s[r]=arguments[r];return n=a=h()(this,e.call.apply(e,[this].concat(s))),a.state={visible:!a.props.sensitive||O.f},a.handleOpen=function(){a.setState({visible:!a.state.visible})},a.handleClick=function(e){a.props.onOpenMedia(a.props.media,e)},a.handleRef=function(e){e&&a.setState({width:e.offsetWidth})},i=n,h()(a,i)}return g()(t,e),t.prototype.componentWillReceiveProps=function(e){Object(b.is)(e.media,this.props.media)||this.setState({visible:!e.sensitive})},t.prototype.isStandaloneEligible=function(){var e=this.props,t=e.media;return e.standalone&&1===t.size&&t.getIn([0,"meta","smal
|
||
|
//# sourceMappingURL=status.js.map
|