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
9c8af9fe
Commit
9c8af9fe
authored
May 03, 2016
by
Chris Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AC-409 adding lang attribute to closed-captions, transcript, and skip links
parent
ce7d4f03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
+19
-0
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+13
-4
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
View file @
9c8af9fe
...
...
@@ -37,6 +37,19 @@
state
=
jasmine
.
initializePlayer
();
expect
(
$
(
'.video'
)).
toContainElement
(
'.subtitles'
);
});
it
(
'has appropriate lang attributes'
,
function
()
{
state
=
jasmine
.
initializePlayer
();
$
(
'.video .toggle-captions'
).
trigger
(
'click'
);
expect
(
$
(
'.video .subtitles-menu'
)).
toHaveAttrs
({
'lang'
:
'en'
});
expect
(
$
(
'.video .closed-captions'
)).
toHaveAttrs
({
'lang'
:
'en'
});
});
it
(
'add transcript control to video player'
,
function
()
{
state
=
jasmine
.
initializePlayer
();
...
...
@@ -247,6 +260,12 @@
expect
(
state
.
storage
.
setItem
)
.
toHaveBeenCalledWith
(
'language'
,
'de'
);
expect
(
$
(
'.langs-list li.is-active'
).
length
).
toBe
(
1
);
expect
(
$
(
'.subtitles .subtitles-menu'
)).
toHaveAttrs
({
'lang'
:
'de'
});
expect
(
$
(
'.closed-captions'
)).
toHaveAttrs
({
'lang'
:
'de'
});
});
it
(
'when clicking on link with current language'
,
function
()
{
...
...
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
View file @
9c8af9fe
...
...
@@ -108,7 +108,7 @@
var
template
=
[
'<div class="subtitles" role="region" id="transcript-'
+
this
.
state
.
id
+
'">'
,
'<h3 id="transcript-label-'
+
this
.
state
.
id
+
'" class="transcript-title sr"></h3>'
,
'<ol id="transcript-captions" class="subtitles-menu"></ol>'
,
'<ol id="transcript-captions" class="subtitles-menu"
lang="'
+
this
.
state
.
lang
+
'"
></ol>'
,
'</div>'
].
join
(
''
);
...
...
@@ -682,6 +682,12 @@
state
.
el
.
trigger
(
'language_menu:change'
,
[
langCode
]);
self
.
fetchCaption
();
// update the closed-captions lang attribute
self
.
captionDisplayEl
.
attr
(
'lang'
,
langCode
);
// update the transcript lang attribute
self
.
subtitlesMenuEl
.
attr
(
'lang'
,
langCode
);
}
});
},
...
...
@@ -754,10 +760,12 @@
.
text
(
gettext
(
'Video transcript'
));
self
.
subtitlesEl
.
find
(
'.transcript-start'
)
.
text
(
gettext
(
'Start of transcript. Skip to the end.'
));
.
text
(
gettext
(
'Start of transcript. Skip to the end.'
))
.
attr
(
'lang'
,
$
(
'html'
).
attr
(
'lang'
));
self
.
subtitlesEl
.
find
(
'.transcript-end'
)
.
text
(
gettext
(
'End of transcript. Skip to the start.'
));
.
text
(
gettext
(
'End of transcript. Skip to the start.'
))
.
attr
(
'lang'
,
$
(
'html'
).
attr
(
'lang'
));
self
.
container
.
find
(
'.menu-container .language-menu'
)
.
attr
(
'aria-label'
,
gettext
(
'Language: Press the UP arrow key to enter the language menu then use UP and DOWN arrow keys to navigate language options. Press ENTER to change to the selected language.'
));
// jshint ignore:line
...
...
@@ -1111,7 +1119,8 @@
this
.
captionDisplayEl
.
show
()
.
addClass
(
'is-visible'
);
.
addClass
(
'is-visible'
)
.
attr
(
'lang'
,
this
.
state
.
lang
);
this
.
captionControlEl
.
addClass
(
'is-active'
)
...
...
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