Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
var FormInputMask = function () {
2
 
3
    var handleInputMasks = function () {
4
 
5
 
6
        $("#mask_date").inputmask("d/m/y", {
7
            autoUnmask: true
8
        }); //direct mask
9
        $("#mask_date1").inputmask("d/m/y", {
10
            "placeholder": "*"
11
        }); //change the placeholder
12
        $("#mask_date2").inputmask("d/m/y", {
13
            "placeholder": "dd/mm/yyyy"
14
        }); //multi-char placeholder
15
        $("#mask_phone").inputmask("mask", {
16
            "mask": "(999) 999-9999"
17
        }); //specifying fn & options
18
        $("#mask_tin").inputmask({
19
            "mask": "99-9999999",
20
            placeholder: "" // remove underscores from the input mask
21
        }); //specifying options only
22
        $("#mask_number").inputmask({
23
            "mask": "9",
24
            "repeat": 10,
25
            "greedy": false
26
        }); // ~ mask "9" or mask "99" or ... mask "9999999999"
27
        $("#mask_decimal").inputmask('decimal', {
28
            rightAlignNumerics: false
29
        }); //disables the right alignment of the decimal input
30
        $("#mask_currency").inputmask('€ 999.999.999,99', {
31
            numericInput: true
32
        }); //123456  =>  € ___.__1.234,56
33
 
34
        $("#mask_currency2").inputmask('€ 999,999,999.99', {
35
            numericInput: true,
36
            rightAlignNumerics: false,
37
            greedy: false
38
        }); //123456  =>  € ___.__1.234,56
39
        $("#mask_ssn").inputmask("999-99-9999", {
40
            placeholder: " ",
41
            clearMaskOnLostFocus: true
42
        }); //default
43
    }
44
 
45
    var handleIPAddressInput = function () {
46
        $('#input_ipv4').ipAddress();
47
        $('#input_ipv6').ipAddress({
48
            v: 6
49
        });
50
    }
51
 
52
    return {
53
        //main function to initiate the module
54
        init: function () {
55
            handleInputMasks();
56
            handleIPAddressInput();
57
        }
58
    };
59
 
60
}();
61
 
62
if (App.isAngularJsApp() === false) {
63
    jQuery(document).ready(function() {
64
        FormInputMask.init(); // init metronic core componets
65
    });
66
}