luci-base: cbi.js: add client-side hexstring datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
f4c39dd6ff
commit
9dda4c651c
1 changed files with 5 additions and 0 deletions
|
@ -582,6 +582,11 @@ var CBIValidatorPrototype = {
|
|||
return this.apply(subvalidator, undefined, subargs);
|
||||
|
||||
return this.assert(true);
|
||||
},
|
||||
|
||||
hexstring: function() {
|
||||
return this.assert(this.value.match(/^([a-f0-9][a-f0-9]|[A-F0-9][A-F0-9])+$/),
|
||||
_('hexadecimal encoded value'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue