mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
91bda4cd45
This change allows form elements to be overridden with a mustache template. The template can even listen for form validation errors and supply the JS to change the look of the form element when there is/isn't a validation error. Initial support is for all core form elements including: text, select, selectyesno and checkboxes, groups, dateselector, datetimeselector, autocomplete, modvisible, advcheckbox, button, duration, filemanager, filepicker, editor, static, grading, warning, textarea, password, url, submit, questioncategory, recaptcha. Part of MDL-55071
1 line
542 B
JavaScript
1 line
542 B
JavaScript
define(["jquery","core/yui"],function(a,b){return{Events:{FORM_FIELD_VALIDATION:"core_form-field-validation"},notifyFilterContentUpdated:function(c){c=a(c),b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.FILTER_CONTENT_UPDATED,c);var d=new b.NodeList(c.get());b.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:d})})},notifyEditorContentRestored:function(){b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.EDITOR_CONTENT_RESTORED),b.fire(M.core.event.EDITOR_CONTENT_RESTORED)})}}}); |