first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
define("report_participation/participants",["exports","jquery","core/custom_interaction_events","core/modal_events","core/notification","core_user/local/participants/bulkactions"],(function(_exports,_jquery,_custom_interaction_events,_modal_events,_notification,_bulkactions){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
/**
* Some UI stuff for participants page.
* This is also used by the report/participants/index.php because it has the same functionality.
*
* @module report_participation/participants
* @copyright 2017 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=_interopRequireDefault(_jquery),_custom_interaction_events=_interopRequireDefault(_custom_interaction_events),_modal_events=_interopRequireDefault(_modal_events),_notification=_interopRequireDefault(_notification);const Selectors_bulkActionSelect="#formactionid",Selectors_bulkUserSelectedCheckBoxes="input[data-togglegroup^='participants-table'][data-toggle='slave']:checked",Selectors_participantsForm="#participantsform";_exports.init=()=>{const root=document.querySelector(Selectors_participantsForm),resetBulkAction=bulkActionSelect=>{bulkActionSelect.value=""};_custom_interaction_events.default.define(Selectors_bulkActionSelect,[_custom_interaction_events.default.events.accessibleChange]),(0,_jquery.default)(Selectors_bulkActionSelect).on(_custom_interaction_events.default.events.accessibleChange,(e=>{const action=e.target.value,checkboxes=root.querySelectorAll(Selectors_bulkUserSelectedCheckBoxes);if(-1!==action.indexOf("#")){e.preventDefault();const ids=[];checkboxes.forEach((checkbox=>{ids.push(checkbox.getAttribute("name").replace("user",""))})),"#messageselect"===action&&(0,_bulkactions.showSendMessage)(ids).then((modal=>(modal.getRoot().on(_modal_events.default.hidden,(()=>{const bulkActionSelector=root.querySelector(Selectors_bulkActionSelect);resetBulkAction(bulkActionSelector),bulkActionSelector.focus()})),modal))).catch(_notification.default.exception)}else""!==action&&checkboxes.length&&e.target.form().submit();resetBulkAction(e.target)}))}}));
//# sourceMappingURL=participants.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"participants.min.js","sources":["../src/participants.js"],"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 report_participation/participants\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'][data-toggle='slave']: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"],"names":["Selectors","root","document","querySelector","resetBulkAction","bulkActionSelect","value","define","CustomEvents","events","accessibleChange","on","e","action","target","checkboxes","querySelectorAll","indexOf","preventDefault","ids","forEach","checkbox","push","getAttribute","replace","then","modal","getRoot","ModalEvents","hidden","bulkActionSelector","focus","catch","Notification","exception","length","form","submit"],"mappings":";;;;;;;;sTA8BMA,2BACgB,gBADhBA,qCAE0B,6EAF1BA,2BAGgB,kCAGF,WACVC,KAAOC,SAASC,cAAcH,4BA4C9BI,gBAAkBC,mBACpBA,iBAAiBC,MAAQ,uCApCZC,OAAOP,2BAA4B,CAACQ,mCAAaC,OAAOC,uCAC9DV,4BAA4BW,GAAGH,mCAAaC,OAAOC,kBAAkBE,UAClEC,OAASD,EAAEE,OAAOR,MAClBS,WAAad,KAAKe,iBAAiBhB,0CAEZ,IAAzBa,OAAOI,QAAQ,KAAa,CAC5BL,EAAEM,uBAEIC,IAAM,GACZJ,WAAWK,SAAQC,WACfF,IAAIG,KAAKD,SAASE,aAAa,QAAQC,QAAQ,OAAQ,QAG5C,mBAAXX,yCACgBM,KACfM,MAAKC,QACFA,MAAMC,UAAUhB,GAAGiB,sBAAYC,QAAQ,WAE7BC,mBAAqB7B,KAAKE,cAAcH,4BAC9CI,gBAAgB0B,oBAChBA,mBAAmBC,WAGhBL,SAEVM,MAAMC,sBAAaC,eAEN,KAAXrB,QAAiBE,WAAWoB,QACnCvB,EAAEE,OAAOsB,OAAOC,SAGpBjC,gBAAgBQ,EAAEE"}
@@ -0,0 +1,87 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Some UI stuff for participants page.
* This is also used by the report/participants/index.php because it has the same functionality.
*
* @module report_participation/participants
* @copyright 2017 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import jQuery from 'jquery';
import CustomEvents from 'core/custom_interaction_events';
import ModalEvents from 'core/modal_events';
import Notification from 'core/notification';
import {showSendMessage} from 'core_user/local/participants/bulkactions';
const Selectors = {
bulkActionSelect: "#formactionid",
bulkUserSelectedCheckBoxes: "input[data-togglegroup^='participants-table'][data-toggle='slave']:checked",
participantsForm: '#participantsform',
};
export const init = () => {
const root = document.querySelector(Selectors.participantsForm);
/**
* Private method.
*
* @method registerEventListeners
* @private
*/
const registerEventListeners = () => {
CustomEvents.define(Selectors.bulkActionSelect, [CustomEvents.events.accessibleChange]);
jQuery(Selectors.bulkActionSelect).on(CustomEvents.events.accessibleChange, e => {
const action = e.target.value;
const checkboxes = root.querySelectorAll(Selectors.bulkUserSelectedCheckBoxes);
if (action.indexOf('#') !== -1) {
e.preventDefault();
const ids = [];
checkboxes.forEach(checkbox => {
ids.push(checkbox.getAttribute('name').replace('user', ''));
});
if (action === '#messageselect') {
showSendMessage(ids)
.then(modal => {
modal.getRoot().on(ModalEvents.hidden, () => {
// Focus on the action select when the dialog is closed.
const bulkActionSelector = root.querySelector(Selectors.bulkActionSelect);
resetBulkAction(bulkActionSelector);
bulkActionSelector.focus();
});
return modal;
})
.catch(Notification.exception);
}
} else if (action !== '' && checkboxes.length) {
e.target.form().submit();
}
resetBulkAction(e.target);
});
};
const resetBulkAction = bulkActionSelect => {
bulkActionSelect.value = '';
};
registerEventListeners();
};