Вход Регистрация
Файл: upload/admin/js/jquery.inputmask.extensions.js
Строк: 89
<?php
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - 2014 Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0

Optional extensions on the jquery.inputmask base
*/
(function ($) {
    
//extra definitions
    
$.extend($.inputmask.defaults.definitions, {
        
'A': {
            
validator"[A-Za-z]",
            
cardinality1,
            
casing"upper" //auto uppercasing
        
},
        
'#': {
            
validator"[A-Za-zu0410-u044Fu0401u04510-9]",
            
cardinality1,
            
casing"upper"
        
}
    });
    $.
extend($.inputmask.defaults.aliases, {
        
'url': {
            
mask"ir",
            
placeholder"",
            
separator"",
            
defaultPrefix"http://",
            
regex: {
                
urlpre1: new RegExp("[fh]"),
                
urlpre2: new RegExp("(ft|ht)"),
                
urlpre3: new RegExp("(ftp|htt)"),
                
urlpre4: new RegExp("(ftp:|http|ftps)"),
                
urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"),
                
urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"),
                
urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"),
                
urlpre8: new RegExp("(ftp://|ftps://|http://|https://)")
            },
            
definitions: {
                
'i': {
                    
validator: function (chrsbufferposstrictopts) {
                        return 
true;
                    },
                    
cardinality8,
                    
prevalidator: (function () {
                        var 
result = [], prefixLimit 8;
                        for (var 
0prefixLimiti++) {
                            
result[i] = (function () {
                                var 
i;
                                return {
                                    
validator: function (chrsbufferposstrictopts) {
                                        if (
opts.regex["urlpre" + (1)]) {
                                            var 
tmp chrsk;
                                            if (((
1) - chrs.length) > 0) {
                                                
tmp buffer.join('').substring(0, ((1) - chrs.length)) + "" tmp;
                                            }
                                            var 
isValid opts.regex["urlpre" + (1)].test(tmp);
                                            if (!
strict && !isValid) {
                                                
pos pos j;
                                                for (
0opts.defaultPrefix.lengthk++) {
                                                    
buffer[pos] = opts.defaultPrefix[k]; pos++;
                                                }
                                                for (
0tmp.length 1k++) {
                                                    
buffer[pos] = tmp[k]; pos++;
                                                }
                                                return { 
"pos"pos };
                                            }
                                            return 
isValid;
                                        } else {
                                            return 
false;
                                        }
                                    }, 
cardinalityj
                                
};
                            })();
                        }
                        return 
result;
                    })()
                },
                
"r": {
                    
validator".",
                    
cardinality50
                
}
            },
            
insertModefalse,
            
autoUnmaskfalse
        
},
        
"ip": { //ip-address mask
            
mask: ["[[x]y]z.[[x]y]z.[[x]y]z.x[yz]""[[x]y]z.[[x]y]z.[[x]y]z.[[x]y][z]"],
            
definitions: {
                
'x': {
                    
validator"[012]",
                    
cardinality1,
                    
definitionSymbol"i"
                
},
                
'y': {
                    
validator: function (chrsbufferposstrictopts) {
                        if (
pos > -&& buffer[pos 1] != ".")
                            
chrs buffer[pos 1] + chrs;
                        else 
chrs "0" chrs;
                        return new 
RegExp("2[0-5]|[01][0-9]").test(chrs);
                    },
                    
cardinality1,
                    
definitionSymbol"i"
                
},
                
'z': {
                    
validator: function (chrsbufferposstrictopts) {
                        if (
pos > -&& buffer[pos 1] != ".") {
                            
chrs buffer[pos 1] + chrs;
                            if (
pos > -&& buffer[pos 2] != ".") {
                                
chrs buffer[pos 2] + chrs;
                            } else 
chrs "0" chrs;
                        } else 
chrs "00" chrs;
                        return new 
RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
                    },
                    
cardinality1,
                    
definitionSymbol"i"
                
}
            }
        }
    });
})(
jQuery);
?>
Онлайн: 0
Реклама