silverstripe-contentreview/client/dist/js/contentreview.js
github-actions[bot] efa4ddad61
DEP Update JS dependencies (#228)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-02 14:17:38 +13:00

1 line
3.0 KiB
JavaScript

!function(){"use strict";var e={592:function(e,t,n){var o=a(n(815)),i=a(n(669)),s=a(n(594)),r=n(145);function a(e){return e&&e.__esModule?e:{default:e}}const l=(0,n(207).loadComponent)("FormBuilderModal");i.default.entwine("ss",(e=>{e(".cms-content-actions .content-review__button").entwine({onclick(t){t.preventDefault();let n=e("#content-review__dialog-wrapper");return n.length||(n=e('<div id="content-review__dialog-wrapper" />'),e("body").append(n)),n.open(),!1}}),e(".content-review-modal .content-review-modal__nav-link").entwine({onclick:t=>{t.preventDefault();const n=e(t.target);window.location=n.attr("href")}}),e("#content-review__dialog-wrapper").entwine({ReactRoot:null,onunmatch(){this._clearModal()},open(){this._renderModal(!0)},close(){this._renderModal(!1)},_renderModal(t){var n=this;const i=e("form.cms-edit-form :input[name=ID]").val(),a=`${window.ss.store.getState().config.sections.find((e=>"SilverStripe\\CMS\\Controllers\\CMSPageEditController"===e.name)).form.ReviewContentForm.schemaUrl}/${i}`,d=o.default._t("ContentReview.CONTENT_DUE_FOR_REVIEW","Content due for review");let c=this.getReactRoot();c||(c=(0,r.createRoot)(this[0]),this.setReactRoot(c)),c.render(s.default.createElement(l,{title:d,isOpen:t,onSubmit:function(){return n._handleSubmitModal(...arguments)},onClosed:()=>this.close(),schemaUrl:a,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"}))},_clearModal(){const e=this.getReactRoot();e&&(e.unmount(),this.setReactRoot(null))},_handleSubmitModal(t,n,o){return e(".content-review__button-holder").remove(),o()}})}))},483:function(e,t,n){var o;((o=n(669))&&o.__esModule?o:{default:o}).default.entwine("ss",(e=>{e(".cms-edit-form #Form_EditForm_ContentReviewType_Holder").entwine({onmatch(){const e=this;this.find(".optionset :input").bind("change",(t=>{e.show_option(t.target.value)}));const t=this.find("input[name=ContentReviewType]:checked").val();this.show_option(t),this._super()},onunmatch(){return this._super()},show_option(e){"Custom"===e?this._custom():"Inherit"===e?this._inherited():this._disabled()},_custom(){e(".review-settings").show(),e(".field.custom-setting").show()},_inherited(){e(".review-settings").show(),e(".field.custom-setting").hide()},_disabled(){e(".review-settings").hide()}})}))},22:function(e,t,n){var o;((o=n(669))&&o.__esModule?o:{default:o}).default.entwine("ss",(e=>{function t(t){const n=`ContentReviewOwnerID${t}`,o=e("div.subsiteSpecificOwnerID");let i=0;for(i=0;i<o.length;i++)o[i].id===n?e(o[i]).show():e(o[i]).hide()}e("#Form_EditForm_SubsiteIDWithOwner").entwine({onmatch(){t(this.value)},change(){t(this.value)}})}))},207:function(e){e.exports=Injector},594:function(e){e.exports=React},145:function(e){e.exports=ReactDomClient},815:function(e){e.exports=i18n},669:function(e){e.exports=jQuery}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n(592),n(483),n(22)}();