silverstripe-contentreview/client/dist/js/contentreview.js
Robbie Averill 19a9d55298 FIX Remove unused variables import and fix the close modal button after submitting
Also update to use the FormBuilderModal component, matching AddToCampaignForm in core.
2018-01-11 15:49:07 +13:00

1 line
3.4 KiB
JavaScript

!function(n){function e(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return n[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t={};e.m=n,e.c=t,e.i=function(n){return n},e.d=function(n,t,o){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:o})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=4)}([function(n,e){n.exports=jQuery},function(n,e,t){"use strict";var o=t(8),i=t.n(o),r=t(0),s=t.n(r),c=t(6),a=t.n(c),u=t(7),d=t.n(u),l=t(5),f=(t.n(l),t.i(l.loadComponent)("FormBuilderModal"));s.a.entwine("ss",function(n){n(".cms-content-actions .content-review__button").entwine({onclick:function(){var e=n("#content-review__dialog-wrapper");return e.length||(e=n('<div id="content-review__dialog-wrapper" />'),n("body").append(e)),e.open(),!1}}),n(".content-review-modal .content-review-modal__nav-link").entwine({onclick:function(e){e.preventDefault();var t=n(e.target);window.location=t.attr("href")}}),n("#content-review__dialog-wrapper").entwine({onunmatch:function(){this._clearModal()},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(e){var t=this,o=function(){return t.close()},r=function(){return t._handleSubmitModal.apply(t,arguments)},s=n("form.cms-edit-form :input[name=ID]").val(),c=window.ss.store,u=c.getState().config.sections.find(function(n){return"SilverStripe\\CMS\\Controllers\\CMSPageEditController"===n.name}),l=u.form.ReviewContentForm.schemaUrl+"/"+s,_=i.a._t("ContentReview.CONTENT_DUE_FOR_REVIEW","Content due for review");d.a.render(a.a.createElement(f,{title:_,show:e,onSubmit:r,onHide:o,schemaUrl:l,bodyClassName:"modal__dialog",className:"content-review-modal",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good",identifier:"ContentReview.CONTENT_DUE_FOR_REVIEW"}),this[0])},_clearModal:function(){d.a.unmountComponentAtNode(this[0])},_handleSubmitModal:function(e,t,o){return n(".content-review__button-holder").remove(),o()}})})},function(n,e,t){"use strict";var o=t(0);t.n(o).a.entwine("ss",function(n){n(".cms-edit-form #Form_EditForm_ContentReviewType_Holder").entwine({onmatch:function(){var n=this;this.find(".optionset :input").bind("change",function(e){n.show_option(e.target.value)});var e=this.find("input[name=ContentReviewType]:checked").val();this.show_option(e),this._super()},onunmatch:function(){return this._super()},show_option:function(n){"Custom"===n?this._custom():"Inherit"===n?this._inherited():this._disabled()},_custom:function(){n(".review-settings").show(),n(".field.custom-setting").show()},_inherited:function(){n(".review-settings").show(),n(".field.custom-setting").hide()},_disabled:function(){n(".review-settings").hide()}})})},function(n,e,t){"use strict";var o=t(0);t.n(o).a.entwine("ss",function(n){function e(e){var t="ContentReviewOwnerID"+e,o=n("div.subsiteSpecificOwnerID"),i=0;for(i=0;i<o.length;i++)o[i].id===t?n(o[i]).show():n(o[i]).hide()}n("#Form_EditForm_SubsiteIDWithOwner").entwine({onmatch:function(){e(this.value)},change:function(){e(this.value)}})})},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(1),t(2),t(3)},function(n,e){n.exports=Injector},function(n,e){n.exports=React},function(n,e){n.exports=ReactDom},function(n,e){n.exports=i18n}]);