Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / priv / static / packs / flavours / glitch / async / embed_modal.js
index 9f18e4f17363916ee3fb5990e76b89362c1283f9..6b2709250c1f51bbe395988da616fa49de77cbfe 100644 (file)
@@ -1,2 +1,2 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{678:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return j});var i,o,n,s=a(1),c=a(6),r=a(0),d=a(2),l=a(3),b=a.n(l),m=a(5),u=a.n(m),f=a(24),h=a(7),p=a(10),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(r.a)(Object(r.a)(t)),"state",{loading:!1,oembed:null}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"setIframeRef",function(e){t.iframe=e}),Object(d.a)(Object(r.a)(Object(r.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})},t.render=function(){var e=this.state.oembed;return Object(s.a)("div",{className:"modal-root__modal embed-modal"},void 0,Object(s.a)("h4",{},void 0,Object(s.a)(h.b,{id:"status.embed",defaultMessage:"Embed"})),Object(s.a)("div",{className:"embed-modal__container"},void 0,Object(s.a)("p",{className:"hint"},void 0,Object(s.a)(h.b,{id:"embed.instructions",defaultMessage:"Embed this status on your website by copying the code below."})),Object(s.a)("input",{type:"text",className:"embed-modal__html",readOnly:!0,value:e&&e.html||"",onClick:this.handleTextareaClick}),Object(s.a)("p",{className:"hint"},void 0,Object(s.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,intl:u.a.object.isRequired}),i=n))||i}}]);
+(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{808:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return g}));var o,i,s,r=a(0),n=a(2),l=(a(9),a(6),a(8)),c=a(1),d=a(3),m=a.n(d),b=a(5),u=a.n(b),p=a(21),f=a(7),h=a(13),j=a(41);var O=Object(f.f)({close:{id:"lightbox.close",defaultMessage:"Close"}}),g=Object(f.g)((s=i=function(e){Object(l.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return t=e.call.apply(e,[this].concat(o))||this,Object(c.a)(Object(n.a)(t),"state",{loading:!1,oembed:null}),Object(c.a)(Object(n.a)(t),"setIframeRef",(function(e){t.iframe=e})),Object(c.a)(Object(n.a)(t),"handleTextareaClick",(function(e){e.target.select()})),t}var o=a.prototype;return o.componentDidMount=function(){var e=this,t=this.props.url;this.setState({loading:!0}),Object(h.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)}))},o.render=function(){var e=this.props,t=e.intl,a=e.onClose,o=this.state.oembed;return Object(r.a)("div",{className:"modal-root__modal report-modal embed-modal"},void 0,Object(r.a)("div",{className:"report-modal__target"},void 0,Object(r.a)(j.a,{className:"media-modal__close",title:t.formatMessage(O.close),icon:"times",onClick:a,size:16}),Object(r.a)(f.b,{id:"status.embed",defaultMessage:"Embed"})),Object(r.a)("div",{className:"report-modal__container embed-modal__container",style:{display:"block"}},void 0,Object(r.a)("p",{className:"hint"},void 0,Object(r.a)(f.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:o&&o.html||"",onClick:this.handleTextareaClick}),Object(r.a)("p",{className:"hint"},void 0,Object(r.a)(f.b,{id:"embed.preview",defaultMessage:"Here is what it will look like:"})),m.a.createElement("iframe",{className:"embed-modal__iframe",frameBorder:"0",ref:this.setIframeRef,sandbox:"allow-same-origin",title:"preview"})))},a}(p.a),Object(c.a)(i,"propTypes",{url:u.a.string.isRequired,onClose:u.a.func.isRequired,onError:u.a.func.isRequired,intl:u.a.object.isRequired}),o=s))||o}}]);
 //# sourceMappingURL=embed_modal.js.map
\ No newline at end of file