mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: i18n for submission
This commit is contained in:
1 parent
05ec5e4737
commit
6ec215df35
1 file changed
+4
-4
@@ -9,6 +9,7 @@ import delay from 'vj/utils/delay';
|
|||||||
import pjax from 'vj/utils/pjax';
|
import pjax from 'vj/utils/pjax';
|
||||||
import request from 'vj/utils/request';
|
import request from 'vj/utils/request';
|
||||||
import tpl from 'vj/utils/tpl';
|
import tpl from 'vj/utils/tpl';
|
||||||
|
import i18n from 'vj/utils/i18n';
|
||||||
|
|
||||||
class ProblemPageExtender {
|
class ProblemPageExtender {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -213,8 +214,8 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
|||||||
});
|
});
|
||||||
if (cnt) {
|
if (cnt) {
|
||||||
$('.problem-content .typo').append(document.getElementsByClassName('nav__item--round').length
|
$('.problem-content .typo').append(document.getElementsByClassName('nav__item--round').length
|
||||||
? '<input type="submit" disabled class="button rounded primary" value="登录后提交" />'
|
? `<input type="submit" disabled class="button rounded primary" value="${i18n('Submit')}" />`
|
||||||
: '<input type="submit" class="button rounded primary" value="提交" />');
|
: `<input type="submit" class="button rounded primary" value="${i18n('Login to Submit')}" />`);
|
||||||
$('input.objective-input[type!=checkbox]').on('input', (e) => {
|
$('input.objective-input[type!=checkbox]').on('input', (e) => {
|
||||||
ans[e.target.name] = e.target.value;
|
ans[e.target.name] = e.target.value;
|
||||||
});
|
});
|
||||||
@@ -225,12 +226,11 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
|||||||
} else {
|
} else {
|
||||||
ans[e.target.name] = ans[e.target.name].filter((v) => v !== e.target.value);
|
ans[e.target.name] = ans[e.target.name].filter((v) => v !== e.target.value);
|
||||||
}
|
}
|
||||||
console.log(ans);
|
|
||||||
});
|
});
|
||||||
$('input[type="submit"]').on('click', (e) => {
|
$('input[type="submit"]').on('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
request
|
request
|
||||||
.post(`${window.location.href}/submit`, {
|
.post(UiContext.postSubmitUrl, {
|
||||||
lang: '_',
|
lang: '_',
|
||||||
code: yaml.dump(ans),
|
code: yaml.dump(ans),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user