diff --git a/static/moderator.js b/static/moderator.js index 4f832d629253ef2ab3c2599647d930e1910d01c8..494f234571197e26d4a04086cc8b1613fdc3a019 100644 --- a/static/moderator.js +++ b/static/moderator.js @@ -105,18 +105,6 @@ var moderator = { if (confirm('Really 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 d351c1c492ca8e40739f10d9b37a2986e805bbce..ff63a943afc8525a2cc7c5ee5e0784a1a844096f 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -65,6 +65,19 @@ </div> </div> <script> +function hintchapterclick (src) { + $.ajax({ + method: "GET", + url: $(src).data('url'), + data: $(src).serialize(), + success: function(data) + { + alert("Kapitelmarker vorgeschlagen. Danke!"); + $('#hintnewchapter').popover('hide'); + } + }); + return false; +} $(function() { $( "#hintnewchapter" ).popover( { @@ -80,7 +93,7 @@ $(function() { 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" 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>'; + return '<form method="post" data-url="{{ url_for('suggest_chapter', lectureid=lecture.id) }}" onSubmit="return 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>'; } })