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
aac179f1
Commit
aac179f1
authored
Feb 04, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try, try again.
parent
39479d9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+10
-8
No files found.
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
aac179f1
...
...
@@ -50,7 +50,7 @@ class @HTMLEditingDescriptor
})
@
showingVisualEditor
=
true
@
element
.
on
(
'click'
,
'.editor-tabs .tab'
,
@
onSwitchEditor
)
@
element
.
on
(
'click'
,
'.editor-tabs .tab'
,
this
,
@
onSwitchEditor
)
@
setupTinyMCE
:
(
ed
)
->
ed
.
addButton
(
'wrapAsCode'
,
{
...
...
@@ -71,16 +71,18 @@ class @HTMLEditingDescriptor
e
.
preventDefault
();
if
not
$
(
e
.
currentTarget
).
hasClass
(
'current'
)
element
=
e
.
data
.
element
$
(
e
.
currentTarget
).
addClass
(
'current'
)
$
(
'table.mceToolbar'
,
@
element
).
toggleClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
$
(
element
).
find
(
'table.mceToolbar'
).
toggleClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
$
(
@
advanced_editor
.
getWrapperElement
()).
toggleClass
(
HTMLEditingDescriptor
.
isInactiveClass
)
visualEditor
=
@
getVisualEditor
()
visualEditor
=
@
getVisualEditor
(
element
)
if
$
(
e
.
currentTarget
).
attr
(
'data-tab'
)
is
'visual'
$
(
'.html-tab'
,
@
element
).
removeClass
(
'current'
)
$
(
element
).
find
(
'.html-tab'
).
removeClass
(
'current'
)
@
showVisualEditor
(
visualEditor
)
else
$
(
'.visual-tab'
,
@
element
).
removeClass
(
'current'
)
$
(
element
).
find
(
'.visual-tab'
).
removeClass
(
'current'
)
@
showAdvancedEditor
(
visualEditor
)
# Show the Advanced (codemirror) Editor. Pulled out as a helper method for unit testing.
...
...
@@ -105,17 +107,17 @@ class @HTMLEditingDescriptor
focusVisualEditor
:
(
visualEditor
)
->
visualEditor
.
focus
()
getVisualEditor
:
->
getVisualEditor
:
(
element
)
->
###
Returns the instance of TinyMCE.
This is different from the textarea that exists in the HTML template (@tiny_mce_textarea.
###
return
tinyMCE
.
get
(
$
(
'.tiny-mce'
,
this
.
element
).
attr
(
'id'
))
return
tinyMCE
.
get
(
$
(
element
).
find
(
'.tiny-mce'
).
attr
(
'id'
))
save
:
->
@
element
.
off
(
'click'
,
'.editor-tabs .tab'
,
@
onSwitchEditor
)
text
=
@
advanced_editor
.
getValue
()
visualEditor
=
@
getVisualEditor
()
visualEditor
=
@
getVisualEditor
(
@
element
)
if
@
showingVisualEditor
and
visualEditor
.
isDirty
()
text
=
visualEditor
.
getContent
({
no_events
:
1
})
data
:
text
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