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
f9169613
Commit
f9169613
authored
Dec 26, 2012
by
Valera Rozuvan
Committed by
Alexander Kryklia
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making JS work with the new XML format.
parent
4268f040
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
21 deletions
+20
-21
common/static/js/capa/drag_and_drop/base_image.js
+3
-3
common/static/js/capa/drag_and_drop/config_parser.js
+12
-12
common/static/js/capa/drag_and_drop/draggables.js
+2
-2
common/static/js/capa/drag_and_drop/main.js
+3
-3
common/static/js/capa/drag_and_drop/update_input.js
+0
-1
No files found.
common/static/js/capa/drag_and_drop/
target_container
.js
→
common/static/js/capa/drag_and_drop/
base_image
.js
View file @
f9169613
...
...
@@ -5,12 +5,12 @@
(
function
(
requirejs
,
require
,
define
)
{
define
([
'logme'
],
function
(
logme
)
{
return
TargetContainer
;
return
BaseImage
;
function
TargetContainer
(
state
)
{
function
BaseImage
(
state
)
{
var
targetImgSrc
,
targetElContainer
,
mouseMoveDiv
;
targetImgSrc
=
state
.
config
.
imageDir
+
'/'
+
state
.
config
.
target_container
;
targetImgSrc
=
state
.
config
.
imageDir
+
'/'
+
state
.
config
.
base_image
;
targetElContainer
=
$
(
'<div '
+
...
...
common/static/js/capa/drag_and_drop/config_parser.js
View file @
f9169613
...
...
@@ -14,33 +14,33 @@ define(['logme'], function (logme) {
state
.
config
=
{
'imageDir'
:
'/static/'
+
imageDir
+
'/images'
,
'draggable'
:
[],
'draggable
s
'
:
[],
'targets'
:
[],
'
target_container
'
:
''
'
base_image
'
:
''
};
if
(
$
.
isArray
(
config
.
draggable
)
===
true
)
{
if
(
$
.
isArray
(
config
.
draggable
s
)
===
true
)
{
(
function
(
i
)
{
while
(
i
<
config
.
draggable
.
length
)
{
if
(
processDraggable
(
config
.
draggable
[
i
])
!==
true
)
{
while
(
i
<
config
.
draggable
s
.
length
)
{
if
(
processDraggable
(
config
.
draggable
s
[
i
])
!==
true
)
{
returnStatus
=
false
;
}
i
+=
1
;
}
}(
0
));
}
else
if
(
$
.
isPlainObject
(
config
.
draggable
)
===
true
)
{
if
(
processDraggable
(
config
.
draggable
)
!==
true
)
{
}
else
if
(
$
.
isPlainObject
(
config
.
draggable
s
)
===
true
)
{
if
(
processDraggable
(
config
.
draggable
s
)
!==
true
)
{
returnStatus
=
false
;
}
}
else
{
logme
(
'ERROR: The type of config.draggable is no supported.'
);
logme
(
'ERROR: The type of config.draggable
s
is no supported.'
);
returnStatus
=
false
;
}
if
(
typeof
config
.
target_container
===
'string'
)
{
state
.
config
.
target_container
=
config
.
target_container
;
if
(
typeof
config
.
base_image
===
'string'
)
{
state
.
config
.
base_image
=
config
.
base_image
;
}
else
{
logme
(
'ERROR: Property config.
target_container
is not of type "string".'
);
logme
(
'ERROR: Property config.
base_image
is not of type "string".'
);
returnStatus
=
false
;
}
...
...
@@ -104,7 +104,7 @@ define(['logme'], function (logme) {
if
(
!
attrIsString
(
obj
,
'icon'
))
{
return
false
;
}
if
(
!
attrIsString
(
obj
,
'label'
))
{
return
false
;
}
state
.
config
.
draggable
.
push
(
obj
);
state
.
config
.
draggable
s
.
push
(
obj
);
true
;
}
...
...
common/static/js/capa/drag_and_drop/draggables.js
View file @
f9169613
...
...
@@ -14,8 +14,8 @@ define(['logme', 'update_input'], function (logme, updateInput) {
state
.
draggables
=
[];
(
function
(
i
)
{
while
(
i
<
state
.
config
.
draggable
.
length
)
{
processDraggable
(
state
.
config
.
draggable
[
i
],
i
+
1
);
while
(
i
<
state
.
config
.
draggable
s
.
length
)
{
processDraggable
(
state
.
config
.
draggable
s
[
i
],
i
+
1
);
i
+=
1
;
}
}(
0
));
...
...
common/static/js/capa/drag_and_drop/main.js
View file @
f9169613
...
...
@@ -5,8 +5,8 @@
(
function
(
requirejs
,
require
,
define
)
{
define
(
[
'logme'
,
'state'
,
'config_parser'
,
'container'
,
'
target_container
'
,
'scroller'
,
'draggables'
,
'targets'
],
function
(
logme
,
State
,
configParser
,
Container
,
TargetContainer
,
Scroller
,
Draggables
,
Targets
)
{
[
'logme'
,
'state'
,
'config_parser'
,
'container'
,
'
base_image
'
,
'scroller'
,
'draggables'
,
'targets'
],
function
(
logme
,
State
,
configParser
,
Container
,
BaseImage
,
Scroller
,
Draggables
,
Targets
)
{
return
Main
;
function
Main
()
{
...
...
@@ -57,7 +57,7 @@ define(
}
Container
(
state
);
TargetContainer
(
state
);
BaseImage
(
state
);
Scroller
(
state
);
Draggables
(
state
);
Targets
(
state
);
...
...
common/static/js/capa/drag_and_drop/update_input.js
View file @
f9169613
...
...
@@ -47,7 +47,6 @@ define(['logme'], function (logme) {
inputEl
=
$
(
'#input_'
+
state
.
problemId
);
inputEl
.
val
(
stateStr
);
logme
(
inputEl
.
val
());
}
});
...
...
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