drag_and_drop.js 1.27 KB
Newer Older
1 2 3
// Wrapper for RequireJS. It will make the standard requirejs(), require(), and
// define() functions from Require JS available inside the anonymous function.
//
4
// See https://openedx.atlassian.net/wiki/display/PLAT/Integration+of+Require+JS+into+the+system
5
(function(requirejs, require, define) {
6
// HACK: this should be removed when it is safe to do so
7 8 9
    if (window.baseUrl) {
        requirejs.config({baseUrl: baseUrl});
    }
10

11 12 13 14 15 16
// The current JS file will be loaded and run each time. It will require a
// single dependency which will be loaded and stored by RequireJS. On
// subsequent runs, RequireJS will return the dependency from memory, rather
// than loading it again from the server. For that reason, it is a good idea to
// keep the current JS file as small as possible, and move everything else into
// RequireJS module dependencies.
17 18 19
    require(['js/capa/drag_and_drop/main'], function(Main) {
        Main();
    });
20 21 22 23 24 25

// End of wrapper for RequireJS. As you can see, we are passing
// namespaced Require JS variables to an anonymous function. Within
// it, you can use the standard requirejs(), require(), and define()
// functions as if they were in the global namespace.
}(RequireJS.requirejs, RequireJS.require, RequireJS.define)); // End-of: (function (requirejs, require, define)