export from svn

This commit is contained in:
Serghey Rodin 2011-06-14 00:22:25 +03:00
commit 641ed97fdd
340 changed files with 32404 additions and 0 deletions

33
web/js/validators.js Normal file
View file

@ -0,0 +1,33 @@
/*App.Validate.form = function(values){
if(values.IP_ADDRESS == '') {
return alert('Not correct ip');
}
return true;
}*/
App.Validate.Is = {
ip: function(object) {
var ip_regexp = new RegExp(/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/);
return ip_regexp.test() ? false : App.i18n.getMessage('incorrect_ip');
}
};
App.Validate.form = function(values, form_ref){
// TODO: validate it!
return true;
var errors = [];
$.each(values, function(key) {
var value = values[key];
/*if ('undefined' != typeof App.Validate.Is[key] ) {
if(var error = App.Validate.Is[key](value)) {
errors[erros.length++] = error;
}
}*/
});
}