MDL-71113 js: Fix all jsdoc warnings

This commit is contained in:
Andrew Nicols 2021-03-15 10:01:58 +08:00
parent 70dcc60862
commit 92179b7057
663 changed files with 510 additions and 812 deletions

View file

@ -1 +1 @@
{"version":3,"sources":["../src/events.js"],"names":["eventTypes","filterContentUpdated","notifyFilterContentUpdated","nodes","legacyEventsRegistered","Y","use","document","addEventListener","e","trigger","M","core","event","FILTER_CONTENT_UPDATED","detail","fire","NodeList"],"mappings":"6NAyBA,uDAQO,GAAMA,CAAAA,CAAU,CAAG,CAWtBC,oBAAoB,CAAE,6BAXA,CAAnB,C,4CAsBmC,QAA7BC,CAAAA,0BAA6B,CAAAC,CAAK,CAAI,CAG/CA,CAAK,CAAG,cAAkBA,CAAlB,CAAR,CAEA,MAAO,oBAAcH,CAAU,CAACC,oBAAzB,CAA+C,CAACE,KAAK,CAALA,CAAD,CAA/C,CACV,C,CAED,GAAIC,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,UAAM,CAEtCC,QAAQ,CAACC,gBAAT,CAA0BR,CAAU,CAACC,oBAArC,CAA2D,SAAAQ,CAAC,CAAI,CAE5D,cAAOF,QAAP,EAAiBG,OAAjB,CAAyBC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAAtC,CAA8D,CAAC,cAAOL,CAAC,CAACM,MAAF,CAASZ,KAAhB,CAAD,CAA9D,EAGAE,CAAC,CAACW,IAAF,CAAOL,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAApB,CAA4C,CAACX,KAAK,CAAE,GAAIE,CAAAA,CAAC,CAACY,QAAN,CAAeR,CAAC,CAACM,MAAF,CAASZ,KAAxB,CAAR,CAA5C,CACH,CAND,CAOH,CATD,EAWAC,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\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 * Javascript events for the `core_filter` subsystem.\n *\n * @module core_filters/events\n * @copyright 2021 Andrew Nicols <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\nimport {getList as normalistNodeList} from 'core/normalise';\nimport jQuery from 'jquery';\n\n/**\n * Events for the `core_filter` subsystem.\n *\n * @constant\n * @property {String} filterContentUpdated See {@link event:filterContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when page content is updated and must be processed by the filter system.\n *\n * An example of this is loading user text that could have equations in it. MathJax can typeset the equations but\n * only if it is notified that there are new nodes in the page that need processing.\n *\n * @event filterContentUpdated\n * @type {CustomEvent}\n * @property {Array} nodes The list of parent nodes which were updated\n */\n filterContentUpdated: 'core_filters/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the specified nodes were updated and should be processed by the filter system.\n *\n * @method notifyFilterContentUpdated\n * @param {jQuery|Array} nodes\n * @returns {CustomEvent}\n * @fires filterContentUpdated\n */\nexport const notifyFilterContentUpdated = nodes => {\n // Historically this could be a jQuery Object.\n // Normalise the list of nodes to a NodeList.\n nodes = normalistNodeList(nodes);\n\n return dispatchEvent(eventTypes.filterContentUpdated, {nodes});\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', () => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.filterContentUpdated, e => {\n // Trigger the legacy jQuery event.\n jQuery(document).trigger(M.core.event.FILTER_CONTENT_UPDATED, [jQuery(e.detail.nodes)]);\n\n // Trigger the legacy YUI event.\n Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: new Y.NodeList(e.detail.nodes)});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"}
{"version":3,"sources":["../src/events.js"],"names":["eventTypes","filterContentUpdated","notifyFilterContentUpdated","nodes","legacyEventsRegistered","Y","use","document","addEventListener","e","trigger","M","core","event","FILTER_CONTENT_UPDATED","detail","fire","NodeList"],"mappings":"6NAyBA,uDAQO,GAAMA,CAAAA,CAAU,CAAG,CAYtBC,oBAAoB,CAAE,6BAZA,CAAnB,C,4CAuBmC,QAA7BC,CAAAA,0BAA6B,CAAAC,CAAK,CAAI,CAG/CA,CAAK,CAAG,cAAkBA,CAAlB,CAAR,CAEA,MAAO,oBAAcH,CAAU,CAACC,oBAAzB,CAA+C,CAACE,KAAK,CAALA,CAAD,CAA/C,CACV,C,CAED,GAAIC,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,UAAM,CAEtCC,QAAQ,CAACC,gBAAT,CAA0BR,CAAU,CAACC,oBAArC,CAA2D,SAAAQ,CAAC,CAAI,CAE5D,cAAOF,QAAP,EAAiBG,OAAjB,CAAyBC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAAtC,CAA8D,CAAC,cAAOL,CAAC,CAACM,MAAF,CAASZ,KAAhB,CAAD,CAA9D,EAGAE,CAAC,CAACW,IAAF,CAAOL,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAApB,CAA4C,CAACX,KAAK,CAAE,GAAIE,CAAAA,CAAC,CAACY,QAAN,CAAeR,CAAC,CAACM,MAAF,CAASZ,KAAxB,CAAR,CAA5C,CACH,CAND,CAOH,CATD,EAWAC,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\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 * Javascript events for the `core_filter` subsystem.\n *\n * @module core_filters/events\n * @copyright 2021 Andrew Nicols <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\nimport {getList as normalistNodeList} from 'core/normalise';\nimport jQuery from 'jquery';\n\n/**\n * Events for the `core_filter` subsystem.\n *\n * @constant\n * @property {String} filterContentUpdated See {@link event:filterContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when page content is updated and must be processed by the filter system.\n *\n * An example of this is loading user text that could have equations in it. MathJax can typeset the equations but\n * only if it is notified that there are new nodes in the page that need processing.\n *\n * @event filterContentUpdated\n * @type {CustomEvent}\n * @property {object} detail\n * @property {NodeElement[]} detail.nodes The list of parent nodes which were updated\n */\n filterContentUpdated: 'core_filters/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the specified nodes were updated and should be processed by the filter system.\n *\n * @method notifyFilterContentUpdated\n * @param {jQuery|Array} nodes\n * @returns {CustomEvent}\n * @fires filterContentUpdated\n */\nexport const notifyFilterContentUpdated = nodes => {\n // Historically this could be a jQuery Object.\n // Normalise the list of nodes to a NodeList.\n nodes = normalistNodeList(nodes);\n\n return dispatchEvent(eventTypes.filterContentUpdated, {nodes});\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', () => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.filterContentUpdated, e => {\n // Trigger the legacy jQuery event.\n jQuery(document).trigger(M.core.event.FILTER_CONTENT_UPDATED, [jQuery(e.detail.nodes)]);\n\n // Trigger the legacy YUI event.\n Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: new Y.NodeList(e.detail.nodes)});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"}

View file

@ -40,7 +40,8 @@ export const eventTypes = {
*
* @event filterContentUpdated
* @type {CustomEvent}
* @property {Array} nodes The list of parent nodes which were updated
* @property {object} detail
* @property {NodeElement[]} detail.nodes The list of parent nodes which were updated
*/
filterContentUpdated: 'core_filters/contentUpdated',
};