MDL-21420 refactoring towards global M

This commit is contained in:
Petr Skoda
2010-01-21 20:55:58 +00:00
parent 26a8a8c8af
commit e50b4c8972
6 changed files with 85 additions and 43 deletions
+14 -4
View File
@@ -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});