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
b6fcf3a5
Commit
b6fcf3a5
authored
Jan 17, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some refactoring from Brian's submission.
parent
db7443ce
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
25 deletions
+17
-25
common/lib/xmodule/xmodule/capa_module.py
+1
-1
common/lib/xmodule/xmodule/css/editor/edit.scss
+1
-2
common/lib/xmodule/xmodule/html_module.py
+1
-1
common/lib/xmodule/xmodule/js/fixtures/html-edit.html
+4
-6
common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee
+0
-1
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+9
-13
common/lib/xmodule/xmodule/self_assessment_module.py
+1
-1
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
b6fcf3a5
...
...
@@ -673,7 +673,7 @@ class CapaDescriptor(RawDescriptor):
mako_template
=
"widgets/problem-edit.html"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/problem/edit.coffee'
)]}
js_module_name
=
"MarkdownEditingDescriptor"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/editor/
display
.scss'
),
resource_string
(
__name__
,
'css/problem/edit.scss'
)]}
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/editor/
edit
.scss'
),
resource_string
(
__name__
,
'css/problem/edit.scss'
)]}
# Capa modules have some additional metadata:
# TODO (vshnayder): do problems have any other metadata? Do they
...
...
common/lib/xmodule/xmodule/css/editor/
display
.scss
→
common/lib/xmodule/xmodule/css/editor/
edit
.scss
View file @
b6fcf3a5
// This is shared CSS between the xmodule problem editor and the xmodule HTML editor.
.editor
{
position
:
relative
;
...
...
@@ -13,8 +14,6 @@
border-radius
:
3px
3px
0
0
;
border-bottom-color
:
#a5aaaf
;
@include
clearfix
;
// TODO: I added this -- Brian to fix roperly
height
:
34px
;
a
{
display
:
block
;
...
...
common/lib/xmodule/xmodule/html_module.py
View file @
b6fcf3a5
...
...
@@ -48,7 +48,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/editor/
display
.scss'
),
resource_string
(
__name__
,
'css/html/edit.scss'
)]}
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/editor/
edit
.scss'
),
resource_string
(
__name__
,
'css/html/edit.scss'
)]}
# VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# are being edited in the cms
...
...
common/lib/xmodule/xmodule/js/fixtures/html-edit.html
View file @
b6fcf3a5
<section
class=
"html-edit"
>
<ul
class=
"editor-tabs"
>
<li><a
href=
"#"
class=
"visual-tab tab current"
data-tab=
"visual"
>
Visual
</a></li>
<li><a
href=
"#"
class=
"html-tab tab"
data-tab=
"advanced"
>
HTML
</a></li>
</ul>
<div
class=
"row"
>
<div
class=
"editor-bar"
>
<ul
class=
"editor-tabs"
>
<li><a
href=
"#"
class=
"visual-tab tab current"
data-tab=
"visual"
>
Visual
</a></li>
<li><a
href=
"#"
class=
"html-tab tab"
data-tab=
"advanced"
>
Advanced
</a></li>
</ul>
</div>
<textarea
class=
"tiny-mce"
>
dummy text
</textarea>
<div
name=
""
class=
"edit-box"
>
Advanced Editor Text
</div>
</div>
...
...
common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee
View file @
b6fcf3a5
...
...
@@ -78,7 +78,6 @@ describe 'HTMLEditingDescriptor', ->
isNotDirty
:
false
content
:
'not set'
startContent
:
'not set'
,
show
:
()
->
true
focus
:
()
->
true
isDirty
:
()
->
not
@
isNotDirty
setContent
:
(
x
)
->
@
content
=
x
...
...
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
b6fcf3a5
class
@
HTMLEditingDescriptor
@
isInactiveClass
:
"is-inactive"
constructor
:
(
element
)
->
@
element
=
element
;
text
=
$
(
".edit-box"
,
@
element
)[
0
];
...
...
@@ -9,7 +11,7 @@ class @HTMLEditingDescriptor
lineNumbers
:
true
lineWrapping
:
true
})
$
(
@
advanced_editor
.
getWrapperElement
()).
addClass
(
'is-inactive'
)
$
(
@
advanced_editor
.
getWrapperElement
()).
addClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
@
tiny_mce_textarea
=
$
(
".tiny-mce"
,
@
element
).
tinymce
({
script_url
:
'/static/js/vendor/tiny_mce/tiny_mce.js'
,
...
...
@@ -29,7 +31,7 @@ class @HTMLEditingDescriptor
height
:
'400px'
,
# Cannot get access to tinyMCE Editor instance (for focusing) until after it is rendered.
# The tinyMCE callback passes in the editor as a paramter.
init_instance_callback
:
@
initialize
VisualEditor
init_instance_callback
:
@
focus
VisualEditor
})
@
showingVisualEditor
=
true
...
...
@@ -41,19 +43,14 @@ class @HTMLEditingDescriptor
if
not
$
(
e
.
currentTarget
).
hasClass
(
'current'
)
$
(
'.editor-tabs .current'
).
removeClass
(
'current'
)
$
(
e
.
currentTarget
).
addClass
(
'current'
)
visualEditor
=
@
getVisualEditor
()
$
(
'table.mceToolbar'
).
toggleClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
$
(
@
advanced_editor
.
getWrapperElement
()).
toggleClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
visualEditor
=
@
getVisualEditor
()
if
$
(
e
.
currentTarget
).
attr
(
'data-tab'
)
is
'visual'
@
showVisualEditor
(
visualEditor
)
$
(
'table.mceToolbar'
).
removeClass
(
'is-inactive'
)
$
(
@
advanced_editor
.
getWrapperElement
()).
addClass
(
'is-inactive'
)
else
# @tiny_mce_textarea.hide()
@
showAdvancedEditor
(
visualEditor
)
$
(
'table.mceToolbar'
).
addClass
(
'is-inactive'
)
$
(
@
advanced_editor
.
getWrapperElement
()).
removeClass
(
'is-inactive'
)
# Show the Advanced (codemirror) Editor. Pulled out as a helper method for unit testing.
showAdvancedEditor
:
(
visualEditor
)
->
...
...
@@ -66,16 +63,15 @@ class @HTMLEditingDescriptor
# Show the Visual (tinyMCE) Editor. Pulled out as a helper method for unit testing.
showVisualEditor
:
(
visualEditor
)
->
# visualEditor.show()
visualEditor
.
setContent
(
@
advanced_editor
.
getValue
())
# In order for isDirty() to return true ONLY if edits have been made after setting the text,
# both the startContent must be sync'ed up and the dirty flag set to false.
visualEditor
.
startContent
=
visualEditor
.
getContent
({
format
:
"raw"
,
no_events
:
1
});
visualEditor
.
isNotDirty
=
true
visualEditor
.
focus
(
)
@
focusVisualEditor
(
visualEditor
)
@
showingVisualEditor
=
true
initialize
VisualEditor
:
(
visualEditor
)
->
focus
VisualEditor
:
(
visualEditor
)
->
visualEditor
.
focus
()
getVisualEditor
:
->
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
b6fcf3a5
...
...
@@ -524,7 +524,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/html/edit.scss'
)]}
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/
editor/edit.scss'
),
resource_string
(
__name__
,
'css/
html/edit.scss'
)]}
@classmethod
def
definition_from_xml
(
cls
,
xml_object
,
system
):
...
...
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