From de9ac5e647622f0e9908bf830a4a962306d350a1 Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 27 Aug 2020 17:25:36 +0530 Subject: Add mathjax support in lesson and module --- yaksh/static/yaksh/js/lesson.js | 9 +++---- yaksh/templates/yaksh/add_lesson.html | 28 ++++++++++--------- yaksh/templates/yaksh/add_module.html | 51 ++++++++++++++++++++--------------- yaksh/templates/yaksh/show_video.html | 6 ++++- yaksh/views.py | 8 +++--- 5 files changed, 58 insertions(+), 44 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js index 55d4846..6eaf6c6 100644 --- a/yaksh/static/yaksh/js/lesson.js +++ b/yaksh/static/yaksh/js/lesson.js @@ -32,13 +32,10 @@ $(document).ready(function(){ }); }); - function preview_text(data){ - var preview_div = $("#preview_text_div"); - if (!preview_div.is(":visible")){ - $("#preview_text_div").toggle(); - } + function preview_text(data) { $("#description_body").empty(); - $("#description_body").append(data); + $("#description_body").html(data); + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } $("#embed").click(function() { diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html index b984db0..4211b1b 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -9,6 +9,8 @@ + {% endblock %} {% block css %} @@ -17,15 +19,15 @@ {% endblock %} {% block content %} -