mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 09:36:08 +08:00
ui: language selection (#171)
This commit is contained in:
1 parent
2393f105dc
commit
d989df2b85
2 files changed
+5
-9
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.14.9",
|
||||
"version": "4.14.10",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -20,14 +20,10 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit', '
|
||||
if (UiContext.domain.langs && !`,${UiContext.domain.langs},`.includes(`,${key},`)) continue;
|
||||
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||
}
|
||||
if (Object.keys(options).length > 1) {
|
||||
setOptions($('#codelang-sub-select'), options);
|
||||
$('#codelang-sub-container').show();
|
||||
if (update) $('[name="lang"]').val($('#codelang-sub-select').val());
|
||||
} else {
|
||||
$('#codelang-sub-container').hide();
|
||||
if (update) $('[name="lang"]').val(this.value);
|
||||
}
|
||||
setOptions($('#codelang-sub-select'), options);
|
||||
if (Object.keys(options).length > 1) $('#codelang-sub-container').show();
|
||||
else $('#codelang-sub-container').hide();
|
||||
if (update) $('[name="lang"]').val($('#codelang-sub-select').val());
|
||||
}
|
||||
const main = {};
|
||||
for (const key in window.LANGS) {
|
||||
|
||||
Reference in new issue
Block a user