diff --git a/static/moderator.js b/static/moderator.js index 5a11898284a664b7e331129bf75a7f912ba77d04..977fc4169758a5ddad4a0ce303a1ebc65534ef0f 100644 --- a/static/moderator.js +++ b/static/moderator.js @@ -93,6 +93,18 @@ var moderator = { if (confirm('Realy delete this?')) { moderator.api.set($(src).data('path'),1,true); } + }, + hintchapterclick: function(src) { + $.ajax({ + method: "GET", + url: $(src).data('url'), + data: $(src).serialize(), + success: function(data) + { + alert("Kapitelmarker vorgeschlagen. Danke!"); + } + }); + return false; } }, permissioneditor: { diff --git a/templates/lecture.html b/templates/lecture.html index ec272032efb77fd381ea69b6a6f954e3a58404c7..98a9b823e6bb9a03d13771db20721fb54f85c211 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -71,10 +71,9 @@ $(function() { var h = zeropad( Math.trunc(timestamp/3600),2); var m = zeropad( Math.trunc((timestamp%3600)/60),2); var s = zeropad( Math.trunc(timestamp%60),2); - var timeasstring = h+':'+m+':'+s - return '<form method="post" action="{{url_for('suggest_chapter', ref=request.url, lectureid=lecture.id)}}"><input placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>' - - } + var timeasstring = h+':'+m+':'+s; + return '<form method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return moderator.editor.hintchapterclick(this);"><input placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>'; + } }) });