summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-11-03 16:46:29 +0530
committeradityacp2020-11-03 16:46:29 +0530
commit81f04f1382b1416480ed0bf0e4018afcce4cfef4 (patch)
treeadd26043d9c69cf50553b5eb45e8744618a4b607 /yaksh
parent96c95dcdb543088008d8b202c1ecbb54f0ea1d45 (diff)
downloadonline_test-81f04f1382b1416480ed0bf0e4018afcce4cfef4.tar.gz
online_test-81f04f1382b1416480ed0bf0e4018afcce4cfef4.tar.bz2
online_test-81f04f1382b1416480ed0bf0e4018afcce4cfef4.zip
Fix katex render to allow math inline
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/static/yaksh/js/lesson.js11
-rw-r--r--yaksh/templates/base.html13
-rw-r--r--yaksh/templates/yaksh/show_lesson_quiz.html10
-rw-r--r--yaksh/templates/yaksh/show_video.html2
4 files changed, 30 insertions, 6 deletions
diff --git a/yaksh/static/yaksh/js/lesson.js b/yaksh/static/yaksh/js/lesson.js
index 2cc2e62..586ae18 100644
--- a/yaksh/static/yaksh/js/lesson.js
+++ b/yaksh/static/yaksh/js/lesson.js
@@ -1,13 +1,20 @@
$(document).ready(function() {
- MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
var simplemde = new SimpleMDE({
element: document.getElementById("id_description"),
forceSync: true,
hideIcons: ["preview", "side-by-side", "fullscreen"]
});
simplemde.codemirror.on("change", function() {
- MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
$("#description_body").html(simplemde.markdown(simplemde.value()));
+ renderMathInElement(
+ document.body,
+ {
+ delimiters: [
+ {left: "$$", right: "$$", display: false},
+ {left: "$", right: "$", display: true},
+ ]
+ }
+ );
});
const player = new Plyr('#player');
var timer = $("#vtimer");
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index 2cc607c..4fa12c7 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -52,12 +52,21 @@
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"
- onload="renderMathInElement(document.body);"></script>
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous">
+ </script>
<script>
new WOW().init();
$(document).ready(function() {
+ renderMathInElement(
+ document.body,
+ {
+ delimiters: [
+ {left: "$$", right: "$$", display: false},
+ {left: "$", right: "$", display: true},
+ ]
+ }
+ );
$(".alert").delay(2000).slideUp(200, function() {
$(this).alert('close');
});
diff --git a/yaksh/templates/yaksh/show_lesson_quiz.html b/yaksh/templates/yaksh/show_lesson_quiz.html
index 2bb51ea..82e01bc 100644
--- a/yaksh/templates/yaksh/show_lesson_quiz.html
+++ b/yaksh/templates/yaksh/show_lesson_quiz.html
@@ -1,7 +1,15 @@
{% load custom_filters %}
<script type="text/javascript">
$(document).ready(function() {
- renderMathInElement(document.body);
+ renderMathInElement(
+ document.body,
+ {
+ delimiters: [
+ {left: "$$", right: "$$", display: false},
+ {left: "$", right: "$", display: true},
+ ]
+ }
+ );
});
function user_arranged_options() {
var temp_array = []
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index 6e3cabb..627773d 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -163,7 +163,7 @@
</a>
</div>
<div class="collapse show" id="toc-collapse">
- <div class="card-body" id="toc">
+ <div class="card-body" id="toc" style="max-height: 400px; overflow-y: auto;">
<table class="table table-responsive">
{% for content in toc %}
{% with content.get_toc_text as toc_name %}