From 06747caf41af01f35a8ac986b200774b008d4bed Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 12 Nov 2020 17:33:44 +0530 Subject: Change templates and js - Fix issue onlick toc jump to player time - Use bootstrap modal instead of jquery dialog for responsive interface - Disallow empty question submission for lesson quiz --- yaksh/static/yaksh/js/show_toc.js | 11 ++++------- yaksh/templates/base.html | 1 - yaksh/templates/yaksh/course_modules.html | 2 +- yaksh/templates/yaksh/show_lesson_quiz.html | 8 ++++---- yaksh/templates/yaksh/show_video.html | 9 +++++++-- 5 files changed, 16 insertions(+), 15 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/js/show_toc.js b/yaksh/static/yaksh/js/show_toc.js index 55e9236..be08e78 100644 --- a/yaksh/static/yaksh/js/show_toc.js +++ b/yaksh/static/yaksh/js/show_toc.js @@ -118,11 +118,8 @@ function unlock_screen() { } function show_question(data) { - $("#dialog").html(data); - $("#dialog").dialog({ - width: 800, - height: 500, - }); + $("#myModal").modal({backdrop: 'static', keyboard: false}); + $("#lesson_quiz_question").html(data) $("#submit-quiz-form").submit(function(e) { e.preventDefault(); lock_screen(); @@ -135,7 +132,7 @@ function show_question(data) { function select_toc(element) { var toc_id = element.getAttribute("data-toc"); var content_type = element.getAttribute("data-toc-type"); - var toc_time = $("#toc_time_"+toc_id).val(); + var toc_time = $("#toc_time_"+toc_id).html().trim(); player.currentTime = get_time_in_seconds(toc_time); if (content_type == 1) { show_topic($("#toc_desc_"+toc_id).val(), true); @@ -199,8 +196,8 @@ function ajax_call(url, method, data, csrf, screen_lock=true) { show_question(msg.data); } if (msg.message) { + $("#myModal").modal('hide'); if (msg.success) { - $("#dialog").dialog("close"); show_message(msg.message, "success"); } else { diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 90a6299..a946c12 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -47,7 +47,6 @@ - diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html index b808562..2ac1962 100644 --- a/yaksh/templates/yaksh/course_modules.html +++ b/yaksh/templates/yaksh/course_modules.html @@ -7,7 +7,7 @@