Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0913e9ef
Commit
0913e9ef
authored
Dec 05, 2012
by
valera-rozuvan
Committed by
Alexander Kryklia
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on GST.
parent
643ac69a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
19 deletions
+114
-19
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/module.js
+15
-0
common/static/js/graphical_slider_tool/gst_module.js
+15
-0
common/static/js/graphical_slider_tool/main.js
+75
-1
lms/envs/common.py
+1
-0
lms/templates/graphical_slider_tool.html
+8
-18
No files found.
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/module.js
0 → 100644
View file @
0913e9ef
// 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)
common/static/js/graphical_slider_tool/gst_module.js
0 → 100644
View file @
0913e9ef
// 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)
common/static/js/graphical_slider_tool/main.js
View file @
0913e9ef
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 <script> tag (and is
// forcefully namespaced) it does not get it's configuration from a
// predefined 'data-main' attribute. Therefore, from the start, it assumes
// that the 'baseUrl' is the same directory that require.js itself is
// contained in - i.e. in '/static/js/vendor'. So, we must specify a
// correct 'baseUrl'.
//
// Require JS initially searches this directory for all of the specified
// dependencies. If the dependency is
//
// 'sylvester'
//
// then it will try to get it from
//
// baseUrl + '/' + 'sylvester' + '.js'
//
// If the dependency is
//
// 'vendor_libs/sylvester'
//
// then it will try to get it from
//
// baseUrl + '/' + 'vendor_libs/sylvester' + '.js'
//
// This means two things. One - you can use sub-folders to separate your
// code. Two - don't include the '.js' suffix when specifying a dependency.
//
// For documentation please check:
// http://requirejs.org/docs/api.html#config-baseUrl
'baseUrl'
:
'/static/js/graphical_slider_tool'
,
// If you need to load from another path, you can specify it here on a
// per-module basis. For example you can specify CDN sources here, or
// absolute paths that lie outside of the 'baseUrl' directory.
//
// For documentation please check:
// http://requirejs.org/docs/api.html#config-paths
'paths'
:
{
},
// Since all of the modules that we require are not aware of our custom
// RequireJS solution, that means all of them will be working in the
// "old mode". I.e. they will populate the global namespace with their
// module object.
//
// For each module that we will use, we will specify what is exports into
// the global namespace, and, if necessary, other modules that it depends.
// on. Module dependencies (downloading them, inserting into the document,
// etc.) are handled by RequireJS.
//
// For documentation please check:
// http://requirejs.org/docs/api.html#config-shim
'shim'
:
{
}
});
// End-of: requirejs.config({
// Start the main app logic.
requirejs
([
'gst_module'
],
function
(
GstModule
)
{
console
.
log
(
GstModule
);
});
// End-of: requirejs(['gst_module'], function (GstModule)
// 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)
lms/envs/common.py
View file @
0913e9ef
...
@@ -430,6 +430,7 @@ courseware_only_js += [
...
@@ -430,6 +430,7 @@ courseware_only_js += [
main_vendor_js
=
[
main_vendor_js
=
[
'js/vendor/RequireJS.js'
,
'js/vendor/RequireJS.js'
,
'js/vendor/json2.js'
,
'js/vendor/json2.js'
,
'js/vendor/RequireJS.js'
,
'js/vendor/jquery.min.js'
,
'js/vendor/jquery.min.js'
,
'js/vendor/jquery-ui.min.js'
,
'js/vendor/jquery-ui.min.js'
,
'js/vendor/jquery.cookie.js'
,
'js/vendor/jquery.cookie.js'
,
...
...
lms/templates/graphical_slider_tool.html
View file @
0913e9ef
<div
align=
"center"
id=
"${element_id}"
class=
"${element_class}"
>
<div
align=
"center"
id=
"${element_id}"
class=
"${element_class}"
>
<!-- xidden field to read configuration json from -->
<div
class=
"${element_class}"
id=
"${element_id}_json"
style=
"hidden"
data-json=
"${configuration_json}"
></div>
<!-- xidden field to read configuration json from -->
<!-- xidden field to read configuration json from -->
<div
class=
"${element_class}"
id=
"${element_id}_json"
style=
"hidden"
<div
class=
"${element_class}"
id=
"${element_id}_plot_code"
style=
"hidden"
data-json=
"${configuration_json}"
></div>
data-plot=
"${plot_code}"
></div>
<!-- xidden field to read configuration json from -->
<div
class=
"${element_class}"
id=
"${element_id}_plot_code"
style=
"hidden"
data-plot=
"${plot_code}"
></div>
<!-- main xml with marked places for sliders, number and plots -->
${gst_html}
<!-- main xml with marked places for sliders, number and plots -->
${gst_html}
</div>
</div>
<script
type=
"text/javascript"
src=
"/static/js/graphical_slider_tool/main.js"
>
// wil be invoked for every GST section
// $(document).ready(function() {
// console.log('Another GST applet is loaded')
// });
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment