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
c541fb7b
Commit
c541fb7b
authored
Sep 13, 2013
by
jmclaus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments
parent
165a1227
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+22
-6
No files found.
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
View file @
c541fb7b
...
...
@@ -334,8 +334,22 @@ function () {
keydown
:
this
.
videoCaption
.
captionKeyDown
});
this
.
videoCaption
.
automaticScroll
=
true
;
// Enables or disables automatic scrolling of the captions when the
// video is playing. This feature has to be disabled when tabbing
// through them as it interferes with that action. Initially, have this
// flag enabled as we assume mouse use. Then, if the first caption
// (through forward tabbing) or the last caption (through backwards
// tabbing) gets the focus, disable that feature. Renable it if tabbing
// then cycles out of the the captions.
this
.
videoCaption
.
autoScrolling
=
true
;
// Keeps track of where the focus is situated in the array of captions.
// Used to implement the automatic scrolling behavior and decide if the
// outline around a caption has to be hidden or shown on a mouseenter or
// mouseleave.
this
.
videoCaption
.
currentCaptionIndex
=
0
;
// Used to track if the focus is coming from a click or tabbing. This
// has to be known to decide if, when a caption gets the focus, an
// outline has to be drawn (tabbing) or not (mouse click).
this
.
videoCaption
.
isMouseFocus
=
false
;
this
.
videoCaption
.
subtitlesEl
.
prepend
(
$
(
'<li class="spacing">'
).
height
(
this
.
videoCaption
.
topSpacingHeight
()));
...
...
@@ -359,7 +373,7 @@ function () {
var
caption
=
$
(
event
.
target
);
this
.
videoCaption
.
isMouseFocus
=
true
;
caption
.
css
(
'outlineWidth'
,
'0px'
);
this
.
videoCaption
.
auto
maticScroll
=
true
;
this
.
videoCaption
.
auto
Scrolling
=
true
;
}
function
captionClick
(
event
)
{
...
...
@@ -372,7 +386,7 @@ function () {
// If the focus comes from a mouse click, hide the outline and turn on
// automatic scrolling.
if
(
this
.
videoCaption
.
isMouseFocus
)
{
this
.
videoCaption
.
auto
maticScroll
=
true
;
this
.
videoCaption
.
auto
Scrolling
=
true
;
caption
.
css
({
'outlineWidth'
:
'0px'
,
'outlineStyle'
:
'none'
...
...
@@ -389,7 +403,7 @@ function () {
// The second and second to last elements turn automatic scrolling
// off again as it may have been enabled in captionBlur.
if
(
captionIndex
<=
1
||
captionIndex
>=
this
.
videoCaption
.
captions
.
length
-
2
)
{
this
.
videoCaption
.
auto
maticScroll
=
false
;
this
.
videoCaption
.
auto
Scrolling
=
false
;
}
}
}
...
...
@@ -408,7 +422,7 @@ function () {
// captions.
if
(
captionIndex
===
0
||
captionIndex
===
this
.
videoCaption
.
captions
.
length
-
1
)
{
this
.
videoCaption
.
auto
maticScroll
=
true
;
this
.
videoCaption
.
auto
Scrolling
=
true
;
}
}
...
...
@@ -422,7 +436,9 @@ function () {
function
scrollCaption
()
{
var
el
=
this
.
videoCaption
.
subtitlesEl
.
find
(
'.current:first'
);
if
(
!
this
.
videoCaption
.
frozen
&&
el
.
length
&&
this
.
videoCaption
.
automaticScroll
)
{
// Automatic scrolling gets disabled if one of the captions has received
// focus through tabbing.
if
(
!
this
.
videoCaption
.
frozen
&&
el
.
length
&&
this
.
videoCaption
.
autoScrolling
)
{
this
.
videoCaption
.
subtitlesEl
.
scrollTo
(
el
,
{
...
...
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