container.js 1.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
// Wrapper for RequireJS. It will make the standard requirejs(), require(), and
// define() functions from Require JS available inside the anonymous function.
//
// See https://edx-wiki.atlassian.net/wiki/display/LMS/Integration+of+Require+JS+into+the+system
(function (requirejs, require, define) {

define(['logme'], function (logme) {
    return Container;

    function Container(state) {
11 12 13 14
        state.containerEl = $(
            '<div ' +
                'style=" ' +
                    'clear: both; ' +
15 16 17
                    'width: 665px; ' +
                    'margin-left: auto; ' +
                    'margin-right: auto; ' +
18 19 20
                '" ' +
            '></div>'
        );
21

22
        $('#inputtype_' + state.problemId).before(state.containerEl);
23 24 25 26 27 28 29 30
    }
});

// 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)