Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/report/participation/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/report/participation/amd/build/participants.min.js.map

{"version":3,"sources":["../src/participants.js"],"names":["Selectors","bulkActionSelect","bulkUserSelectedCheckBoxes","participantsForm","init","root","document","querySelector","registerEventListeners","CustomEvents","define","events","accessibleChange","on","e","action","target","value","checkboxes","querySelectorAll","indexOf","preventDefault","ids","forEach","checkbox","push","getAttribute","replace","then","modal","getRoot","ModalEvents","hidden","bulkActionSelector","resetBulkAction","focus","catch","Notification","exception","length","form","submit"],"mappings":"uRAyBA,OACA,OACA,OACA,O,sDAGMA,CAAAA,CAAS,CAAG,CACdC,gBAAgB,CAAE,eADJ,CAEdC,0BAA0B,CAAE,uDAFd,CAGdC,gBAAgB,CAAE,mBAHJ,C,QAME,QAAPC,CAAAA,IAAO,EAAM,IAChBC,CAAAA,CAAI,CAAGC,QAAQ,CAACC,aAAT,CAAuBP,CAAS,CAACG,gBAAjC,CADS,CAShBK,CAAsB,CAAG,UAAM,CACjCC,UAAaC,MAAb,CAAoBV,CAAS,CAACC,gBAA9B,CAAgD,CAACQ,UAAaE,MAAb,CAAoBC,gBAArB,CAAhD,EACA,cAAOZ,CAAS,CAACC,gBAAjB,EAAmCY,EAAnC,CAAsCJ,UAAaE,MAAb,CAAoBC,gBAA1D,CAA4E,SAAAE,CAAC,CAAI,IACvEC,CAAAA,CAAM,CAAGD,CAAC,CAACE,MAAF,CAASC,KADqD,CAEvEC,CAAU,CAAGb,CAAI,CAACc,gBAAL,CAAsBnB,CAAS,CAACE,0BAAhC,CAF0D,CAI7E,GAA4B,CAAC,CAAzB,GAAAa,CAAM,CAACK,OAAP,CAAe,GAAf,CAAJ,CAAgC,CAC5BN,CAAC,CAACO,cAAF,GAEA,GAAMC,CAAAA,CAAG,CAAG,EAAZ,CACAJ,CAAU,CAACK,OAAX,CAAmB,SAAAC,CAAQ,CAAI,CAC3BF,CAAG,CAACG,IAAJ,CAASD,CAAQ,CAACE,YAAT,CAAsB,MAAtB,EAA8BC,OAA9B,CAAsC,MAAtC,CAA8C,EAA9C,CAAT,CACH,CAFD,EAIA,GAAe,gBAAX,GAAAZ,CAAJ,CAAiC,CAC7B,sBAAgBO,CAAhB,EACCM,IADD,CACM,SAAAC,CAAK,CAAI,CACXA,CAAK,CAACC,OAAN,GAAgBjB,EAAhB,CAAmBkB,UAAYC,MAA/B,CAAuC,UAAM,CAEzC,GAAMC,CAAAA,CAAkB,CAAG5B,CAAI,CAACE,aAAL,CAAmBP,CAAS,CAACC,gBAA7B,CAA3B,CACAiC,CAAe,CAACD,CAAD,CAAf,CACAA,CAAkB,CAACE,KAAnB,EACH,CALD,EAOA,MAAON,CAAAA,CACV,CAVD,EAWCO,KAXD,CAWOC,UAAaC,SAXpB,CAYH,CACJ,CAtBD,IAsBO,IAAe,EAAX,GAAAvB,CAAM,EAAWG,CAAU,CAACqB,MAAhC,CAAwC,CAC3CzB,CAAC,CAACE,MAAF,CAASwB,IAAT,GAAgBC,MAAhB,EACH,CAEDP,CAAe,CAACpB,CAAC,CAACE,MAAH,CAClB,CA/BD,CAgCH,CA3CqB,CA6ChBkB,CAAe,CAAG,SAAAjC,CAAgB,CAAI,CACxCA,CAAgB,CAACgB,KAAjB,CAAyB,EAC5B,CA/CqB,CAiDtBT,CAAsB,EACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Some UI stuff for participants page.\n * This is also used by the report/participants/index.php because it has the same functionality.\n *\n * @module     core_user/participants\n * @package    core_user\n * @copyright  2017 Damyon Wiese\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport jQuery from 'jquery';\nimport CustomEvents from 'core/custom_interaction_events';\nimport ModalEvents from 'core/modal_events';\nimport Notification from 'core/notification';\nimport {showSendMessage} from 'core_user/local/participants/bulkactions';\n\nconst Selectors = {\n    bulkActionSelect: \"#formactionid\",\n    bulkUserSelectedCheckBoxes: \"input[data-togglegroup^='participants-table']:checked\",\n    participantsForm: '#participantsform',\n};\n\nexport const init = () => {\n    const root = document.querySelector(Selectors.participantsForm);\n\n    /**\n     * Private method.\n     *\n     * @method registerEventListeners\n     * @private\n     */\n    const registerEventListeners = () => {\n        CustomEvents.define(Selectors.bulkActionSelect, [CustomEvents.events.accessibleChange]);\n        jQuery(Selectors.bulkActionSelect).on(CustomEvents.events.accessibleChange, e => {\n            const action = e.target.value;\n            const checkboxes = root.querySelectorAll(Selectors.bulkUserSelectedCheckBoxes);\n\n            if (action.indexOf('#') !== -1) {\n                e.preventDefault();\n\n                const ids = [];\n                checkboxes.forEach(checkbox => {\n                    ids.push(checkbox.getAttribute('name').replace('user', ''));\n                });\n\n                if (action === '#messageselect') {\n                    showSendMessage(ids)\n                    .then(modal => {\n                        modal.getRoot().on(ModalEvents.hidden, () => {\n                            // Focus on the action select when the dialog is closed.\n                            const bulkActionSelector = root.querySelector(Selectors.bulkActionSelect);\n                            resetBulkAction(bulkActionSelector);\n                            bulkActionSelector.focus();\n                        });\n\n                        return modal;\n                    })\n                    .catch(Notification.exception);\n                }\n            } else if (action !== '' && checkboxes.length) {\n                e.target.form().submit();\n            }\n\n            resetBulkAction(e.target);\n        });\n    };\n\n    const resetBulkAction = bulkActionSelect => {\n        bulkActionSelect.value = '';\n    };\n\n    registerEventListeners();\n};\n"],"file":"participants.min.js"}