Commit 3081cc01 by Kyle Fiedler

Added styles and js to hide captions

--HG--
branch : kf-captions
parent 06fa36ce
<%inherit file="main.html" /> <%inherit file="main.html" />
<%block name="js_extra">
<!-- TODO: http://docs.jquery.com/Plugins/Validation --> <!-- TODO: http://docs.jquery.com/Plugins/Validation -->
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
${init} ${init}
}); });
</script> </script>
</%block>
<%include file="navigation.html" args="active_page='courseware'" /> <%include file="navigation.html" args="active_page='courseware'" />
......
section.course-content { section.course-content {
div.video-subtitles {
position: relative;
div.video-wrapper {
float: left;
width: flex-grid(6, 9);
margin-right: flex-gutter(9);
div.video-player {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
object {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
div.video-wrapper { iframe#html5_player {
float: left; border: none;
width: flex-grid(6, 9); display: none;
margin-right: flex-gutter(9); position: absolute;
top: 0;
div.video-player { left: 0;
position: relative; width: 100%;
padding-bottom: 56.25%; height: 100%;
padding-top: 30px; }
height: 0;
overflow: hidden;
object {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
iframe#html5_player {
border: none;
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
} }
}
// ul { // ul {
// float: left; // float: left;
// li { // li {
// margin-top: 5px; // margin-top: 5px;
// display: inline-block; // display: inline-block;
// cursor: pointer; // cursor: pointer;
// border: 0; // border: 0;
// padding: 0; // padding: 0;
// div { // div {
// &:empty { // &:empty {
// display: none; // display: none;
// } // }
// } // }
// } // }
// } // }
section.video-controls { section.video-controls {
@extend .clearfix;
background: #333;
border: 1px solid #000;
color: #ccc;
div#slider {
@extend .clearfix; @extend .clearfix;
@include border-radius(0); background: #333;
@include box-shadow(inset 0 1px 0 #eee, 0 1px 0 #555); border: 1px solid #000;
background: #c2c2c2; color: #ccc;
border: none;
border-bottom: 1px solid #000; div#slider {
height: 14px; @extend .clearfix;
@include border-radius(0);
a.ui-slider-handle { @include box-shadow(inset 0 1px 0 #eee, 0 1px 0 #555);
@include border-radius(20px); background: #c2c2c2;
@include box-shadow(inset 0 1px 0 lighten($mit-red, 10%)); border: none;
background: $mit-red url(/static/images/slider-handle.png) center center no-repeat; border-bottom: 1px solid #000;
border: 0; height: 14px;
border: 1px solid darken($mit-red, 20%);
cursor: pointer; a.ui-slider-handle {
height: 20px; @include border-radius(20px);
margin-left: -10px; @include box-shadow(inset 0 1px 0 lighten($mit-red, 10%));
top: -4px; background: $mit-red url(/static/images/slider-handle.png) center center no-repeat;
width: 20px; border: 0;
border: 1px solid darken($mit-red, 20%);
&:focus { cursor: pointer;
outline: none; height: 20px;
margin-left: -10px;
top: -4px;
width: 20px;
&:focus {
outline: none;
}
} }
} }
}
ul.vcr { ul.vcr {
float: left;
margin-right: lh();
li {
float: left; float: left;
margin-bottom: 0; margin-right: lh();
a {
@include box-shadow(1px 0 0 #555);
border-right: 1px solid #000;
display: block;
cursor: pointer;
height: 14px;
padding: lh(.75) lh();
text-indent: -9999px;
width: 14px;
&.play { li {
background: url('/static/images/play-icon.png') center center no-repeat; float: left;
margin-bottom: 0;
&:hover { a {
background-color: #444; @include box-shadow(1px 0 0 #555);
border-right: 1px solid #000;
display: block;
cursor: pointer;
height: 14px;
padding: lh(.75) lh();
text-indent: -9999px;
width: 14px;
&.play {
background: url('/static/images/play-icon.png') center center no-repeat;
&:hover {
background-color: #444;
}
} }
}
&.pause { &.pause {
background: url('/static/images/pause-icon.png') center center no-repeat; background: url('/static/images/pause-icon.png') center center no-repeat;
&:hover { &:hover {
background-color: #444; background-color: #444;
}
} }
}
div#vidtime {
padding-left: lh();
font-weight: bold;
line-height: 46px; //height of play pause buttons
-webkit-font-smoothing: antialiased;
} }
} }
} }
}
div#vidtime {
float: left;
font-weight: bold;
line-height: 46px; //height of play pause buttons
-webkit-font-smoothing: antialiased;
}
div.speeds {
float: right;
line-height: 46px; //height of play pause buttons
margin-right: lh();
-webkit-font-smoothing: antialiased;
div#video_speeds { div.secondary-controls {
@include inline-block(); float: right;
font-weight: bold;
div.speeds {
float: left;
line-height: 46px; //height of play pause buttons
padding-right: lh();
margin-right: 0;
-webkit-font-smoothing: antialiased;
@include box-shadow(1px 0 0 #555);
border-right: 1px solid #000;
div#video_speeds {
@include inline-block();
font-weight: bold;
span {
@include inline-block();
cursor: pointer;
margin-bottom: 0;
&:hover {
color: $mit-red;
}
}
}
}
span { a.hide-subtitles {
@include inline-block(); float: left;
cursor: pointer; display: block;
margin-bottom: 0; padding-right: lh(.5);
margin-left: 0;
color: #797979;
padding-left: 50px;
line-height: 46px; //height of play pause buttons
font-weight: 800;
background: url('/static/images/cc.png') 16px center no-repeat;
-webkit-font-smoothing: antialiased;
&:hover { &:hover {
color: $mit-red; color: #fff;
text-decoration: none;
background-color: #444;
} }
} }
} }
} }
} }
}
ol.subtitles { ol.subtitles {
float: left; float: left;
width: flex-grid(3, 9); width: flex-grid(3, 9);
height: 530px; height: 530px;
overflow: hidden; overflow: hidden;
li {
margin-bottom: 0px;
cursor: pointer;
border: 0;
padding: 0;
color: #666;
&.current {
background-color: #f3f3f3;
color: #333;
}
&:hover { li {
color: $mit-red; margin-bottom: 0px;
cursor: pointer;
border: 0;
padding: 0;
color: #666;
&.current {
background-color: #f3f3f3;
color: #333;
}
&:hover {
color: $mit-red;
}
div {
margin-bottom: 8px;
}
div:empty {
margin-bottom: 0px;
}
} }
}
&.closed {
@extend .trans;
div { div.video-wrapper {
margin-bottom: 8px; width: flex-grid(9,9);
} }
div:empty { ol.subtitles {
margin-bottom: 0px; width: 0px;
height: 0;
} }
} }
} }
} }
% if name is not UNDEFINED and name != None: % if name is not UNDEFINED and name != None:
<h1> ${name} </h1> <h1> ${name} </h1>
% endif % endif
<div class="video-wrapper">
<div class="video-player"> <div class="video-subtitles">
<div id="ytapiplayer">
<div class="video-wrapper">
<div class="video-player">
<div id="ytapiplayer">
</div>
<iframe id="html5_player" type="text/html" frameborder="0">
</iframe>
</div> </div>
<iframe id="html5_player" type="text/html" frameborder="0"> <section class="video-controls">
</iframe> <div id="slider"></div>
</div>
<section class="video-controls"> <section>
<div id="slider"></div> <ul class="vcr">
<li><a id="video_control" class="pause">Pause</a></li>
<section> <li>
<ul class="vcr"> <div id="vidtime">0:00/0:00</div>
<li><a id="video_control" class="pause">Pause</a></li> </li>
</ul> </ul>
<div id="vidtime">0:00/0:00</div>
<div class="speeds"> <div class="secondary-controls">
Speed: <div id="video_speeds"></div> <div class="speeds">
</div> Speed: <div id="video_speeds"></div>
</div>
<a href="#" class="hide-subtitles">on</a>
</div>
</section>
</section> </section>
</section> </div>
<ol class="subtitles">
<!-- <li id="stt_n5"><div id="std_n7" onclick="title_seek(-7);"></div></li> -->
<li id="stt_n4"><div id="std_n6" onclick="title_seek(-6);"></div></li>
<li id="stt_n4"><div id="std_n5" onclick="title_seek(-5);"></div></li>
<li id="stt_n4"><div id="std_n4" onclick="title_seek(-4);"></div></li>
<li id="stt_n3"><div id="std_n3" onclick="title_seek(-3);"></div></li>
<li id="stt_n2"><div id="std_n2" onclick="title_seek(-2);"></div></li>
<li id="stt_n1"><div id="std_n1" onclick="title_seek(-1);"></div></li>
<li id="stt_0 "class="current"><div id="std_0" onclick="title_seek(0);"></div></li>
<li id="stt_p1"><div id="std_p1" onclick="title_seek( 1);"></div></li>
<li id="stt_p2"><div id="std_p2" onclick="title_seek( 2);"></div></li>
<li id="stt_p3"><div id="std_p3" onclick="title_seek( 3);"></div></li>
<li id="stt_p4"><div id="std_p4" onclick="title_seek( 4);"></div></li>
<li id="stt_p5"><div id="std_p5" onclick="title_seek( 5);"></div></li>
<li id="stt_p6"><div id="std_p7" onclick="title_seek( 6);"></div></li>
<li id="stt_p6"><div id="std_p7" onclick="title_seek( 7);"></div></li>
<!-- <li id="stt_p6"><div id="std_p7" onclick="title_seek( 8);"></div></li> -->
</ol>
</div> </div>
<ol class="subtitles"> <%block name="js_extra">
<!-- <li id="stt_n5"><div id="std_n7" onclick="title_seek(-7);"></div></li> --> <script type="text/javascript" charset="utf-8">
<li id="stt_n4"><div id="std_n6" onclick="title_seek(-6);"></div></li> $(function() {
<li id="stt_n4"><div id="std_n5" onclick="title_seek(-5);"></div></li> $('.hide-subtitles').click(function() {
<li id="stt_n4"><div id="std_n4" onclick="title_seek(-4);"></div></li> $('div.video-subtitles').toggleClass('closed');
<li id="stt_n3"><div id="std_n3" onclick="title_seek(-3);"></div></li>
<li id="stt_n2"><div id="std_n2" onclick="title_seek(-2);"></div></li> var link_text = $('.hide-subtitles').text();
<li id="stt_n1"><div id="std_n1" onclick="title_seek(-1);"></div></li> $(this).text((link_text == 'on') ? 'off' : 'on');
<li id="stt_0 "class="current"><div id="std_0" onclick="title_seek(0);"></div></li> return false;
<li id="stt_p1"><div id="std_p1" onclick="title_seek( 1);"></div></li> });
<li id="stt_p2"><div id="std_p2" onclick="title_seek( 2);"></div></li> });
<li id="stt_p3"><div id="std_p3" onclick="title_seek( 3);"></div></li> </script>
<li id="stt_p4"><div id="std_p4" onclick="title_seek( 4);"></div></li> </%block>
<li id="stt_p5"><div id="std_p5" onclick="title_seek( 5);"></div></li>
<li id="stt_p6"><div id="std_p7" onclick="title_seek( 6);"></div></li>
<li id="stt_p6"><div id="std_p7" onclick="title_seek( 7);"></div></li>
<!-- <li id="stt_p6"><div id="std_p7" onclick="title_seek( 8);"></div></li> -->
</ol>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment