luci-base: cbi.js: add client-side hexstring datatype validator

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-11-05 11:13:39 +01:00
parent f4c39dd6ff
commit 9dda4c651c

View file

@ -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'));
}
}
};