ref: refs/heads/backgroud_patches_bnc550934
commit 6d48c5b9c2a07a115594c24a6584b3e2f0516ab9
Author: Josef Reidinger
Date: Fri Nov 13 08:43:54 2009 +0100
improve error messages for invalid fields(bnc#551775)
---
plugins/network/app/views/network/index.html.erb | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/plugins/network/app/views/network/index.html.erb b/plugins/network/app/views/network/index.html.erb
index ce370b6..c7fc8ec 100644
--- a/plugins/network/app/views/network/index.html.erb
+++ b/plugins/network/app/views/network/index.html.erb
@@ -39,6 +39,7 @@
<% end -%>
<% javascript_tag do -%>
+ //TODO move this validations to separate js library
function validIP(ip) {
//use [0-9] to avoid negative values and it is also better prepared to IP6
if (!ip.match(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/))
@@ -93,31 +94,31 @@
//support only prefix as it is not confusing with label
if (!validPrefix(netmask)) {
focus_tabbed("netmask");
- say_bad_mask = "<%= _("Invalid Prefix. The correct one /nn where nn is between 0-32 (CIDR format).") %>"
+ say_bad_mask = "<%= _("Invalid Prefix format. The correct one /nn where nn is between 0-32 (CIDR format).") %>"
alert (say_bad_mask);
return false;
}
if (! validIP($("#default_route")[0].value)) {
focus_tabbed("default_route");
- say_bad_route = "<%= _("Invalid default route. The correct one is nnn.nnn.nnn.nnn for nnn between 0 and 255.") %>"
+ say_bad_route = "<%= _("Invalid default route format. The correct one is nnn.nnn.nnn.nnn for nnn between 0 and 255.") %>"
alert (say_bad_route);
return false;
}
if (!validNameservers($("#nameservers")[0].value)){
focus_tabbed("nameservers");
- say_bad_ns = "<%= _("Name servers is not valid. There must be at least one specified.") %>"
+ say_bad_ns = "<%= _("Name servers are required. There must be at least one specified.") %>"
alert (say_bad_ns);
return false;
}
if (!validHostname($("#name")[0].value)){
focus_tabbed("name");
- say_bad_hostname = "<%= _("Hostname is not valid. It must be specified.") %>"
+ say_bad_hostname = "<%= _("Hostname is required. It must be specified.") %>"
alert (say_bad_hostname);
return false;
}
if (!validDomain($("#domain")[0].value)){
focus_tabbed("domain");
- say_bad_domain = "<%= _("Domain is not valid. It is not supported empty domain.") %>"
+ say_bad_domain = "<%= _("Domain is required. It is not supported empty domain.") %>"
alert (say_bad_domain);
return false;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org