Fix some css bugs:

This commit is contained in:
cuom1999 2022-11-25 01:50:32 -06:00
parent 7a74f940fa
commit 756e4749c9
5 changed files with 10 additions and 13 deletions

View file

@ -49,10 +49,6 @@ DMOJ_PP_BONUS_FUNCTION = lambda n: 300 * (1 - 0.997**n) # noqa: E731
NODEJS = "/usr/bin/node" NODEJS = "/usr/bin/node"
EXIFTOOL = "/usr/bin/exiftool" EXIFTOOL = "/usr/bin/exiftool"
ACE_URL = "//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3" ACE_URL = "//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3"
SELECT2_JS_URL = "//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"
DEFAULT_SELECT2_CSS = (
"//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css"
)
DMOJ_CAMO_URL = None DMOJ_CAMO_URL = None
DMOJ_CAMO_KEY = None DMOJ_CAMO_KEY = None

View file

@ -60,7 +60,7 @@ else:
class Media: class Media:
js = [ js = [
"mathjax_config.js", "mathjax_config.js",
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML", "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js",
"pagedown_math.js", "pagedown_math.js",
] ]

View file

@ -47,9 +47,9 @@ from django.forms.models import ModelChoiceIterator
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.http import urlencode from django.utils.http import urlencode
DEFAULT_SELECT2_JS = "//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js" DEFAULT_SELECT2_JS = settings.STATIC_URL + "/libs/select2/select2.js"
DEFAULT_SELECT2_CSS = ( DEFAULT_SELECT2_CSS = settings.STATIC_URL + (
"//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" "/libs/select2/select2.min.css"
) )
__all__ = [ __all__ = [
@ -106,8 +106,8 @@ class Select2Mixin(object):
https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property
""" """
return forms.Media( return forms.Media(
js=[settings.SELECT2_JS_URL, "django_select2.js"], js=[DEFAULT_SELECT2_JS, "django_select2.js"],
css={"screen": [settings.SELECT2_CSS_URL]}, css={"screen": [DEFAULT_SELECT2_CSS]},
) )
@ -117,10 +117,10 @@ class AdminSelect2Mixin(Select2Mixin):
return forms.Media( return forms.Media(
js=[ js=[
"admin/js/jquery.init.js", "admin/js/jquery.init.js",
settings.SELECT2_JS_URL, DEFAULT_SELECT2_JS,
"django_select2.js", "django_select2.js",
], ],
css={"screen": [settings.SELECT2_CSS_URL]}, css={"screen": [DEFAULT_SELECT2_CSS]},
) )

View file

@ -14,7 +14,7 @@
success: function () { success: function () {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config=TeX-AMS_HTML', url: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js',
dataType: "script", dataType: "script",
cache: true, cache: true,
success: function () { success: function () {

View file

@ -145,6 +145,7 @@
$('.middle-right-content').html(reload_content.first().html()); $('.middle-right-content').html(reload_content.first().html());
MathJax.typeset($('.middle-right-content')[0]); MathJax.typeset($('.middle-right-content')[0]);
onWindowReady(); onWindowReady();
$('.xdsoft_datetimepicker').hide();
} }
else { else {
window.location.href = url; window.location.href = url;