mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix highlighter
This commit is contained in:
1 parent
a5f8f02d8e
commit
015c55f144
4 files changed
+12
-6
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.8.12",
|
"version": "4.8.13",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ const page = new NamedPage('home_preference', async () => {
|
|||||||
.after($el);
|
.after($el);
|
||||||
|
|
||||||
$('#codelang-main-select').on('change', function () {
|
$('#codelang-main-select').on('change', function () {
|
||||||
$('[name="codeLang"]').val(this.value);
|
|
||||||
const options = {};
|
const options = {};
|
||||||
for (const key in window.LANGS) {
|
for (const key in window.LANGS) {
|
||||||
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||||
@@ -103,7 +102,11 @@ const page = new NamedPage('home_preference', async () => {
|
|||||||
if (Object.keys(options).length > 1) {
|
if (Object.keys(options).length > 1) {
|
||||||
setOptions($('#codelang-sub-select'), options);
|
setOptions($('#codelang-sub-select'), options);
|
||||||
$('#codelang-sub-container').show();
|
$('#codelang-sub-container').show();
|
||||||
} else $('#codelang-sub-container').hide();
|
$('[name="codeLang"]').val($('#codelang-sub-container').val());
|
||||||
|
} else {
|
||||||
|
$('#codelang-sub-container').hide();
|
||||||
|
$('[name="codeLang"]').val(this.value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#codelang-sub-select').on('change', function () {
|
$('#codelang-sub-select').on('change', function () {
|
||||||
$('[name="codeLang"]').val(this.value);
|
$('[name="codeLang"]').val(this.value);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit'],
|
|||||||
$('[name="problem-sidebar__categories"]').show();
|
$('[name="problem-sidebar__categories"]').show();
|
||||||
});
|
});
|
||||||
$('#codelang-main-select').on('change', function () {
|
$('#codelang-main-select').on('change', function () {
|
||||||
$('[name="lang"]').val(this.value);
|
|
||||||
const options = {};
|
const options = {};
|
||||||
for (const key in window.LANGS) {
|
for (const key in window.LANGS) {
|
||||||
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||||
@@ -21,7 +20,11 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit'],
|
|||||||
if (Object.keys(options).length > 1) {
|
if (Object.keys(options).length > 1) {
|
||||||
setOptions($('#codelang-sub-select'), options);
|
setOptions($('#codelang-sub-select'), options);
|
||||||
$('#codelang-sub-container').show();
|
$('#codelang-sub-container').show();
|
||||||
} else $('#codelang-sub-container').hide();
|
$('[name="codeLang"]').val($('#codelang-sub-container').val());
|
||||||
|
} else {
|
||||||
|
$('#codelang-sub-container').hide();
|
||||||
|
$('[name="codeLang"]').val(this.value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#codelang-sub-select').on('change', function () {
|
$('#codelang-sub-select').on('change', function () {
|
||||||
$('[name="lang"]').val(this.value);
|
$('[name="lang"]').val(this.value);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<h1 class="section__title">{{ _('Code') }}</h1>
|
<h1 class="section__title">{{ _('Code') }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="section__body">
|
<div class="section__body">
|
||||||
<pre><code class="line-numbers language-{{ model.system.langs[rdoc.lang].highlight }}">{{ rdoc['code'] }}</code></pre>
|
<pre><code class="line-numbers language-{{ model.setting.langs[rdoc.lang].highlight }}">{{ rdoc['code'] }}</code></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in new issue
Block a user