diff --git a/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/module.js b/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/module.js new file mode 100644 index 0000000000..c4661b5e44 --- /dev/null +++ b/common/lib/xmodule/xmodule/js/src/graphical_slider_tool/module.js @@ -0,0 +1,15 @@ +// Wrapper for RequireJS. It will make the standard requirejs(), require(), and +// define() functions from Require JS available inside the anonymous function. +(function (requirejs, require, define) { + +define([], function () { + return { + 'module_status': 'OK' + }; +}); + +// 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) diff --git a/common/static/js/graphical_slider_tool/gst_module.js b/common/static/js/graphical_slider_tool/gst_module.js new file mode 100644 index 0000000000..c4661b5e44 --- /dev/null +++ b/common/static/js/graphical_slider_tool/gst_module.js @@ -0,0 +1,15 @@ +// Wrapper for RequireJS. It will make the standard requirejs(), require(), and +// define() functions from Require JS available inside the anonymous function. +(function (requirejs, require, define) { + +define([], function () { + return { + 'module_status': 'OK' + }; +}); + +// 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) diff --git a/common/static/js/graphical_slider_tool/main.js b/common/static/js/graphical_slider_tool/main.js index bb624d5888..da36d9c9d6 100644 --- a/common/static/js/graphical_slider_tool/main.js +++ b/common/static/js/graphical_slider_tool/main.js @@ -1 +1,75 @@ -alert('Hello, world!'); +// Wrapper for RequireJS. It will make the standard requirejs(), require(), and +// define() functions from Require JS available inside the anonymous function. +(function (requirejs, require, define) { + +// For documentation please check: +// http://requirejs.org/docs/api.html +requirejs.config({ + // Because require.js is included as a simple