summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-11-05 11:13:39 +0100
committerJo-Philipp Wich <jo@mein.io>2018-11-05 11:13:39 +0100
commit9dda4c651c93a32753af1b833f94bd7aefc5f97a (patch)
tree7d4eb0bcc9e1bde27a21656ed04be6b9731be830 /modules/luci-base
parentf4c39dd6ff6f60dc48982d822faa6d9a85c2e4d7 (diff)
luci-base: cbi.js: add client-side hexstring datatype validator
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js5
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 d9b9baf7be..1c2b14df69 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'));
}
}
};