PageSourceSearch

https://www.journaldesaintbarth.com/js/plugins/minusandplus/bootstrap-minusandplus.js

js journaldesaintbarth.com collected 2026-10-02 21:19:51 UTC 2,864 bytes, 78 lines download raw bytes

1//plugin bootstrap minus and plus
2//http://jsfiddle.net/laelitenetwork/puJ6G/
3
4// INFO : obligé de faire document ready ou alors il faut le mettre dans le page-footer et non le page-head-plugins
5$(document).ready(function () {
6
7    $('.btn-number').click(function (e) {
8        e.preventDefault();
9
10        fieldName = $(this).attr('data-field');
11        type = $(this).attr('data-type');
12        var input = $("input[name='" + fieldName + "']");
13        var currentVal = parseInt(input.val());
14        if (!isNaN(currentVal)) {
15            if (type == 'minus') {
16
17                if (currentVal > input.attr('min')) {
18                    input.val(currentVal - 1).change();
19                }
20                if (parseInt(input.val()) == input.attr('min')) {
21                    $(this).attr('disabled', true);
22                }
23
24            } else if (type == 'plus') {
25
26                if (currentVal < input.attr('max')) {
27                    input.val(currentVal + 1).change();
28                }
29                if (parseInt(input.val()) == input.attr('max')) {
30                    $(this).attr('disabled', true);
31                }
32
33            }
34        } else {
35            input.val(0);
36        }
37    });
38    $('.input-number').focusin(function () {
39        $(this).data('oldValue', $(this).val());
40    });
41    $('.input-number').change(function () {
42
43        minValue = parseInt($(this).attr('min'));
44        maxValue = parseInt($(this).attr('max'));
45        valueCurrent = parseInt($(this).val());
46
47        name = $(this).attr('name');
48        if (valueCurrent >= minValue) {
49            $(".btn-number[data-type='minus'][data-field='" + name + "']").removeAttr('disabled')
50        } else {
51            alert('Sorry, the minimum value was reached');
52            $(this).val($(this).data('oldValue'));
53        }
54        if (valueCurrent <= maxValue) {
55            $(".btn-number[data-type='plus'][data-field='" + name + "']").removeAttr('disabled')
56        } else {
57            alert('Vous avez dépassez le maximum');
58            $(this).val($(this).data('oldValue'));
59        }
60
61
62    });
63    $(".input-number").keydown(function (e) {
64        // Allow: backspace, delete, tab, escape, enter and .
65        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 ||
66                // Allow: Ctrl+A
67                        (e.keyCode == 65 && e.ctrlKey === true) ||
68                        // Allow: home, end, left, right
69                                (e.keyCode >= 35 && e.keyCode <= 39)) {
70                    // let it happen, don't do anything
71                    return;
72                }
73                // Ensure that it is a number and stop the keypress
74                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
75                    e.preventDefault();
76                }
77            });
78});

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.