MDL-21420 refactoring towards global M
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
// Miscellaneous core Javascript functions for Moodle
|
||||
// Global instance of YUI3
|
||||
// Global M object is initilised in inline javascript
|
||||
|
||||
// Global Y instance, inilialised much later in page footer
|
||||
var Y = null;
|
||||
|
||||
// Global M object, this helps with solving of namespace and scope issues
|
||||
var M = M || {};
|
||||
/**
|
||||
* Add module to list of available modules that can be laoded from YUI.
|
||||
*/
|
||||
M.yui.add_module = function(modules) {
|
||||
for (modname in modules) {
|
||||
M.yui.loader[modname] = modules[modname];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// old JS functions, to be converted soon
|
||||
|
||||
function launch_filemanager(options) {
|
||||
Y.use('core_filemanager', function() {
|
||||
@@ -1409,7 +1419,7 @@ function get_image_url(imagename, component) {
|
||||
|
||||
// ===== Deprecated core Javascript functions for Moodle ====
|
||||
// DO NOT USE!!!!!!!
|
||||
// Do not put this stuff in separate file because it only adds extra load on servers!
|
||||
// Do not put this stuff in separate file because it only adds extra load on servers!
|
||||
|
||||
function submitFormById(id) {
|
||||
submit_form_by_id(null, {id: id});
|
||||
|
||||
Reference in New Issue
Block a user