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
be0e0b8e
Commit
be0e0b8e
authored
Nov 03, 2016
by
Albert St. Aubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to correct a11y issues with CodeMirror
TNL-5281
parent
5afab424
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
cms/static/js/views/settings/main.js
+5
-3
cms/templates/settings.html
+3
-0
common/lib/capa/capa/templates/codeinput.html
+3
-1
common/test/acceptance/tests/studio/test_studio_settings.py
+0
-9
No files found.
cms/static/js/views/settings/main.js
View file @
be0e0b8e
...
@@ -337,7 +337,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
...
@@ -337,7 +337,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
},
},
codeMirrors
:
{},
codeMirrors
:
{},
codeMirrorize
:
function
(
e
,
forcedTarget
)
{
codeMirrorize
:
function
(
e
,
forcedTarget
)
{
var
thisTarget
;
var
thisTarget
,
cachethis
,
field
,
cmTextArea
;
if
(
forcedTarget
)
{
if
(
forcedTarget
)
{
thisTarget
=
forcedTarget
;
thisTarget
=
forcedTarget
;
thisTarget
.
id
=
$
(
thisTarget
).
attr
(
'id'
);
thisTarget
.
id
=
$
(
thisTarget
).
attr
(
'id'
);
...
@@ -354,8 +354,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
...
@@ -354,8 +354,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
}
}
if
(
!
this
.
codeMirrors
[
thisTarget
.
id
])
{
if
(
!
this
.
codeMirrors
[
thisTarget
.
id
])
{
var
cachethis
=
this
;
cachethis
=
this
;
var
field
=
this
.
selectorToField
[
thisTarget
.
id
];
field
=
this
.
selectorToField
[
thisTarget
.
id
];
this
.
codeMirrors
[
thisTarget
.
id
]
=
CodeMirror
.
fromTextArea
(
thisTarget
,
{
this
.
codeMirrors
[
thisTarget
.
id
]
=
CodeMirror
.
fromTextArea
(
thisTarget
,
{
mode
:
'text/html'
,
lineNumbers
:
true
,
lineWrapping
:
true
});
mode
:
'text/html'
,
lineNumbers
:
true
,
lineWrapping
:
true
});
this
.
codeMirrors
[
thisTarget
.
id
].
on
(
'change'
,
function
(
mirror
)
{
this
.
codeMirrors
[
thisTarget
.
id
].
on
(
'change'
,
function
(
mirror
)
{
...
@@ -366,6 +366,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
...
@@ -366,6 +366,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
cachethis
.
setAndValidate
(
field
,
newVal
);
cachethis
.
setAndValidate
(
field
,
newVal
);
}
}
});
});
cmTextArea
=
this
.
codeMirrors
[
thisTarget
.
id
].
getInputField
();
cmTextArea
.
setAttribute
(
'id'
,
'course-overview-cm-textarea'
);
}
}
},
},
...
...
cms/templates/settings.html
View file @
be0e0b8e
...
@@ -333,6 +333,9 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url | n, js_escaped_string}'
...
@@ -333,6 +333,9 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url | n, js_escaped_string}'
<li
class=
"field text"
id=
"field-course-overview"
>
<li
class=
"field text"
id=
"field-course-overview"
>
<label
for=
"course-overview"
>
${_("Course Overview")}
</label>
<label
for=
"course-overview"
>
${_("Course Overview")}
</label>
<textarea
class=
"tinymce text-editor"
id=
"course-overview"
></textarea>
<textarea
class=
"tinymce text-editor"
id=
"course-overview"
></textarea>
<label
class=
"sr"
for=
"course-overview-cm-textarea"
>
${_('HTML Code Editor')}
</label>
<span
class=
"tip tip-stacked"
>
${
<span
class=
"tip tip-stacked"
>
${
Text(_("Introductions, prerequisites, FAQs that are used on {a_link_start}your course summary page{a_link_end} (formatted in HTML)")).format(
Text(_("Introductions, prerequisites, FAQs that are used on {a_link_start}your course summary page{a_link_end} (formatted in HTML)")).format(
a_link_start=HTML("
<a
class=
'link-courseURL'
rel=
'external'
href=
'{lms_link_for_about_page}'
>
").format(lms_link_for_about_page=lms_link_for_about_page),
a_link_start=HTML("
<a
class=
'link-courseURL'
rel=
'external'
href=
'{lms_link_for_about_page}'
>
").format(lms_link_for_about_page=lms_link_for_about_page),
...
...
common/lib/capa/capa/templates/codeinput.html
View file @
be0e0b8e
...
@@ -5,7 +5,9 @@ from openedx.core.djangolib.markup import HTML
...
@@ -5,7 +5,9 @@ from openedx.core.djangolib.markup import HTML
%
>
%
>
<div
id=
"textbox_${id}"
class=
"capa_inputtype textbox cminput"
>
<div
id=
"textbox_${id}"
class=
"capa_inputtype textbox cminput"
>
% if response_data['label']:
% if response_data['label']:
<label
class=
"problem-group-label"
for=
"cm-textarea-${id}"
>
${response_data['label']}
</label>
<label
class=
"problem-group-label"
for=
"cm-textarea-${id}"
>
${response_data['label']}
</label>
% else:
<label
class=
"sr problem-group-label"
for=
"cm-textarea-${id}"
>
${_('Code Editor')}
</label>
% endif
% endif
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"input_${id}"
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"input_${id}"
aria-label=
"${aria_label}"
aria-label=
"${aria_label}"
...
...
common/test/acceptance/tests/studio/test_studio_settings.py
View file @
be0e0b8e
...
@@ -502,15 +502,6 @@ class StudioSettingsA11yTest(StudioCourseTest):
...
@@ -502,15 +502,6 @@ class StudioSettingsA11yTest(StudioCourseTest):
],
],
})
})
# TODO: Figure out how to get CodeMirror to pass accessibility testing
# We use the CodeMirror Javascript library to
# add code editing to a number of textarea elements
# on this page. CodeMirror generates markup that does
# not pass our accessibility testing rules.
self
.
settings_page
.
a11y_audit
.
config
.
set_scope
(
exclude
=
[
'.CodeMirror textarea'
]
# TODO: TNL-5831
)
self
.
settings_page
.
a11y_audit
.
check_for_accessibility_errors
()
self
.
settings_page
.
a11y_audit
.
check_for_accessibility_errors
()
...
...
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