PageSourceSearch

https://www.lepointveterinaire.fr/assets/js/scripts.js?version=1657183988

js lepointveterinaire.fr collected 2026-09-24 19:14:35 UTC 14,414 bytes, 393 lines download raw bytes

1/*
2    TRADUCTION DE VALIDATE
3*/
4(function (factory) {
5    if (typeof define === "function" && define.amd) {
6        define(["jquery", "../jquery.validate"], factory);
7    } else {
8        factory(jQuery);
9    }
10}(function ($) {
11    /*
12     * Translated default messages for the jQuery validation plugin.
13     * Locale: FR (French; français)
14     */
15    $.extend($.validator.messages, {
16        required: "Ce champ est obligatoire.",
17        remote: "Veuillez corriger ce champ.",
18        email: "Veuillez fournir une adresse électronique valide.",
19        url: "Veuillez fournir une adresse URL valide.",
20        date: "Veuillez fournir une date valide.",
21        dateISO: "Veuillez fournir une date valide (ISO).",
22        number: "Veuillez fournir seulement des chiffres.",
23        digits: "Veuillez fournir seulement des chiffres.",
24        creditcard: "Veuillez fournir un numéro de carte de crédit valide.",
25        equalTo: "Veuillez fournir encore la même valeur.",
26        extension: "Veuillez fournir une valeur avec une extension valide.",
27        maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."),
28        minlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
29        rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),
30        range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."),
31        max: $.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."),
32        min: $.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."),
33        maxWords: $.validator.format("Veuillez fournir au plus {0} mots."),
34        minWords: $.validator.format("Veuillez fournir au moins {0} mots."),
35        rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."),
36        letterswithbasicpunc: "Veuillez fournir seulement des lettres et des signes de ponctuation.",
37        alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages.",
38        lettersonly: "Veuillez fournir seulement des lettres.",
39        nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.",
40        ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.",
41        integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.",
42        vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).",
43        dateITA: "Veuillez fournir une date valide.",
44        time: "Veuillez fournir une heure valide entre 00:00 et 23:59.",
45        phoneUS: "Veuillez fournir un numéro de téléphone valide.",
46        phoneUK: "Veuillez fournir un numéro de téléphone valide.",
47        mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.",
48        strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
49        email2: "Veuillez fournir une adresse électronique valide.",
50        url2: "Veuillez fournir une adresse URL valide.",
51        creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.",
52        ipv4: "Veuillez fournir une adresse IP v4 valide.",
53        ipv6: "Veuillez fournir une adresse IP v6 valide.",
54        require_from_group: "Veuillez fournir au moins {0} de ces champs.",
55        nifES: "Veuillez fournir un numéro NIF valide.",
56        nieES: "Veuillez fournir un numéro NIE valide.",
57        cifES: "Veuillez fournir un numéro CIF valide.",
58        postalCodeCA: "Veuillez fournir un code postal valide."
59    });
60}));
61/** recherche **/
62var $mainNavigation = $('.mobile-menu');
63var $body = $('body');
64var $searchModal = $('.search-modal');
65var $closeSearchModal = $('.search-modal-close');
66$('div#menu').on('click', function () {
67    if ($mainNavigation.hasClass("open")) {
68        // Hide
69        $body.removeClass('overflow');
70        $mainNavigation.removeClass('open');
71    } else {
72        // Show
73        $body.addClass('overflow');
74        $mainNavigation.addClass('open');
75    }
76});
77$('.call-search').on('click', function () {
78    if ($searchModal.hasClass("open")) {
79        // Hide
80        $body.removeClass('overflow');
81        $searchModal.removeClass('open');
82    } else {
83        // Show
84        $body.addClass('overflow');
85        $searchModal.addClass('open');
86    }
87});
88$closeSearchModal.on('click', function () {
89    // Hide
90    $body.removeClass('overflow');
91    $searchModal.removeClass('open');
92});
93$('.item-search-mobile').on('click', function () {
94    if ($('.search-modal-mobile').hasClass("open")) {
95        // Hide
96        $('.search-modal-mobile').removeClass('open');
97    } else {
98        // Show
99        $('.search-modal-mobile').addClass('open');
100    }
101});
102$(document).keydown(function (e) {
103    // ESCAPE key pressed
104    if ((e.keyCode == 27) && ($searchModal.hasClass("open"))) {
105        // Hide
106        $body.removeClass('overflow');
107        $searchModal.removeClass('open');
108    }
109});
110/*menu secondaire*/
111
112$(window).scroll(function () {
113    var posScroll = $(document).scrollTop();
114
115    if (posScroll > 200) {
116        $('#gototop').show();
117    } else {
118        $('#gototop').hide();
119    }
120    if ($('.navfullwidth_grey').length) {
121        var offset = $('.navfullwidth_grey').offset();
122        var posY = offset.top - $(window).scrollTop();
123
124        if ($body.hasClass('homepage')) {
125            if (posY <= 0) {
126                $('.mainmenu').removeClass('onscroll');
127                $('.navfullwidth_grey').css('visibility', 'hidden');
128            } else {
129                $('.mainmenu').addClass('onscroll');
130                $('.navfullwidth_grey').css('visibility', 'visible');
131            }
132        } else {
133            if ($body.hasClass('univers')) {
134                if (posY <= 0) {
135                    $('.transversal').removeClass('onscroll');
136                    $('.navfullwidth_grey').css('visibility', 'visible');
137                } else {
138                    $('.transversal').addClass('onscroll');
139                    $('.navfullwidth_grey').css('visibility', 'visible');
140                }
141            }
142        }
143    }
144
145});
146$(function () {
147    var current_url = window.location.href;
148    //console.log(current_url);
149    /* ******************
150    LISTE DES PAGES A EXCLURE pour les pub instrusives
151    ****************** */
152    var exclusions = [
153        '/boutique/revues.html', //page abo
154        '/boutique/livres/', // fiche ouvrage
155        '/boutique/search.php', //boutique recherche
156        '/boutique/librairie/', // boutique librairie
157        '/boutique/livraison.html', //boutique livraison
158        '/boutique/livres-du-point-veterinaire/catalogue-veterinaire.html', //catalogue veterinaire
159        '/je-m-abonne', // Pages abonnement
160        '/espace-membre/creer-un-compte', // Créer compte
161        '/espace-membre/s-identifier', // page de connexion
162        '/espace-membre/mon-compte', // Mon compte
163        '/espace-membre/mes-informations', // Mes informations
164        '/annonces/passer-une-annonce-veterinaire/historique-de-mes-annonces', // Mes annonces
165        '/actualites/lettres-d-information/la-lettre-de-la-semaine-veterinaire', //Mes newsletters
166        '/espace-membre/mot-de-passe-oublie.html', // mot de passe oublie
167        '/my-account/my-alerts', // Mes alertes
168        '/boutique/inscription-newsletter-boutique', // inscription newsletter boutique
169        '/roy/actualisez-vos-coordonnees/identification-maj-coordonnees', // MAJ Roy
170        '/annonces/passer-une-annonce'
171    ];
172
173    /* ******************
174       CNIL COOKIE
175    ****************** */
176    if ($.cookie('cookie_cnil') == null) {
177        $('#conteneurCookies').css('display', 'block');
178        $('a.fermeCookie').click(function () {
179            $('#conteneurCookies').hide();
180            $.cookie('cookie_cnil', 'cnil_ok', {
181                expires: 390,
182                path: '/'
183            });
184            return false;
185        });
186    }
187
188    /* ******************
189       tooltip
190    ****************** */
191    $('[data-toggle="tooltip"]').tooltip();
192    $('a.wk-tooltip').tooltip({
193        html: true,
194        title: function () {
195            var element = $(this);
196            return $('#wk-' + this.href.replace(/[^#]+#/, '')).html();
197        }
198    });
199
200    /* ******************
201       popover
202    ****************** */
203    $("[data-toggle='popover']").popover();
204
205    /* ******************
206      scroll to anchor link
207    ****************** */
208    $('a.anchor').click(function (event) {
209        var ancre = $(this).attr('href');
210        if (ancre.indexOf('#') != -1) {
211            event.preventDefault();
212            $('html, body').animate({
213                scrollTop: $(ancre).offset().top - 200
214            }, 500, 'linear');
215        }
216    });
217
218
219
220    /* ******************
221       carousel
222    ****************** */
223    $('.carousel').carousel({
224        interval: 3000
225    });
226    /*  detection ancre et se repositionne correctement dans la page */
227    if (current_url.indexOf("#") != -1) {
228        var hash = current_url.substring(current_url.indexOf("#") + 1);
229        console.log("url : " + current_url + " hash = " + hash);
230        if ($("#" + hash).length) {
231            $('html, body').animate({
232                scrollTop: $("#" + hash).offset().top - 200
233            }, 500, 'linear');
234        }
235    }
236
237    /* ******************
238       Magnificpopup
239    ****************** */
240    /*
241        $('.photos-article').magnificPopup({
242            delegate: 'a',
243            type: 'image',
244            tClose: 'Fermer (touche clavier Echap)',
245            tLoading: 'Chargement de l\'image #%curr%...',
246            mainClass: 'mfp-img-mobile',
247            gallery: {
248                enabled: true,
249                navigateByImgClick: true,
250                // preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
251                tPrev: 'Précédent (touche clavier flèche gauche)', // title for left button
252                tNext: 'Suivant (touche clavier flèche droite)', // title for right button
253                tCounter: '<span class="mfp-counter">%curr% / %total%</span>',
254            },
255            image: {
256                verticalFit: true,
257                tError: '<a href="%url%">L\'image #%curr%</a> n\'a pas pu se charger.',
258                titleSrc: function (item) {
259                    return item.el.attr('title');
260                }
261            }
262        });*/
263
264    $('a.thumbnail').magnificPopup({
265        type: 'image',
266        gallery: {
267            enabled: true,
268            tCounter: '<span class="mfp-counter">%curr%&nbsp;/&nbsp;%total%</span>'
269        },
270        image: {
271            verticalFit: true,
272            titleSrc: function (item) {
273                return item.el.attr('title');
274            }
275        },
276    });
277
278    /* ******************
279       /plan-du-site.html
280    ****************** */
281    var current_url = window.location.href;
282
283    if (current_url.indexOf("/plan-du-site") >= 0) {
284        $('#colonne_gauche #plan-du-site').removeAttr('class');
285
286    }
287
288
289    /*
290    Datepicker
291    */
292    $("input.bddDatepicker").datepicker({
293        dateFormat: "yy-mm-dd"
294    });
295
296    /*autocompletion recherche*/
297    $(".autocomplRecherche").on('input', function () {
298
299        if (current_url.indexOf("/" + "dmv" + "/") >= 0) {
300
301            $(".autocomplRecherche").autocomplete({
302				source: '/ressources/php/admin/dmv/autocompletion.php?q=' + $(".autocomplRecherche").val(),
303				minLength: 3,
304				select: function (event, ui) {	
305					$.post('/ressources/php/admin/dmv/autocompletion.php', {type:'rubrique',q:ui.item.value},
306					function(data) {
307					 	var retour = JSON.parse(data);
308					 	console.log(retour['0']);
309						window.location = retour['0'];
310					});
311				}
312			});
313
314
315
316
317	
318            
319        } else if (current_url.indexOf("/" + "roy" + "/") >= 0) {
320        	var base = 'veterinaire';
321        		champ = "mybdd_search_410";
322        	if ($('input[id=radio_fournisseur]:checked', '#mybdd_search_form').val() == "on") {
323        		base = 'fournisseur';
324        		champ = "mybdd_search_445";
325        	}
326        	if ($('input[id=radio_associations]:checked', '#mybdd_search_form').val() == "on") {
327        		base = 'association';
328        		champ = "mybdd_search_799";
329        	}
330            $(".autocomplRecherche").autocomplete({
331				source: '/ressources/php/admin/roy/autocompletion.php?q=' + $("#"+champ).val()+'&base='+base,
332				minLength: 3,
333				select: function (event, ui) {	
334					$.post('/ressources/php/admin/roy/autocompletion.php', {type:'rubrique',base:base,q:ui.item.value},
335					function(data) {
336					 	var retour = JSON.parse(data);
337					 	console.log(retour['0']);
338						window.location = retour['0'];
339					});
340				}
341			});
342
343        } else {
344
345            $(".autocomplRecherche").autocomplete({
346                source: '/ressources/php/elastic/autocompletion.php?b=pv&q=' + $(".autocomplRecherche").val(),
347                minLength: 2,
348                select: function (event, ui) {
349                    if (current_url.indexOf("/" + "boutique") >= 0) {
350                        window.location = "/boutique/recherche.html?text=" + ui.item.value;
351                    } else {
352                        window.location = "/recherche-dans-le-site.html?text=" + ui.item.value;
353                    }
354                }
355            });
356
357
358        }
359    });
360
361
362
363
364
365
366
367
368
369});
370
371function createCookie(name, value, days) {
372    if (days) {
373        var date = new Date();
374        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
375        var expires = "; expires=" + date.toGMTString();
376    } else var expires = "";
377    document.cookie = name + "=" + value + expires + "; path=/";
378}
379
380function readCookie(name) {
381    var nameEQ = name + "=";
382    var ca = document.cookie.split(';');
383    for (var i = 0; i < ca.length; i++) {
384        var c = ca[i];
385        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
386        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
387    }
388    return null;
389}
390
391function eraseCookie(name) {
392    createCookie(name, "", -1);
393}

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.