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
be1e308d
Commit
be1e308d
authored
Jun 01, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cale's fix for eval/extra json encode
parent
7567e5eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
djangoapps/courseware/modules/seq_module.py
+3
-12
static/coffee/src/modules/sequence.coffee
+1
-1
No files found.
djangoapps/courseware/modules/seq_module.py
View file @
be1e308d
...
...
@@ -41,11 +41,9 @@ class Module(XModule):
if
self
.
rendered
:
return
def
j
(
m
):
''' jsonify contents so it can be embedded in a js array
We also need to split </script> tags so they don't break
mid-string'''
content
=
json
.
dumps
(
m
[
'content'
])
content
=
content
.
replace
(
'</script>'
,
'<"+"/script>'
)
''' Split </script> tags -- browsers handle this as end
of script, even if it occurs mid-string'''
content
=
m
[
'content'
]
.
replace
(
'</script>'
,
'<"+"/script>'
)
return
{
'content'
:
content
,
'type'
:
m
[
'type'
]}
...
...
@@ -76,13 +74,6 @@ class Module(XModule):
'titles'
:
titles
,
'tag'
:
self
.
xmltree
.
tag
}
# TODO/BUG: Destroy JavaScript should only be called for the active view
# This calls it for all the views
#
# To fix this, we'd probably want to have some way of assigning unique
# IDs to sequences.
destroy_js
=
""
.
join
([
e
[
'destroy_js'
]
for
e
in
self
.
contents
if
'destroy_js'
in
e
])
if
self
.
xmltree
.
tag
in
[
'sequential'
,
'videosequence'
]:
self
.
content
=
render_to_string
(
'seq_module.html'
,
params
)
if
self
.
xmltree
.
tag
==
'tab'
:
...
...
static/coffee/src/modules/sequence.coffee
View file @
be1e308d
...
...
@@ -39,7 +39,7 @@ class @Sequence
$
.
postWithPrefix
"/modx/
#{
@
tag
}
/
#{
@
id
}
/goto_position"
,
position
:
new_position
@
mark_active
new_position
@
$
(
'#seq_content'
).
html
eval
(
@
elements
[
new_position
-
1
].
content
)
@
$
(
'#seq_content'
).
html
@
elements
[
new_position
-
1
].
content
MathJax
.
Hub
.
Queue
([
"Typeset"
,
MathJax
.
Hub
])
@
position
=
new_position
...
...
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