Set up of basic RequireJS skeleton structure.
This commit is contained in:
committed by
Alexander Kryklia
parent
757f955c5e
commit
61c68b740c
@@ -1 +1,27 @@
|
||||
alert('drag-and-drop js is loaded')
|
||||
// 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) {
|
||||
|
||||
requirejs.config({
|
||||
'baseUrl': '/static/js/capa/drag_and_drop/',
|
||||
|
||||
'paths': {
|
||||
|
||||
},
|
||||
|
||||
'shim': {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
requirejs(['main'], function (Main) {
|
||||
Main();
|
||||
});
|
||||
|
||||
// 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)
|
||||
|
||||
19
common/static/js/capa/drag_and_drop/main.js
Normal file
19
common/static/js/capa/drag_and_drop/main.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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([], function () {
|
||||
return Main;
|
||||
|
||||
function Main() {
|
||||
alert('This is a drag-and-drop demo.');
|
||||
}
|
||||
});
|
||||
|
||||
// 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)
|
||||
@@ -432,6 +432,8 @@ courseware_only_js += [
|
||||
in glob2.glob(PROJECT_ROOT / 'static/coffee/src/modules/**/*.coffee')
|
||||
]
|
||||
|
||||
# 'js/vendor/RequireJS.js' - Require JS wrapper.
|
||||
# See https://edx-wiki.atlassian.net/wiki/display/LMS/Integration+of+Require+JS+into+the+system
|
||||
main_vendor_js = [
|
||||
'js/vendor/RequireJS.js',
|
||||
'js/vendor/json2.js',
|
||||
|
||||
Reference in New Issue
Block a user