Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
837219f7
Commit
837219f7
authored
6 years ago
by
noraiz-anwar
Committed by
Noraiz Anwar
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add aria-label in video caption control
parent
03b83ed6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
+22
-1
22 additions, 1 deletion
...n/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+10
-4
10 additions, 4 deletions
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
with
32 additions
and
5 deletions
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
+
22
−
1
View file @
837219f7
...
...
@@ -63,7 +63,13 @@
state
=
jasmine
.
initializePlayer
();
$captionControl
=
$
(
'
.toggle-transcript
'
);
expect
(
$captionControl
).
toHaveAttrs
({
'
aria-disabled
'
:
'
false
'
'
aria-disabled
'
:
'
false
'
,
'
aria-label
'
:
'
Turn off transcripts
'
});
$captionControl
.
click
();
expect
(
$captionControl
).
toHaveAttrs
({
'
aria-disabled
'
:
'
false
'
,
'
aria-label
'
:
'
Turn on transcripts
'
});
});
...
...
@@ -73,6 +79,21 @@
expect
(
$
(
'
.video
'
)).
toContainElement
(
'
.closed-captions
'
);
});
it
(
'
add ARIA attributes to caption control
'
,
function
()
{
var
$toggleCaption
;
state
=
jasmine
.
initializePlayer
();
$toggleCaption
=
$
(
'
.toggle-captions
'
);
expect
(
$toggleCaption
).
toHaveAttrs
({
'
aria-disabled
'
:
'
false
'
,
'
aria-label
'
:
'
Turn on closed captioning
'
});
$toggleCaption
.
click
();
expect
(
$toggleCaption
).
toHaveAttrs
({
'
aria-disabled
'
:
'
false
'
,
'
aria-label
'
:
'
Hide closed captions
'
});
});
it
(
'
fetch the transcript in HTML5 mode
'
,
function
(
done
)
{
var
transcriptURL
=
'
/transcript/translation/en
'
,
transcriptCall
;
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+
10
−
4
View file @
837219f7
...
...
@@ -1180,6 +1180,7 @@
},
showClosedCaptions
:
function
()
{
var
text
=
gettext
(
'
Hide closed captions
'
);
this
.
state
.
el
.
addClass
(
'
has-captions
'
);
this
.
captionDisplayEl
...
...
@@ -1189,7 +1190,8 @@
this
.
captionControlEl
.
addClass
(
'
is-active
'
)
.
attr
(
'
title
'
,
gettext
(
'
Hide closed captions
'
));
.
attr
(
'
title
'
,
text
)
.
attr
(
'
aria-label
'
,
text
);
if
(
this
.
subtitlesEl
.
find
(
'
.current
'
).
text
())
{
this
.
captionDisplayEl
...
...
@@ -1203,6 +1205,7 @@
},
hideClosedCaptions
:
function
()
{
var
text
=
gettext
(
'
Turn on closed captioning
'
);
this
.
state
.
el
.
removeClass
(
'
has-captions
'
);
this
.
captionDisplayEl
...
...
@@ -1211,7 +1214,8 @@
this
.
captionControlEl
.
removeClass
(
'
is-active
'
)
.
attr
(
'
title
'
,
gettext
(
'
Turn on closed captioning
'
));
.
attr
(
'
title
'
,
text
)
.
attr
(
'
aria-label
'
,
text
);
this
.
state
.
el
.
trigger
(
'
captions:hide
'
);
},
...
...
@@ -1266,7 +1270,8 @@
transcriptControlEl
.
removeClass
(
'
is-active
'
)
.
attr
(
'
title
'
,
gettext
(
text
));
.
attr
(
'
title
'
,
gettext
(
text
))
.
attr
(
'
aria-label
'
,
text
);
}
else
{
state
.
captionsHidden
=
false
;
state
.
el
.
removeClass
(
'
closed
'
);
...
...
@@ -1278,7 +1283,8 @@
transcriptControlEl
.
addClass
(
'
is-active
'
)
.
attr
(
'
title
'
,
gettext
(
text
));
.
attr
(
'
title
'
,
gettext
(
text
))
.
attr
(
'
aria-label
'
,
text
);
}
if
(
state
.
resizer
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment