Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
var ComponentsBootstrapMaxlength = function () {
2
 
3
    var handleBootstrapMaxlength = function() {
4
        $('#maxlength_defaultconfig').maxlength({
5
            limitReachedClass: "label label-danger",
6
        })
7
 
8
        $('#maxlength_thresholdconfig').maxlength({
9
            limitReachedClass: "label label-danger",
10
            threshold: 20
11
        });
12
 
13
        $('#maxlength_alloptions').maxlength({
14
            alwaysShow: true,
15
            warningClass: "label label-success",
16
            limitReachedClass: "label label-danger",
17
            separator: ' out of ',
18
            preText: 'You typed ',
19
            postText: ' chars available.',
20
            validate: true
21
        });
22
 
23
        $('#maxlength_textarea').maxlength({
24
            limitReachedClass: "label label-danger",
25
            alwaysShow: true
26
        });
27
 
28
        $('#maxlength_placement').maxlength({
29
            limitReachedClass: "label label-danger",
30
            alwaysShow: true,
31
            placement: App.isRTL() ? 'top-right' : 'top-left'
32
        });
33
    }
34
 
35
    return {
36
        //main function to initiate the module
37
        init: function () {
38
            handleBootstrapMaxlength();
39
        }
40
    };
41
 
42
}();
43
 
44
jQuery(document).ready(function() {
45
   ComponentsBootstrapMaxlength.init();
46
});