summaryrefslogtreecommitdiffhomepage
path: root/libs/web/htdocs/luci-static/resources/cbi.js
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-04-13 00:33:42 +0000
committerManuel Munz <freifunk@somakoma.de>2011-04-13 00:33:42 +0000
commitbb2d7517eb3d2229331e11aab5c6c900259e0742 (patch)
tree72625b858eb52433a3b87000b895ef872510dbe1 /libs/web/htdocs/luci-static/resources/cbi.js
parent5a1e9354b41155b9604362c9a1ef8d7a899ba2b2 (diff)
luci-firewall: Add support for negations for ip addresses/nets (#218)
Diffstat (limited to 'libs/web/htdocs/luci-static/resources/cbi.js')
-rw-r--r--libs/web/htdocs/luci-static/resources/cbi.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js
index ddafd79180..a8814d451f 100644
--- a/libs/web/htdocs/luci-static/resources/cbi.js
+++ b/libs/web/htdocs/luci-static/resources/cbi.js
@@ -42,6 +42,11 @@ var cbi_validators = {
return cbi_validators.ip4addr(v) || cbi_validators.ip6addr(v);
},
+ 'neg_ipaddr': function(v)
+ {
+ return cbi_validators.ip4addr(v.replace(/^\s*!/, "")) || cbi_validators.ip6addr(v.replace(/^\s*!/, ""));
+ },
+
'ip4addr': function(v)
{
if( v.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)(\/(\d+))?$/) )
@@ -57,6 +62,11 @@ var cbi_validators = {
return false;
},
+ 'neg_ip4addr': function(v)
+ {
+ return cbi_validators.ip4addr(v.replace(/^\s*!/, ""));
+ },
+
'ip6addr': function(v)
{
if( v.match(/^([a-fA-F0-9:.]+)(\/(\d+))?$/) )