silverstripe-contentreview/client/dist/js/contentreview.js.map

1 line
14 KiB
Plaintext

{"version":3,"sources":["webpack:///webpack/bootstrap 2e84be8a35a52c0a303b","webpack:///external \"jQuery\"","webpack:///./client/src/bundles/ContentReviewForm.js","webpack:///./client/src/bundles/ContentReviewSettings.js","webpack:///./client/src/bundles/PagesDueForReview.js","webpack:///./client/src/bundles/bundle.js","webpack:///external \"FormBuilderModal\"","webpack:///external \"Injector\"","webpack:///external \"React\"","webpack:///external \"ReactDom\"","webpack:///external \"ReactRedux\"","webpack:///external \"i18n\""],"names":["InjectableFormBuilderModal","provideInjector","jQuery","entwine","$","onclick","e","preventDefault","dialog","length","append","open","$link","target","window","location","attr","onunmatch","_clearModal","_renderModal","close","show","handleHide","handleSubmit","_handleSubmitModal","id","val","store","ss","sectionConfigKey","sectionConfig","getState","config","sections","find","section","name","modalSchemaUrl","form","ReviewContentForm","schemaUrl","title","i18n","_t","ReactDOM","render","unmountComponentAtNode","data","action","submitFn","onmatch","self","bind","show_option","value","currentVal","_super","_custom","_inherited","_disabled","hide","showCorrectSubsiteIDDropdown","domid","ownerIDDropdowns","i","change"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AChEA,wB;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,6BAA6B,oFAAAC,CAAgB,oFAAhB,CAAnC;;AAMA,8CAAAC,CAAOC,OAAP,CAAe,IAA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vC,CAA+C;AAE7C+C,WAF6C,qBAEnC;AACRW,mCAA6B,KAAKP,KAAlC;AACD,KAJ4C;AAO7CW,UAP6C,oBAOpC;AACPJ,mCAA6B,KAAKP,KAAlC;AACD;AAT4C,GAA/C;AAWD,CA3BD,E;;;;;;;;;;;ACLA;AACA;;;;;;;ACDA,kC;;;;;;ACAA,0B;;;;;;ACAA,uB;;;;;;ACAA,0B;;;;;;ACAA,4B;;;;;;ACAA,sB","file":"js/contentreview.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2e84be8a35a52c0a303b","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0","import i18n from 'i18n';\nimport jQuery from 'jquery';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { provideInjector } from 'lib/Injector';\nimport FormBuilderModal from 'components/FormBuilderModal/FormBuilderModal';\n\nconst InjectableFormBuilderModal = provideInjector(FormBuilderModal);\n\n/**\n * \"Content due for review\" modal popup. See AddToCampaignForm.js in\n * silverstripe/admin for reference.\n */\njQuery.entwine('ss', ($) => {\n\t/**\n * Kick off a \"content due for review\" dialog from the CMS actions.\n */\n $('.cms-content-actions .content-review__button').entwine({\n onclick(e) {\n e.preventDefault();\n\n let dialog = $('#content-review__dialog-wrapper');\n\n if (!dialog.length) {\n dialog = $('<div id=\"content-review__dialog-wrapper\" />');\n $('body').append(dialog);\n }\n\n dialog.open();\n\n return false;\n },\n });\n\n // This is required because the React version of e.preventDefault() doesn't work\n // this is to prevent PJAX request to occur when clicking a link the modal\n $('.content-review-modal .content-review-modal__nav-link').entwine({\n onclick: (e) => {\n e.preventDefault();\n const $link = $(e.target);\n window.location = $link.attr('href');\n },\n });\n\n\t/**\n * Uses React-Bootstrap in order to replicate the bootstrap styling and JavaScript behaviour.\n */\n $('#content-review__dialog-wrapper').entwine({\n onunmatch() {\n // solves errors given by ReactDOM \"no matched root found\" error.\n this._clearModal();\n },\n\n open() {\n this._renderModal(true);\n },\n\n close() {\n this._renderModal(false);\n },\n\n _renderModal(show) {\n const handleHide = () => this.close();\n const handleSubmit = (...args) => this._handleSubmitModal(...args);\n const id = $('form.cms-edit-form :input[name=ID]').val();\n const store = window.ss.store;\n const sectionConfigKey = 'SilverStripe\\\\CMS\\\\Controllers\\\\CMSPageEditController';\n const sectionConfig = store.getState().config.sections\n .find((section) => section.name === sectionConfigKey);\n const modalSchemaUrl = `${sectionConfig.form.ReviewContentForm.schemaUrl}/${id}`;\n const title = i18n._t(\n 'SilverStripe\\\\ContentReview\\\\Models\\\\ContentReviewLog.CONTENT_DUE_FOR_REVIEW',\n 'Content due for review'\n );\n\n ReactDOM.render(\n <Provider store={store}>\n <InjectableFormBuilderModal\n title={title}\n show={show}\n handleSubmit={handleSubmit}\n handleHide={handleHide}\n schemaUrl={modalSchemaUrl}\n bodyClassName=\"modal__dialog\"\n className=\"content-review-modal\"\n responseClassBad=\"modal__response modal__response--error\"\n responseClassGood=\"modal__response modal__response--good\"\n identifier=\"SilverStripe\\\\ContentReview\\\\Models\\\\ContentReviewLog.CONTENT_DUE_FOR_REVIEW\"\n />\n </Provider>,\n this[0]\n );\n },\n\n _clearModal() {\n ReactDOM.unmountComponentAtNode(this[0]);\n // this.empty();\n },\n\n _handleSubmitModal(data, action, submitFn) {\n return submitFn();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/ContentReviewForm.js","import jQuery from 'jquery';\n\njQuery.entwine('ss', ($) => {\n /**\n * Class: .cms-edit-form #Form_EditForm_ContentReviewType_Holder\n *\n * Toggle display of group dropdown in \"access\" tab,\n * based on selection of radiobuttons.\n */\n $('.cms-edit-form #Form_EditForm_ContentReviewType_Holder').entwine({\n // Constructor: onmatch\n onmatch() {\n const self = this;\n this.find('.optionset :input').bind('change', (e) => {\n self.show_option(e.target.value);\n });\n\n // initial state\n const currentVal = this.find('input[name=ContentReviewType]:checked').val();\n this.show_option(currentVal);\n this._super();\n },\n\n onunmatch() {\n return this._super();\n },\n\n show_option(value) {\n if (value === 'Custom') {\n this._custom();\n } else if (value === 'Inherit') {\n this._inherited();\n } else {\n this._disabled();\n }\n },\n\n _custom() {\n $('.review-settings').show();\n $('.field.custom-setting').show();\n },\n\n _inherited() {\n $('.review-settings').show();\n $('.field.custom-setting').hide();\n },\n\n _disabled() {\n $('.review-settings').hide();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/ContentReviewSettings.js","import jQuery from 'jquery';\n\n/**\n * @todo Re-validate this with Subsites\n */\njQuery.entwine('ss', ($) => {\n // Hide all owner dropdowns except the one for the current subsite\n function showCorrectSubsiteIDDropdown(value) {\n const domid = `ContentReviewOwnerID${value}`;\n\n const ownerIDDropdowns = $('div.subsiteSpecificOwnerID');\n let i = 0;\n for (i = 0; i < ownerIDDropdowns.length; i++) {\n if (ownerIDDropdowns[i].id === domid) {\n $(ownerIDDropdowns[i]).show();\n } else {\n $(ownerIDDropdowns[i]).hide();\n }\n }\n }\n\n $('#Form_EditForm_SubsiteIDWithOwner').entwine({\n // Call method to show on report load\n onmatch() {\n showCorrectSubsiteIDDropdown(this.value);\n },\n\n // Call method to show on dropdown change\n change() {\n showCorrectSubsiteIDDropdown(this.value);\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/PagesDueForReview.js","import 'bundles/ContentReviewForm.js';\nimport 'bundles/ContentReviewSettings.js';\nimport 'bundles/PagesDueForReview.js';\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle.js","module.exports = FormBuilderModal;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"FormBuilderModal\"\n// module id = 5\n// module chunks = 0","module.exports = Injector;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"Injector\"\n// module id = 6\n// module chunks = 0","module.exports = React;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"React\"\n// module id = 7\n// module chunks = 0","module.exports = ReactDom;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"ReactDom\"\n// module id = 8\n// module chunks = 0","module.exports = ReactRedux;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"ReactRedux\"\n// module id = 9\n// module chunks = 0","module.exports = i18n;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"i18n\"\n// module id = 10\n// module chunks = 0"],"sourceRoot":""}