ui: add alert/prompt/confirm helper function (#1018)

This commit is contained in:
undefined authored and GitHub committed 2025-07-19 11:27:37 +01:00
1 parent 2d7979105e
commit d4271b3fbd
12 files changed
+176 -196

No files matched your search

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