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
439ca1dd
Commit
439ca1dd
authored
Sep 15, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write setter, toggle uses setter
parent
1625125e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
+12
-7
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/video/display/video_caption.coffee
View file @
439ca1dd
...
...
@@ -130,16 +130,21 @@ class @VideoCaption extends Subview
toggle
:
(
event
)
=>
event
.
preventDefault
()
if
@
el
.
hasClass
(
'closed'
)
$
.
cookie
(
'hide_captions'
,
'false'
,
expires
:
3650
,
path
:
'/'
)
if
@
el
.
hasClass
(
'closed'
)
# Captions are "closed" e.g. turned off
@
hideCaptions
(
false
)
else
# Captions are on
@
hideCaptions
(
true
)
hideCaptions
:
(
hide_captions
)
=>
if
hide_captions
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn on captions'
)
@
el
.
addClass
(
'closed'
)
else
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn off captions'
)
@
el
.
removeClass
(
'closed'
)
@
scrollCaption
()
else
$
.
cookie
(
'hide_captions'
,
'true'
,
expires
:
3650
,
path
:
'/'
)
@
$
(
'.hide-subtitles'
).
attr
(
'title'
,
'Turn on captions'
)
@
el
.
addClass
(
'closed'
)
$
.
cookie
(
'hide_captions'
,
hide_captions
,
expires
:
3650
,
path
:
'/'
)
captionHeight
:
->
if
@
el
.
hasClass
(
'fullscreen'
)
$
(
window
).
height
()
-
@
$
(
'.video-controls'
).
height
()
...
...
common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee
View file @
439ca1dd
class
@
VideoPlayer
extends
Subview
initialize
:
->
console
.
log
(
@
[
'video'
].
hide_captions
)
# Define a missing constant of Youtube API
YT
.
PlayerState
.
UNSTARTED
=
-
1
...
...
@@ -46,6 +45,7 @@ class @VideoPlayer extends Subview
events
:
onReady
:
@
onReady
onStateChange
:
@
onStateChange
@
caption
.
hideCaptions
(
@
[
'video'
].
hide_captions
)
addToolTip
:
->
@
$
(
'.add-fullscreen, .hide-subtitles'
).
qtip
...
...
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