MDL-43856 MathJax: Improvements to the MathJax filter
[moodle.git] / lib / yui / build / moodle-core-event / moodle-core-event.js
CommitLineData
cc90cedc
DW
1YUI.add('moodle-core-event', function (Y, NAME) {
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * @module moodle-core-event
20 */
21
22var LOGNAME = 'moodle-core-event';
23
24/**
25 * List of published global JS events in Moodle. This is a collection
26 * of global events that can be subscribed to, or fired from any plugin.
27 *
28 * @namespace M.core.event
29 */
30M.core = M.core || {};
31
32M.core.event = {
33 // This event is triggered when a page has added dynamic nodes to a page
34 // that should be processed by the filter system. An example is loading
35 // user text that could have equations in it. MathJax can typeset the equations
36 // but only if it is notified that there are new nodes in the page that need processing.
37 // This event must contain a property "nodes" listing the root of any new nodes in the DOM (as a NodeList).
38 // To trigger this event use M.core.Event.fire(M.core.Event.FILTER_CONTENT_UPDATED, {nodes: list});
39 FILTER_CONTENT_UPDATED: "filter-content-updated"
40};
41
42
43var eventDefaultConfig = {
44 emitFacade: true,
45 defaultFn: function(e) {
46 },
47 preventedFn: function(e) {
48 },
49 stoppedFn: function(e) {
50 }
51};
52
53for (var key in M.core.event) {
54 Y.publish(M.core.event[key], eventDefaultConfig);
55}
56
57
58
59
60}, '@VERSION@', {"requires": ["event-custom"]});