{"version":3,"sources":["https:\/\/immet-dist.spbstu.ru\/lib\/amd\/src\/event.js"],"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":"AAyBAA,OAAM,cAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAAe,CAElB,MAAuC,CAKnCC,MAAM,CAAE,CACJC,qBAAqB,CAAE,4BADnB,CAL2B,CAenCC,eAAe,CAAE,0BAAW,CACxB,GAAIC,CAAAA,CAAM,CAAGL,CAAC,CAACM,QAAF,EAAb,CACAL,CAAC,CAACM,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,UAAW,CAC3CF,CAAM,CAACG,OAAP,CAAeC,MAAM,CAACC,CAAP,CAASC,IAAT,CAAcC,KAA7B,CACH,CAFD,EAGA,MAAOP,CAAAA,CAAM,CAACQ,OAAP,EACV,CArBkC,CA6BnCC,0BAA0B,CAAE,oCAASC,CAAT,CAAgB,CACxCA,CAAK,CAAGf,CAAC,CAACe,CAAD,CAAT,CACAd,CAAC,CAACM,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,SAASN,CAAT,CAAY,CAE5CD,CAAC,CAACgB,QAAD,CAAD,CAAYC,OAAZ,CAAoBP,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaM,sBAAjC,CAAyD,CAACH,CAAD,CAAzD,EAGA,GAAII,CAAAA,CAAQ,CAAG,GAAIlB,CAAAA,CAAC,CAACmB,QAAN,CAAeL,CAAK,CAACM,GAAN,EAAf,CAAf,CAGApB,CAAC,CAACqB,IAAF,CAAOZ,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaM,sBAApB,CAA4C,CAACH,KAAK,CAAEI,CAAR,CAA5C,CACH,CATD,CAUH,CAzCkC,CAkDnCI,oBAAoB,CAAE,8BAASC,CAAT,CAAeC,CAAf,CAA+B,CAGjDA,CAAc,CAAGA,CAAc,IAA\/B,CAEAxB,CAAC,CAACM,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,SAASN,CAAT,CAAY,CAC5C,GAAIwB,CAAJ,CAAoB,CAChBhB,MAAM,CAACiB,oBAAP,GACH,CAED1B,CAAC,CAACwB,CAAD,CAAD,CAAQP,OAAR,CAAgBP,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAae,gBAA7B,EAGA1B,CAAC,CAAC2B,GAAF,CAAMJ,CAAN,EAAYF,IAAZ,CAAiBZ,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAae,gBAA9B,CAAgD,CAACE,aAAa,CAAE5B,CAAC,CAAC2B,GAAF,CAAMJ,CAAN,CAAhB,CAAhD,EAEA,GAAIC,CAAJ,CAAoB,CAChBhB,MAAM,CAACiB,oBAAP,GACH,CACJ,CAbD,CAcH,CArEkC,CA6EnCI,2BAA2B,CAAE,sCAAW,CACpC7B,CAAC,CAACM,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,SAASN,CAAT,CAAY,CAE5CD,CAAC,CAACgB,QAAD,CAAD,CAAYC,OAAZ,CAAoBP,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAamB,uBAAjC,EAGA9B,CAAC,CAACqB,IAAF,CAAOZ,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAamB,uBAApB,CACH,CAND,CAOH,CArFkC,CAuF1C,CA1FK,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 .\n\n\/**\n * Global registry of core events that can be triggered\/listened for.\n *\n * @module core\/event\n * @package core\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"],"file":"event.min.js"}