Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 24... Línea 24...
24
 
24
 
25
import {notifyEditorContentRestored} from 'core_editor/events';
25
import {notifyEditorContentRestored} from 'core_editor/events';
26
import {notifyFilterContentUpdated} from 'core_filters/events';
26
import {notifyFilterContentUpdated} from 'core_filters/events';
Línea 27... Línea -...
27
import {notifyFormSubmittedByJavascript} from 'core_form/events';
-
 
28
 
-
 
29
// These are only imported for legacy.
-
 
30
import $ from 'jquery';
-
 
31
import Y from 'core/yui';
27
import {notifyFormSubmittedByJavascript} from 'core_form/events';
32
 
28
 
33
// These are AMD only events - no backwards compatibility for new things.
29
// These are AMD only events - no backwards compatibility for new things.
34
// Note: No new events should be created here.
30
// Note: No new events should be created here.
35
const Events = {
31
const Events = {
Línea 36... Línea 32...
36
    FORM_FIELD_VALIDATION: "core_form-field-validation"
32
    FORM_FIELD_VALIDATION: "core_form-field-validation"
37
};
-
 
38
 
-
 
39
/**
-
 
40
 * Load the legacy YUI module which defines events in M.core.event and return it.
-
 
41
 *
-
 
42
 * @method getLegacyEvents
-
 
43
 * @return {Promise}
-
 
44
 * @deprecated
-
 
45
 */
-
 
46
const getLegacyEvents = () => {
-
 
47
    const result = $.Deferred();
-
 
48
    window.console.warn("The getLegacyEvents function has been deprecated. Please update your code to use native events.");
-
 
49
 
-
 
50
    Y.use('event', 'moodle-core-event', function() {
-
 
51
        result.resolve(window.M.core.event);
-
 
52
    });
-
 
53
    return result.promise();
-
 
54
};
33
};
55
 
34
 
56
/**
35
/**
57
 * Get a curried function to warn that a function has been moved and renamed
36
 * Get a curried function to warn that a function has been moved and renamed
58
 *
37
 *
Línea 71... Línea 50...
71
    return newFunctionRef(...args);
50
    return newFunctionRef(...args);
72
};
51
};
Línea 73... Línea 52...
73
 
52
 
74
export default {
53
export default {
75
    Events,
-
 
76
    getLegacyEvents,
-
 
77
 
54
    Events,
78
    notifyEditorContentRestored: getRenamedLegacyFunction(
55
    notifyEditorContentRestored: getRenamedLegacyFunction(
79
        'notifyEditorContentRestored',
56
        'notifyEditorContentRestored',
80
        'core_editor/events',
57
        'core_editor/events',
81
        'notifyEditorContentRestored',
58
        'notifyEditorContentRestored',