From 0b433aa1b8aeb9bf6786d5c8bcfd76b6a583befc Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Thu, 31 Aug 2017 01:27:20 +0200 Subject: [PATCH] Made chapter links work without javascript --- templates/lecture.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/lecture.html b/templates/lecture.html index e9e9f79..37ba7ea 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -55,7 +55,7 @@ {% for c in chapters|sort(attribute='time') %} <tr> <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> {% if ismod() %} {{ moderator_editor(['chapters',c.id,'time'],c['time'],true) }} @@ -146,6 +146,10 @@ $(document).ready(function() { }, 500); return false; }); + $("a.chapterlink").click(function () { + videojs('videoplayer').currentTime($(this).data("seek-time")); + return false; + }); }); </script> {% endblock %} -- GitLab