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
bb0a58ab
Commit
bb0a58ab
authored
Mar 21, 2014
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review feedback.
parent
b0c35982
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
16 deletions
+20
-16
cms/djangoapps/contentstore/features/common.py
+4
-2
cms/djangoapps/contentstore/features/html-editor.feature
+2
-3
cms/djangoapps/contentstore/features/html-editor.py
+2
-2
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+3
-1
common/static/js/vendor/tiny_mce/plugins/codemirror/source.html
+9
-8
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
bb0a58ab
...
...
@@ -329,9 +329,11 @@ def type_in_codemirror(index, text, find_prefix="$"):
def
get_codemirror_value
(
index
=
0
,
find_prefix
=
"$"
):
return
world
.
browser
.
driver
.
execute_script
(
"""
return
world
.
browser
.
driver
.
execute_script
(
"""
return {find_prefix}('div.CodeMirror:eq({index})').get(0).CodeMirror.getValue();
"""
.
format
(
index
=
index
,
find_prefix
=
find_prefix
))
"""
.
format
(
index
=
index
,
find_prefix
=
find_prefix
)
)
def
upload_file
(
filename
):
...
...
cms/djangoapps/contentstore/features/html-editor.feature
View file @
bb0a58ab
...
...
@@ -39,9 +39,8 @@ Feature: CMS.HTML Editor
When
I edit the page
And type "<p class='title'>pages</p><style><!-- .title { color
:
red;
}
--></style>"
in
the
code
editor
and
press
OK
And
I save the page
Then the page text
i
s
:
Then the page text
contain
s
:
"""
<p> </p>
<p class="title">pages</p>
<style><!--
.title { color: red; }
...
...
@@ -66,7 +65,7 @@ Feature: CMS.HTML Editor
And
I set the text to
"display as code"
and I select the text
And
I select the code toolbar button
And
I save the page
Then the page text
i
s
:
Then the page text
contain
s
:
"""
<p><code>display as code</code></p>
"""
cms/djangoapps/contentstore/features/html-editor.py
View file @
bb0a58ab
...
...
@@ -99,9 +99,9 @@ def i_click_on_save(step):
world
.
save_component
(
step
)
@step
(
'the page text
i
s:'
)
@step
(
'the page text
contain
s:'
)
def
check_page_text
(
step
):
assert_
equal
(
step
.
multiline
,
world
.
css_find
(
'.xmodule_HtmlModule'
)
.
html
.
strip
()
)
assert_
in
(
step
.
multiline
,
world
.
css_find
(
'.xmodule_HtmlModule'
)
.
html
)
@step
(
'the src link is rewritten to "(.*)"$'
)
...
...
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
bb0a58ab
...
...
@@ -81,12 +81,14 @@ class @HTMLEditingDescriptor
@
rewriteLinksFromStatic
(
e
.
target
)
showCodeEditor
:
(
codeEditor
)
=>
# Called with the CodeMirror Editor is displayed to convert links to show satic prefix.
# Called when the CodeMirror Editor is displayed to convert links to show satic prefix.
# The input argument is the CodeMirror instance.
content
=
rewriteStaticLinks
(
codeEditor
.
getValue
(),
@
base_asset_url
,
'/static/'
)
codeEditor
.
setValue
(
content
)
saveCodeEditor
:
(
codeEditor
)
=>
# Called when the CodeMirror Editor is saved to convert links back to the full form.
# The input argument is the CodeMirror instance.
content
=
rewriteStaticLinks
(
codeEditor
.
getValue
(),
'/static/'
,
@
base_asset_url
)
codeEditor
.
setValue
(
content
)
...
...
common/static/js/vendor/tiny_mce/plugins/codemirror/source.html
View file @
bb0a58ab
...
...
@@ -110,14 +110,15 @@ function start()
}
// Create legend for keyboard shortcuts for find & replace:
var
head
=
parent
.
document
.
querySelectorAll
(
'.mce-foot'
)[
0
],
div
=
parent
.
document
.
createElement
(
'div'
),
td1
=
'<td style="font-size:11px;background:#777;color:#fff;padding:0 4px">'
,
td2
=
'<td style="font-size:11px;padding-right:5px">'
;
div
.
innerHTML
=
'<table cellspacing="0" cellpadding="0" style="border-spacing:4px"><tr>'
+
td1
+
(
isMac
?
'⌘-F'
:
'Ctrl-F</td>'
)
+
td2
+
tinymce
.
translate
(
'Start search'
)
+
'</td>'
+
td1
+
(
isMac
?
'⌘-G'
:
'Ctrl-G'
)
+
'</td>'
+
td2
+
tinymce
.
translate
(
'Find next'
)
+
'</td>'
+
td1
+
(
isMac
?
'⌘-Alt-F'
:
'Shift-Ctrl-F'
)
+
'</td>'
+
td2
+
tinymce
.
translate
(
'Find previous'
)
+
'</td></tr>'
+
'<tr>'
+
td1
+
(
isMac
?
'⌘-Alt-F'
:
'Shift-Ctrl-F'
)
+
'</td>'
+
td2
+
tinymce
.
translate
(
'Replace'
)
+
'</td>'
+
td1
+
(
isMac
?
'Shift-⌘-Alt-F'
:
'Shift-Ctrl-R'
)
+
'</td>'
+
td2
+
tinymce
.
translate
(
'Replace all'
)
+
'</td></tr></table>'
;
div
.
style
.
position
=
'absolute'
;
div
.
style
.
left
=
div
.
style
.
bottom
=
'5px'
;
head
.
appendChild
(
div
);
// Disabled by EDX.
// var head = parent.document.querySelectorAll('.mce-foot')[0],
// div = parent.document.createElement('div'),
// td1 = '
<
td
style
=
"font-size:11px;background:#777;color:#fff;padding:0 4px"
>
',
// td2 = '
<
td
style
=
"font-size:11px;padding-right:5px"
>
';
// div.innerHTML = '
<
table
cellspacing
=
"0"
cellpadding
=
"0"
style
=
"border-spacing:4px"
><
tr
>
' + td1 + (isMac ? '
&
#
8984
;
-
F
' : '
Ctrl
-
F
<
/td>'
)
+ td2 + tinymce.translate
(
'Start search'
)
+ '</
td
>
' + td1 + (isMac ? '
&
#
8984
;
-
G
' : '
Ctrl
-
G
') + '
<
/td>' + td2 + tinymce.translate
(
'Find next'
)
+ '</
td
>
' + td1 + (isMac ? '
&
#
8984
;
-
Alt
-
F
' : '
Shift
-
Ctrl
-
F
') + '
<
/td>' + td2 + tinymce.translate
(
'Find previous'
)
+ '</
td
><
/tr>' + '<tr>' + td1 +
(
isMac
?
'⌘-Alt-F' : 'Shift-Ctrl-F'
)
+ '</
td
>
' + td2 + tinymce.translate('
Replace
') + '
<
/td>' + td1 +
(
isMac
?
'Shift-⌘-Alt-F' : 'Shift-Ctrl-R'
)
+'</
td
>
' + td2 + tinymce.translate('
Replace
all
') + '
<
/td></
tr
><
/table>'
;
// div.style.position = 'absolute';
// div.style.left = div.style.bottom = '5px';
// head.appendChild(div);
// Set CodeMirror cursor to same position as cursor was in TinyMCE:
var
html
=
editor
.
getContent
({
source_view
:
true
});
...
...
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