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
882eed4f
Commit
882eed4f
authored
Jan 11, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saving work.
parent
221ac493
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
7 deletions
+77
-7
cms/templates/widgets/html-edit.html
+12
-2
common/lib/xmodule/xmodule/css/html/edit.scss
+49
-0
common/lib/xmodule/xmodule/html_module.py
+1
-0
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+14
-5
common/templates/courseware_vendor_js.html
+1
-0
No files found.
cms/templates/widgets/html-edit.html
View file @
882eed4f
<
%
include
file=
"metadata-edit.html"
/>
<
%
include
file=
"metadata-edit.html"
/>
<section
class=
"html-edit"
>
<section
class=
"html-edit"
>
<textarea
name=
""
class=
"tiny-mce"
></textarea>
<div
class=
"html-editor editor"
>
<div
name=
""
class=
"edit-box"
>
${data}
</div>
<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=
"html"
>
Advanced
</a></li>
</ul>
</div>
<textarea
class=
"tiny-mce"
>
${data}
</textarea>
<div
name=
""
class=
"edit-box"
>
${data}
</div>
</div>
</div>
</section>
</section>
common/lib/xmodule/xmodule/css/html/edit.scss
0 → 100644
View file @
882eed4f
.editor-bar
{
position
:
relative
;
@include
linear-gradient
(
top
,
#d4dee8
,
#c9d5e2
);
padding
:
5px
;
border
:
1px
solid
#3c3c3c
;
border-radius
:
3px
3px
0
0
;
border-bottom-color
:
#a5aaaf
;
@include
clearfix
;
a
{
display
:
block
;
float
:
left
;
padding
:
3px
10px
7px
;
margin-left
:
7px
;
border-radius
:
2px
;
&
:hover
{
background
:
rgba
(
255
,
255
,
255
,
.5
);
}
}
.editor-tabs
{
position
:
absolute
;
top
:
10px
;
right
:
10px
;
li
{
float
:
left
;
}
.tab
{
height
:
24px
;
padding
:
7px
20px
3px
;
border
:
1px
solid
#a5aaaf
;
border-radius
:
3px
3px
0
0
;
@include
linear-gradient
(
top
,
rgba
(
0
,
0
,
0
,
0
)
87%
,
rgba
(
0
,
0
,
0
,
.06
));
background-color
:
#e5ecf3
;
font-size
:
13px
;
color
:
#3c3c3c
;
box-shadow
:
1px
-1px
1px
rgba
(
0
,
0
,
0
,
.05
);
&
.current
{
background
:
#fff
;
border-bottom-color
:
#fff
;
}
}
}
}
common/lib/xmodule/xmodule/html_module.py
View file @
882eed4f
...
@@ -48,6 +48,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
...
@@ -48,6 +48,7 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
js_module_name
=
"HTMLEditingDescriptor"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/html/edit.scss'
)]}
# VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# VS[compat] TODO (cpennington): Delete this method once all fall 2012 course
# are being edited in the cms
# are being edited in the cms
...
...
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
882eed4f
class
@
HTMLEditingDescriptor
class
@
HTMLEditingDescriptor
constructor
:
(
@
element
)
->
constructor
:
(
element
)
->
@
element
=
element
;
text
=
$
(
".edit-box"
,
@
element
)[
0
];
text
=
$
(
".edit-box"
,
@
element
)[
0
];
replace_func
=
(
elt
)
->
text
.
parentNode
.
replaceChild
(
elt
,
text
)
replace_func
=
(
elt
)
->
text
.
parentNode
.
replaceChild
(
elt
,
text
)
@
edit_box
=
CodeMirror
(
replace_func
,
{
@
advanced_editor
=
CodeMirror
(
replace_func
,
{
value
:
text
.
innerHTML
value
:
text
.
innerHTML
mode
:
"text/html"
mode
:
"text/html"
lineNumbers
:
true
lineNumbers
:
true
lineWrapping
:
true
})
lineWrapping
:
true
})
@
tiny_mce
=
$
(
".tiny-mce"
).
tinymce
({
$
(
@
advanced_editor
.
getWrapperElement
()).
hide
()
@
tiny_mce
=
$
(
".tiny-mce"
,
@
element
).
tinymce
({
script_url
:
'/static/js/vendor/tiny_mce/tiny_mce.js'
,
script_url
:
'/static/js/vendor/tiny_mce/tiny_mce.js'
,
theme
:
"advanced"
,
theme
:
"advanced"
,
#skin: 'studio',
#skin: 'studio',
...
@@ -21,7 +24,13 @@ class @HTMLEditingDescriptor
...
@@ -21,7 +24,13 @@ class @HTMLEditingDescriptor
theme_advanced_blockformats
:
"p,code,h2,h3,blockquote"
,
theme_advanced_blockformats
:
"p,code,h2,h3,blockquote"
,
width
:
'100%'
,
width
:
'100%'
,
height
:
'400px'
height
:
'400px'
});
})
# @tiny_mce.focus()
# /tinyMCE.activeEditor.setContent(text, {format : 'raw'});
# @tiny = tinyMCE.get($('.tiny-mce', this.element).attr('id'))
# @tiny.setContent(@edit_box.getValue(), {format : 'raw'});
# @tiny_mce.html(@edit_box.getValue())
@
visual_editor
=
tinyMCE
.
get
(
$
(
'.tiny-mce'
,
this
.
element
).
attr
(
'id'
))
save
:
->
save
:
->
data
:
@
edit_box
.
getValue
()
data
:
@
advanced_editor
.
getValue
()
common/templates/courseware_vendor_js.html
View file @
882eed4f
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/codemirror-compressed.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/codemirror-compressed.js')}"
></script>
## tiny_mce
## tiny_mce
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/tiny_mce/tiny_mce.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/tiny_mce/jquery.tinymce.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/tiny_mce/jquery.tinymce.js')}"
></script>
<
%
include
file=
"mathjax_include.html"
/>
<
%
include
file=
"mathjax_include.html"
/>
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