mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Merge branch 'MDL-50852-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
f6c3a22946
@ -2233,9 +2233,11 @@ function validate_' . $this->_formName . '_' . $escapedElementName . '(element,
|
||||
ret = validate_' . $this->_formName . '_' . $escapedElementName.'(frm.elements[\''.$elementName.'\'], \''.$escapedElementName.'\') && ret;
|
||||
if (!ret && !first_focus) {
|
||||
first_focus = true;
|
||||
Y.Global.fire(M.core.globalEvents.FORM_ERROR, {formid: \''. $this->_attributes['id'] .'\',
|
||||
elementid: \'id_error_'.$escapedElementName.'\'});
|
||||
document.getElementById(\'id_error_'.$escapedElementName.'\').focus();
|
||||
Y.use(\'moodle-core-event\', function() {
|
||||
Y.Global.fire(M.core.globalEvents.FORM_ERROR, {formid: \'' . $this->_attributes['id'] . '\',
|
||||
elementid: \'id_error_' . $escapedElementName . '\'});
|
||||
document.getElementById(\'id_error_' . $escapedElementName . '\').focus();
|
||||
});
|
||||
}
|
||||
';
|
||||
|
||||
|
@ -30,7 +30,7 @@ var LOGNAME = 'moodle-core-event';
|
||||
*/
|
||||
M.core = M.core || {};
|
||||
|
||||
M.core.event = {
|
||||
M.core.event = M.core.event || {
|
||||
/**
|
||||
* This event is triggered when a page has added dynamic nodes to a page
|
||||
* that should be processed by the filter system. An example is loading
|
||||
@ -44,7 +44,7 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
M.core.globalEvents = M.core.globalEvents || {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
@ -74,15 +74,17 @@ var eventDefaultConfig = {
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
if (M.core.event.hasOwnProperty(key)) {
|
||||
if (M.core.event.hasOwnProperty(key) && Y.getEvent(M.core.event[key]) === null) {
|
||||
Y.publish(M.core.event[key], eventDefaultConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//Publish all the global events.
|
||||
// Publish global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
// Make sure the key exists and that the event has not yet been published. Otherwise, skip publishing.
|
||||
if (M.core.globalEvents.hasOwnProperty(key) && Y.Global.getEvent(M.core.globalEvents[key]) === null) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: true}));
|
||||
Y.log('Global event published: ' + key, 'debug', LOGNAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-event",function(e,t){var n="moodle-core-event";M.core=M.core||{},M.core.event={FILTER_CONTENT_UPDATED:"filter-content-updated"},M.core.globalEvents={FORM_ERROR:"form_error"};var r={emitFacade:!0,defaultFn:function(e){},preventedFn:function(e){},stoppedFn:function(e){}},i;for(i in M.core.event)M.core.event.hasOwnProperty(i)&&e.publish(M.core.event[i],r);for(i in M.core.globalEvents)M.core.globalEvents.hasOwnProperty(i)&&e.Global.publish(M.core.globalEvents[i],e.merge(r,{broadcast:2}))},"@VERSION@",{requires:["event-custom"]});
|
||||
YUI.add("moodle-core-event",function(e,t){var n="moodle-core-event";M.core=M.core||{},M.core.event=M.core.event||{FILTER_CONTENT_UPDATED:"filter-content-updated"},M.core.globalEvents=M.core.globalEvents||{FORM_ERROR:"form_error"};var r={emitFacade:!0,defaultFn:function(e){},preventedFn:function(e){},stoppedFn:function(e){}},i;for(i in M.core.event)M.core.event.hasOwnProperty(i)&&e.getEvent(M.core.event[i])===null&&e.publish(M.core.event[i],r);for(i in M.core.globalEvents)M.core.globalEvents.hasOwnProperty(i)&&e.Global.getEvent(M.core.globalEvents[i])===null&&e.Global.publish(M.core.globalEvents[i],e.merge(r,{broadcast:!0}))},"@VERSION@",{requires:["event-custom"]});
|
||||
|
@ -30,7 +30,7 @@ var LOGNAME = 'moodle-core-event';
|
||||
*/
|
||||
M.core = M.core || {};
|
||||
|
||||
M.core.event = {
|
||||
M.core.event = M.core.event || {
|
||||
/**
|
||||
* This event is triggered when a page has added dynamic nodes to a page
|
||||
* that should be processed by the filter system. An example is loading
|
||||
@ -44,7 +44,7 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
M.core.globalEvents = M.core.globalEvents || {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
@ -71,15 +71,16 @@ var eventDefaultConfig = {
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
if (M.core.event.hasOwnProperty(key)) {
|
||||
if (M.core.event.hasOwnProperty(key) && Y.getEvent(M.core.event[key]) === null) {
|
||||
Y.publish(M.core.event[key], eventDefaultConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//Publish all the global events.
|
||||
// Publish global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
// Make sure the key exists and that the event has not yet been published. Otherwise, skip publishing.
|
||||
if (M.core.globalEvents.hasOwnProperty(key) && Y.Global.getEvent(M.core.globalEvents[key]) === null) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: true}));
|
||||
}
|
||||
}
|
||||
|
||||
|
14
lib/yui/src/event/js/event.js
vendored
14
lib/yui/src/event/js/event.js
vendored
@ -28,7 +28,7 @@ var LOGNAME = 'moodle-core-event';
|
||||
*/
|
||||
M.core = M.core || {};
|
||||
|
||||
M.core.event = {
|
||||
M.core.event = M.core.event || {
|
||||
/**
|
||||
* This event is triggered when a page has added dynamic nodes to a page
|
||||
* that should be processed by the filter system. An example is loading
|
||||
@ -42,7 +42,7 @@ M.core.event = {
|
||||
FILTER_CONTENT_UPDATED: "filter-content-updated"
|
||||
};
|
||||
|
||||
M.core.globalEvents = {
|
||||
M.core.globalEvents = M.core.globalEvents || {
|
||||
/**
|
||||
* This event is triggered when form has an error
|
||||
*
|
||||
@ -72,14 +72,16 @@ var eventDefaultConfig = {
|
||||
// Publish all the events with a standard config.
|
||||
var key;
|
||||
for (key in M.core.event) {
|
||||
if (M.core.event.hasOwnProperty(key)) {
|
||||
if (M.core.event.hasOwnProperty(key) && Y.getEvent(M.core.event[key]) === null) {
|
||||
Y.publish(M.core.event[key], eventDefaultConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//Publish all the global events.
|
||||
// Publish global events.
|
||||
for (key in M.core.globalEvents) {
|
||||
if (M.core.globalEvents.hasOwnProperty(key)) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: 2}));
|
||||
// Make sure the key exists and that the event has not yet been published. Otherwise, skip publishing.
|
||||
if (M.core.globalEvents.hasOwnProperty(key) && Y.Global.getEvent(M.core.globalEvents[key]) === null) {
|
||||
Y.Global.publish(M.core.globalEvents[key], Y.merge(eventDefaultConfig, {broadcast: true}));
|
||||
Y.log('Global event published: ' + key, 'debug', LOGNAME);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user