first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
define("tool_usertours/events",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.eventTypes=void 0;_exports.eventTypes={stepRender:"tool_usertours/stepRender",stepRendered:"tool_usertours/stepRendered",tourStart:"tool_usertours/tourStart",tourStarted:"tool_usertours/tourStarted",tourEnd:"tool_usertours/tourEnd",tourEnded:"tool_usertours/tourEnded",stepHide:"tool_usertours/stepHide",stepHidden:"tool_usertours/stepHidden"}}));
//# sourceMappingURL=events.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"events.min.js","sources":["../src/events.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript events for the `tool_usertours` subsystem.\n *\n * @module tool_usertours/events\n * @copyright 2021 Andrew Lyons <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n *\n * @example <caption>Example of listening to a step rendering event and cancelling it.</caption>\n * import {eventTypes as userTourEvents} from 'tool_usertours/events';\n *\n * document.addEventListener(userTourEvents.stepRender, e => {\n * console.log(e.detail.tour); // The Tour instance\n * e.preventDefault();\n * });\n */\n\n/**\n * Events for the component.\n *\n * @constant\n * @property {object} eventTypes\n * @property {String} eventTypes.stepRender See {@link event:tool_usertours/stepRender}\n * @property {String} eventTypes.stepRendered See {@link event:tool_usertours/stepRendered}\n * @property {String} eventTypes.tourStart See {@link event:tool_usertours/tourStart}\n * @property {String} eventTypes.tourStarted See {@link event:tool_usertours/tourStarted}\n * @property {String} eventTypes.tourEnd See {@link event:tool_usertours/tourEnd}\n * @property {String} eventTypes.tourEnded See {@link event:tool_usertours/tourEnded}\n * @property {String} eventTypes.stepHide See {@link event:tool_usertours/stepHide}\n * @property {String} eventTypes.stepHidden See {@link event:tool_usertours/stepHidden}\n */\nexport const eventTypes = {\n /**\n * An event triggered before a user tour step is rendered.\n *\n * This event is cancellable.\n *\n * @event tool_usertours/stepRender\n * @type {CustomEvent}\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @property {object} detail.stepConfig\n */\n stepRender: 'tool_usertours/stepRender',\n\n /**\n * An event triggered after a user tour step has been rendered.\n *\n * @event tool_usertours/stepRendered\n * @type {CustomEvent}\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @property {object} detail.stepConfig\n */\n stepRendered: 'tool_usertours/stepRendered',\n\n /**\n * An event triggered before a user tour starts.\n *\n * This event is cancellable.\n *\n * @event tool_usertours/tourStart\n * @type {CustomEvent}\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @property {Number} detail.startAt\n */\n tourStart: 'tool_usertours/tourStart',\n\n /**\n * An event triggered after a user tour has started.\n *\n * @event tool_usertours/tourStarted\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @type {CustomEvent}\n */\n tourStarted: 'tool_usertours/tourStarted',\n\n /**\n * An event triggered before a tour ends.\n *\n * This event is cancellable.\n *\n * @event tool_usertours/tourEnd\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @type {CustomEvent}\n */\n tourEnd: 'tool_usertours/tourEnd',\n\n /**\n * An event triggered after a tour has ended.\n *\n * @event tool_usertours/tourEnded\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @type {CustomEvent}\n */\n tourEnded: 'tool_usertours/tourEnded',\n\n /**\n * An event triggered before a step is hidden.\n *\n * This event is cancellable.\n *\n * @event tool_usertours/stepHide\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @type {CustomEvent}\n */\n stepHide: 'tool_usertours/stepHide',\n\n /**\n * An event triggered after a step has been hidden.\n *\n * @event tool_usertours/stepHidden\n * @property {object} detail\n * @property {tool_usertours/tour} detail.tour\n * @type {CustomEvent}\n */\n stepHidden: 'tool_usertours/stepHidden',\n};\n"],"names":["stepRender","stepRendered","tourStart","tourStarted","tourEnd","tourEnded","stepHide","stepHidden"],"mappings":"sKA6C0B,CAYtBA,WAAY,4BAWZC,aAAc,8BAadC,UAAW,2BAUXC,YAAa,6BAYbC,QAAS,yBAUTC,UAAW,2BAYXC,SAAU,0BAUVC,WAAY"}
@@ -0,0 +1,3 @@
define("tool_usertours/filter_cssselector",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.filterMatches=void 0;_exports.filterMatches=function(tourConfig){let filterValues=tourConfig.filtervalues.cssselector;return!filterValues[0]||!!document.querySelector(filterValues[0])}}));
//# sourceMappingURL=filter_cssselector.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"filter_cssselector.min.js","sources":["../src/filter_cssselector.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * CSS selector client side filter.\n *\n * @module tool_usertours/filter_cssselector\n * @copyright 2020 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Checks whether the configured CSS selector exists on this page.\n *\n * @param {array} tourConfig The tour configuration.\n * @returns {boolean}\n */\nexport const filterMatches = function(tourConfig) {\n let filterValues = tourConfig.filtervalues.cssselector;\n if (filterValues[0]) {\n return !!document.querySelector(filterValues[0]);\n }\n // If there is no CSS selector configured, this page matches.\n return true;\n};\n"],"names":["tourConfig","filterValues","filtervalues","cssselector","document","querySelector"],"mappings":"wLA6B6B,SAASA,gBAC9BC,aAAeD,WAAWE,aAAaC,mBACvCF,aAAa,MACJG,SAASC,cAAcJ,aAAa"}
+3
View File
@@ -0,0 +1,3 @@
define("tool_usertours/managesteps",["exports","core/prefetch","core/str","core/notification"],(function(_exports,_prefetch,_str,_notification){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.setup=void 0;const removeStepHandler=e=>{const deleteButton=e.target.closest('[data-action="delete"]');deleteButton&&(e.preventDefault(),removeStepFromLink(deleteButton.href))},removeStepFromLink=targetUrl=>{(0,_notification.confirm)((0,_str.getString)("confirmstepremovaltitle","tool_usertours"),(0,_str.getString)("confirmstepremovalquestion","tool_usertours"),(0,_str.getString)("yes","core"),(0,_str.getString)("no","core"),(()=>{window.location=targetUrl}))};_exports.setup=()=>{(0,_prefetch.prefetchStrings)("tool_usertours",["confirmstepremovaltitle","confirmstepremovalquestion"]),(0,_prefetch.prefetchStrings)("core",["yes","no"]),document.querySelector("body").addEventListener("click",removeStepHandler)}}));
//# sourceMappingURL=managesteps.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"managesteps.min.js","sources":["../src/managesteps.js"],"sourcesContent":["/**\n * Step management code.\n *\n * @module tool_usertours/managesteps\n * @copyright 2016 Andrew Nicols <andrew@nicols.co.uk>\n */\nimport {prefetchStrings} from 'core/prefetch';\nimport {getString} from 'core/str';\nimport {confirm as confirmModal} from 'core/notification';\n\n/**\n * Handle step management actions.\n *\n * @param {Event} e\n * @private\n */\nconst removeStepHandler = e => {\n const deleteButton = e.target.closest('[data-action=\"delete\"]');\n if (deleteButton) {\n e.preventDefault();\n removeStepFromLink(deleteButton.href);\n }\n};\n\n/**\n * Handle removal of a step with confirmation.\n *\n * @param {string} targetUrl\n * @private\n */\nconst removeStepFromLink = targetUrl => {\n confirmModal(\n getString('confirmstepremovaltitle', 'tool_usertours'),\n getString('confirmstepremovalquestion', 'tool_usertours'),\n getString('yes', 'core'),\n getString('no', 'core'),\n () => {\n window.location = targetUrl;\n }\n );\n};\n\n/**\n * Set up the step management handlers.\n */\nexport const setup = () => {\n prefetchStrings('tool_usertours', [\n 'confirmstepremovaltitle',\n 'confirmstepremovalquestion',\n ]);\n\n prefetchStrings('core', [\n 'yes',\n 'no',\n ]);\n\n document.querySelector('body').addEventListener('click', removeStepHandler);\n};\n"],"names":["removeStepHandler","e","deleteButton","target","closest","preventDefault","removeStepFromLink","href","targetUrl","window","location","document","querySelector","addEventListener"],"mappings":"oOAgBMA,kBAAoBC,UAChBC,aAAeD,EAAEE,OAAOC,QAAQ,0BAClCF,eACAD,EAAEI,iBACFC,mBAAmBJ,aAAaK,QAUlCD,mBAAqBE,uCAEnB,kBAAU,0BAA2B,mBACrC,kBAAU,6BAA8B,mBACxC,kBAAU,MAAO,SACjB,kBAAU,KAAM,SAChB,KACIC,OAAOC,SAAWF,6BAQT,mCACD,iBAAkB,CAC9B,0BACA,6DAGY,OAAQ,CACpB,MACA,OAGJG,SAASC,cAAc,QAAQC,iBAAiB,QAASb"}
+3
View File
@@ -0,0 +1,3 @@
define("tool_usertours/managetours",["exports","core/prefetch","core/str","core/notification"],(function(_exports,_prefetch,_str,_notification){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.setup=void 0;const removeTourHandler=e=>{const deleteButton=e.target.closest('[data-action="delete"]');deleteButton&&(e.preventDefault(),removeTourFromLink(deleteButton.href))},removeTourFromLink=targetUrl=>{(0,_notification.confirm)((0,_str.getString)("confirmtourremovaltitle","tool_usertours"),(0,_str.getString)("confirmtourremovalquestion","tool_usertours"),(0,_str.getString)("yes","core"),(0,_str.getString)("no","core"),(()=>{window.location=targetUrl}))};_exports.setup=()=>{(0,_prefetch.prefetchStrings)("tool_usertours",["confirmtourremovaltitle","confirmtourremovalquestion"]),(0,_prefetch.prefetchStrings)("core",["yes","no"]),document.querySelector("body").addEventListener("click",removeTourHandler)}}));
//# sourceMappingURL=managetours.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"managetours.min.js","sources":["../src/managetours.js"],"sourcesContent":["/**\n * Tour management code.\n *\n * @module tool_usertours/managetours\n * @copyright 2016 Andrew Nicols <andrew@nicols.co.uk>\n */\nimport {prefetchStrings} from 'core/prefetch';\nimport {getString} from 'core/str';\nimport {confirm as confirmModal} from 'core/notification';\n\n/**\n * Handle tour management actions.\n *\n * @param {Event} e\n * @private\n */\nconst removeTourHandler = e => {\n const deleteButton = e.target.closest('[data-action=\"delete\"]');\n if (deleteButton) {\n e.preventDefault();\n removeTourFromLink(deleteButton.href);\n }\n};\n\n/**\n * Handle removal of a tour with confirmation.\n *\n * @param {string} targetUrl\n * @private\n */\nconst removeTourFromLink = targetUrl => {\n confirmModal(\n getString('confirmtourremovaltitle', 'tool_usertours'),\n getString('confirmtourremovalquestion', 'tool_usertours'),\n getString('yes', 'core'),\n getString('no', 'core'),\n () => {\n window.location = targetUrl;\n }\n );\n};\n\n/**\n * Set up the tour management handlers.\n */\nexport const setup = () => {\n prefetchStrings('tool_usertours', [\n 'confirmtourremovaltitle',\n 'confirmtourremovalquestion',\n ]);\n\n prefetchStrings('core', [\n 'yes',\n 'no',\n ]);\n\n document.querySelector('body').addEventListener('click', removeTourHandler);\n};\n"],"names":["removeTourHandler","e","deleteButton","target","closest","preventDefault","removeTourFromLink","href","targetUrl","window","location","document","querySelector","addEventListener"],"mappings":"oOAgBMA,kBAAoBC,UAChBC,aAAeD,EAAEE,OAAOC,QAAQ,0BAClCF,eACAD,EAAEI,iBACFC,mBAAmBJ,aAAaK,QAUlCD,mBAAqBE,uCAEnB,kBAAU,0BAA2B,mBACrC,kBAAU,6BAA8B,mBACxC,kBAAU,MAAO,SACjB,kBAAU,KAAM,SAChB,KACIC,OAAOC,SAAWF,6BAQT,mCACD,iBAAkB,CAC9B,0BACA,6DAGY,OAAQ,CACpB,MACA,OAGJG,SAASC,cAAc,QAAQC,iBAAiB,QAASb"}
+3
View File
@@ -0,0 +1,3 @@
define("tool_usertours/repository",["exports","core/ajax","core/config"],(function(_exports,_ajax,_config){var obj;Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.resetTourState=_exports.markTourComplete=_exports.markStepShown=_exports.fetchTour=void 0,_config=(obj=_config)&&obj.__esModule?obj:{default:obj};_exports.resetTourState=tourid=>(0,_ajax.call)([{methodname:"tool_usertours_reset_tour",args:{tourid:tourid,context:_config.default.contextid,pageurl:window.location.href}}])[0];_exports.markTourComplete=(stepid,tourid,stepindex)=>(0,_ajax.call)([{methodname:"tool_usertours_complete_tour",args:{stepid:stepid,stepindex:stepindex,tourid:tourid,context:_config.default.contextid,pageurl:window.location.href}}])[0];_exports.fetchTour=tourid=>(0,_ajax.call)([{methodname:"tool_usertours_fetch_and_start_tour",args:{tourid:tourid,context:_config.default.contextid,pageurl:window.location.href}}])[0];_exports.markStepShown=(stepid,tourid,stepindex)=>(0,_ajax.call)([{methodname:"tool_usertours_step_shown",args:{tourid:tourid,stepid:stepid,stepindex:stepindex,context:_config.default.contextid,pageurl:window.location.href}}])[0]}));
//# sourceMappingURL=repository.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"repository.min.js","sources":["../src/repository.js"],"sourcesContent":["/**\n * Javascript module to handle tool_usertour AJAX requests.\n *\n * @module tool_usertours/repository\n * @copyright 2016 Andrew Nicols <andrew@nicols.co.uk>\n */\nimport {call as fetchMany} from 'core/ajax';\nimport moodleConfig from 'core/config';\n\n/**\n * Reset the tour state of the specified tour.\n *\n * @param {number} tourid\n * @return {Promise}\n */\nexport const resetTourState = tourid => fetchMany([{\n methodname: 'tool_usertours_reset_tour',\n args: {\n tourid,\n context: moodleConfig.contextid,\n pageurl: window.location.href,\n }\n}])[0];\n\n/**\n * Mark the specified tour as complete.\n *\n * @param {number} stepid\n * @param {number} tourid\n * @param {number} stepindex\n * @return {Promise}\n */\nexport const markTourComplete = (stepid, tourid, stepindex) => fetchMany([{\n methodname: 'tool_usertours_complete_tour',\n args: {\n stepid,\n stepindex: stepindex,\n tourid,\n context: moodleConfig.contextid,\n pageurl: window.location.href,\n }\n}])[0];\n\n/**\n * Fetch the specified tour.\n *\n * @param {number} tourid\n * @return {Promise}\n */\nexport const fetchTour = tourid => fetchMany([{\n methodname: 'tool_usertours_fetch_and_start_tour',\n args: {\n tourid,\n context: moodleConfig.contextid,\n pageurl: window.location.href,\n }\n}])[0];\n\n/**\n * Mark the specified step as having been shown.\n *\n * @param {number} stepid\n * @param {number} tourid\n * @param {number} stepindex\n * @return {Promise}\n */\nexport const markStepShown = (stepid, tourid, stepindex) => fetchMany([{\n methodname: 'tool_usertours_step_shown',\n args: {\n tourid,\n stepid,\n stepindex,\n context: moodleConfig.contextid,\n pageurl: window.location.href,\n }\n}])[0];\n"],"names":["tourid","methodname","args","context","moodleConfig","contextid","pageurl","window","location","href","stepid","stepindex"],"mappings":"8VAe8BA,SAAU,cAAU,CAAC,CAC/CC,WAAY,4BACZC,KAAM,CACFF,OAAAA,OACAG,QAASC,gBAAaC,UACtBC,QAASC,OAAOC,SAASC,SAE7B,6BAU4B,CAACC,OAAQV,OAAQW,aAAc,cAAU,CAAC,CACtEV,WAAY,+BACZC,KAAM,CACFQ,OAAAA,OACAC,UAAWA,UACXX,OAAAA,OACAG,QAASC,gBAAaC,UACtBC,QAASC,OAAOC,SAASC,SAE7B,sBAQqBT,SAAU,cAAU,CAAC,CAC1CC,WAAY,sCACZC,KAAM,CACFF,OAAAA,OACAG,QAASC,gBAAaC,UACtBC,QAASC,OAAOC,SAASC,SAE7B,0BAUyB,CAACC,OAAQV,OAAQW,aAAc,cAAU,CAAC,CACnEV,WAAY,4BACZC,KAAM,CACFF,OAAAA,OACAU,OAAAA,OACAC,UAAAA,UACAR,QAASC,gBAAaC,UACtBC,QAASC,OAAOC,SAASC,SAE7B"}
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