PageSourceSearch

https://www.smavd.org/wp-content/plugins/gbovdv/assets/javascript/gbovdv-custom.js?ver=7.1.2

js smavd.org collected 2026-10-02 20:03:33 UTC 5,338 bytes, 123 lines download raw bytes

1var $j = jQuery.noConflict();
2jQuery(document).ready(function() {
3    // Get the modal
4    var modal = jQuery("#myModal");
5
6// When the user clicks the button, open the modal
7    jQuery("a.btn_context").on('click', function() {
8        var params = {
9            'action': 'get_context_meteo',
10            'context': jQuery(this).attr('data-type'),
11            'date': jQuery('#date_actualisation').attr('data-date'),
12            // 'date': jQuery('#date_actualisation').val(),
13        };
14
15        jQuery.post(gbo_vdv_ajax.url, params, function(response) {
16            jQuery('#vdv-modal-content').html(response);
17            modal.css('display', "block");
18            var imageHeight = 0;
19            if (window.innerWidth >= 2200) { imageHeight = 1200; }
20            else if (window.innerWidth >= 2000) { imageHeight = 750; }
21            else if (window.innerWidth >= 1800) { imageHeight = 700; }
22            else if (window.innerWidth >= 1600) { imageHeight = 600; }
23            else if (window.innerWidth >= 1400) { imageHeight = 500; }
24            else if (window.innerWidth < 1400) { imageHeight = 400; }
25            modal.css('padding-top', ((window.innerHeight - (jQuery('.modal-content')[0].scrollHeight + imageHeight)) / 2) + 'px');
26        });
27    });
28
29// When the user clicks the button, open the modal
30    jQuery("img.btn-point").on('click', function() {
31        if (jQuery(this).attr('data-modal') == 1) {
32            var params = {
33                'action': 'get_points_data',
34                'type': jQuery(this).attr('data-type'),
35                'station': jQuery(this).attr('data-station'),
36                'id': jQuery(this).attr('data-id'),
37                'date': jQuery('#date_actualisation').attr('data-date'),
38                // 'date': jQuery('#date_actualisation').val(),
39            };
40
41            jQuery.post(gbo_vdv_ajax.url, params, function (response) {
42                var zoomLevel = window.devicePixelRatio;
43				
44                if (zoomLevel !== 1) {
45                    // Réinitialiser le zoom en ajustant la largeur du viewport
46                    var newViewportWidth = window.innerWidth / zoomLevel;
47                    //document.querySelector("meta[name=viewport]").setAttribute("content", "width=" + newViewportWidth);
48                }
49
50                jQuery('#vdv-modal-content').html(response);
51                modal.css('display', "block");
52                var canvasHeight = 0;
53                if (window.innerWidth > 2000) { canvasHeight = 500; }
54                else if (window.innerWidth > 1800) { canvasHeight = 400; }
55                else if (window.innerWidth > 1600) { canvasHeight = 300; }
56                else if (window.innerWidth > 1400) { canvasHeight = 250; }
57                else if (window.innerWidth < 1400) { canvasHeight = 200; }
58                modal.css('padding-top', ((window.innerHeight - (jQuery('.modal-content')[0].scrollHeight + ((jQuery('#myChart').length == 1) ? canvasHeight : 0))) / 2) + 'px');
59            });
60        }
61    });
62
63// When the user clicks the button, open the modal
64    jQuery("a.icone_info").on('click', function() {
65        var params = {
66            'action': 'get_text_information',
67        };
68
69        jQuery.post(gbo_vdv_ajax.url, params, function(response) {
70            jQuery('#vdv-modal-content').html(response);
71            modal.css('display', "block");
72            modal.css('padding-top', ((window.innerHeight - jQuery('.modal-content')[0].scrollHeight) / 2) + 'px');
73        });
74    });
75
76// When the user clicks on <span> (x), close the modal
77    jQuery(".close").on('click', function() {
78        jQuery('#vdv-modal-content').html('');
79        modal.css('display', "none");
80    });
81
82    // Date picker sur la date d'actualisation
83    var params = {
84        'action': 'get_all_dates',
85    };
86
87    jQuery.post(gbo_vdv_ajax.url, params, function(response) {
88        if (response) {
89            var dates = JSON.parse(response);
90
91            $j("#date_actualisation").datepicker({
92                dateFormat: 'dd/mm/yy',
93                // dateFormat: 'yy-mm-dd',
94                showOtherMonths: true,
95                selectOtherMonths: true,
96                showButtonPanel: true,
97                beforeShowDay: displayActualisationDate,
98      		  	showOn: "button",
99      		  	buttonText: "Choisir la date",
100            }).on('change', function(e) {
101                var element = jQuery(this).val().toString().split('/');
102                location.href = './?date_actualisation=' + element[2] + '-' + element[1] + '-' + element[0];
103                // location.href = './?date_actualisation=' + jQuery(this).attr('data-id');
104            });
105
106            function displayActualisationDate(date) {
107                var evenement = false;
108                var element = [];
109
110                if (dates != null) {
111                    for (i = 0; i < dates.length; i++) {
112                        element = dates[i].DATE_MAJ.toString().split('-');
113                        if (date.getMonth() == element[1] - 1 && date.getDate() == element[2] && date.getFullYear() == element[0]) {
114                            evenement = true;
115                        }
116                    }
117                }
118                if (evenement) return [true, 'css_jour_evenement'];
119                else return [false, ''];
120            }
121        }
122    });
123});

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.