Merge branch 'remove-avatar-header' into 'develop'
[akkoma] / priv / static / packs / modals / embed_modal.js
index cf479060cb0eab07d3803831aa9801c1a7b76f25..09f5cd364d050a8a194a37a5cb38690f564dcf80 100644 (file)
@@ -1,2 +1,2 @@
-webpackJsonp([32],{837:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),a.d(t,"default",function(){return k});var i,o,n,r=a(2),s=a.n(r),d=a(1),l=a.n(d),c=a(3),m=a.n(c),u=a(4),f=a.n(u),b=a(0),h=a.n(b),p=a(5),v=a.n(p),y=a(12),g=a.n(y),w=a(7),_=a(11),k=Object(w.g)((n=o=function(e){function t(){var a,i,o;l()(this,t);for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];return a=i=m()(this,e.call.apply(e,[this].concat(r))),i.state={loading:!1,oembed:null},i.setIframeRef=function(e){i.iframe=e},i.handleTextareaClick=function(e){e.target.select()},o=a,m()(i,o)}return f()(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.url;this.setState({loading:!0}),Object(_.a)().post("/api/web/embed",{url:t}).then(function(t){e.setState({loading:!1,oembed:t.data});var a=e.iframe.contentWindow.document;a.open(),a.write(t.data.html),a.close(),a.body.style.margin=0,e.iframe.width=a.body.scrollWidth,e.iframe.height=a.body.scrollHeight}).catch(function(t){e.props.onError(t)})},t.prototype.render=function(){var e=this.state.oembed;return s()("div",{className:"modal-root__modal embed-modal"},void 0,s()("h4",{},void 0,s()(w.b,{id:"status.embed",defaultMessage:"Embed"})),s()("div",{className:"embed-modal__container"},void 0,s()("p",{className:"hint"},void 0,s()(w.b,{id:"embed.instructions",defaultMessage:"Embed this status on your website by copying the code below."})),s()("input",{type:"text",className:"embed-modal__html",readOnly:!0,value:e&&e.html||"",onClick:this.handleTextareaClick}),s()("p",{className:"hint"},void 0,s()(w.b,{id:"embed.preview",defaultMessage:"Here is what it will look like:"})),h.a.createElement("iframe",{className:"embed-modal__iframe",frameBorder:"0",ref:this.setIframeRef,title:"preview"})))},t}(g.a),o.propTypes={url:v.a.string.isRequired,onClose:v.a.func.isRequired,onError:v.a.func.isRequired,intl:v.a.object.isRequired},i=n))||i}});
+(window.webpackJsonp=window.webpackJsonp||[]).push([[180],{688:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return j});var i,o,n,r=a(0),s=a(2),c=a(6),d=a(1),l=a(3),b=a.n(l),m=a(5),u=a.n(m),f=a(25),h=a(7),p=a(9),j=Object(h.g)((n=o=function(o){function e(){for(var t,e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return t=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(s.a)(t),"state",{loading:!1,oembed:null}),Object(d.a)(Object(s.a)(t),"setIframeRef",function(e){t.iframe=e}),Object(d.a)(Object(s.a)(t),"handleTextareaClick",function(e){e.target.select()}),t}Object(c.a)(e,o);var t=e.prototype;return t.componentDidMount=function(){var a=this,e=this.props.url;this.setState({loading:!0}),Object(p.a)().post("/api/web/embed",{url:e}).then(function(e){a.setState({loading:!1,oembed:e.data});var t=a.iframe.contentWindow.document;t.open(),t.write(e.data.html),t.close(),t.body.style.margin=0,a.iframe.width=t.body.scrollWidth,a.iframe.height=t.body.scrollHeight}).catch(function(e){a.props.onError(e)})},t.render=function(){var e=this.state.oembed;return Object(r.a)("div",{className:"modal-root__modal embed-modal"},void 0,Object(r.a)("h4",{},void 0,Object(r.a)(h.b,{id:"status.embed",defaultMessage:"Embed"})),Object(r.a)("div",{className:"embed-modal__container"},void 0,Object(r.a)("p",{className:"hint"},void 0,Object(r.a)(h.b,{id:"embed.instructions",defaultMessage:"Embed this status on your website by copying the code below."})),Object(r.a)("input",{type:"text",className:"embed-modal__html",readOnly:!0,value:e&&e.html||"",onClick:this.handleTextareaClick}),Object(r.a)("p",{className:"hint"},void 0,Object(r.a)(h.b,{id:"embed.preview",defaultMessage:"Here is what it will look like:"})),b.a.createElement("iframe",{className:"embed-modal__iframe",frameBorder:"0",ref:this.setIframeRef,sandbox:"allow-same-origin",title:"preview"})))},e}(f.a),Object(d.a)(o,"propTypes",{url:u.a.string.isRequired,onClose:u.a.func.isRequired,onError:u.a.func.isRequired,intl:u.a.object.isRequired}),i=n))||i}}]);
 //# sourceMappingURL=embed_modal.js.map
\ No newline at end of file