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
b554eb5a
Commit
b554eb5a
authored
Jan 22, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of format dropdown, toolbar buttons.
parent
e3a2749f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+23
-2
common/static/images/code.gif
+0
-0
No files found.
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
b554eb5a
...
@@ -22,15 +22,24 @@ class @HTMLEditingDescriptor
...
@@ -22,15 +22,24 @@ class @HTMLEditingDescriptor
schema
:
"html5"
,
schema
:
"html5"
,
# TODO: we should share this CSS with studio (and LMS)
# TODO: we should share this CSS with studio (and LMS)
content_css
:
"/static/css/tiny-mce.css"
,
content_css
:
"/static/css/tiny-mce.css"
,
# Disable h4, h5, and h6 styles as we don't have CSS for them.
formats
:
{
h4
:
{},
h5
:
{},
h6
:
{}
},
# Disable visual aid on borderless table.
visual
:
false
,
# We may want to add "styleselect" when we collect all styles used throughout the LMS
# We may want to add "styleselect" when we collect all styles used throughout the LMS
theme_advanced_buttons1
:
"formatselect,bold,italic,underline,
bullist,numlist,outdent,indent,blockquote
,link,unlink"
,
theme_advanced_buttons1
:
"formatselect,bold,italic,underline,
|,bullist,numlist,outdent,indent,|,blockquote,wrapAsCode,|
,link,unlink"
,
theme_advanced_toolbar_location
:
"top"
,
theme_advanced_toolbar_location
:
"top"
,
theme_advanced_toolbar_align
:
"left"
,
theme_advanced_toolbar_align
:
"left"
,
theme_advanced_statusbar_location
:
"none"
,
theme_advanced_statusbar_location
:
"none"
,
theme_advanced_resizing
:
true
,
theme_advanced_resizing
:
true
,
theme_advanced_blockformats
:
"p,
code,h2,h3,blockquot
e"
,
theme_advanced_blockformats
:
"p,
h1,h2,h3,pr
e"
,
width
:
'100%'
,
width
:
'100%'
,
height
:
'400px'
,
height
:
'400px'
,
setup
:
HTMLEditingDescriptor
.
setupTinyMCE
,
# Cannot get access to tinyMCE Editor instance (for focusing) until after it is rendered.
# Cannot get access to tinyMCE Editor instance (for focusing) until after it is rendered.
# The tinyMCE callback passes in the editor as a paramter.
# The tinyMCE callback passes in the editor as a paramter.
init_instance_callback
:
@
focusVisualEditor
init_instance_callback
:
@
focusVisualEditor
...
@@ -39,6 +48,18 @@ class @HTMLEditingDescriptor
...
@@ -39,6 +48,18 @@ class @HTMLEditingDescriptor
@
showingVisualEditor
=
true
@
showingVisualEditor
=
true
@
element
.
on
(
'click'
,
'.editor-tabs .tab'
,
@
onSwitchEditor
)
@
element
.
on
(
'click'
,
'.editor-tabs .tab'
,
@
onSwitchEditor
)
@
setupTinyMCE
:
(
ed
)
->
ed
.
addButton
(
'wrapAsCode'
,
{
title
:
'Code Block'
,
image
:
'/static/images/code.gif'
,
onclick
:
()
->
ed
.
formatter
.
toggle
(
'code'
)
})
ed
.
onNodeChange
.
add
((
editor
,
command
,
e
)
->
command
.
setActive
(
'wrapAsCode'
,
e
.
nodeName
==
'CODE'
)
)
onSwitchEditor
:
(
e
)
=>
onSwitchEditor
:
(
e
)
=>
e
.
preventDefault
();
e
.
preventDefault
();
...
...
common/static/images/code.gif
0 → 100644
View file @
b554eb5a
1.2 KB
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