{"version":3,"file":"event.min.js","sources":["https:\/\/lms.spbstu.ru\/lib\/amd\/src\/event.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 .\n\n\/**\n * Global registry of core events that can be triggered\/listened for.\n *\n * @module core\/event\n * @class event\n * @copyright 2015 Damyon Wiese \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n * @since 3.0\n *\/\ndefine(['jquery', 'core\/yui'],\n function($, Y) {\n\n return \/** @alias module:core\/event *\/ {\n\n\n \/\/ Public variables and functions.\n \/\/ These are AMD only events - no backwards compatibility for new things.\n Events: {\n FORM_FIELD_VALIDATION: \"core_form-field-validation\"\n },\n\n \/**\n * Load the legacy YUI module which defines events in M.core.event and return it.\n *\n * @method getLegacyEvents\n * @return {Promise}\n *\/\n getLegacyEvents: function() {\n var result = $.Deferred();\n Y.use('event', 'moodle-core-event', function() {\n result.resolve(window.M.core.event);\n });\n return result.promise();\n },\n\n \/**\n * Trigger an event using both JQuery and YUI\n *\n * @method notifyFilterContentUpdated\n * @param {string|JQuery} nodes - Selector or list of elements that were inserted.\n *\/\n notifyFilterContentUpdated: function(nodes) {\n nodes = $(nodes);\n Y.use('event', 'moodle-core-event', function(Y) {\n \/\/ Trigger it the JQuery way.\n $(document).trigger(M.core.event.FILTER_CONTENT_UPDATED, [nodes]);\n\n \/\/ Create a YUI NodeList from our JQuery Object.\n var yuiNodes = new Y.NodeList(nodes.get());\n\n \/\/ And again for YUI.\n Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: yuiNodes});\n });\n },\n\n \/**\n * Trigger an event using both JQuery and YUI\n *\n * @method notifyFormSubmittedAjax\n * @param {DOMElement} form\n * @param {boolean} skipValidation Submit the form without validation. E.g. \"Cancel\".\n *\/\n notifyFormSubmitAjax: function(form, skipValidation) {\n\n \/\/ Argument is optional.\n skipValidation = skipValidation || false;\n\n Y.use('event', 'moodle-core-event', function(Y) {\n if (skipValidation) {\n window.skipClientValidation = true;\n }\n \/\/ Trigger it the JQuery way.\n $(form).trigger(M.core.event.FORM_SUBMIT_AJAX);\n\n \/\/ And again for YUI.\n Y.one(form).fire(M.core.event.FORM_SUBMIT_AJAX, {currentTarget: Y.one(form)});\n\n if (skipValidation) {\n window.skipClientValidation = false;\n }\n });\n },\n\n \/**\n * Trigger an event using both JQuery and YUI\n * This event alerts the world that the editor has restored some content.\n *\n * @method notifyEditorContentRestored\n *\/\n notifyEditorContentRestored: function() {\n Y.use('event', 'moodle-core-event', function(Y) {\n \/\/ Trigger it the JQuery way.\n $(document).trigger(M.core.event.EDITOR_CONTENT_RESTORED);\n\n \/\/ And again for YUI.\n Y.fire(M.core.event.EDITOR_CONTENT_RESTORED);\n });\n },\n };\n});\n"],"names":["define","$","Y","Events","FORM_FIELD_VALIDATION","getLegacyEvents","result","Deferred","use","resolve","window","M","core","event","promise","notifyFilterContentUpdated","nodes","document","trigger","FILTER_CONTENT_UPDATED","yuiNodes","NodeList","get","fire","notifyFormSubmitAjax","form","skipValidation","skipClientValidation","FORM_SUBMIT_AJAX","one","currentTarget","notifyEditorContentRestored","EDITOR_CONTENT_RESTORED"],"mappings":";;;;;;;;;AAwBAA,oBAAO,CAAC,SAAU,aACX,SAASC,EAAGC,SAEwB,CAKnCC,OAAQ,CACJC,sBAAuB,8BAS3BC,gBAAiB,eACTC,OAASL,EAAEM,kBACfL,EAAEM,IAAI,QAAS,qBAAqB,WAChCF,OAAOG,QAAQC,OAAOC,EAAEC,KAAKC,UAE1BP,OAAOQ,WASlBC,2BAA4B,SAASC,OACjCA,MAAQf,EAAEe,OACVd,EAAEM,IAAI,QAAS,qBAAqB,SAASN,GAEzCD,EAAEgB,UAAUC,QAAQP,EAAEC,KAAKC,MAAMM,uBAAwB,CAACH,YAGtDI,SAAW,IAAIlB,EAAEmB,SAASL,MAAMM,OAGpCpB,EAAEqB,KAAKZ,EAAEC,KAAKC,MAAMM,uBAAwB,CAACH,MAAOI,eAW5DI,qBAAsB,SAASC,KAAMC,gBAGjCA,eAAiBA,iBAAkB,EAEnCxB,EAAEM,IAAI,QAAS,qBAAqB,SAASN,GACrCwB,iBACAhB,OAAOiB,sBAAuB,GAGlC1B,EAAEwB,MAAMP,QAAQP,EAAEC,KAAKC,MAAMe,kBAG7B1B,EAAE2B,IAAIJ,MAAMF,KAAKZ,EAAEC,KAAKC,MAAMe,iBAAkB,CAACE,cAAe5B,EAAE2B,IAAIJ,QAElEC,iBACAhB,OAAOiB,sBAAuB,OAW1CI,4BAA6B,WACzB7B,EAAEM,IAAI,QAAS,qBAAqB,SAASN,GAEzCD,EAAEgB,UAAUC,QAAQP,EAAEC,KAAKC,MAAMmB,yBAGjC9B,EAAEqB,KAAKZ,EAAEC,KAAKC,MAAMmB"}