Change mathjax config file name
This commit is contained in:
parent
51a8400fa5
commit
3df9b6ab79
16 changed files with 15 additions and 41 deletions
|
@ -96,7 +96,7 @@ class Command(BaseCommand):
|
||||||
.replace("'//", "'https://")
|
.replace("'//", "'https://")
|
||||||
)
|
)
|
||||||
maker.title = problem_name
|
maker.title = problem_name
|
||||||
for file in ("style.css", "pygment-github.css", "mathjax_config.js"):
|
for file in ("style.css", "pygment-github.css", "mathjax3_config.js"):
|
||||||
maker.load(file, os.path.join(settings.DMOJ_RESOURCES, file))
|
maker.load(file, os.path.join(settings.DMOJ_RESOURCES, file))
|
||||||
maker.make(debug=True)
|
maker.make(debug=True)
|
||||||
if not maker.success:
|
if not maker.success:
|
||||||
|
|
|
@ -394,7 +394,7 @@ class ProblemPdfView(ProblemMixin, SingleObjectMixin, View):
|
||||||
maker.title = problem_name
|
maker.title = problem_name
|
||||||
assets = ["style.css", "pygment-github.css"]
|
assets = ["style.css", "pygment-github.css"]
|
||||||
if maker.math_engine == "jax":
|
if maker.math_engine == "jax":
|
||||||
assets.append("mathjax_config.js")
|
assets.append("mathjax3_config.js")
|
||||||
for file in assets:
|
for file in assets:
|
||||||
maker.load(file, os.path.join(settings.DMOJ_RESOURCES, file))
|
maker.load(file, os.path.join(settings.DMOJ_RESOURCES, file))
|
||||||
maker.make()
|
maker.make()
|
||||||
|
|
|
@ -59,7 +59,7 @@ else:
|
||||||
class MathJaxPagedownWidget(PagedownWidget):
|
class MathJaxPagedownWidget(PagedownWidget):
|
||||||
class Media:
|
class Media:
|
||||||
js = [
|
js = [
|
||||||
"mathjax_config.js",
|
"mathjax3_config.js",
|
||||||
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js",
|
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js",
|
||||||
"pagedown_math.js",
|
"pagedown_math.js",
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{% block title %} {{_('Chat Box')}} {% endblock %}
|
{% block title %} {{_('Chat Box')}} {% endblock %}
|
||||||
{% block js_media %}
|
{% block js_media %}
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ static('mathjax_config.js') }}"></script>
|
<script type="text/javascript" src="{{ static('mathjax3_config.js') }}"></script>
|
||||||
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
||||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||||
<script type="module" src="https://unpkg.com/emoji-picker-element@1"></script>
|
<script type="module" src="https://unpkg.com/emoji-picker-element@1"></script>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
if (!("MathJax" in window)) {
|
if (!("MathJax" in window)) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '{{ static('mathjax_config.js') }}',
|
url: '{{ static('mathjax3_config.js') }}',
|
||||||
dataType: "script",
|
dataType: "script",
|
||||||
cache: true,
|
cache: true,
|
||||||
success: function () {
|
success: function () {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -76,31 +76,5 @@
|
||||||
{% block bodyend %}
|
{% block bodyend %}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
{% include "mathjax-load.html" %}
|
{% include "mathjax-load.html" %}
|
||||||
<script>
|
|
||||||
// TODO: remove this
|
|
||||||
window.MathJax = {
|
|
||||||
options: {
|
|
||||||
ignoreHtmlClass: 'tex2jax_ignore',
|
|
||||||
processHtmlClass: 'tex2jax_process',
|
|
||||||
renderActions: {
|
|
||||||
find: [10, function (doc) {
|
|
||||||
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
|
|
||||||
const display = !!node.type.match(/; *mode=display/);
|
|
||||||
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
|
|
||||||
const text = document.createTextNode('');
|
|
||||||
const sibling = node.previousElementSibling;
|
|
||||||
node.parentNode.replaceChild(text, node);
|
|
||||||
math.start = {node: text, delim: '', n: 0};
|
|
||||||
math.end = {node: text, delim: '', n: 0};
|
|
||||||
doc.math.push(math);
|
|
||||||
if (sibling && sibling.matches('.MathJax_Preview')) {
|
|
||||||
sibling.parentNode.removeChild(sibling);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, '']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,2 +1,2 @@
|
||||||
<script type="text/javascript" src="{{ static('mathjax_config.js') }}"></script>
|
<script type="text/javascript" src="{{ static('mathjax3_config.js') }}"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -93,8 +93,8 @@
|
||||||
{{ description|markdown|reference|absolutify(url)|str|safe }}
|
{{ description|markdown|reference|absolutify(url)|str|safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ static('mathjax_config.js') }}"></script>
|
<script type="text/javascript" src="{{ static('mathjax3_config.js') }}"></script>
|
||||||
<script type="text/javascript" src="mathjax_config.js"></script>
|
<script type="text/javascript" src="mathjax3_config.js"></script>
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML"></script>
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
MathJax.Hub.Register.StartupHook("End", function () {
|
MathJax.Hub.Register.StartupHook("End", function () {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -1,4 +1,4 @@
|
||||||
{{ preview_data|markdown|reference|str|safe }}
|
{{ preview_data|markdown|reference|str|safe }}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
<div data-config="{{ static('mathjax_config.js') }}" class="require-mathjax-support"></div>
|
<div data-config="{{ static('mathjax3_config.js') }}" class="require-mathjax-support"></div>
|
||||||
{% endif %}
|
{% endif %}
|
Loading…
Add table
Reference in a new issue