Commit 0b433aa1 authored by Julian Rother's avatar Julian Rother
Browse files

Made chapter links work without javascript

parent ec92e4d7
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
{% for c in chapters|sort(attribute='time') %} {% for c in chapters|sort(attribute='time') %}
<tr> <tr>
<td> <td>
<a href="javascript:videojs('videoplayer').currentTime({{c['time']}})">{{ '%02d:%02d:%02d'|format( c['time']//3600, (c['time']//60)%60, c['time']%60) }}</a> <a class="chapterlink" href="{{url_for('lecture', course=course.handle, id=lecture.id, t=c['time'])}}" data-seek-time="{{c['time']}}">{{ '%02d:%02d:%02d'|format( c['time']//3600, (c['time']//60)%60, c['time']%60) }}</a>
<br> <br>
{% if ismod() %} {% if ismod() %}
{{ moderator_editor(['chapters',c.id,'time'],c['time'],true) }} {{ moderator_editor(['chapters',c.id,'time'],c['time'],true) }}
...@@ -146,6 +146,10 @@ $(document).ready(function() { ...@@ -146,6 +146,10 @@ $(document).ready(function() {
}, 500); }, 500);
return false; return false;
}); });
$("a.chapterlink").click(function () {
videojs('videoplayer').currentTime($(this).data("seek-time"));
return false;
});
}); });
</script> </script>
{% endblock %} {% endblock %}
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