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
7de575a8
Commit
7de575a8
authored
Dec 10, 2012
by
Valera Rozuvan
Committed by
Alexander Kryklia
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GST work in progress.
parent
ce7a01dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js
+8
-10
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/state.js
+11
-8
No files found.
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/graph.js
View file @
7de575a8
...
@@ -19,22 +19,20 @@ define('Graph', ['logme'], function (logme) {
...
@@ -19,22 +19,20 @@ define('Graph', ['logme'], function (logme) {
plotDiv
.
width
(
300
);
plotDiv
.
width
(
300
);
plotDiv
.
height
(
300
);
plotDiv
.
height
(
300
);
plotDiv
.
bind
(
'update_plot'
,
function
(
event
,
forGstId
)
{
state
.
bindUpdatePlotEvent
(
plotDiv
,
onUpdatePlot
);
if
(
forGstId
!==
gstId
)
{
logme
(
'update_plot event not for current ID'
);
}
logme
(
'redrawing plot'
);
generateData
();
updatePlot
();
});
generateData
();
generateData
();
updatePlot
();
updatePlot
();
return
;
return
;
function
onUpdatePlot
(
event
)
{
logme
(
'redrawing plot'
);
generateData
();
updatePlot
();
}
function
generateData
()
{
function
generateData
()
{
var
a
,
b
,
c1
;
var
a
,
b
,
c1
;
...
...
common/lib/xmodule/xmodule/js/src/graphical_slider_tool/state.js
View file @
7de575a8
...
@@ -18,7 +18,7 @@ define('State', ['logme'], function (logme) {
...
@@ -18,7 +18,7 @@ define('State', ['logme'], function (logme) {
*
*
*/
*/
function
State
(
gstId
,
config
)
{
function
State
(
gstId
,
config
)
{
var
constants
,
c1
;
var
constants
,
c1
,
plotDiv
;
constants
=
{};
constants
=
{};
...
@@ -62,9 +62,16 @@ define('State', ['logme'], function (logme) {
...
@@ -62,9 +62,16 @@ define('State', ['logme'], function (logme) {
// it's private properties.
// it's private properties.
return
{
return
{
'getConstValue'
:
getConstValue
,
'getConstValue'
:
getConstValue
,
'setConstValue'
:
setConstValue
'setConstValue'
:
setConstValue
,
'bindUpdatePlotEvent'
:
bindUpdatePlotEvent
};
};
function
bindUpdatePlotEvent
(
newPlotDiv
,
callback
)
{
plotDiv
=
newPlotDiv
;
plotDiv
.
bind
(
'update_plot'
,
callback
);
}
function
getConstValue
(
constName
)
{
function
getConstValue
(
constName
)
{
if
(
constants
.
hasOwnProperty
(
constName
)
===
false
)
{
if
(
constants
.
hasOwnProperty
(
constName
)
===
false
)
{
// If the name of the constant is not tracked by state, return an
// If the name of the constant is not tracked by state, return an
...
@@ -76,8 +83,6 @@ define('State', ['logme'], function (logme) {
...
@@ -76,8 +83,6 @@ define('State', ['logme'], function (logme) {
}
}
function
setConstValue
(
constName
,
constValue
)
{
function
setConstValue
(
constName
,
constValue
)
{
var
plotDiv
;
if
(
constants
.
hasOwnProperty
(
constName
)
===
false
)
{
if
(
constants
.
hasOwnProperty
(
constName
)
===
false
)
{
// If the name of the constant is not tracked by state, return an
// If the name of the constant is not tracked by state, return an
// 'undefined' value.
// 'undefined' value.
...
@@ -93,10 +98,8 @@ define('State', ['logme'], function (logme) {
...
@@ -93,10 +98,8 @@ define('State', ['logme'], function (logme) {
logme
(
'From setConstValue: new value for "'
+
constName
+
'" is '
+
constValue
);
logme
(
'From setConstValue: new value for "'
+
constName
+
'" is '
+
constValue
);
plotDiv
=
$
(
'#'
+
gstId
+
'_plot'
);
if
(
plotDiv
!==
undefined
)
{
plotDiv
.
trigger
(
'update_plot'
);
if
(
plotDiv
.
length
===
1
)
{
plotDiv
.
trigger
(
'update_plot'
,
[
gstId
]);
}
}
}
}
...
...
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