Proyectos de Subversion Moodle

Rev

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

Rev Autor Línea Nro. Línea
1441 ariadna 1
{"version":3,"file":"events.min.js","sources":["../src/events.js"],"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_editor` subsystem.\n *\n * @module     core_editor/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';\n\n/**\n * Events for the `core_editor` subsystem.\n *\n * @constant\n * @property {String} editorContentRestored See {@link event:editorContentRestored}\n */\nexport const eventTypes = {\n    /**\n     * An event triggered when an editor restores auto-saved content.\n     *\n     * @event editorContentRestored\n     */\n    editorContentRestored: 'core_editor/contentRestored',\n};\n\n/**\n * Trigger an event to indicate that editor content was restored.\n *\n * @method  notifyEditorContentRestored\n * @param   {HTMLElement|null} editor The element that was modified\n * @returns {CustomEvent}\n * @fires   editorContentRestored\n */\nexport const notifyEditorContentRestored = editor => {\n    if (!editor) {\n        window.console.warn(\n            `The HTMLElement representing the editor that was modified should be provided to notifyEditorContentRestored.`\n        );\n    }\n    return dispatchEvent(\n        eventTypes.editorContentRestored,\n        {},\n        editor || document\n    );\n};\n"],"names":["eventTypes","editorContentRestored","editor","window","console","warn","document"],"mappings":";;;;;;;;;MA+BaA,WAAa,CAMtBC,sBAAuB,mGAWgBC,SAClCA,QACDC,OAAOC,QAAQC,sHAIZ,mCACHL,WAAWC,sBACX,GACAC,QAAUI"}