diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-11-05 11:13:39 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-11-05 11:13:39 +0100 |
commit | 9dda4c651c93a32753af1b833f94bd7aefc5f97a (patch) | |
tree | 7d4eb0bcc9e1bde27a21656ed04be6b9731be830 /modules | |
parent | f4c39dd6ff6f60dc48982d822faa6d9a85c2e4d7 (diff) |
luci-base: cbi.js: add client-side hexstring datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index d9b9baf7b..1c2b14df6 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -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')); } } }; |