mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-25 23:36:24 +00:00
![]() This does a few things, but all affecting the same validator and there would not be much value with separate commits, so just use one. Namely: - reduce code by a lot, mostly by having a explicit ordered if-else chain that avoids the need for some extra checks as further branches can assume that former did not evaluate to true, thus we cans safe the closure that checked invalidity for a range-atom. While this allows entering "useless" ranges like "2-2" it's not clear why that should be a disallowed range, it's perfectly clear about what it represents. - use Number.isNaN to avoid oddities from global isNaN that MDN warns against [0] - give explicit error messages for different failure cases like out-of-range or not-a-number - place error messages under gettext, our translators frequently ask to avoid untranslatable literals. - support the same lists as the backend does, i.e. allow multiple whitespace and comma and semicolon as separators. [0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> |
||
---|---|---|
debian | ||
src | ||
.gitignore | ||
Makefile |