PageSourceSearch

https://rubiomusic.cl/news/wp-content/themes/shop-toolkit/assets/js/number.js?ver=1.0.3

js rubiomusic.cl collected 2026-10-02 19:10:19 UTC 2,461 bytes, 119 lines download raw bytes

1(function( $ ) {
2
3    $.fn.number = function(customOptions) {
4
5        var options = {
6
7            'containerClass' : 'number-style',
8            'minus' : 'number-minus',
9            'plus' : 'number-plus',
10            'containerTag' : 'div',
11            'btnTag' : 'span'
12
13        };
14
15        options = $.extend(true, options, customOptions);
16
17        var input = this;
18
19        input.wrap('<' + options.containerTag + ' class="' + options.containerClass + '">');
20
21        var wrapper = input.parent();
22
23        wrapper.prepend('<' + options.btnTag + ' class="' + options.minus + '"></' + options.btnTag + '>');
24
25        var minus = wrapper.find('.' + options.minus);
26
27        wrapper.append('<' + options.btnTag + ' class="' + options.plus + '"></' + options.btnTag + '>');
28
29        var plus = wrapper.find('.' + options.plus);
30
31        var min = input.attr('min');
32
33        var max = input.attr('max');
34
35        if(input.attr('step')){
36
37            var step = +input.attr('step');
38
39        } else {
40
41            var step = 1;
42
43        }
44
45        if(+input.val() <= +min){
46
47            minus.addClass('disabled');
48
49        }
50
51        if(+input.val() >= +max){
52
53            plus.addClass('disabled');
54
55        }
56
57        minus.click(function () {
58
59            var input = $(this).parent().find('input');
60
61            var value = input.val();
62
63            if(+value > +min){
64
65                input.val(+value - step);
66
67                if(+input.val() === +min){
68
69                    input.prev('.' + options.minus).addClass('disabled');
70
71                }
72
73                if(input.next('.' + options.plus).hasClass('disabled')){
74
75                    input.next('.' + options.plus).removeClass('disabled')
76
77                }
78
79            } else if(!min){
80
81                input.val(+value - step);
82
83            }
84
85        });
86
87        plus.click(function () {
88
89            var input = $(this).parent().find('input');
90
91            var value = input.val();
92
93            if(+value < +max){
94
95                input.val(+value + step);
96
97                if(+input.val() === +max){
98
99                    input.next('.' + options.plus).addClass('disabled');
100
101                }
102
103                if(input.prev('.' + options.minus).hasClass('disabled')){
104
105                    input.prev('.' + options.minus).removeClass('disabled')
106
107                }
108
109            } else if(!max){
110
111                input.val(+value + step);
112
113            }
114
115        });
116
117    };
118
119})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.