mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-72013-master-int' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
6863a92722
141 changed files with 504 additions and 303 deletions
64
.eslintrc
64
.eslintrc
|
@ -2,6 +2,7 @@
|
||||||
'plugins': [
|
'plugins': [
|
||||||
'babel',
|
'babel',
|
||||||
'promise',
|
'promise',
|
||||||
|
'jsdoc',
|
||||||
],
|
],
|
||||||
'env': {
|
'env': {
|
||||||
'browser': true,
|
'browser': true,
|
||||||
|
@ -191,7 +192,6 @@
|
||||||
'property': 'str',
|
'property': 'str',
|
||||||
'message': 'Use AMD module "core/str" or M.util.get_string()'
|
'message': 'Use AMD module "core/str" or M.util.get_string()'
|
||||||
}],
|
}],
|
||||||
|
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
@ -200,7 +200,23 @@
|
||||||
rules: {
|
rules: {
|
||||||
'no-undef': 'off',
|
'no-undef': 'off',
|
||||||
'no-unused-vars': 'off',
|
'no-unused-vars': 'off',
|
||||||
'no-unused-expressions': 'off'
|
'no-unused-expressions': 'off',
|
||||||
|
|
||||||
|
// === JSDocs ===
|
||||||
|
"jsdoc/check-access": 'off',
|
||||||
|
"jsdoc/check-alignment": 'off',
|
||||||
|
"jsdoc/check-param-names": 'off',
|
||||||
|
"jsdoc/check-property-names": 'off',
|
||||||
|
"jsdoc/empty-tags": 'off',
|
||||||
|
"jsdoc/implements-on-classes": 'off',
|
||||||
|
"jsdoc/multiline-blocks": 'off',
|
||||||
|
"jsdoc/require-jsdoc": 'off',
|
||||||
|
"jsdoc/require-param": 'off',
|
||||||
|
"jsdoc/require-param-name": 'off',
|
||||||
|
"jsdoc/require-param-type": 'off',
|
||||||
|
"jsdoc/require-property": 'off',
|
||||||
|
"jsdoc/require-property-name": 'off',
|
||||||
|
"jsdoc/require-property-type": 'off',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -238,7 +254,49 @@
|
||||||
// === Promises ===
|
// === Promises ===
|
||||||
// We have Promise now that we're using ES6.
|
// We have Promise now that we're using ES6.
|
||||||
'promise/no-native': 'off',
|
'promise/no-native': 'off',
|
||||||
'promise/avoid-new': 'off'
|
'promise/avoid-new': 'off',
|
||||||
|
|
||||||
|
// === JSDocs ===
|
||||||
|
"jsdoc/check-access": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/check-alignment": 1, // Recommended.
|
||||||
|
"jsdoc/check-param-names": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/check-property-names": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/empty-tags": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/implements-on-classes": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/multiline-blocks": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-jsdoc": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-param": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-param-name": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-param-type": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-property": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-property-name": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
|
"jsdoc/require-property-type": [
|
||||||
|
'error',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
'ecmaVersion': 9,
|
'ecmaVersion': 9,
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -98,8 +98,7 @@ define(['jquery'], function($) {
|
||||||
/**
|
/**
|
||||||
* Callback to inject the template.
|
* Callback to inject the template.
|
||||||
*
|
*
|
||||||
* @param {Node} container Node to inject in.
|
* @returns {Promise} Resolved when done.
|
||||||
* @return {Promise} Resolved when done.
|
|
||||||
* @method injectTemplate
|
* @method injectTemplate
|
||||||
*/
|
*/
|
||||||
Rule.prototype.injectTemplate = function() {
|
Rule.prototype.injectTemplate = function() {
|
||||||
|
|
|
@ -37,9 +37,6 @@ define(['jquery',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CompetencyDialogue.
|
* Constructor for CompetencyDialogue.
|
||||||
*
|
|
||||||
* @param {Object} options
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
var Competencydialogue = function() {
|
var Competencydialogue = function() {
|
||||||
// Intentionally left empty.
|
// Intentionally left empty.
|
||||||
|
|
|
@ -156,9 +156,8 @@ define(['jquery',
|
||||||
/**
|
/**
|
||||||
* Opens the picker.
|
* Opens the picker.
|
||||||
*
|
*
|
||||||
* @param {Number} competencyId The competency ID of the competency to work on.
|
|
||||||
* @method display
|
* @method display
|
||||||
* @return {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
RuleConfig.prototype.display = function() {
|
RuleConfig.prototype.display = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
@ -137,7 +137,6 @@ define(['jquery',
|
||||||
/**
|
/**
|
||||||
* Refresh the course competencies page.
|
* Refresh the course competencies page.
|
||||||
*
|
*
|
||||||
* @param {Event} e
|
|
||||||
* @method saveSettings
|
* @method saveSettings
|
||||||
*/
|
*/
|
||||||
settingsMod.prototype.refreshCourseCompetenciesPage = function() {
|
settingsMod.prototype.refreshCourseCompetenciesPage = function() {
|
||||||
|
|
|
@ -26,7 +26,7 @@ define(['core/str', 'core/yui'], function(str, Y) {
|
||||||
/**
|
/**
|
||||||
* Store the current instance of the core drag drop.
|
* Store the current instance of the core drag drop.
|
||||||
*
|
*
|
||||||
* @property dragDropInstance M.tool_lp.dragdrop_reorder
|
* @property {object} dragDropInstance M.tool_lp.dragdrop_reorder
|
||||||
*/
|
*/
|
||||||
var dragDropInstance = null;
|
var dragDropInstance = null;
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ define(['jquery',
|
||||||
/**
|
/**
|
||||||
* Opens the picker.
|
* Opens the picker.
|
||||||
*
|
*
|
||||||
* @param {Number} competencyId The competency ID of the competency to work on.
|
|
||||||
* @method display
|
* @method display
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -43,8 +43,8 @@ define(['jquery'], function($) {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param {$} menuRoot Jquery collection matching the root of the menu.
|
* @param {jQuery} menuRoot Jquery collection matching the root of the menu.
|
||||||
* @param {Function[]} handlers, called when a menu item is chosen.
|
* @param {Function[]} handlers called when a menu item is chosen.
|
||||||
*/
|
*/
|
||||||
var Menubar = function(menuRoot, handlers) {
|
var Menubar = function(menuRoot, handlers) {
|
||||||
// Setup private class variables.
|
// Setup private class variables.
|
||||||
|
|
|
@ -574,8 +574,6 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
|
||||||
* Handle a blur event
|
* Handle a blur event
|
||||||
*
|
*
|
||||||
* @method handleBlur
|
* @method handleBlur
|
||||||
* @param {Object} item item is the jquery id of the parent item of the group
|
|
||||||
* @param {Event} e The event.
|
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
Tree.prototype.handleBlur = function() {
|
Tree.prototype.handleBlur = function() {
|
||||||
|
@ -587,7 +585,6 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
|
||||||
*
|
*
|
||||||
* @method handleFocus
|
* @method handleFocus
|
||||||
* @param {Object} item item is the jquery id of the parent item of the group
|
* @param {Object} item item is the jquery id of the parent item of the group
|
||||||
* @param {Event} e The event.
|
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
Tree.prototype.handleFocus = function(item) {
|
Tree.prototype.handleFocus = function(item) {
|
||||||
|
|
|
@ -31,8 +31,6 @@ define(['jquery',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UserCompetencyWorkflow class.
|
* UserCompetencyWorkflow class.
|
||||||
*
|
|
||||||
* @param {String} selector The node containing the buttons to switch mode.
|
|
||||||
*/
|
*/
|
||||||
var UserCompetencyWorkflow = function() {
|
var UserCompetencyWorkflow = function() {
|
||||||
EventBase.prototype.constructor.apply(this, []);
|
EventBase.prototype.constructor.apply(this, []);
|
||||||
|
|
|
@ -195,7 +195,6 @@ define(['jquery',
|
||||||
*
|
*
|
||||||
* @param {Object} evidenceData Evidence data from evidence node.
|
* @param {Object} evidenceData Evidence data from evidence node.
|
||||||
* @param {Number} competencyIds The competency IDs.
|
* @param {Number} competencyIds The competency IDs.
|
||||||
* @param {Boolean} requestReview Send competencies to review.
|
|
||||||
*/
|
*/
|
||||||
UserEvidenceActions.prototype._doCreateUserEvidenceCompetency = function(evidenceData, competencyIds) {
|
UserEvidenceActions.prototype._doCreateUserEvidenceCompetency = function(evidenceData, competencyIds) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,8 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PolicyActions class.
|
* PolicyActions class.
|
||||||
|
*
|
||||||
|
* @param {jQuery} root
|
||||||
*/
|
*/
|
||||||
var PolicyActions = function(root) {
|
var PolicyActions = function(root) {
|
||||||
this.registerEvents(root);
|
this.registerEvents(root);
|
||||||
|
@ -37,6 +39,8 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register event listeners.
|
* Register event listeners.
|
||||||
|
*
|
||||||
|
* @param {jQuery} root
|
||||||
*/
|
*/
|
||||||
PolicyActions.prototype.registerEvents = function(root) {
|
PolicyActions.prototype.registerEvents = function(root) {
|
||||||
root.on("click", function(e) {
|
root.on("click", function(e) {
|
||||||
|
@ -115,6 +119,7 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
|
||||||
* Initialise the actions helper.
|
* Initialise the actions helper.
|
||||||
*
|
*
|
||||||
* @method init
|
* @method init
|
||||||
|
* @param {object} root
|
||||||
* @return {PolicyActions}
|
* @return {PolicyActions}
|
||||||
*/
|
*/
|
||||||
'init': function(root) {
|
'init': function(root) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -33,6 +33,7 @@
|
||||||
* Events for the component.
|
* Events for the component.
|
||||||
*
|
*
|
||||||
* @constant
|
* @constant
|
||||||
|
* @property {object} eventTypes
|
||||||
* @property {String} eventTypes.stepRender See {@link event:tool_usertours/stepRender}
|
* @property {String} eventTypes.stepRender See {@link event:tool_usertours/stepRender}
|
||||||
* @property {String} eventTypes.stepRendered See {@link event:tool_usertours/stepRendered}
|
* @property {String} eventTypes.stepRendered See {@link event:tool_usertours/stepRendered}
|
||||||
* @property {String} eventTypes.tourStart See {@link event:tool_usertours/tourStart}
|
* @property {String} eventTypes.tourStart See {@link event:tool_usertours/tourStart}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -290,7 +290,6 @@ const fetchReviewData = (courseid, updatePreference = false) => {
|
||||||
* @param {number} toggled A number represnting the state of the review toggle.
|
* @param {number} toggled A number represnting the state of the review toggle.
|
||||||
* @param {string} displayFormat A string representing the display format for icons.
|
* @param {string} displayFormat A string representing the display format for icons.
|
||||||
* @param {number} courseId The course ID.
|
* @param {number} courseId The course ID.
|
||||||
* @param {number} userId The id of the currently logged-in user.
|
|
||||||
*/
|
*/
|
||||||
export const init = (toggled, displayFormat, courseId) => {
|
export const init = (toggled, displayFormat, courseId) => {
|
||||||
// Settings consts.
|
// Settings consts.
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -97,6 +97,8 @@ define([
|
||||||
/**
|
/**
|
||||||
* This will add a visual indicator to the calendar UI to
|
* This will add a visual indicator to the calendar UI to
|
||||||
* indicate which nav link is a valid drop zone.
|
* indicate which nav link is a valid drop zone.
|
||||||
|
*
|
||||||
|
* @param {Event} e
|
||||||
*/
|
*/
|
||||||
var dragstartHandler = function(e) {
|
var dragstartHandler = function(e) {
|
||||||
// Make sure the drag event is for a calendar event.
|
// Make sure the drag event is for a calendar event.
|
||||||
|
|
|
@ -137,9 +137,9 @@ define([
|
||||||
* The current drag target and the 2 days following it (including
|
* The current drag target and the 2 days following it (including
|
||||||
* wrapping to the next week if necessary).
|
* wrapping to the next week if necessary).
|
||||||
*
|
*
|
||||||
* @param {string|object} target The drag target element
|
* @param {string|object} dropZone The drag target element
|
||||||
* @param {bool} hovered If the target is hovered or not
|
* @param {bool} hovered If the target is hovered or not
|
||||||
* @param {int} count How many days to highlight (default to duration)
|
* @param {Number} count How many days to highlight (default to duration)
|
||||||
*/
|
*/
|
||||||
var updateHoverState = function(dropZone, hovered, count) {
|
var updateHoverState = function(dropZone, hovered, count) {
|
||||||
if (typeof count === 'undefined') {
|
if (typeof count === 'undefined') {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -228,8 +228,8 @@ const updateButtonTitle = (button, ascending) => {
|
||||||
* @method updateSortOrder
|
* @method updateSortOrder
|
||||||
* @param {HTMLElement} fileArea the Dom container for the itemlist
|
* @param {HTMLElement} fileArea the Dom container for the itemlist
|
||||||
* @param {Array} itemList Nodelist of Dom elements
|
* @param {Array} itemList Nodelist of Dom elements
|
||||||
* @param {String} attribute, the attribut to sort on
|
* @param {String} attribute the attribut to sort on
|
||||||
* @param {Bool} ascending, Sort Ascending
|
* @param {Bool} ascending Sort Ascending
|
||||||
*/
|
*/
|
||||||
const updateSortOrder = (fileArea, itemList, attribute, ascending) => {
|
const updateSortOrder = (fileArea, itemList, attribute, ascending) => {
|
||||||
const sortList = [].slice.call(itemList).sort(function(a, b) {
|
const sortList = [].slice.call(itemList).sort(function(a, b) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../src/courseeditor.js"],"names":["courseEditorMap","Map","dispatchStateChangedEvent","detail","target","document","dispatchEvent","CustomEvent","events","stateChanged","bubbles","setViewFormat","courseId","setup","editor","getCourseEditor","parseInt","has","set","CourseEditor","name","eventName","eventDispatch","mutations","DefaultMutations","get","loadCourse","getCurrentCourseEditor","M","cfg"],"mappings":"iUAuBA,OACA,OACA,O,mDAGA,GAAMA,CAAAA,CAAe,CAAG,GAAIC,CAAAA,GAA5B,CAYA,QAASC,CAAAA,CAAT,CAAmCC,CAAnC,CAA2CC,CAA3C,CAAmD,CAC/C,GAAIA,CAAM,SAAV,CAA0B,CACtBA,CAAM,CAAGC,QACZ,CACDD,CAAM,CAACE,aAAP,CAAqB,GAAIC,CAAAA,WAAJ,CAAgBC,UAAOC,YAAvB,CAAqC,CACtDC,OAAO,GAD+C,CAEtDP,MAAM,CAAEA,CAF8C,CAArC,CAArB,CAIH,C,gBAU4B,QAAhBQ,CAAAA,aAAgB,CAACC,CAAD,CAAWC,CAAX,CAAqB,CAC9C,GAAMC,CAAAA,CAAM,CAAGC,CAAe,CAACH,CAAD,CAA9B,CACAE,CAAM,CAACH,aAAP,CAAqBE,CAArB,CACH,C,CAQM,GAAME,CAAAA,CAAe,CAAG,SAACH,CAAD,CAAc,CACzCA,CAAQ,CAAGI,QAAQ,CAACJ,CAAD,CAAnB,CAEA,GAAI,CAACZ,CAAe,CAACiB,GAAhB,CAAoBL,CAApB,CAAL,CAAoC,CAChCZ,CAAe,CAACkB,GAAhB,CACIN,CADJ,CAEI,GAAIO,UAAJ,CAAiB,CACbC,IAAI,uBAAiBR,CAAjB,CADS,CAEbS,SAAS,CAAEb,UAAOC,YAFL,CAGba,aAAa,CAAEpB,CAHF,CAMbqB,SAAS,CAAE,GAAIC,UANF,CAAjB,CAFJ,EAWAxB,CAAe,CAACyB,GAAhB,CAAoBb,CAApB,EAA8Bc,UAA9B,CAAyCd,CAAzC,CACH,CACD,MAAOZ,CAAAA,CAAe,CAACyB,GAAhB,CAAoBb,CAApB,CACV,CAlBM,C,6CAyB+B,QAAzBe,CAAAA,sBAAyB,SAAMZ,CAAAA,CAAe,CAACa,CAAC,CAACC,GAAF,CAAMjB,QAAP,CAArB,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 * Generic reactive module used in the course editor.\n *\n * @module core_courseformat/courseeditor\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DefaultMutations from 'core_courseformat/local/courseeditor/mutations';\nimport CourseEditor from 'core_courseformat/local/courseeditor/courseeditor';\nimport events from 'core_course/events';\n\n// A map with all the course editor instances.\nconst courseEditorMap = new Map();\n\n/**\n * Trigger a state changed event.\n *\n * This function will be moved to core_course/events module\n * when the file is migrated to the new JS events structure proposed in MDL-70990.\n *\n * @method dispatchStateChangedEvent\n * @param {object} detail the full state\n * @param {object} target the custom event target (document if none provided)\n */\nfunction dispatchStateChangedEvent(detail, target) {\n if (target === undefined) {\n target = document;\n }\n target.dispatchEvent(new CustomEvent(events.stateChanged, {\n bubbles: true,\n detail: detail,\n }));\n}\n\n/**\n * Setup the current view settings\n *\n * @param {number} courseId the course id\n * @param {setup} setup format, page and course settings\n * @property {boolean} setup.editing if the page is in edit mode\n * @property {boolean} setup.supportscomponents if the format supports components for content\n */\nexport const setViewFormat = (courseId, setup) => {\n const editor = getCourseEditor(courseId);\n editor.setViewFormat(setup);\n};\n\n/**\n * Get a specific course editor reactive instance.\n *\n * @param {number} courseId the course id\n * @returns {CourseEditor}\n */\nexport const getCourseEditor = (courseId) => {\n courseId = parseInt(courseId);\n\n if (!courseEditorMap.has(courseId)) {\n courseEditorMap.set(\n courseId,\n new CourseEditor({\n name: `CourseEditor${courseId}`,\n eventName: events.stateChanged,\n eventDispatch: dispatchStateChangedEvent,\n // Mutations can be overridden by the format plugin using setMutations\n // but we need the default one at least.\n mutations: new DefaultMutations(),\n })\n );\n courseEditorMap.get(courseId).loadCourse(courseId);\n }\n return courseEditorMap.get(courseId);\n};\n\n/**\n * Get the current course reactive instance.\n *\n * @returns {CourseEditor}\n */\nexport const getCurrentCourseEditor = () => getCourseEditor(M.cfg.courseId);\n"],"file":"courseeditor.min.js"}
|
{"version":3,"sources":["../src/courseeditor.js"],"names":["courseEditorMap","Map","dispatchStateChangedEvent","detail","target","document","dispatchEvent","CustomEvent","events","stateChanged","bubbles","setViewFormat","courseId","setup","editor","getCourseEditor","parseInt","has","set","CourseEditor","name","eventName","eventDispatch","mutations","DefaultMutations","get","loadCourse","getCurrentCourseEditor","M","cfg"],"mappings":"iUAuBA,OACA,OACA,O,mDAGA,GAAMA,CAAAA,CAAe,CAAG,GAAIC,CAAAA,GAA5B,CAYA,QAASC,CAAAA,CAAT,CAAmCC,CAAnC,CAA2CC,CAA3C,CAAmD,CAC/C,GAAIA,CAAM,SAAV,CAA0B,CACtBA,CAAM,CAAGC,QACZ,CACDD,CAAM,CAACE,aAAP,CAAqB,GAAIC,CAAAA,WAAJ,CAAgBC,UAAOC,YAAvB,CAAqC,CACtDC,OAAO,GAD+C,CAEtDP,MAAM,CAAEA,CAF8C,CAArC,CAArB,CAIH,C,gBAU4B,QAAhBQ,CAAAA,aAAgB,CAACC,CAAD,CAAWC,CAAX,CAAqB,CAC9C,GAAMC,CAAAA,CAAM,CAAGC,CAAe,CAACH,CAAD,CAA9B,CACAE,CAAM,CAACH,aAAP,CAAqBE,CAArB,CACH,C,CAQM,GAAME,CAAAA,CAAe,CAAG,SAACH,CAAD,CAAc,CACzCA,CAAQ,CAAGI,QAAQ,CAACJ,CAAD,CAAnB,CAEA,GAAI,CAACZ,CAAe,CAACiB,GAAhB,CAAoBL,CAApB,CAAL,CAAoC,CAChCZ,CAAe,CAACkB,GAAhB,CACIN,CADJ,CAEI,GAAIO,UAAJ,CAAiB,CACbC,IAAI,uBAAiBR,CAAjB,CADS,CAEbS,SAAS,CAAEb,UAAOC,YAFL,CAGba,aAAa,CAAEpB,CAHF,CAMbqB,SAAS,CAAE,GAAIC,UANF,CAAjB,CAFJ,EAWAxB,CAAe,CAACyB,GAAhB,CAAoBb,CAApB,EAA8Bc,UAA9B,CAAyCd,CAAzC,CACH,CACD,MAAOZ,CAAAA,CAAe,CAACyB,GAAhB,CAAoBb,CAApB,CACV,CAlBM,C,6CAyB+B,QAAzBe,CAAAA,sBAAyB,SAAMZ,CAAAA,CAAe,CAACa,CAAC,CAACC,GAAF,CAAMjB,QAAP,CAArB,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 * Generic reactive module used in the course editor.\n *\n * @module core_courseformat/courseeditor\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DefaultMutations from 'core_courseformat/local/courseeditor/mutations';\nimport CourseEditor from 'core_courseformat/local/courseeditor/courseeditor';\nimport events from 'core_course/events';\n\n// A map with all the course editor instances.\nconst courseEditorMap = new Map();\n\n/**\n * Trigger a state changed event.\n *\n * This function will be moved to core_course/events module\n * when the file is migrated to the new JS events structure proposed in MDL-70990.\n *\n * @method dispatchStateChangedEvent\n * @param {object} detail the full state\n * @param {object} target the custom event target (document if none provided)\n */\nfunction dispatchStateChangedEvent(detail, target) {\n if (target === undefined) {\n target = document;\n }\n target.dispatchEvent(new CustomEvent(events.stateChanged, {\n bubbles: true,\n detail: detail,\n }));\n}\n\n/**\n * Setup the current view settings\n *\n * @param {number} courseId the course id\n * @param {setup} setup format, page and course settings\n * @param {boolean} setup.editing if the page is in edit mode\n * @param {boolean} setup.supportscomponents if the format supports components for content\n */\nexport const setViewFormat = (courseId, setup) => {\n const editor = getCourseEditor(courseId);\n editor.setViewFormat(setup);\n};\n\n/**\n * Get a specific course editor reactive instance.\n *\n * @param {number} courseId the course id\n * @returns {CourseEditor}\n */\nexport const getCourseEditor = (courseId) => {\n courseId = parseInt(courseId);\n\n if (!courseEditorMap.has(courseId)) {\n courseEditorMap.set(\n courseId,\n new CourseEditor({\n name: `CourseEditor${courseId}`,\n eventName: events.stateChanged,\n eventDispatch: dispatchStateChangedEvent,\n // Mutations can be overridden by the format plugin using setMutations\n // but we need the default one at least.\n mutations: new DefaultMutations(),\n })\n );\n courseEditorMap.get(courseId).loadCourse(courseId);\n }\n return courseEditorMap.get(courseId);\n};\n\n/**\n * Get the current course reactive instance.\n *\n * @returns {CourseEditor}\n */\nexport const getCurrentCourseEditor = () => getCourseEditor(M.cfg.courseId);\n"],"file":"courseeditor.min.js"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../../../../src/local/content/section/cmitem.js"],"names":["name","selectors","DRAGICON","classes","LOCKED","id","element","dataset","configDragDrop","getElement","classList","add","watch","handler","unregister","_refreshCm","toggle","DRAGGING","dragging","locked","DndCmItem"],"mappings":"mNA0BA,uD,gwDAOa,CAEL,KAAKA,IAAL,CAAY,wBAAZ,CAEA,KAAKC,SAAL,CAAiB,CACbC,QAAQ,gBADK,CAAjB,CAIA,KAAKC,OAAL,CAAe,CACXC,MAAM,CAAE,gBADG,CAAf,CAIA,KAAKC,EAAL,CAAU,KAAKC,OAAL,CAAaC,OAAb,CAAqBF,EAClC,C,+CAKY,OACT,KAAKG,cAAL,CAAoB,KAAKH,EAAzB,EACA,eAAKI,UAAL,CAAgB,KAAKR,SAAL,CAAeC,QAA/B,wBAA0CQ,SAA1C,CAAoDC,GAApD,CAAwD,KAAKR,OAAL,CAAaD,QAArE,CACH,C,iDAOa,CACV,MAAO,CACH,CAACU,KAAK,cAAQ,KAAKP,EAAb,aAAN,CAAkCQ,OAAO,CAAE,KAAKC,UAAhD,CADG,CAEH,CAACF,KAAK,cAAQ,KAAKP,EAAb,aAAN,CAAkCQ,OAAO,CAAE,KAAKE,UAAhD,CAFG,CAIV,C,gDAOqB,SAAVT,CAAU,GAAVA,OAAU,CAElB,KAAKA,OAAL,CAAaI,SAAb,CAAuBM,MAAvB,CAA8B,KAAKb,OAAL,CAAac,QAA3C,WAAqDX,CAAO,CAACY,QAA7D,oBACA,KAAKZ,OAAL,CAAaI,SAAb,CAAuBM,MAAvB,CAA8B,KAAKb,OAAL,CAAaC,MAA3C,WAAmDE,CAAO,CAACa,MAA3D,oBACA,KAAKA,MAAL,CAAcb,CAAO,CAACa,MACzB,C,cAlDwBC,S","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 * Course course module item component.\n *\n * This component is used to control specific course modules interactions like drag and drop.\n *\n * @module core_courseformat/local/content/section/cmitem\n * @class core_courseformat/local/content/section/cmitem\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DndCmItem from 'core_courseformat/local/courseeditor/dndcmitem';\n\nexport default class extends DndCmItem {\n\n /**\n * Constructor hook.\n */\n create() {\n // Optional component name for debugging.\n this.name = 'content_section_cmitem';\n // Default query selectors.\n this.selectors = {\n DRAGICON: `.editing_move`,\n };\n // Most classes will be loaded later by DndCmItem.\n this.classes = {\n LOCKED: 'editinprogress',\n };\n // We need our id to watch specific events.\n this.id = this.element.dataset.id;\n }\n\n /**\n * Initial state ready method.\n */\n stateReady() {\n this.configDragDrop(this.id);\n this.getElement(this.selectors.DRAGICON)?.classList.add(this.classes.DRAGICON);\n }\n\n /**\n * Component watchers.\n *\n * @returns {Array} of watchers\n */\n getWatchers() {\n return [\n {watch: `cm[${this.id}]:deleted`, handler: this.unregister},\n {watch: `cm[${this.id}]:updated`, handler: this._refreshCm},\n ];\n }\n\n /**\n * Update a course index cm using the state information.\n *\n * @param {Object} details the update details.\n */\n _refreshCm({element}) {\n // Update classes.\n this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);\n this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);\n this.locked = element.locked;\n }\n}"],"file":"cmitem.min.js"}
|
{"version":3,"sources":["../../../../src/local/content/section/cmitem.js"],"names":["name","selectors","DRAGICON","classes","LOCKED","id","element","dataset","configDragDrop","getElement","classList","add","watch","handler","unregister","_refreshCm","toggle","DRAGGING","dragging","locked","DndCmItem"],"mappings":"mNA0BA,uD,gwDAOa,CAEL,KAAKA,IAAL,CAAY,wBAAZ,CAEA,KAAKC,SAAL,CAAiB,CACbC,QAAQ,gBADK,CAAjB,CAIA,KAAKC,OAAL,CAAe,CACXC,MAAM,CAAE,gBADG,CAAf,CAIA,KAAKC,EAAL,CAAU,KAAKC,OAAL,CAAaC,OAAb,CAAqBF,EAClC,C,+CAKY,OACT,KAAKG,cAAL,CAAoB,KAAKH,EAAzB,EACA,eAAKI,UAAL,CAAgB,KAAKR,SAAL,CAAeC,QAA/B,wBAA0CQ,SAA1C,CAAoDC,GAApD,CAAwD,KAAKR,OAAL,CAAaD,QAArE,CACH,C,iDAOa,CACV,MAAO,CACH,CAACU,KAAK,cAAQ,KAAKP,EAAb,aAAN,CAAkCQ,OAAO,CAAE,KAAKC,UAAhD,CADG,CAEH,CAACF,KAAK,cAAQ,KAAKP,EAAb,aAAN,CAAkCQ,OAAO,CAAE,KAAKE,UAAhD,CAFG,CAIV,C,gDAQqB,SAAVT,CAAU,GAAVA,OAAU,CAElB,KAAKA,OAAL,CAAaI,SAAb,CAAuBM,MAAvB,CAA8B,KAAKb,OAAL,CAAac,QAA3C,WAAqDX,CAAO,CAACY,QAA7D,oBACA,KAAKZ,OAAL,CAAaI,SAAb,CAAuBM,MAAvB,CAA8B,KAAKb,OAAL,CAAaC,MAA3C,WAAmDE,CAAO,CAACa,MAA3D,oBACA,KAAKA,MAAL,CAAcb,CAAO,CAACa,MACzB,C,cAnDwBC,S","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 * Course course module item component.\n *\n * This component is used to control specific course modules interactions like drag and drop.\n *\n * @module core_courseformat/local/content/section/cmitem\n * @class core_courseformat/local/content/section/cmitem\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DndCmItem from 'core_courseformat/local/courseeditor/dndcmitem';\n\nexport default class extends DndCmItem {\n\n /**\n * Constructor hook.\n */\n create() {\n // Optional component name for debugging.\n this.name = 'content_section_cmitem';\n // Default query selectors.\n this.selectors = {\n DRAGICON: `.editing_move`,\n };\n // Most classes will be loaded later by DndCmItem.\n this.classes = {\n LOCKED: 'editinprogress',\n };\n // We need our id to watch specific events.\n this.id = this.element.dataset.id;\n }\n\n /**\n * Initial state ready method.\n */\n stateReady() {\n this.configDragDrop(this.id);\n this.getElement(this.selectors.DRAGICON)?.classList.add(this.classes.DRAGICON);\n }\n\n /**\n * Component watchers.\n *\n * @returns {Array} of watchers\n */\n getWatchers() {\n return [\n {watch: `cm[${this.id}]:deleted`, handler: this.unregister},\n {watch: `cm[${this.id}]:updated`, handler: this._refreshCm},\n ];\n }\n\n /**\n * Update a course index cm using the state information.\n *\n * @param {object} param\n * @param {Object} param.element details the update details.\n */\n _refreshCm({element}) {\n // Update classes.\n this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);\n this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);\n this.locked = element.locked;\n }\n}\n"],"file":"cmitem.min.js"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../../../src/local/courseindex/cm.js"],"names":["Component","name","selectors","CM_NAME","classes","CMHIDDEN","LOCKED","id","element","dataset","configDragDrop","watch","handler","remove","_refreshCm","classList","toggle","visible","getElement","innerHTML","DRAGGING","dragging","locked","target","document","getElementById","DndCmItem"],"mappings":"2MA0BA,uD,+nDAEqBA,CAAAA,C,+HAKR,CAEL,KAAKC,IAAL,CAAY,gBAAZ,CAEA,KAAKC,SAAL,CAAiB,CACbC,OAAO,uBADM,CAAjB,CAIA,KAAKC,OAAL,CAAe,CACXC,QAAQ,CAAE,QADC,CAEXC,MAAM,CAAE,gBAFG,CAAf,CAKA,KAAKC,EAAL,CAAU,KAAKC,OAAL,CAAaC,OAAb,CAAqBF,EAClC,C,+CAmBY,CACT,KAAKG,cAAL,CAAoB,KAAKH,EAAzB,CACH,C,iDAOa,CACV,MAAO,CACH,CAACI,KAAK,cAAQ,KAAKJ,EAAb,aAAN,CAAkCK,OAAO,CAAE,KAAKC,MAAhD,CADG,CAEH,CAACF,KAAK,cAAQ,KAAKJ,EAAb,aAAN,CAAkCK,OAAO,CAAE,KAAKE,UAAhD,CAFG,CAIV,C,gDAOqB,SAAVN,CAAU,GAAVA,OAAU,CAElB,KAAKA,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAaC,QAA3C,CAAqD,CAACG,CAAO,CAACS,OAA9D,EACA,KAAKC,UAAL,CAAgB,KAAKhB,SAAL,CAAeC,OAA/B,EAAwCgB,SAAxC,CAAoDX,CAAO,CAACP,IAA5D,CACA,KAAKO,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAagB,QAA3C,WAAqDZ,CAAO,CAACa,QAA7D,oBACA,KAAKb,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAaE,MAA3C,WAAmDE,CAAO,CAACc,MAA3D,oBACA,KAAKA,MAAL,CAAcd,CAAO,CAACc,MACzB,C,oCAtCWC,C,CAAQrB,C,CAAW,CAC3B,MAAO,IAAIF,CAAAA,CAAJ,CAAc,CACjBQ,OAAO,CAAEgB,QAAQ,CAACC,cAAT,CAAwBF,CAAxB,CADQ,CAEjBrB,SAAS,CAATA,CAFiB,CAAd,CAIV,C,cAjCkCwB,S","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 * Course index cm component.\n *\n * This component is used to control specific course modules interactions like drag and drop.\n *\n * @module core_courseformat/local/courseindex/cm\n * @class core_courseformat/local/courseindex/cm\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DndCmItem from 'core_courseformat/local/courseeditor/dndcmitem';\n\nexport default class Component extends DndCmItem {\n\n /**\n * Constructor hook.\n */\n create() {\n // Optional component name for debugging.\n this.name = 'courseindex_cm';\n // Default query selectors.\n this.selectors = {\n CM_NAME: `[data-for='cm_name']`,\n };\n // Default classes to toggle on refresh.\n this.classes = {\n CMHIDDEN: 'dimmed',\n LOCKED: 'editinprogress',\n };\n // We need our id to watch specific events.\n this.id = this.element.dataset.id;\n }\n\n /**\n * Static method to create a component instance form the mustache template.\n *\n * @param {element|string} target the DOM main element or its ID\n * @param {object} selectors optional css selector overrides\n * @return {Component}\n */\n static init(target, selectors) {\n return new Component({\n element: document.getElementById(target),\n selectors,\n });\n }\n\n /**\n * Initial state ready method.\n */\n stateReady() {\n this.configDragDrop(this.id);\n }\n\n /**\n * Component watchers.\n *\n * @returns {Array} of watchers\n */\n getWatchers() {\n return [\n {watch: `cm[${this.id}]:deleted`, handler: this.remove},\n {watch: `cm[${this.id}]:updated`, handler: this._refreshCm},\n ];\n }\n\n /**\n * Update a course index cm using the state information.\n *\n * @param {Object} details the update details.\n */\n _refreshCm({element}) {\n // Update classes.\n this.element.classList.toggle(this.classes.CMHIDDEN, !element.visible);\n this.getElement(this.selectors.CM_NAME).innerHTML = element.name;\n this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);\n this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);\n this.locked = element.locked;\n }\n\n}\n"],"file":"cm.min.js"}
|
{"version":3,"sources":["../../../src/local/courseindex/cm.js"],"names":["Component","name","selectors","CM_NAME","classes","CMHIDDEN","LOCKED","id","element","dataset","configDragDrop","watch","handler","remove","_refreshCm","classList","toggle","visible","getElement","innerHTML","DRAGGING","dragging","locked","target","document","getElementById","DndCmItem"],"mappings":"2MA0BA,uD,+nDAEqBA,CAAAA,C,+HAKR,CAEL,KAAKC,IAAL,CAAY,gBAAZ,CAEA,KAAKC,SAAL,CAAiB,CACbC,OAAO,uBADM,CAAjB,CAIA,KAAKC,OAAL,CAAe,CACXC,QAAQ,CAAE,QADC,CAEXC,MAAM,CAAE,gBAFG,CAAf,CAKA,KAAKC,EAAL,CAAU,KAAKC,OAAL,CAAaC,OAAb,CAAqBF,EAClC,C,+CAmBY,CACT,KAAKG,cAAL,CAAoB,KAAKH,EAAzB,CACH,C,iDAOa,CACV,MAAO,CACH,CAACI,KAAK,cAAQ,KAAKJ,EAAb,aAAN,CAAkCK,OAAO,CAAE,KAAKC,MAAhD,CADG,CAEH,CAACF,KAAK,cAAQ,KAAKJ,EAAb,aAAN,CAAkCK,OAAO,CAAE,KAAKE,UAAhD,CAFG,CAIV,C,gDAQqB,SAAVN,CAAU,GAAVA,OAAU,CAElB,KAAKA,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAaC,QAA3C,CAAqD,CAACG,CAAO,CAACS,OAA9D,EACA,KAAKC,UAAL,CAAgB,KAAKhB,SAAL,CAAeC,OAA/B,EAAwCgB,SAAxC,CAAoDX,CAAO,CAACP,IAA5D,CACA,KAAKO,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAagB,QAA3C,WAAqDZ,CAAO,CAACa,QAA7D,oBACA,KAAKb,OAAL,CAAaO,SAAb,CAAuBC,MAAvB,CAA8B,KAAKZ,OAAL,CAAaE,MAA3C,WAAmDE,CAAO,CAACc,MAA3D,oBACA,KAAKA,MAAL,CAAcd,CAAO,CAACc,MACzB,C,oCAvCWC,C,CAAQrB,C,CAAW,CAC3B,MAAO,IAAIF,CAAAA,CAAJ,CAAc,CACjBQ,OAAO,CAAEgB,QAAQ,CAACC,cAAT,CAAwBF,CAAxB,CADQ,CAEjBrB,SAAS,CAATA,CAFiB,CAAd,CAIV,C,cAjCkCwB,S","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 * Course index cm component.\n *\n * This component is used to control specific course modules interactions like drag and drop.\n *\n * @module core_courseformat/local/courseindex/cm\n * @class core_courseformat/local/courseindex/cm\n * @copyright 2021 Ferran Recio <ferran@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport DndCmItem from 'core_courseformat/local/courseeditor/dndcmitem';\n\nexport default class Component extends DndCmItem {\n\n /**\n * Constructor hook.\n */\n create() {\n // Optional component name for debugging.\n this.name = 'courseindex_cm';\n // Default query selectors.\n this.selectors = {\n CM_NAME: `[data-for='cm_name']`,\n };\n // Default classes to toggle on refresh.\n this.classes = {\n CMHIDDEN: 'dimmed',\n LOCKED: 'editinprogress',\n };\n // We need our id to watch specific events.\n this.id = this.element.dataset.id;\n }\n\n /**\n * Static method to create a component instance form the mustache template.\n *\n * @param {element|string} target the DOM main element or its ID\n * @param {object} selectors optional css selector overrides\n * @return {Component}\n */\n static init(target, selectors) {\n return new Component({\n element: document.getElementById(target),\n selectors,\n });\n }\n\n /**\n * Initial state ready method.\n */\n stateReady() {\n this.configDragDrop(this.id);\n }\n\n /**\n * Component watchers.\n *\n * @returns {Array} of watchers\n */\n getWatchers() {\n return [\n {watch: `cm[${this.id}]:deleted`, handler: this.remove},\n {watch: `cm[${this.id}]:updated`, handler: this._refreshCm},\n ];\n }\n\n /**\n * Update a course index cm using the state information.\n *\n * @param {object} param\n * @param {Object} param.element details the update details.\n */\n _refreshCm({element}) {\n // Update classes.\n this.element.classList.toggle(this.classes.CMHIDDEN, !element.visible);\n this.getElement(this.selectors.CM_NAME).innerHTML = element.name;\n this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);\n this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);\n this.locked = element.locked;\n }\n\n}\n"],"file":"cm.min.js"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -53,8 +53,8 @@ function dispatchStateChangedEvent(detail, target) {
|
||||||
*
|
*
|
||||||
* @param {number} courseId the course id
|
* @param {number} courseId the course id
|
||||||
* @param {setup} setup format, page and course settings
|
* @param {setup} setup format, page and course settings
|
||||||
* @property {boolean} setup.editing if the page is in edit mode
|
* @param {boolean} setup.editing if the page is in edit mode
|
||||||
* @property {boolean} setup.supportscomponents if the format supports components for content
|
* @param {boolean} setup.supportscomponents if the format supports components for content
|
||||||
*/
|
*/
|
||||||
export const setViewFormat = (courseId, setup) => {
|
export const setViewFormat = (courseId, setup) => {
|
||||||
const editor = getCourseEditor(courseId);
|
const editor = getCourseEditor(courseId);
|
||||||
|
|
|
@ -182,7 +182,8 @@ export default class Component extends BaseComponent {
|
||||||
* Most course module HTML is still strongly backend dependant.
|
* Most course module HTML is still strongly backend dependant.
|
||||||
* Some changes require to get a new version af the module.
|
* Some changes require to get a new version af the module.
|
||||||
*
|
*
|
||||||
* @param {Object} update the state update data
|
* @param {Object} param
|
||||||
|
* @param {Object} param.element update the state update data
|
||||||
*/
|
*/
|
||||||
_reloadCm({element}) {
|
_reloadCm({element}) {
|
||||||
const cmitem = this.getElement(this.selectors.CM, element.id);
|
const cmitem = this.getElement(this.selectors.CM, element.id);
|
||||||
|
@ -194,7 +195,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Update section collapsed.
|
* Update section collapsed.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} args
|
||||||
|
* @param {Object} args.element The element to update
|
||||||
*/
|
*/
|
||||||
_refreshSectionCollapsed({element}) {
|
_refreshSectionCollapsed({element}) {
|
||||||
const target = this.getElement(this.selectors.SECTION, element.id);
|
const target = this.getElement(this.selectors.SECTION, element.id);
|
||||||
|
@ -234,7 +236,8 @@ export default class Component extends BaseComponent {
|
||||||
* Course formats can override the section title rendering so the frontend depends heavily on backend
|
* Course formats can override the section title rendering so the frontend depends heavily on backend
|
||||||
* rendering. Luckily in edit mode we can trigger a title update using the inplace_editable module.
|
* rendering. Luckily in edit mode we can trigger a title update using the inplace_editable module.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {Object} param
|
||||||
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshSectionNumber({element}) {
|
_refreshSectionNumber({element}) {
|
||||||
// Find the element.
|
// Find the element.
|
||||||
|
@ -272,8 +275,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Refresh a section cm list.
|
* Refresh a section cm list.
|
||||||
*
|
*
|
||||||
* @param {details} details the update details
|
* @param {Object} param
|
||||||
* @property {object} details.element the state object
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshSectionCmlist({element}) {
|
_refreshSectionCmlist({element}) {
|
||||||
const cmlist = element.cmlist ?? [];
|
const cmlist = element.cmlist ?? [];
|
||||||
|
@ -289,7 +292,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Refresh the section list.
|
* Refresh the section list.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {Object} param
|
||||||
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshCourseSectionlist({element}) {
|
_refreshCourseSectionlist({element}) {
|
||||||
const sectionlist = element.sectionlist ?? [];
|
const sectionlist = element.sectionlist ?? [];
|
||||||
|
@ -361,8 +365,8 @@ export default class Component extends BaseComponent {
|
||||||
* Most course module HTML is still strongly backend dependant.
|
* Most course module HTML is still strongly backend dependant.
|
||||||
* Some changes require to get a new version of the module.
|
* Some changes require to get a new version of the module.
|
||||||
*
|
*
|
||||||
* @param {details} param0 the watcher details
|
* @param {object} param0 the watcher details
|
||||||
* @property {object} param0.element the state object
|
* @param {object} param0.element the state object
|
||||||
*/
|
*/
|
||||||
_reloadCm({element}) {
|
_reloadCm({element}) {
|
||||||
const cmitem = this.getElement(this.selectors.CM, element.id);
|
const cmitem = this.getElement(this.selectors.CM, element.id);
|
||||||
|
|
|
@ -98,7 +98,8 @@ export default class extends DndSection {
|
||||||
/**
|
/**
|
||||||
* Update a course index section using the state information.
|
* Update a course index section using the state information.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshSection({element}) {
|
_refreshSection({element}) {
|
||||||
// Update classes.
|
// Update classes.
|
||||||
|
|
|
@ -69,7 +69,8 @@ export default class extends DndCmItem {
|
||||||
/**
|
/**
|
||||||
* Update a course index cm using the state information.
|
* Update a course index cm using the state information.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshCm({element}) {
|
_refreshCm({element}) {
|
||||||
// Update classes.
|
// Update classes.
|
||||||
|
|
|
@ -96,8 +96,8 @@ export default class extends Reactive {
|
||||||
* Setup the current view settings
|
* Setup the current view settings
|
||||||
*
|
*
|
||||||
* @param {Object} setup format, page and course settings
|
* @param {Object} setup format, page and course settings
|
||||||
* @property {boolean} setup.editing if the page is in edit mode
|
* @param {boolean} setup.editing if the page is in edit mode
|
||||||
* @property {boolean} setup.supportscomponents if the format supports components for content
|
* @param {boolean} setup.supportscomponents if the format supports components for content
|
||||||
*/
|
*/
|
||||||
setViewFormat(setup) {
|
setViewFormat(setup) {
|
||||||
this._editing = setup.editing ?? false;
|
this._editing = setup.editing ?? false;
|
||||||
|
@ -213,8 +213,7 @@ export default class extends Reactive {
|
||||||
* goes wrong. However, course editor can directly display a notification.
|
* goes wrong. However, course editor can directly display a notification.
|
||||||
*
|
*
|
||||||
* @method dispatch
|
* @method dispatch
|
||||||
* @param {string} actionName the action name (usually the mutation name)
|
* @param {mixed} args any number of params the mutation needs.
|
||||||
* @param {*} param any number of params the mutation needs.
|
|
||||||
*/
|
*/
|
||||||
async dispatch(...args) {
|
async dispatch(...args) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -119,8 +119,6 @@ export default class extends BaseComponent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the component dropzone.
|
* Display the component dropzone.
|
||||||
*
|
|
||||||
* @param {Object} dropdata the accepted drop data
|
|
||||||
*/
|
*/
|
||||||
showDropZone() {
|
showDropZone() {
|
||||||
this.element.classList.add(this.classes.DROPZONE);
|
this.element.classList.add(this.classes.DROPZONE);
|
||||||
|
|
|
@ -83,7 +83,8 @@ export default class Component extends DndCmItem {
|
||||||
/**
|
/**
|
||||||
* Update a course index cm using the state information.
|
* Update a course index cm using the state information.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element details the update details.
|
||||||
*/
|
*/
|
||||||
_refreshCm({element}) {
|
_refreshCm({element}) {
|
||||||
// Update classes.
|
// Update classes.
|
||||||
|
|
|
@ -133,7 +133,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Update section collapsed.
|
* Update section collapsed.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} args
|
||||||
|
* @param {object} args.element The leement to be expanded
|
||||||
*/
|
*/
|
||||||
_refreshSectionCollapsed({element}) {
|
_refreshSectionCollapsed({element}) {
|
||||||
const target = this.getElement(this.selectors.SECTION, element.id);
|
const target = this.getElement(this.selectors.SECTION, element.id);
|
||||||
|
@ -186,7 +187,9 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Create a newcm instance.
|
* Create a newcm instance.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.state
|
||||||
|
* @param {Object} param.element
|
||||||
*/
|
*/
|
||||||
async _createCm({state, element}) {
|
async _createCm({state, element}) {
|
||||||
// Create a fake node while the component is loading.
|
// Create a fake node while the component is loading.
|
||||||
|
@ -213,7 +216,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Refresh a section cm list.
|
* Refresh a section cm list.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element
|
||||||
*/
|
*/
|
||||||
_refreshSectionCmlist({element}) {
|
_refreshSectionCmlist({element}) {
|
||||||
const cmlist = element.cmlist ?? [];
|
const cmlist = element.cmlist ?? [];
|
||||||
|
@ -224,7 +228,8 @@ export default class Component extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Refresh the section list.
|
* Refresh the section list.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element
|
||||||
*/
|
*/
|
||||||
_refreshCourseSectionlist({element}) {
|
_refreshCourseSectionlist({element}) {
|
||||||
const sectionlist = element.sectionlist ?? [];
|
const sectionlist = element.sectionlist ?? [];
|
||||||
|
@ -274,7 +279,8 @@ export default class Component extends BaseComponent {
|
||||||
*
|
*
|
||||||
* The actual DOM element removal is delegated to the cm component.
|
* The actual DOM element removal is delegated to the cm component.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {object} param
|
||||||
|
* @param {Object} param.element
|
||||||
*/
|
*/
|
||||||
_deleteCm({element}) {
|
_deleteCm({element}) {
|
||||||
delete this.cms[element.id];
|
delete this.cms[element.id];
|
||||||
|
|
|
@ -108,7 +108,8 @@ export default class Component extends DndSection {
|
||||||
/**
|
/**
|
||||||
* Update a course index section using the state information.
|
* Update a course index section using the state information.
|
||||||
*
|
*
|
||||||
* @param {Object} details the update details.
|
* @param {Object} param details the update details.
|
||||||
|
* @param {Object} param.element
|
||||||
*/
|
*/
|
||||||
_refreshSection({element}) {
|
_refreshSection({element}) {
|
||||||
// Update classes.
|
// Update classes.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../../../../src/grades/grader/gradingpanel/point.js"],"names":["fetchCurrentGrade","storeCurrentGrade","component","context","itemname","userId","notifyUser","rootNode","form","querySelector","grade","checkValidity","value","trim","invalidResult","serialize"],"mappings":"8RA0BA,uD,mVAaiC,QAApBA,CAAAA,iBAAoB,SAAa,iBAAW,OAAX,yBAAb,C,CAc1B,GAAMC,CAAAA,CAAiB,4CAAG,WAAMC,CAAN,CAAiBC,CAAjB,CAA0BC,CAA1B,CAAoCC,CAApC,CAA4CC,CAA5C,CAAwDC,CAAxD,2FACvBC,CADuB,CAChBD,CAAQ,CAACE,aAAT,CAAuB,MAAvB,CADgB,CAEvBC,CAFuB,CAEfF,CAAI,CAACC,aAAL,CAAmB,uBAAnB,CAFe,MAIzB,CAACC,CAAK,CAACC,aAAN,EAAD,EAA0B,CAACD,CAAK,CAACE,KAAN,CAAYC,IAAZ,EAJF,2CAKlBC,eALkB,cAQzB,uBAAYN,CAAZ,CARyB,kCASZ,gBAAU,OAAV,EAAmBN,CAAnB,CAA8BC,CAA9B,CAAuCC,CAAvC,CAAiDC,CAAjD,CAAyDC,CAAzD,CAAqE,cAAOE,CAAP,EAAaO,SAAb,EAArE,CATY,0EAWlB,EAXkB,2CAAH,uDAAvB,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 * Grading panel for simple direct grading.\n *\n * @module core_grades/grades/grader/gradingpanel/point\n * @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {saveGrade, fetchGrade} from './repository';\nimport {compareData} from 'core_grades/grades/grader/gradingpanel/comparison';\n// Note: We use jQuery.serializer here until we can rewrite Ajax to use XHR.send()\nimport jQuery from 'jquery';\nimport {invalidResult} from './normalise';\n\n/**\n * Fetch the current grade for a user.\n *\n * @param {String} component\n * @param {Number} context\n * @param {String} itemname\n * @param {Number} userId\n * @param {Element} rootNode\n * @return {Object}\n */\nexport const fetchCurrentGrade = (...args) => fetchGrade('point')(...args);\n\n/**\n * Store a new grade for a user.\n *\n * @param {String} component\n * @param {Number} context\n * @param {String} itemname\n * @param {Number} userId\n * @param {Boolean} notifyUser\n * @param {Element} rootNode\n *\n * @return {Object}\n */\nexport const storeCurrentGrade = async(component, context, itemname, userId, notifyUser, rootNode) => {\n const form = rootNode.querySelector('form');\n const grade = form.querySelector('input[name=\"grade\"]');\n\n if (!grade.checkValidity() || !grade.value.trim()) {\n return invalidResult;\n }\n\n if (compareData(form) === true) {\n return await saveGrade('point')(component, context, itemname, userId, notifyUser, jQuery(form).serialize());\n } else {\n return '';\n }\n};\n"],"file":"point.min.js"}
|
{"version":3,"sources":["../../../../src/grades/grader/gradingpanel/point.js"],"names":["fetchCurrentGrade","storeCurrentGrade","component","context","itemname","userId","notifyUser","rootNode","form","querySelector","grade","checkValidity","value","trim","invalidResult","serialize"],"mappings":"8RA0BA,uD,mVAciC,QAApBA,CAAAA,iBAAoB,SAAa,iBAAW,OAAX,yBAAb,C,CAa1B,GAAMC,CAAAA,CAAiB,4CAAG,WAAMC,CAAN,CAAiBC,CAAjB,CAA0BC,CAA1B,CAAoCC,CAApC,CAA4CC,CAA5C,CAAwDC,CAAxD,2FACvBC,CADuB,CAChBD,CAAQ,CAACE,aAAT,CAAuB,MAAvB,CADgB,CAEvBC,CAFuB,CAEfF,CAAI,CAACC,aAAL,CAAmB,uBAAnB,CAFe,MAIzB,CAACC,CAAK,CAACC,aAAN,EAAD,EAA0B,CAACD,CAAK,CAACE,KAAN,CAAYC,IAAZ,EAJF,2CAKlBC,eALkB,cAQzB,uBAAYN,CAAZ,CARyB,kCASZ,gBAAU,OAAV,EAAmBN,CAAnB,CAA8BC,CAA9B,CAAuCC,CAAvC,CAAiDC,CAAjD,CAAyDC,CAAzD,CAAqE,cAAOE,CAAP,EAAaO,SAAb,EAArE,CATY,0EAWlB,EAXkB,2CAAH,uDAAvB,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 * Grading panel for simple direct grading.\n *\n * @module core_grades/grades/grader/gradingpanel/point\n * @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {saveGrade, fetchGrade} from './repository';\nimport {compareData} from 'core_grades/grades/grader/gradingpanel/comparison';\n// Note: We use jQuery.serializer here until we can rewrite Ajax to use XHR.send()\nimport jQuery from 'jquery';\nimport {invalidResult} from './normalise';\n\n/**\n * Fetch the current grade for a user.\n *\n * @param {object} args\n * @param {String} args.component\n * @param {Number} args.context\n * @param {String} args.itemname\n * @param {Number} args.userId\n * @param {Element} args.rootNode\n * @returns {Object}\n */\nexport const fetchCurrentGrade = (...args) => fetchGrade('point')(...args);\n\n/**\n * Store a new grade for a user.\n *\n * @param {String} component\n * @param {Number} context\n * @param {String} itemname\n * @param {Number} userId\n * @param {Boolean} notifyUser\n * @param {Element} rootNode\n * @returns {Object}\n */\nexport const storeCurrentGrade = async(component, context, itemname, userId, notifyUser, rootNode) => {\n const form = rootNode.querySelector('form');\n const grade = form.querySelector('input[name=\"grade\"]');\n\n if (!grade.checkValidity() || !grade.value.trim()) {\n return invalidResult;\n }\n\n if (compareData(form) === true) {\n return await saveGrade('point')(component, context, itemname, userId, notifyUser, jQuery(form).serialize());\n } else {\n return '';\n }\n};\n"],"file":"point.min.js"}
|
|
@ -30,12 +30,13 @@ import {invalidResult} from './normalise';
|
||||||
/**
|
/**
|
||||||
* Fetch the current grade for a user.
|
* Fetch the current grade for a user.
|
||||||
*
|
*
|
||||||
* @param {String} component
|
* @param {object} args
|
||||||
* @param {Number} context
|
* @param {String} args.component
|
||||||
* @param {String} itemname
|
* @param {Number} args.context
|
||||||
* @param {Number} userId
|
* @param {String} args.itemname
|
||||||
* @param {Element} rootNode
|
* @param {Number} args.userId
|
||||||
* @return {Object}
|
* @param {Element} args.rootNode
|
||||||
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export const fetchCurrentGrade = (...args) => fetchGrade('point')(...args);
|
export const fetchCurrentGrade = (...args) => fetchGrade('point')(...args);
|
||||||
|
|
||||||
|
@ -48,8 +49,7 @@ export const fetchCurrentGrade = (...args) => fetchGrade('point')(...args);
|
||||||
* @param {Number} userId
|
* @param {Number} userId
|
||||||
* @param {Boolean} notifyUser
|
* @param {Boolean} notifyUser
|
||||||
* @param {Element} rootNode
|
* @param {Element} rootNode
|
||||||
*
|
* @returns {Object}
|
||||||
* @return {Object}
|
|
||||||
*/
|
*/
|
||||||
export const storeCurrentGrade = async(component, context, itemname, userId, notifyUser, rootNode) => {
|
export const storeCurrentGrade = async(component, context, itemname, userId, notifyUser, rootNode) => {
|
||||||
const form = rootNode.querySelector('form');
|
const form = rootNode.querySelector('form');
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../src/utils.js"],"names":["throttle","func","wait","onCooldown","runAgain","run","args","apply","setTimeout","recurse","debounce","timeout","clearTimeout"],"mappings":"mJAoCwB,QAAXA,CAAAA,QAAW,CAACC,CAAD,CAAOC,CAAP,CAAgB,IAChCC,CAAAA,CAAU,GADsB,CAEhCC,CAAQ,CAAG,IAFqB,CAG9BC,CAAG,CAAG,UAAkB,4BAANC,CAAM,uBAANA,CAAM,iBAC1B,GAAiB,IAAb,GAAAF,CAAJ,CAAuB,CAEnBA,CAAQ,GACX,CAHD,IAGO,CAGHA,CAAQ,GACX,CAED,GAAID,CAAJ,CAAgB,CAEZ,MACH,CAEDF,CAAI,CAACM,KAAL,CAAW,IAAX,CAAiBD,CAAjB,EACAH,CAAU,GAAV,CAEAK,UAAU,CAAC,UAAM,CACb,GAAMC,CAAAA,CAAO,CAAGL,CAAhB,CACAD,CAAU,GAAV,CACAC,CAAQ,CAAG,IAAX,CAEA,GAAIK,CAAJ,CAAa,CACTJ,CAAG,CAACC,CAAD,CACN,CACJ,CARS,CAQPJ,CARO,CASb,CA9BmC,CAgCpC,MAAOG,CAAAA,CACV,C,YAYuB,QAAXK,CAAAA,QAAW,CAACT,CAAD,CAAOC,CAAP,CAAgB,CACpC,GAAIS,CAAAA,CAAO,CAAG,IAAd,CACA,MAAO,WAAkB,mCAANL,CAAM,uBAANA,CAAM,iBACrBM,YAAY,CAACD,CAAD,CAAZ,CACAA,CAAO,CAAGH,UAAU,CAAC,UAAM,CACvBP,CAAI,CAACM,KAAL,CAAW,CAAX,CAAiBD,CAAjB,CACH,CAFmB,CAEjBJ,CAFiB,CAGvB,CACJ,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 * Utility functions.\n *\n * @module core/utils\n * @copyright 2019 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n /**\n * Create a wrapper function to throttle the execution of the given\n * function to at most once every specified period.\n *\n * If the function is attempted to be executed while it's in cooldown\n * (during the wait period) then it'll immediately execute again as\n * soon as the cooldown is over.\n *\n * @method\n * @param {Function} func The function to throttle\n * @param {Number} wait The number of milliseconds to wait between executions\n * @return {Function}\n */\nexport const throttle = (func, wait) => {\n let onCooldown = false;\n let runAgain = null;\n const run = function(...args) {\n if (runAgain === null) {\n // This is the first time the function has been called.\n runAgain = false;\n } else {\n // This function has been called a second time during the wait period\n // so re-run it once the wait period is over.\n runAgain = true;\n }\n\n if (onCooldown) {\n // Function has already run for this wait period.\n return;\n }\n\n func.apply(this, args);\n onCooldown = true;\n\n setTimeout(() => {\n const recurse = runAgain;\n onCooldown = false;\n runAgain = null;\n\n if (recurse) {\n run(args);\n }\n }, wait);\n };\n\n return run;\n};\n\n/**\n * Create a wrapper function to debounce the execution of the given\n * function. Each attempt to execute the function will reset the cooldown\n * period.\n *\n * @method\n * @param {Function} func The function to debounce\n * @param {Number} wait The number of milliseconds to wait after the final attempt to execute\n * @return {Function}\n */\nexport const debounce = (func, wait) => {\n let timeout = null;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n func.apply(this, args);\n }, wait);\n };\n};\n"],"file":"utils.min.js"}
|
{"version":3,"sources":["../src/utils.js"],"names":["throttle","func","wait","onCooldown","runAgain","run","args","apply","setTimeout","recurse","debounce","timeout","clearTimeout"],"mappings":"mJAqCwB,QAAXA,CAAAA,QAAW,CAACC,CAAD,CAAOC,CAAP,CAAgB,IAChCC,CAAAA,CAAU,GADsB,CAEhCC,CAAQ,CAAG,IAFqB,CAG9BC,CAAG,CAAG,UAAkB,4BAANC,CAAM,uBAANA,CAAM,iBAC1B,GAAiB,IAAb,GAAAF,CAAJ,CAAuB,CAEnBA,CAAQ,GACX,CAHD,IAGO,CAGHA,CAAQ,GACX,CAED,GAAID,CAAJ,CAAgB,CAEZ,MACH,CAEDF,CAAI,CAACM,KAAL,CAAW,IAAX,CAAiBD,CAAjB,EACAH,CAAU,GAAV,CAEAK,UAAU,CAAC,UAAM,CACb,GAAMC,CAAAA,CAAO,CAAGL,CAAhB,CACAD,CAAU,GAAV,CACAC,CAAQ,CAAG,IAAX,CAEA,GAAIK,CAAJ,CAAa,CACTJ,CAAG,CAACC,CAAD,CACN,CACJ,CARS,CAQPJ,CARO,CASb,CA9BmC,CAgCpC,MAAOG,CAAAA,CACV,C,YAYuB,QAAXK,CAAAA,QAAW,CAACT,CAAD,CAAOC,CAAP,CAAgB,CACpC,GAAIS,CAAAA,CAAO,CAAG,IAAd,CACA,MAAO,WAAkB,mCAANL,CAAM,uBAANA,CAAM,iBACrBM,YAAY,CAACD,CAAD,CAAZ,CACAA,CAAO,CAAGH,UAAU,CAAC,UAAM,CACvBP,CAAI,CAACM,KAAL,CAAW,CAAX,CAAiBD,CAAjB,CACH,CAFmB,CAEjBJ,CAFiB,CAGvB,CACJ,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 * Utility functions.\n *\n * @module core/utils\n * @copyright 2019 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n /**\n * Create a wrapper function to throttle the execution of the given\n *\n * function to at most once every specified period.\n *\n * If the function is attempted to be executed while it's in cooldown\n * (during the wait period) then it'll immediately execute again as\n * soon as the cooldown is over.\n *\n * @method\n * @param {Function} func The function to throttle\n * @param {Number} wait The number of milliseconds to wait between executions\n * @return {Function}\n */\nexport const throttle = (func, wait) => {\n let onCooldown = false;\n let runAgain = null;\n const run = function(...args) {\n if (runAgain === null) {\n // This is the first time the function has been called.\n runAgain = false;\n } else {\n // This function has been called a second time during the wait period\n // so re-run it once the wait period is over.\n runAgain = true;\n }\n\n if (onCooldown) {\n // Function has already run for this wait period.\n return;\n }\n\n func.apply(this, args);\n onCooldown = true;\n\n setTimeout(() => {\n const recurse = runAgain;\n onCooldown = false;\n runAgain = null;\n\n if (recurse) {\n run(args);\n }\n }, wait);\n };\n\n return run;\n};\n\n/**\n * Create a wrapper function to debounce the execution of the given\n * function. Each attempt to execute the function will reset the cooldown\n * period.\n *\n * @method\n * @param {Function} func The function to debounce\n * @param {Number} wait The number of milliseconds to wait after the final attempt to execute\n * @return {Function}\n */\nexport const debounce = (func, wait) => {\n let timeout = null;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n func.apply(this, args);\n }, wait);\n };\n};\n"],"file":"utils.min.js"}
|
|
@ -73,7 +73,7 @@ const registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {
|
||||||
* Method that creates the 'add block' modal.
|
* Method that creates the 'add block' modal.
|
||||||
*
|
*
|
||||||
* @method buildAddBlockModal
|
* @method buildAddBlockModal
|
||||||
* @return {Promise} The modal promise (modal's body will be rendered later).
|
* @returns {Promise} The modal promise (modal's body will be rendered later).
|
||||||
*/
|
*/
|
||||||
const buildAddBlockModal = () => {
|
const buildAddBlockModal = () => {
|
||||||
return ModalFactory.create({
|
return ModalFactory.create({
|
||||||
|
|
|
@ -184,7 +184,6 @@ define([
|
||||||
* Make the config config.
|
* Make the config config.
|
||||||
*
|
*
|
||||||
* @protected
|
* @protected
|
||||||
* @param {module:core/chart_axis} axis The axis.
|
|
||||||
* @return {Object} The axis config.
|
* @return {Object} The axis config.
|
||||||
*/
|
*/
|
||||||
Output.prototype._makeConfig = function() {
|
Output.prototype._makeConfig = function() {
|
||||||
|
|
|
@ -206,7 +206,7 @@ class DebugInstance {
|
||||||
*
|
*
|
||||||
* Quick access to the instance setReadOnly method.
|
* Quick access to the instance setReadOnly method.
|
||||||
*
|
*
|
||||||
* @param {bool} value: the new read only value
|
* @param {bool} value the new read only value
|
||||||
*/
|
*/
|
||||||
set readOnly(value) {
|
set readOnly(value) {
|
||||||
this.instance.stateManager.setReadOnly(value);
|
this.instance.stateManager.setReadOnly(value);
|
||||||
|
@ -215,7 +215,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* Get the read only value
|
* Get the read only value
|
||||||
*
|
*
|
||||||
* @return {bool}
|
* @returns {bool}
|
||||||
*/
|
*/
|
||||||
get readOnly() {
|
get readOnly() {
|
||||||
return this.instance.stateManager.readonly;
|
return this.instance.stateManager.readonly;
|
||||||
|
@ -224,7 +224,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* Return the current state object.
|
* Return the current state object.
|
||||||
*
|
*
|
||||||
* @return {object}
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
get state() {
|
get state() {
|
||||||
return this.instance.state;
|
return this.instance.state;
|
||||||
|
@ -246,7 +246,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* Get the current highligh value.
|
* Get the current highligh value.
|
||||||
*
|
*
|
||||||
* @return {bool}
|
* @returns {bool}
|
||||||
*/
|
*/
|
||||||
get highlight() {
|
get highlight() {
|
||||||
return this.instance._reactiveDebugData.highlighted;
|
return this.instance._reactiveDebugData.highlighted;
|
||||||
|
@ -255,7 +255,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* List all the components registered in this instance.
|
* List all the components registered in this instance.
|
||||||
*
|
*
|
||||||
* @return {array}
|
* @returns {array}
|
||||||
*/
|
*/
|
||||||
get components() {
|
get components() {
|
||||||
return [...this.instance.components];
|
return [...this.instance.components];
|
||||||
|
@ -264,7 +264,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* List all the state changes evenet pending to dispatch.
|
* List all the state changes evenet pending to dispatch.
|
||||||
*
|
*
|
||||||
* @return {array}
|
* @returns {array}
|
||||||
*/
|
*/
|
||||||
get changes() {
|
get changes() {
|
||||||
const result = [];
|
const result = [];
|
||||||
|
@ -283,8 +283,7 @@ class DebugInstance {
|
||||||
* goes wrong. However, course editor can directly display a notification.
|
* goes wrong. However, course editor can directly display a notification.
|
||||||
*
|
*
|
||||||
* @method dispatch
|
* @method dispatch
|
||||||
* @param {string} actionName the action name (usually the mutation name)
|
* @param {*} args
|
||||||
* @param {*} param any number of params the mutation needs.
|
|
||||||
*/
|
*/
|
||||||
async dispatch(...args) {
|
async dispatch(...args) {
|
||||||
this.instance.dispatch(...args);
|
this.instance.dispatch(...args);
|
||||||
|
@ -293,7 +292,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* Return all the HTML elements registered in the instance components.
|
* Return all the HTML elements registered in the instance components.
|
||||||
*
|
*
|
||||||
* @return {array}
|
* @returns {array}
|
||||||
*/
|
*/
|
||||||
get elements() {
|
get elements() {
|
||||||
const result = [];
|
const result = [];
|
||||||
|
@ -306,7 +305,7 @@ class DebugInstance {
|
||||||
/**
|
/**
|
||||||
* Return a plain copy of the state data.
|
* Return a plain copy of the state data.
|
||||||
*
|
*
|
||||||
* @return {object}
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
get stateData() {
|
get stateData() {
|
||||||
return JSON.parse(JSON.stringify(this.state));
|
return JSON.parse(JSON.stringify(this.state));
|
||||||
|
|
|
@ -274,7 +274,8 @@ class DebugInstanceSubpanel extends BaseComponent {
|
||||||
/**
|
/**
|
||||||
* Wtacher method to refresh the log panel.
|
* Wtacher method to refresh the log panel.
|
||||||
*
|
*
|
||||||
* @param {object} detail of the change
|
* @param {object} args
|
||||||
|
* @param {HTMLElement} args.element
|
||||||
*/
|
*/
|
||||||
_refreshLog({element}) {
|
_refreshLog({element}) {
|
||||||
const list = element?.lastChanges ?? [];
|
const list = element?.lastChanges ?? [];
|
||||||
|
|
|
@ -235,11 +235,11 @@ export default class {
|
||||||
*
|
*
|
||||||
* @method registerComponent
|
* @method registerComponent
|
||||||
* @param {object} component the new component
|
* @param {object} component the new component
|
||||||
* @property {string} [component.name] the component name to display in warnings and errors.
|
* @param {string} [component.name] the component name to display in warnings and errors.
|
||||||
* @property {Function} [component.dispatchRegistrationSuccess] method to notify registration success
|
* @param {Function} [component.dispatchRegistrationSuccess] method to notify registration success
|
||||||
* @property {Function} [component.dispatchRegistrationFail] method to notify registration fail
|
* @param {Function} [component.dispatchRegistrationFail] method to notify registration fail
|
||||||
* @property {Function} [component.getWatchers] getter of the component watchers
|
* @param {Function} [component.getWatchers] getter of the component watchers
|
||||||
* @property {Function} [component.stateReady] method to call when the state is ready
|
* @param {Function} [component.stateReady] method to call when the state is ready
|
||||||
* @return {object} the registered component
|
* @return {object} the registered component
|
||||||
*/
|
*/
|
||||||
registerComponent(component) {
|
registerComponent(component) {
|
||||||
|
@ -368,7 +368,7 @@ export default class {
|
||||||
*
|
*
|
||||||
* @method dispatch
|
* @method dispatch
|
||||||
* @param {string} actionName the action name (usually the mutation name)
|
* @param {string} actionName the action name (usually the mutation name)
|
||||||
* @param {*} param any number of params the mutation needs.
|
* @param {mixed} params any number of params the mutation needs.
|
||||||
*/
|
*/
|
||||||
async dispatch(actionName, ...params) {
|
async dispatch(actionName, ...params) {
|
||||||
if (typeof actionName !== 'string') {
|
if (typeof actionName !== 'string') {
|
||||||
|
|
|
@ -123,7 +123,8 @@ function($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {
|
||||||
* Allow to create non-passive touchstart listeners and prevent page scrolling when dragging
|
* Allow to create non-passive touchstart listeners and prevent page scrolling when dragging
|
||||||
* From: https://stackoverflow.com/a/48098097
|
* From: https://stackoverflow.com/a/48098097
|
||||||
*
|
*
|
||||||
* @type {Object}
|
* @param {string} eventname
|
||||||
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
var registerNotPassiveListeners = function(eventname) {
|
var registerNotPassiveListeners = function(eventname) {
|
||||||
return {
|
return {
|
||||||
|
@ -149,13 +150,13 @@ function($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {
|
||||||
*
|
*
|
||||||
* @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e. <ul>, <tbody>) or CSS selector
|
* @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e. <ul>, <tbody>) or CSS selector
|
||||||
* @param {Object} config Parameters for the list. See defaultParameters above for examples.
|
* @param {Object} config Parameters for the list. See defaultParameters above for examples.
|
||||||
* @property {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root
|
* @param {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root
|
||||||
* @property {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'
|
* @param {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'
|
||||||
* @property {String} config.targetListSelector CSS selector for target lists. By default the same as root
|
* @param {String} config.listSelector CSS selector for target lists. By default the same as root
|
||||||
* @property {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal
|
* @param {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal (can also be a callback
|
||||||
* (can also be a callback with list as an argument)
|
* with list as an argument)
|
||||||
* @property {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the
|
* @param {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the whole page,
|
||||||
* whole page, by default true
|
* by default true
|
||||||
*/
|
*/
|
||||||
var SortableList = function(root, config) {
|
var SortableList = function(root, config) {
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a wrapper function to throttle the execution of the given
|
* Create a wrapper function to throttle the execution of the given
|
||||||
|
*
|
||||||
* function to at most once every specified period.
|
* function to at most once every specified period.
|
||||||
*
|
*
|
||||||
* If the function is attempted to be executed while it's in cooldown
|
* If the function is attempted to be executed while it's in cooldown
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,13 @@
|
||||||
/**
|
/**
|
||||||
* Display an embedded form, it is only loaded and reloaded inside its container
|
* Display an embedded form, it is only loaded and reloaded inside its container
|
||||||
*
|
*
|
||||||
* Example:
|
*
|
||||||
|
* @module core_form/dynamicform
|
||||||
|
* @copyright 2019 Marina Glancy
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
|
* See also https://docs.moodle.org/dev/Modal_and_AJAX_forms
|
||||||
|
*
|
||||||
|
* @example
|
||||||
* import DynamicForm from 'core_form/dynamicform';
|
* import DynamicForm from 'core_form/dynamicform';
|
||||||
*
|
*
|
||||||
* const dynamicForm = new DynamicForm(document.querySelector('#mycontainer', 'pluginname\\form\\formname');
|
* const dynamicForm = new DynamicForm(document.querySelector('#mycontainer', 'pluginname\\form\\formname');
|
||||||
|
@ -27,11 +33,6 @@
|
||||||
* });
|
* });
|
||||||
* dynamicForm.load();
|
* dynamicForm.load();
|
||||||
*
|
*
|
||||||
* See also https://docs.moodle.org/dev/Modal_and_AJAX_forms
|
|
||||||
*
|
|
||||||
* @module core_form/dynamicform
|
|
||||||
* @copyright 2019 Marina Glancy
|
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as FormChangeChecker from 'core_form/changechecker';
|
import * as FormChangeChecker from 'core_form/changechecker';
|
||||||
|
@ -160,7 +161,8 @@ export default class DynamicForm {
|
||||||
/**
|
/**
|
||||||
* Add listener for an event
|
* Add listener for an event
|
||||||
*
|
*
|
||||||
* Example:
|
* @param {array} args
|
||||||
|
* @example:
|
||||||
* const dynamicForm = new DynamicForm(...);
|
* const dynamicForm = new DynamicForm(...);
|
||||||
* dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {
|
* dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {
|
||||||
* e.preventDefault();
|
* e.preventDefault();
|
||||||
|
@ -285,8 +287,9 @@ export default class DynamicForm {
|
||||||
/**
|
/**
|
||||||
* Update form contents
|
* Update form contents
|
||||||
*
|
*
|
||||||
* @param {string} html
|
* @param {object} param
|
||||||
* @param {string} js
|
* @param {string} param.html
|
||||||
|
* @param {string} param.js
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
updateForm({html, js}) {
|
updateForm({html, js}) {
|
||||||
|
|
|
@ -87,13 +87,13 @@ export default class ModalForm {
|
||||||
* Shows the required form inside a modal dialogue
|
* Shows the required form inside a modal dialogue
|
||||||
*
|
*
|
||||||
* @param {Object} config parameters for the form and modal dialogue:
|
* @param {Object} config parameters for the form and modal dialogue:
|
||||||
* @property {String} config.formClass PHP class name that handles the form (should extend \core_form\modal )
|
* @paramy {String} config.formClass PHP class name that handles the form (should extend \core_form\modal )
|
||||||
* @property {Object} config.modalConfig modal config - title, type, etc.
|
* @paramy {Object} config.modalConfig modal config - title, type, etc.
|
||||||
* Default: {removeOnClose: true, type: ModalFactory.types.SAVE_CANCEL}
|
* Default: {removeOnClose: true, type: ModalFactory.types.SAVE_CANCEL}
|
||||||
* @property {Object} config.args Arguments for the initial form rendering (for example, id of the edited entity)
|
* @paramy {Object} config.args Arguments for the initial form rendering (for example, id of the edited entity)
|
||||||
* @property {String} config.saveButtonText the text to display on the Modal "Save" button (optional)
|
* @paramy {String} config.saveButtonText the text to display on the Modal "Save" button (optional)
|
||||||
* @property {String} config.saveButtonClasses additional CSS classes for the Modal "Save" button
|
* @paramy {String} config.saveButtonClasses additional CSS classes for the Modal "Save" button
|
||||||
* @property {HTMLElement} config.returnFocus element to return focus to after the dialogue is closed
|
* @paramy {HTMLElement} config.returnFocus element to return focus to after the dialogue is closed
|
||||||
*/
|
*/
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.modal = null;
|
this.modal = null;
|
||||||
|
@ -207,7 +207,8 @@ export default class ModalForm {
|
||||||
/**
|
/**
|
||||||
* Add listener for an event
|
* Add listener for an event
|
||||||
*
|
*
|
||||||
* Example:
|
* @param {array} args
|
||||||
|
* @example:
|
||||||
* const modalForm = new ModalForm(...);
|
* const modalForm = new ModalForm(...);
|
||||||
* dynamicForm.addEventListener(modalForm.events.FORM_SUBMITTED, e => {
|
* dynamicForm.addEventListener(modalForm.events.FORM_SUBMITTED, e => {
|
||||||
* window.console.log(e.detail);
|
* window.console.log(e.detail);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../src/message_drawer_helper.js"],"names":["define","PubSub","MessageDrawerEvents","createConversationWithUser","args","publish","CREATE_CONVERSATION_WITH_USER","hide","HIDE","show","SHOW","showConversation","SHOW_CONVERSATION","showSettings","SHOW_SETTINGS"],"mappings":"AAsBAA,OAAM,sCACN,CACI,aADJ,CAEI,oCAFJ,CADM,CAKN,SACIC,CADJ,CAEIC,CAFJ,CAGE,CAyCE,MAAO,CACHC,0BAA0B,CAnCG,QAA7BA,CAAAA,0BAA6B,CAASC,CAAT,CAAe,CAC5CH,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACI,6BAAnC,CAAkEF,CAAlE,CACH,CAgCM,CAEHG,IAAI,CA7BG,QAAPA,CAAAA,IAAO,EAAW,CAClBN,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACM,IAAnC,CACH,CAyBM,CAGHC,IAAI,CAvBG,QAAPA,CAAAA,IAAO,EAAW,CAClBR,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACQ,IAAnC,CACH,CAkBM,CAIHC,gBAAgB,CAfG,QAAnBA,CAAAA,gBAAmB,CAASP,CAAT,CAAe,CAClCH,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACU,iBAAnC,CAAsDR,CAAtD,CACH,CASM,CAKHS,YAAY,CATG,QAAfA,CAAAA,YAAe,EAAW,CAC1BZ,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACY,aAAnC,CACH,CAEM,CAOV,CAxDK,CAAN","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 * Provides some helper functions to trigger actions in the message drawer.\n *\n * @module core_message/message_drawer_helper\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'core/pubsub',\n 'core_message/message_drawer_events'\n],\nfunction(\n PubSub,\n MessageDrawerEvents\n) {\n\n /**\n * Trigger an event to create a new conversation in the message drawer.\n *\n * @param {Number} userId The user id to start a conversation.\n */\n var createConversationWithUser = function(args) {\n PubSub.publish(MessageDrawerEvents.CREATE_CONVERSATION_WITH_USER, args);\n };\n\n /**\n * Trigger an event to hide the message drawer.\n */\n var hide = function() {\n PubSub.publish(MessageDrawerEvents.HIDE);\n };\n\n /**\n * Trigger an event to show the message drawer.\n */\n var show = function() {\n PubSub.publish(MessageDrawerEvents.SHOW);\n };\n\n /**\n * Trigger an event to show the given conversation.\n *\n * @param {int} conversationId Id for the conversation to show.\n */\n var showConversation = function(args) {\n PubSub.publish(MessageDrawerEvents.SHOW_CONVERSATION, args);\n };\n\n /**\n * Trigger an event to show messaging settings.\n */\n var showSettings = function() {\n PubSub.publish(MessageDrawerEvents.SHOW_SETTINGS);\n };\n\n return {\n createConversationWithUser: createConversationWithUser,\n hide: hide,\n show: show,\n showConversation: showConversation,\n showSettings: showSettings\n };\n});\n"],"file":"message_drawer_helper.min.js"}
|
{"version":3,"sources":["../src/message_drawer_helper.js"],"names":["define","PubSub","MessageDrawerEvents","createConversationWithUser","args","publish","CREATE_CONVERSATION_WITH_USER","hide","HIDE","show","SHOW","showConversation","SHOW_CONVERSATION","showSettings","SHOW_SETTINGS"],"mappings":"AAsBAA,OAAM,sCACN,CACI,aADJ,CAEI,oCAFJ,CADM,CAKN,SACIC,CADJ,CAEIC,CAFJ,CAGE,CA2CE,MAAO,CACHC,0BAA0B,CApCG,QAA7BA,CAAAA,0BAA6B,CAASC,CAAT,CAAe,CAC5CH,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACI,6BAAnC,CAAkEF,CAAlE,CACH,CAiCM,CAEHG,IAAI,CA9BG,QAAPA,CAAAA,IAAO,EAAW,CAClBN,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACM,IAAnC,CACH,CA0BM,CAGHC,IAAI,CAxBG,QAAPA,CAAAA,IAAO,EAAW,CAClBR,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACQ,IAAnC,CACH,CAmBM,CAIHC,gBAAgB,CAfG,QAAnBA,CAAAA,gBAAmB,CAASP,CAAT,CAAe,CAClCH,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACU,iBAAnC,CAAsDR,CAAtD,CACH,CASM,CAKHS,YAAY,CATG,QAAfA,CAAAA,YAAe,EAAW,CAC1BZ,CAAM,CAACI,OAAP,CAAeH,CAAmB,CAACY,aAAnC,CACH,CAEM,CAOV,CA1DK,CAAN","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 * Provides some helper functions to trigger actions in the message drawer.\n *\n * @module core_message/message_drawer_helper\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'core/pubsub',\n 'core_message/message_drawer_events'\n],\nfunction(\n PubSub,\n MessageDrawerEvents\n) {\n\n /**\n * Trigger an event to create a new conversation in the message drawer.\n *\n * @param {object} args\n * @param {Number} args.userId The user id to start a conversation.\n */\n var createConversationWithUser = function(args) {\n PubSub.publish(MessageDrawerEvents.CREATE_CONVERSATION_WITH_USER, args);\n };\n\n /**\n * Trigger an event to hide the message drawer.\n */\n var hide = function() {\n PubSub.publish(MessageDrawerEvents.HIDE);\n };\n\n /**\n * Trigger an event to show the message drawer.\n */\n var show = function() {\n PubSub.publish(MessageDrawerEvents.SHOW);\n };\n\n /**\n * Trigger an event to show the given conversation.\n *\n * @param {object} args\n * @param {int} args.conversationId Id for the conversation to show.\n */\n var showConversation = function(args) {\n PubSub.publish(MessageDrawerEvents.SHOW_CONVERSATION, args);\n };\n\n /**\n * Trigger an event to show messaging settings.\n */\n var showSettings = function() {\n PubSub.publish(MessageDrawerEvents.SHOW_SETTINGS);\n };\n\n return {\n createConversationWithUser: createConversationWithUser,\n hide: hide,\n show: show,\n showConversation: showConversation,\n showSettings: showSettings\n };\n});\n"],"file":"message_drawer_helper.min.js"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -33,7 +33,8 @@ function(
|
||||||
/**
|
/**
|
||||||
* Trigger an event to create a new conversation in the message drawer.
|
* Trigger an event to create a new conversation in the message drawer.
|
||||||
*
|
*
|
||||||
* @param {Number} userId The user id to start a conversation.
|
* @param {object} args
|
||||||
|
* @param {Number} args.userId The user id to start a conversation.
|
||||||
*/
|
*/
|
||||||
var createConversationWithUser = function(args) {
|
var createConversationWithUser = function(args) {
|
||||||
PubSub.publish(MessageDrawerEvents.CREATE_CONVERSATION_WITH_USER, args);
|
PubSub.publish(MessageDrawerEvents.CREATE_CONVERSATION_WITH_USER, args);
|
||||||
|
@ -56,7 +57,8 @@ function(
|
||||||
/**
|
/**
|
||||||
* Trigger an event to show the given conversation.
|
* Trigger an event to show the given conversation.
|
||||||
*
|
*
|
||||||
* @param {int} conversationId Id for the conversation to show.
|
* @param {object} args
|
||||||
|
* @param {int} args.conversationId Id for the conversation to show.
|
||||||
*/
|
*/
|
||||||
var showConversation = function(args) {
|
var showConversation = function(args) {
|
||||||
PubSub.publish(MessageDrawerEvents.SHOW_CONVERSATION, args);
|
PubSub.publish(MessageDrawerEvents.SHOW_CONVERSATION, args);
|
||||||
|
|
|
@ -351,9 +351,9 @@ function(
|
||||||
/**
|
/**
|
||||||
* Build a patch for this conversation.
|
* Build a patch for this conversation.
|
||||||
*
|
*
|
||||||
* @param {Object} state, The current state of this conversation.
|
* @param {Object} state The current state of this conversation.
|
||||||
* @param {Object} newState, The new state of this conversation.
|
* @param {Object} newState The new state of this conversation.
|
||||||
* @return {Object} Patch with days and messsages for each day.
|
* @returns {Object} Patch with days and messsages for each day.
|
||||||
*/
|
*/
|
||||||
var buildConversationPatch = function(state, newState) {
|
var buildConversationPatch = function(state, newState) {
|
||||||
var diff = diffArrays(state.messages, newState.messages, isMessageEqual);
|
var diff = diffArrays(state.messages, newState.messages, isMessageEqual);
|
||||||
|
|
|
@ -1401,7 +1401,7 @@ function(
|
||||||
* @param {Object} header The header container element.
|
* @param {Object} header The header container element.
|
||||||
* @param {Object} body The body container element.
|
* @param {Object} body The body container element.
|
||||||
* @param {Object} footer The footer container element.
|
* @param {Object} footer The footer container element.
|
||||||
* @param {Bool} isFavourite is this conversation a favourite.
|
* @param {Bool} state is this conversation a favourite.
|
||||||
*/
|
*/
|
||||||
var renderIsFavourite = function(header, body, footer, state) {
|
var renderIsFavourite = function(header, body, footer, state) {
|
||||||
var favouriteIcon = header.find(SELECTORS.FAVOURITE_ICON_CONTAINER);
|
var favouriteIcon = header.find(SELECTORS.FAVOURITE_ICON_CONTAINER);
|
||||||
|
|
|
@ -513,6 +513,7 @@ define(['jquery'], function($) {
|
||||||
*
|
*
|
||||||
* @param {Object} state Current state.
|
* @param {Object} state Current state.
|
||||||
* @param {Array} messageIds Messages to delete.
|
* @param {Array} messageIds Messages to delete.
|
||||||
|
* @param {string} errorMessage
|
||||||
* @return {Object} New state with array of pending delete message ids.
|
* @return {Object} New state with array of pending delete message ids.
|
||||||
*/
|
*/
|
||||||
var setMessagesSendFailById = function(state, messageIds, errorMessage) {
|
var setMessagesSendFailById = function(state, messageIds, errorMessage) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ function(
|
||||||
/**
|
/**
|
||||||
* Toggle the message drawer visibility.
|
* Toggle the message drawer visibility.
|
||||||
*
|
*
|
||||||
* @param {String} button The button id for the popover.
|
* @param {String} buttonid The button id for the popover.
|
||||||
*/
|
*/
|
||||||
var toggleMessageDrawerVisibility = function(buttonid) {
|
var toggleMessageDrawerVisibility = function(buttonid) {
|
||||||
PubSub.publish(MessageDrawerEvents.TOGGLE_VISIBILITY, buttonid);
|
PubSub.publish(MessageDrawerEvents.TOGGLE_VISIBILITY, buttonid);
|
||||||
|
|
|
@ -763,6 +763,7 @@ define(
|
||||||
* @param {int} limit Limit for results
|
* @param {int} limit Limit for results
|
||||||
* @param {int} offset Offset for results
|
* @param {int} offset Offset for results
|
||||||
* @param {bool|null} favourites If favourites should be included or not
|
* @param {bool|null} favourites If favourites should be included or not
|
||||||
|
* @param {bool} mergeself
|
||||||
* @return {object} jQuery promise
|
* @return {object} jQuery promise
|
||||||
*/
|
*/
|
||||||
var getConversations = function(
|
var getConversations = function(
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -222,7 +222,6 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @method _filterChanged
|
* @method _filterChanged
|
||||||
* @param {Event} event
|
|
||||||
*/
|
*/
|
||||||
GradingNavigation.prototype._filterChanged = function() {
|
GradingNavigation.prototype._filterChanged = function() {
|
||||||
// There are 3 types of filter right now.
|
// There are 3 types of filter right now.
|
||||||
|
@ -536,7 +535,6 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @method _handleChangeUser
|
* @method _handleChangeUser
|
||||||
* @param {Event} event
|
|
||||||
*/
|
*/
|
||||||
GradingNavigation.prototype._handleChangeUser = function() {
|
GradingNavigation.prototype._handleChangeUser = function() {
|
||||||
var select = this._region.find('[data-action=change-user]');
|
var select = this._region.find('[data-action=change-user]');
|
||||||
|
|
|
@ -27,7 +27,6 @@ define(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {
|
||||||
* GradingReviewPanel class.
|
* GradingReviewPanel class.
|
||||||
*
|
*
|
||||||
* @class mod_assign/grading_review_panel
|
* @class mod_assign/grading_review_panel
|
||||||
* @param {String} selector The selector for the page region containing the user navigation.
|
|
||||||
*/
|
*/
|
||||||
var GradingReviewPanel = function() {
|
var GradingReviewPanel = function() {
|
||||||
this._region = $('[data-region="review-panel-content"]');
|
this._region = $('[data-region="review-panel-content"]');
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -39,6 +39,8 @@ const findGradableNode = node => node.closest(ForumSelectors.expandConversation)
|
||||||
* Show the post in context in a modal.
|
* Show the post in context in a modal.
|
||||||
*
|
*
|
||||||
* @param {HTMLElement} rootNode The button that has been clicked
|
* @param {HTMLElement} rootNode The button that has been clicked
|
||||||
|
* @param {object} param
|
||||||
|
* @param {bool} [param.focusOnClose=null]
|
||||||
*/
|
*/
|
||||||
const showPostInContext = async(rootNode, {
|
const showPostInContext = async(rootNode, {
|
||||||
focusOnClose = null,
|
focusOnClose = null,
|
||||||
|
|
|
@ -112,6 +112,8 @@ const discussionPostMapper = (discussion) => {
|
||||||
* Launch the Grader.
|
* Launch the Grader.
|
||||||
*
|
*
|
||||||
* @param {HTMLElement} rootNode the root HTML element describing what is to be graded
|
* @param {HTMLElement} rootNode the root HTML element describing what is to be graded
|
||||||
|
* @param {object} param
|
||||||
|
* @param {bool} [param.focusOnClose=null]
|
||||||
*/
|
*/
|
||||||
const launchWholeForumGrading = async(rootNode, {
|
const launchWholeForumGrading = async(rootNode, {
|
||||||
focusOnClose = null,
|
focusOnClose = null,
|
||||||
|
@ -148,6 +150,8 @@ const launchWholeForumGrading = async(rootNode, {
|
||||||
* Launch the Grader.
|
* Launch the Grader.
|
||||||
*
|
*
|
||||||
* @param {HTMLElement} rootNode the root HTML element describing what is to be graded
|
* @param {HTMLElement} rootNode the root HTML element describing what is to be graded
|
||||||
|
* @param {object} param
|
||||||
|
* @param {bool} [param.focusOnClose=null]
|
||||||
*/
|
*/
|
||||||
const launchViewGrading = async(rootNode, {
|
const launchViewGrading = async(rootNode, {
|
||||||
focusOnClose = null,
|
focusOnClose = null,
|
||||||
|
|
|
@ -389,7 +389,13 @@ const displayGradingError = async(root, user, err) => {
|
||||||
* @param {Function} getContentForUser A function to get the content for a specific user
|
* @param {Function} getContentForUser A function to get the content for a specific user
|
||||||
* @param {Function} getGradeForUser A function get the grade details for a specific user
|
* @param {Function} getGradeForUser A function get the grade details for a specific user
|
||||||
* @param {Function} setGradeForUser A function to set the grade for a specific user
|
* @param {Function} setGradeForUser A function to set the grade for a specific user
|
||||||
* @param {Object} Preferences for the launch function
|
* @param {Object} preferences Preferences for the launch function
|
||||||
|
* @param {Number} preferences.initialUserId
|
||||||
|
* @param {string} preferences.moduleName
|
||||||
|
* @param {string} preferences.courseName
|
||||||
|
* @param {string} preferences.courseUrl
|
||||||
|
* @param {boolean} preferences.sendStudentNotifications
|
||||||
|
* @param {null|HTMLElement} preferences.focusOnClose
|
||||||
*/
|
*/
|
||||||
export const launch = async(getListOfUsers, getContentForUser, getGradeForUser, setGradeForUser, {
|
export const launch = async(getListOfUsers, getContentForUser, getGradeForUser, setGradeForUser, {
|
||||||
initialUserId = null,
|
initialUserId = null,
|
||||||
|
@ -475,6 +481,8 @@ export const launch = async(getListOfUsers, getContentForUser, getGradeForUser,
|
||||||
* @param {Function} getGradeForUser A function get the grade details for a specific user
|
* @param {Function} getGradeForUser A function get the grade details for a specific user
|
||||||
* @param {Number} userid The ID of a specific user
|
* @param {Number} userid The ID of a specific user
|
||||||
* @param {String} moduleName the name of the module
|
* @param {String} moduleName the name of the module
|
||||||
|
* @param {object} param
|
||||||
|
* @param {null|HTMLElement} param.focusOnClose
|
||||||
*/
|
*/
|
||||||
export const view = async(getGradeForUser, userid, moduleName, {
|
export const view = async(getGradeForUser, userid, moduleName, {
|
||||||
focusOnClose = null,
|
focusOnClose = null,
|
||||||
|
|
129
npm-shrinkwrap.json
generated
129
npm-shrinkwrap.json
generated
|
@ -2456,6 +2456,40 @@
|
||||||
"to-fast-properties": "^2.0.0"
|
"to-fast-properties": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@es-joy/jsdoccomment": {
|
||||||
|
"version": "0.10.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.10.8.tgz",
|
||||||
|
"integrity": "sha512-3P1JiGL4xaR9PoTKUHa2N/LKwa2/eUdRqGwijMWWgBqbFEqJUVpmaOi2TcjcemrsRMgFLBzQCK4ToPhrSVDiFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"comment-parser": "1.2.4",
|
||||||
|
"esquery": "^1.4.0",
|
||||||
|
"jsdoc-type-pratt-parser": "1.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"esquery": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"estraverse": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"estraverse": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"jsdoc-type-pratt-parser": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-uelRmpghNwPBuZScwgBG/OzodaFk5RbO5xaivBdsAY70icWfShwZ7PCMO0x1zSkOa8T1FzHThmrdoyg/0AwV5g==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@nodelib/fs.scandir": {
|
"@nodelib/fs.scandir": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||||
|
@ -3922,6 +3956,12 @@
|
||||||
"integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==",
|
"integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"comment-parser": {
|
||||||
|
"version": "1.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz",
|
||||||
|
"integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"common-sequence": {
|
"common-sequence": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz",
|
||||||
|
@ -4870,6 +4910,83 @@
|
||||||
"eslint-rule-composer": "^0.3.0"
|
"eslint-rule-composer": "^0.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"eslint-plugin-jsdoc": {
|
||||||
|
"version": "36.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.1.1.tgz",
|
||||||
|
"integrity": "sha512-nuLDvH1EJaKx0PCa9oeQIxH6pACIhZd1gkalTUxZbaxxwokjs7TplqY0Q8Ew3CoZaf5aowm0g/Z3JGHCatt+gQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@es-joy/jsdoccomment": "0.10.8",
|
||||||
|
"comment-parser": "1.2.4",
|
||||||
|
"debug": "^4.3.2",
|
||||||
|
"esquery": "^1.4.0",
|
||||||
|
"jsdoc-type-pratt-parser": "^1.1.1",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"regextras": "^0.8.0",
|
||||||
|
"semver": "^7.3.5",
|
||||||
|
"spdx-expression-parse": "^3.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "4.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
||||||
|
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"esquery": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"estraverse": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"estraverse": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"lru-cache": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"yallist": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "7.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
||||||
|
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lru-cache": "^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-expression-parse": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"spdx-exceptions": "^2.1.0",
|
||||||
|
"spdx-license-ids": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yallist": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-plugin-promise": {
|
"eslint-plugin-promise": {
|
||||||
"version": "4.2.1",
|
"version": "4.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz",
|
||||||
|
@ -7266,6 +7383,12 @@
|
||||||
"walk-back": "^5.0.0"
|
"walk-back": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jsdoc-type-pratt-parser": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-4STjeF14jp4bqha44nKMY1OUI6d2/g6uclHWUCZ7B4DoLzaB5bmpTkQrpqU+vSVzMD0LsKAOskcnI3I3VfIpmg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"jsesc": {
|
"jsesc": {
|
||||||
"version": "2.5.2",
|
"version": "2.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
|
||||||
|
@ -9440,6 +9563,12 @@
|
||||||
"unicode-match-property-value-ecmascript": "^1.2.0"
|
"unicode-match-property-value-ecmascript": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"regextras": {
|
||||||
|
"version": "0.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz",
|
||||||
|
"integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"regjsgen": {
|
"regjsgen": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz",
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
"docdash": "^1.2.0",
|
"docdash": "^1.2.0",
|
||||||
"eslint": "6.8.0",
|
"eslint": "6.8.0",
|
||||||
"eslint-plugin-babel": "5.3.0",
|
"eslint-plugin-babel": "5.3.0",
|
||||||
|
"eslint-plugin-jsdoc": "^36.1.1",
|
||||||
"eslint-plugin-promise": "4.2.1",
|
"eslint-plugin-promise": "4.2.1",
|
||||||
"fb-watchman": "2.0.1",
|
"fb-watchman": "2.0.1",
|
||||||
"gherkin-lint": "^4.2.2",
|
"gherkin-lint": "^4.2.2",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","submitTagCreateUpdateForm","questionId","contextId","formdata","window","console","warn","call","methodname","args","questionid","contextid"],"mappings":"AAwBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAwB9C,MAAO,CACHC,yBAAyB,CAhBG,QAA5BA,CAAAA,yBAA4B,CAASC,CAAT,CAAqBC,CAArB,CAAgCC,CAAhC,CAA0C,CACtEC,MAAM,CAACC,OAAP,CAAeC,IAAf,4GAWA,MAAOP,CAAAA,CAAI,CAACQ,IAAL,CAAU,CATH,CACVC,UAAU,CAAE,gCADF,CAEVC,IAAI,CAAE,CACFC,UAAU,CAAET,CADV,CAEFU,SAAS,CAAET,CAFT,CAGFC,QAAQ,CAAEA,CAHR,CAFI,CASG,CAAV,EAAqB,CAArB,CACV,CAEM,CAGV,CA3BK,CAAN","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 * A javascript module to handle question ajax actions.\n *\n * @deprecated since Moodle 4.0\n * @todo Final deprecation on Moodle 4.4 MDL-72438\n * @module core_question/repository\n * @copyright 2017 Simey Lameze <lameze@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Submit the form data for the question tags form.\n *\n * @method submitTagCreateUpdateForm\n * @param {string} formdata The URL encoded values from the form\n * @return {promise}\n */\n var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {\n window.console.warn('warn: The core_question/repository has been deprecated.' +\n 'Please use qbank_tagquestion/repository instead.');\n var request = {\n methodname: 'core_question_submit_tags_form',\n args: {\n questionid: questionId,\n contextid: contextId,\n formdata: formdata\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n submitTagCreateUpdateForm: submitTagCreateUpdateForm\n };\n});\n"],"file":"repository.min.js"}
|
{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","submitTagCreateUpdateForm","questionId","contextId","formdata","window","console","warn","call","methodname","args","questionid","contextid"],"mappings":"AAwBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CA0B9C,MAAO,CACHC,yBAAyB,CAhBG,QAA5BA,CAAAA,yBAA4B,CAASC,CAAT,CAAqBC,CAArB,CAAgCC,CAAhC,CAA0C,CACtEC,MAAM,CAACC,OAAP,CAAeC,IAAf,4GAWA,MAAOP,CAAAA,CAAI,CAACQ,IAAL,CAAU,CATH,CACVC,UAAU,CAAE,gCADF,CAEVC,IAAI,CAAE,CACFC,UAAU,CAAET,CADV,CAEFU,SAAS,CAAET,CAFT,CAGFC,QAAQ,CAAEA,CAHR,CAFI,CASG,CAAV,EAAqB,CAArB,CACV,CAEM,CAGV,CA7BK,CAAN","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 * A javascript module to handle question ajax actions.\n *\n * @deprecated since Moodle 4.0\n * @todo Final deprecation on Moodle 4.4 MDL-72438\n * @module core_question/repository\n * @copyright 2017 Simey Lameze <lameze@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Submit the form data for the question tags form.\n *\n * @method submitTagCreateUpdateForm\n * @param {number} questionId\n * @param {number} contextId\n * @param {string} formdata The URL encoded values from the form\n * @returns {promise}\n */\n var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {\n window.console.warn('warn: The core_question/repository has been deprecated.' +\n 'Please use qbank_tagquestion/repository instead.');\n var request = {\n methodname: 'core_question_submit_tags_form',\n args: {\n questionid: questionId,\n contextid: contextId,\n formdata: formdata\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n submitTagCreateUpdateForm: submitTagCreateUpdateForm\n };\n});\n"],"file":"repository.min.js"}
|
|
@ -28,8 +28,10 @@ define(['jquery', 'core/ajax'], function($, Ajax) {
|
||||||
* Submit the form data for the question tags form.
|
* Submit the form data for the question tags form.
|
||||||
*
|
*
|
||||||
* @method submitTagCreateUpdateForm
|
* @method submitTagCreateUpdateForm
|
||||||
|
* @param {number} questionId
|
||||||
|
* @param {number} contextId
|
||||||
* @param {string} formdata The URL encoded values from the form
|
* @param {string} formdata The URL encoded values from the form
|
||||||
* @return {promise}
|
* @returns {promise}
|
||||||
*/
|
*/
|
||||||
var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {
|
var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {
|
||||||
window.console.warn('warn: The core_question/repository has been deprecated.' +
|
window.console.warn('warn: The core_question/repository has been deprecated.' +
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -108,7 +108,7 @@ define(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise clear choice module.
|
* Initialise clear choice module.
|
||||||
|
*
|
||||||
* @param {string} root The question outer div prefix.
|
* @param {string} root The question outer div prefix.
|
||||||
* @param {string} fieldPrefix The "Clear choice" div prefix.
|
* @param {string} fieldPrefix The "Clear choice" div prefix.
|
||||||
*/
|
*/
|
||||||
|
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue