diff --git a/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-debug.js b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-debug.js new file mode 100644 index 00000000000..4b22e976853 --- /dev/null +++ b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-debug.js @@ -0,0 +1,28 @@ +YUI.add('moodle-course-formatchooser', function (Y, NAME) { + +var FORMATCHOOSER = function() { + FORMATCHOOSER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(FORMATCHOOSER, Y.Base, { + initializer : function(params) { + if (params && params.formid) { + var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat'); + var formatselect = Y.one('#'+params.formid+' #id_format'); + if (updatebut && formatselect) { + updatebut.setStyle('display', 'none'); + formatselect.on('change', function() { + updatebut.simulate('click'); + }); + } + } + } +}); + +M.course = M.course || {}; +M.course.init_formatchooser = function(params) { + return new FORMATCHOOSER(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]}); diff --git a/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-min.js b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-min.js new file mode 100644 index 00000000000..714963808e4 --- /dev/null +++ b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser-min.js @@ -0,0 +1 @@ +YUI.add("moodle-course-formatchooser",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){if(t&&t.formid){var n=e.one("#"+t.formid+" #id_updatecourseformat"),r=e.one("#"+t.formid+" #id_format");n&&r&&(n.setStyle("display","none"),r.on("change",function(){n.simulate("click")}))}}}),M.course=M.course||{},M.course.init_formatchooser=function(e){return new n(e)}},"@VERSION@",{requires:["base","node","node-event-simulate"]}); diff --git a/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser.js b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser.js new file mode 100644 index 00000000000..4b22e976853 --- /dev/null +++ b/course/yui/build/moodle-course-formatchooser/moodle-course-formatchooser.js @@ -0,0 +1,28 @@ +YUI.add('moodle-course-formatchooser', function (Y, NAME) { + +var FORMATCHOOSER = function() { + FORMATCHOOSER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(FORMATCHOOSER, Y.Base, { + initializer : function(params) { + if (params && params.formid) { + var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat'); + var formatselect = Y.one('#'+params.formid+' #id_format'); + if (updatebut && formatselect) { + updatebut.setStyle('display', 'none'); + formatselect.on('change', function() { + updatebut.simulate('click'); + }); + } + } + } +}); + +M.course = M.course || {}; +M.course.init_formatchooser = function(params) { + return new FORMATCHOOSER(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]}); diff --git a/course/yui/formatchooser/formatchooser.js b/course/yui/formatchooser/formatchooser.js deleted file mode 100644 index 0597c4ba736..00000000000 --- a/course/yui/formatchooser/formatchooser.js +++ /dev/null @@ -1,25 +0,0 @@ -YUI.add('moodle-course-formatchooser', function(Y) { - var FORMATCHOOSER = function() { - FORMATCHOOSER.superclass.constructor.apply(this, arguments); - } - - Y.extend(FORMATCHOOSER, Y.Base, { - initializer : function(params) { - if (params && params.formid) { - var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat'); - var formatselect = Y.one('#'+params.formid+' #id_format'); - if (updatebut && formatselect) { - updatebut.setStyle('display', 'none'); - formatselect.on('change', function() { - updatebut.simulate('click'); - }); - } - } - } - }); - - M.course = M.course || {}; - M.course.init_formatchooser = function(params) { - return new FORMATCHOOSER(params); - } -}, '@VERSION@', {requires:['base', 'node', 'node-event-simulate']}); diff --git a/course/yui/src/formatchooser/build.json b/course/yui/src/formatchooser/build.json new file mode 100644 index 00000000000..ddc0d4181a2 --- /dev/null +++ b/course/yui/src/formatchooser/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-course-formatchooser", + "builds": { + "moodle-course-formatchooser": { + "jsfiles": [ + "formatchooser.js" + ] + } + } +} diff --git a/course/yui/src/formatchooser/js/formatchooser.js b/course/yui/src/formatchooser/js/formatchooser.js new file mode 100644 index 00000000000..8e380c16718 --- /dev/null +++ b/course/yui/src/formatchooser/js/formatchooser.js @@ -0,0 +1,23 @@ +var FORMATCHOOSER = function() { + FORMATCHOOSER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(FORMATCHOOSER, Y.Base, { + initializer : function(params) { + if (params && params.formid) { + var updatebut = Y.one('#'+params.formid+' #id_updatecourseformat'); + var formatselect = Y.one('#'+params.formid+' #id_format'); + if (updatebut && formatselect) { + updatebut.setStyle('display', 'none'); + formatselect.on('change', function() { + updatebut.simulate('click'); + }); + } + } + } +}); + +M.course = M.course || {}; +M.course.init_formatchooser = function(params) { + return new FORMATCHOOSER(params); +}; diff --git a/course/yui/src/formatchooser/meta/formatchooser.json b/course/yui/src/formatchooser/meta/formatchooser.json new file mode 100644 index 00000000000..9b2117840a4 --- /dev/null +++ b/course/yui/src/formatchooser/meta/formatchooser.json @@ -0,0 +1,9 @@ +{ + "moodle-course-formatchooser": { + "requires": [ + "base", + "node", + "node-event-simulate" + ] + } +}