ui: add hint to pid input

This commit is contained in:
undefined committed 2021-08-26 23:12:43 +08:00
1 parent 0301de94cf
commit 80f34547da
3 files changed
+19 -1

No files matched your search

@@ -0,0 +1,17 @@
import { NamedPage } from 'vj/misc/Page';
import { InfoDialog } from 'vj/components/dialog';
import tpl from 'vj/utils/tpl';
import i18n from 'vj/utils/i18n';
export default new NamedPage(['problem_create', 'problem_edit', 'problem_import_syzoj'], () => {
$('input[name="pid"]').on('blur', () => {
if (/^[0-9]+$/.test($('input[name="pid"]').val())) {
new InfoDialog({
$body: tpl`
<div class="typo">
<p>${i18n('Problem ID cannot be a pure number. Leave blank if you want to use numberic id.')}</p>
</div>`,
}).open();
}
});
});