Proyectos de Subversion Moodle

Rev

Rev 1 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

{"version":3,"file":"event.min.js","sources":["../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 <http://www.gnu.org/licenses/>.\n\n/**\n * Global registry of core events that can be triggered/listened for.\n *\n * @module     core/event\n * @copyright  2015 Damyon Wiese <damyon@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since      3.0\n */\n\nimport {notifyEditorContentRestored} from 'core_editor/events';\nimport {notifyFilterContentUpdated} from 'core_filters/events';\nimport {notifyFormSubmittedByJavascript} from 'core_form/events';\n\n// These are AMD only events - no backwards compatibility for new things.\n// Note: No new events should be created here.\nconst Events = {\n    FORM_FIELD_VALIDATION: \"core_form-field-validation\"\n};\n\n/**\n * Get a curried function to warn that a function has been moved and renamed\n *\n * @param   {String} oldFunctionName\n * @param   {String} newModule\n * @param   {String} newFunctionName\n * @param   {Function} newFunctionRef\n * @returns {Function}\n */\nconst getRenamedLegacyFunction = (oldFunctionName, newModule, newFunctionName, newFunctionRef) => (...args) => {\n    window.console.warn(\n        `The core/event::${oldFunctionName}() function has been moved to ${newModule}::${newFunctionName}. ` +\n        `Please update your code to use the new module.`\n    );\n\n    return newFunctionRef(...args);\n};\n\nexport default {\n    Events,\n    notifyEditorContentRestored: getRenamedLegacyFunction(\n        'notifyEditorContentRestored',\n        'core_editor/events',\n        'notifyEditorContentRestored',\n        notifyEditorContentRestored\n    ),\n\n    notifyFilterContentUpdated: getRenamedLegacyFunction(\n        'notifyFilterContentUpdated',\n        'core_filters/events',\n        'notifyFilterContentUpdated',\n        notifyFilterContentUpdated\n    ),\n\n    notifyFormSubmitAjax: getRenamedLegacyFunction(\n        'notifyFormSubmitAjax',\n        'core_form/events',\n        'notifyFormSubmittedByJavascript',\n        notifyFormSubmittedByJavascript\n    ),\n};\n"],"names":["getRenamedLegacyFunction","oldFunctionName","newModule","newFunctionName","newFunctionRef","window","console","warn","Events","FORM_FIELD_VALIDATION","notifyEditorContentRestored","notifyFilterContentUpdated","notifyFormSubmitAjax","notifyFormSubmittedByJavascript"],"mappings":";;;;;;;;;MA2CMA,yBAA2B,CAACC,gBAAiBC,UAAWC,gBAAiBC,iBAAmB,kBAC9FC,OAAOC,QAAQC,KACX,0BAAmBN,yDAAgDC,uBAAcC,wEAI9EC,2CAGI,CACXI,OAvBW,CACXC,sBAAuB,8BAuBvBC,4BAA6BV,yBACzB,8BACA,qBACA,8BACAU,qCAGJC,2BAA4BX,yBACxB,6BACA,sBACA,6BACAW,qCAGJC,qBAAsBZ,yBAClB,uBACA,mBACA,kCACAa"}