diff --git a/client/dist/bundle.min.js b/client/dist/bundle.min.js index 0e99131..37fc967 100644 --- a/client/dist/bundle.min.js +++ b/client/dist/bundle.min.js @@ -1,5 +1,5 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";n(1),n(7),n(8)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(2),o=r(i),a=n(3),s=r(a),l=n(4),u=r(l),c=n(5),d=n(6),p=(0,d.provideInjector)(window.InsertEmbedModal.default);o.default.entwine("ss",function(e){e("#insert-md-embed-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this.setData({}),this._renderModal(!1)},_renderModal:function(e){var t=this,n=function(){return t.close()},r=function(){return t._handleInsert.apply(t,arguments)},i=function(){return t._handleCreate.apply(t,arguments)},o=function(){return t._handleLoadingError.apply(t,arguments)},a=window.ss.store,l=window.ss.apolloClient,d=this.getOriginalAttributes();u.default.render(s.default.createElement(c.ApolloProvider,{store:a,client:l},s.default.createElement(p,{show:e,onCreate:i,onInsert:r,onHide:n,onLoadingError:o,fileAttributes:d,bodyClassName:"modal__dialog modal__dialog--scrollable",className:"insert-embed-react__dialog-wrapper"})),this[0])},_handleLoadingError:function(){this.setData({}),this.open()},_handleInsert:function(e){var t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate:function(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes:function(){var e=this.getData();return e},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var n=e.split(" ");return t.find(function(e){return n.indexOf(e)>-1})},insertRemote:function(){var e=this.getElement();if(!e)return!1;var t=this.getData(),n='[embed url="'+t.Url+'" thumbnail="'+t.PreviewUrl+'" width="'+t.Width+'" height="'+t.Height+'" ]',r=e.codemirror.getCursor();return e.codemirror.setSelection(r,r),e.codemirror.replaceSelection("\n"+n+"\n"),this.updateTextarea(),!0},updateTextarea:function(){var t=this.getElement();e(t.element).closest(".js-markdown-holder").find("textarea.markdowneditor").val(t.value())}})})},function(e,t){e.exports=jQuery},function(e,t){e.exports=React},function(e,t){e.exports=ReactDom},function(e,t){e.exports=ReactApollo},function(e,t){e.exports=Injector},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(2),o=r(i),a=n(3),s=r(a),l=n(4),u=r(l),c=n(5),d=n(6),p=(0,d.provideInjector)(window.InsertMediaModal.default);o.default.entwine("ss",function(e){e("#insert-md-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(e){var t=this,n=function(){return t.close()},r=function(){return t._handleInsert.apply(t,arguments)},i=window.ss.store,o=window.ss.apolloClient,a=this.getOriginalAttributes();delete a.url,u.default.render(s.default.createElement(c.ApolloProvider,{store:i,client:o},s.default.createElement(p,{title:!1,type:"insert-media",show:e,onInsert:r,onHide:n,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:!1,fileAttributes:a})),this[0])},_handleInsert:function(e,t){var n=!1;this.setData(Object.assign({},e,t));try{var r=null;switch(r=t?t.category:"image"){case"image":n=this.insertImage();break;default:n=this.insertFile()}}catch(e){this.statusMessage(e,"bad")}return n&&this.close(),Promise.resolve()},getOriginalAttributes:function(){return{}},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];return t.find(function(t){var n=new RegExp("\\b"+t+"\\b");return n.test(e)})},getAttributes:function(){var e=this.getData();return{src:e.url,alt:e.AltText,width:e.InsertWidth,height:e.InsertHeight,title:e.TitleTooltip,class:e.Alignment,"data-id":e.ID,"data-shortcode":"image"}},getExtraData:function(){var e=this.getData();return{CaptionText:e&&e.Caption}},insertFile:function(){var e=this.getElement(),t=this.getData(),n=t.title||t.filename,r="["+n+"]([file_link,id="+t.ID+"])",i=e.codemirror.getCursor();return e.codemirror.setSelection(i,i),e.codemirror.replaceSelection("\n"+r+"\n"),this.updateTextarea(),!0},insertImage:function(){var e=this.getElement();if(!e)return!1;var t=this.getData(),n=this.getExtraData(),r="!["+(n.CaptionText?n.CaptionText:t.title)+"]([image_link id="+t.ID+" width="+t.width+" height="+t.height+'] "'+t.title+'")',i=e.codemirror.getCursor();return e.codemirror.setSelection(i,i),e.codemirror.replaceSelection("\n"+r+"\n"),this.updateTextarea(),!0},statusMessage:function(t,n){var r=e("
").text(t).html();e.noticeAdd({text:r,type:n,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})},updateTextarea:function(){var t=this.getElement();e(t.element).closest(".js-markdown-holder").find("textarea.markdowneditor").val(t.value())}})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 a(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 s=function(){function e(e,t){for(var n=0;n