PageSourceSearch

https://vegetolab.com/wp-content/themes/lithiummarketing/disponibilites/assets/js/scripts.js?ver=1791291921

js vegetolab.com collected 2026-10-06 13:05:57 UTC 3,621 bytes, 105 lines download raw bytes

1jQuery(function($) {
2
3    $('#disponibilites .checkall').bind('click',function(){
4        let hasChecked = $('#disponibilites tr:gt(0) [type="checkbox"]:checked').length;
5        let all = $('#disponibilites tr:gt(0) [type="checkbox"]').length;
6        if(hasChecked===all){
7            $('#disponibilites tr:gt(0) [type="checkbox"]').prop('checked',false);
8        }else{
9            $('#disponibilites tr:gt(0) [type="checkbox"]').prop('checked',true);
10        }
11        //$('#disponibilites tr:gt(0) [type="checkbox"]').prop('checked',);
12        return false;
13    });
14
15    $('#disponibilites #checkSelector').bind('change',function(){
16        let val = $(this).val();
17        if(val){
18            $('#disponibilites tr [type="checkbox"]').prop('checked',false);
19        }
20        if(val==='publish'){
21            $('#disponibilites tr.status-publish [type="checkbox"]').prop('checked',true);
22        }else if(val==='draft'){
23            $('#disponibilites tr.status-draft [type="checkbox"]').prop('checked',true);
24        }else if(val==='all'){
25            $('#disponibilites tr [type="checkbox"]').prop('checked',true);
26        }else if(val==='none'){
27            $('#disponibilites tr [type="checkbox"]').prop('checked',false);
28        }
29    });
30
31    $('.input-prevision').bind('blur',function(){
32        console.log('blur');
33        let id = parseInt($(this).data('id'));
34        let min = parseInt($(this).data('min'));
35        let max = parseInt($(this).data('max'));
36        let step = parseInt($(this).data('step'));
37        let val = parseInt($(this).val());
38
39
40        min = !isNaN(min) ? min : 0;
41        max = !isNaN(max) ? max : 0;
42        step = !isNaN(step) ? step : 0;
43        val = !isNaN(val) ? val : 0;
44
45        let _val = val;
46
47        if(val){
48            //min
49            if(min&&val<min){
50                alert(DISPO_TEXT_MINIMUM+' '+min);
51                _val = min;
52            }
53            if(max&&val>max){
54                alert(DISPO_TEXT_MAXIMUM+' '+max);
55                _val = max;
56            }
57            if(step){
58               /*
59               console.log('step : '+(_val%step));
60                if(_val%step){
61                    _val = Math.floor(_val/step) * step;
62                }
63                */
64            }
65        }
66        $(this).val(_val);
67
68        DISPONIBILITES.get_price(id);
69
70    });
71
72    $('.page-template-template-disponibilites button.btn').bind('click',function(){
73        if($('body').hasClass('loading')){
74            return false;
75        }
76        $('body').toggleClass('loading');
77        $(this).toggleClass('loading');
78        return true;
79    });
80});
81
82var DISPONIBILITES = {
83
84    id: null,
85
86    get_price: function(id){
87        DISPONIBILITES.id = id;
88        jQuery('tr[data-id="'+DISPONIBILITES.id+'"]').toggleClass('loading');
89
90        const qty = jQuery('input[data-id="'+id+'"]').val();
91        const nonce = jQuery('input[data-id="'+id+'"]').data('nonce');
92        jQuery.post('/wp-admin/admin-ajax.php','action=wdr_ajax&method=get_price_html&product_id='+id+'&qty='+qty+'&awdr_nonce='+nonce,function(response){
93            DISPONIBILITES.get_price_complete(response);
94        });
95    },
96
97    get_price_complete: function(response){
98        if(response&&response.price_html&&DISPONIBILITES.id){
99            jQuery('tr[data-id="'+DISPONIBILITES.id+'"] .price span:eq(0)').html(response&&response.price_html);
100        }
101        jQuery('tr[data-id="'+DISPONIBILITES.id+'"]').toggleClass('loading');
102        DISPONIBILITES.id = null;
103    }
104
105}

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.