PageSourceSearch

https://www.auto.leclerc/themes/js/formHome.js

js auto.leclerc collected 2026-10-08 16:48:06 UTC 31,669 bytes, 621 lines download raw bytes

1var modeleArianeAffichage = []; // juste pour le fil d'ariane
2var swiper;
3
4
5var speed = 400;
6
7var paramfinauxParModeleDeVehicule = {};
8
9// AJOUTER OU ENLEVER LA CALSSE AVTIVE
10/*$('*[class^="select"]').on('click', function(){
11	if ($(this).parent().attr('id')=='choix_largeur') {
12		if ($('.text_pneu .largeur').hasClass('active')) {
13			$('.text_pneu .largeur').removeClass('active');
14		}else{
15			$('.text_pneu div').removeClass('active');
16			$('.text_pneu .largeur').addClass('active');
17		}
18	}
19	if ($(this).parent().attr('id')=='choix_hauteur') {
20		if ($('.text_pneu .hauteur').hasClass('active')) {
21			$('.text_pneu .hauteur').removeClass('active');
22		}else{
23			$('.text_pneu div').removeClass('active');
24			$('.text_pneu .hauteur').addClass('active');
25		}
26	}
27	if ($(this).parent().attr('id')=='choix_diametre') {
28		if ($('.text_pneu .diametre').hasClass('active')) {
29			$('.text_pneu .diametre').removeClass('active');
30		}else{
31			$('.text_pneu div').removeClass('active');
32			$('.text_pneu .diametre').addClass('active');
33		}
34	}
35	if ($(this).parent().attr('id')=='choix_charge') {
36		if ($('.text_pneu .charge').hasClass('active')) {
37			$('.text_pneu .charge').removeClass('active');
38		}else{
39			$('.text_pneu div').removeClass('active');
40			$('.text_pneu .charge').addClass('active');
41		}
42	}
43	if ($(this).parent().attr('id')=='choix_vitesse') {
44		if ($('.text_pneu .vitesse').hasClass('active')) {
45			$('.text_pneu .vitesse').removeClass('active');
46		}else{
47			$('.text_pneu div').removeClass('active');
48			$('.text_pneu .vitesse').addClass('active');
49		}
50	}
51});*/
52
53// CHANGE LE TEXTE SELON CE QUI EST SELECTIONNE
54/** fin **/
55
56function cliqueSurCaseConstructeur(autocompletion, nom) {
57    //$('.formHome .tab-content>.tab#onglet_vehicule .etape1 .logos_top.logo_voiture>div>div').on('click', function(e){
58    var constructeur;
59    var htmlToInject = '';
60    var htmlToInjectAllGammes = '';
61    if (!autocompletion) {
62        constructeur = nom;
63    } else {
64        constructeur = $('#onglet_vehicule input[name="search"]').val();
65    }
66    //dataLayer.push({'event_detail.action':'Step - Constructeur' , 'event_detail.label':constructeur})
67    dataLayer.push({
68        'event': 'RecherchePneus',
69        'event_detail':
70            {
71                'action': 'Step - Constructeur',
72                'label': constructeur
73            }
74    });
75
76    $('.etape2 .logos_gamme').empty();
77    $('.swiper-container').empty();
78    htmlToInjectAllGammes += '<div class="swiper-wrapper">';
79    $.ajax({
80        url: 'rechercheParMarque',
81        type: 'get',
82        data: {
83            marque: constructeur
84        },
85        dataType: 'json',
86        async: false,
87        success: function (retour) {
88            if (retour.statut === 'ok') {
89
90                $('.etape1').hide();
91                $('.etape2').show();
92
93                //for (var i = 0; i < (retour.gammes.length)-1; i++) {
94                //    htmlToInject += '<div class="newgeneratedtop col-lg-1 col-md-2 col-sm-4 col-xs-6">\n' +
95                //        '                            <div data-segment-type-car-year="' + retour.gammes[i].car_segment + ';;' + retour.gammes[i].car_type + ';;' + retour.gammes[i].year + '">\n' +
96                //        '                                <div>' + retour.gammes[retour.gammes.length-1][i] + '</div>\n' +
97                //        checkImage(retour.cheminImagesGammes, retour.gammes[i].picture_name, false) +
98                //        '                                <div>depuis ' + retour.gammes[i].year + '</div>\n' +
99                //        '                            </div>\n' +
100                //        '                        </div>';
101                //}
102//
103                //for (var j = 0; j < (retour.allGammes.length)-1; j++) {
104                //    if (retour.allGammes[j].year == null) {
105                //        retour.allGammes[j].year = '?';
106                //    }
107                //    htmlToInjectAllGammes += '<div class="newgeneratedall swiper-slide">\n' +
108                //        '                            <div data-segment-type-car-year="' + retour.allGammes[j].car_segment + ';;' + retour.allGammes[j].car_type + ';;' + retour.allGammes[j].year + '">\n' +
109                //        '                              <div>' + retour.allGammes[retour.allGammes.length-1][i] + '</div>\n' +
110                //        checkImage(retour.cheminImagesGammes, retour.allGammes[j].picture_name, true) +
111                //        '                                <div>depuis ' + retour.allGammes[j].year + '</div>\n' +
112                //        '                            </div>\n' +
113                //        '                        </div>';
114                //}
115
116                for (var i = 0; i < retour.gammes.length; i++) {
117                    htmlToInject += '<div class="newgeneratedtop col-lg-1 col-md-2 col-sm-4 col-xs-6">\n' +
118                        '                            <div data-segment-type-car-year="' + retour.gammes[i].car_segment + ';;' + retour.gammes[i].car_type + ';;' + retour.gammes[i].year + '">\n' +
119                        '                                <div ' + (retour.gammes[i].car_type.length > 14 ? "class=shrink_lib" : "") + '>
119' + retour.gammes[i].car_type + '</div>\n' +
120                        checkImage(retour.cheminImagesGammes, retour.gammes[i].picture_name, false) +
121                        '                                <div>depuis ' + retour.gammes[i].year + '</div>\n' +
122                        '                            </div>\n' +
123                        '                        </div>';
124                }
125
126                for (var j = 0; j < retour.allGammes.length; j++) {
127                    if (retour.allGammes[j].year == null) {
128                        retour.allGammes[j].year = '?';
129                    }
130                    htmlToInjectAllGammes += '<div class="newgeneratedall swiper-slide">\n' +
131                        '                            <div data-segment-type-car-year="' + retour.allGammes[j].car_segment + ';;' + retour.allGammes[j].car_type + ';;' + retour.allGammes[j].year + '">\n' +
132                        '                               <div ' + (retour.allGammes[j].car_type.length > 14 ? "class=shrink_lib" : "") + '>' + retour.allGammes[j].car_type + '</div>\n' +
133                        checkImage(retour.cheminImagesGammes, retour.allGammes[j].picture_name, true) +
134                        '                                <div>depuis ' + retour.allGammes[j].year + '</div>\n' +
135                        '                            </div>\n' +
136                        '                        </div>';
137                }
138
139
140            }
141        }, error: function (erreur) {
142
143            // console.log(erreur);
144            return false;
145        }
146    });
147    htmlToInjectAllGammes += '</div><div class="swiper-pagination"></div><div class="swiper-button-next"></div><div class="swiper-button-prev"></div>';
148    $('.etape2 .logos_gamme').html(htmlToInject);
149    $('.swiper-container').html(htmlToInjectAllGammes);
150
151    // $(".logos_gamme_slider").not('.slick-initialized').slick(slickOptions);
152    initSwiper();
153
154}
155
156$('.formHome .tab-content>.tab#onglet_vehicule .etape1 .logos_top.logo_voiture>div>div').click(function () {
157    var nom = ($(this).attr('class'));
158    paramfinauxParModeleDeVehicule.constructeur = nom;
159    filAriane(paramfinauxParModeleDeVehicule, 1);
160    cliqueSurCaseConstructeur(false, nom); // quand on clique sur la 1re etape dans le menu de recherche autocompletion ou alors sur les top logos
161});
162
163// ECRAN SUIVANT
164$(document).ready(function () {
165    $("#formHome").insertAfter($(".slider").first().parent().parent());
166
167// ETAPE 1
168
169    $('.formHome .tab-content>.tab#onglet_vehicule .etape1 .constructeur').on('click', function () {
170        $('.etape1').hide();
171        //alert('test raph 111');
172        $('.etape2').show();
173    });
174
175// ETAPE 2
176    $(document).on('click', '.formHome .tab-content .newgeneratedtop', function (e) {
177        $('.etape2').hide();
178        $('.etape3').show();
179        var gamme = $(this).eq(0).children().eq(0).data('segment-type-car-year');
180
181        var gammeTampon = gamme.split(';;');
182        paramfinauxParModeleDeVehicule.gamme = gammeTampon[0];
183        modeleArianeAffichage.typeChoix = gammeTampon[1];
184        filAriane(paramfinauxParModeleDeVehicule, 2);
185        dataLayer.push({
186            'event': 'RecherchePneus',
187            'event_detail':
188                {
189                    'action': 'Step - Gamme',
190                    'label': gammeTampon[0],
191                }
192        });
193        // $('.logos_gamme_slider').slick('unslick');
194        // alert('click');
195        trosiemeEtapeModel(gamme);
196    });
197    $(document).on('click', '.formHome .tab-content .newgeneratedall', function () {
198        $('.etape2').hide();
199        $('.etape3').show();
200        var gamme = $(this).eq(0).children().eq(0).data('segment-type-car-year');
201        var gammeTampon = gamme.split(';;');
202        paramfinauxParModeleDeVehicule.gamme = gammeTampon[0];
203        modeleArianeAffichage.typeChoix = gammeTampon[1];
204        filAriane(paramfinauxParModeleDeVehicule, 2);
205        dataLayer.push({
206            'event': 'RecherchePneus',
207            'event_detail':
208                {
209                    'action': 'Step - Gamme',
210                    'label': gammeTampon[0],
211                }
212        });
213        trosiemeEtapeModel(gamme);
214    });
215
216    /****
217     * affichage des modèles
218     * @param gamme
219     */
220    function trosiemeEtapeModel(gamme) {
221
222        /****
223         * on récupère le modele
224         */
225        var card = $('.etape3 .regulMarge');
226        card.empty();
227        var htmlToInject = '';
228        $.ajax({
229            url: 'rechercheParGamme',
230            type: 'get',
231            data: {
232                gamme: gamme
233            },
234            dataType: 'json',
235            async: false,
236            success: function (retour) {
237
238                console.log(retour);
239
240                if (retour.statut === 'ok') {
241
242                    if (retour.models.length !== 0) {
243                        for (var i = 0; i < retour.models.length; i++) {
244                            if (retour.models[i].year == null) {
245                                retour.models[i].year = '?';
246                            }
247                            htmlToInject += '<div class="modele">\n' +
248                                '                        <div class="label">' + retour.models[i].car_body + '</div>\n' +
249                                '                        <div class="logos_gamme logo_voiture">\n' +
250                                '                            <div class="col-lg-1 col-md-2 col-sm-4 col-xs-6">\n' +
251                                '                                <div data-year="' + retour.models[i].year + '" data-model="' + retour.models[i].car_type + '" class="' + retour.models[i].car_segment + '">\n' +
252                                '                                    <div>' + retour.models[i].car_type + '</div>\n' +
253                                checkImage(retour.cheminImagesGammes, retour.models[i].picture_name) +
254                                '                                <div>depuis ' + retour.models[i].year + '</div>\n' +
255                                '                                </div>\n' +
256                                '                            </div>\n' +
257                                '                        </div>\n' +
258                                '                    </div>';
259                        }
260                    } else {
261
262                        htmlToInject += '<div class="modele">\n' +
263                            '                        <div class="label">Aucun modèle trouvé</div>\n' +
264                            '                    </div>';
265                    }
266                }
267
268            }, error: function (erreur) {
269                // console.log(erreur);
270                alert('Une erreur est survenue.');
271                return false;
272            }
273        });
274        card.hide().html(htmlToInject).fadeIn();
275    }
276
277
278// ETAPE 3 : on clique sur le modèle
279    $(document).on('click', '.formHome .tab-content>.tab#onglet_vehicule .etape3 .logos_gamme.logo_voiture>div>div', function () {
280        $('.etape3').hide();
281        $('.etape4').show();
282        var modelSelectionne = $(this).data('model');
283        paramfinauxParModeleDeVehicule.modele = modelSelectionne; // $(this).parents('.modele').find('.label').text();
284
285        modeleArianeAffichage.modeleChoix = $(this).parents('.modele').find('.label').text();
286
287        filAriane(paramfinauxParModeleDeVehicule, 3);
288        dataLayer.push({
289            'event': 'RecherchePneus',
290            'event_detail':
291                {
292                    'action': 'Step - Modèle',
293                    'label': modeleArianeAffichage.modeleChoix
294                }
295        });
296
297        var htmlToInject = '';
298        var divEtape4 = $('.et4');
299
300        /*** envoi du modele pour avoir tous les motorisations ***/
301        $.ajax({
302            url: 'rechercheParModele',
303            type: 'get',
304            data: {
305                gamme: modelSelectionne, // gamme = par exemple Golf, modèle = berline|break etc
306                modele: $(this).parents('.modele').find('.label').text(),
307                annee: $(this).data('year'),
308            },
309            dataType: 'json',
310            async: false,
311            success: function (retour) {
312                //console.log(852, retour);
313                if (retour.statut === 'ok') {
314                    if (!retour.hasOwnProperty('motorisationElectrique')) {
315
316                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-2"><div class="label">Essence</div><div class="logo_voiture select_carburant"><div class="col-xs-12 col-sm-6 col-md-4"><div><select>';
317                        htmlToInject += '<option value="def" selected disabled hidden>-- Sélectionnez une motorisation</option>';
318
319                        for (var i = 0; i < retour.motorisationEssence.length; i++) {
320                            htmlToInject += '<option  data-carb="' + retour.motorisationEssence[i].energy + '" data-motor="' + retour.motorisationEssence[i].motor + '">' + retour.motorisationEssence[i].motor + ' (' + retour.motorisationEssence[i].year + ')</option>';
321                        }
322                        htmlToInject += '<option data-carb="ESS" data-motor="unknown">je ne sais pas</option></select></div></div></div></div>';
323
324
325                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-2"><div class="label">Diesel</div><div class="logo_voiture select_carburant"><div class="col-xs-12 col-sm-6 col-md-4"><div><select>';
326                        htmlToInject += '<option value="def" selected disabled hidden>-- Sélectionnez une motorisation</option>';
327                        for (var j = 0; j < retour.motorisationDiesel.length; j++) {
328                            htmlToInject += ' <option data-carb="' + retour.motorisationDiesel[j].energy + '" data-motor="' + retour.motorisationDiesel[j].motor + '">' + retour.motorisationDiesel[j].motor + ' (' + retour.motorisationDiesel[j].year + ')</option>';
329                        }
330                        htmlToInject += '<option data-carb="DIES" data-motor="unknown">je ne sais pas</option></select></div></div></div></div>';
331                    }
332                    if (retour.hasOwnProperty('motorisationElectrique')) {
333                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-2"><div class="label">Electrique</div><div class="logo_voiture select_carburant"><div class="col-xs-12 col-sm-6 col-md-4"><div><select>';
334                        htmlToInject += '<option value="def" selected disabled hidden>-- Sélectionnez une motorisation</option>';
335                        for (var k = 0; k < retour.motorisationElectrique.length; k++) {
336                            htmlToInject += ' <option data-carb="' + retour.motorisationElectrique[k].energy + '" data-motor="' + retour.motorisationElectrique[k].motor + '">' + retour.motorisationElectrique[k].motor + ' (' + retour.motorisationElectrique[k].year + ')</option>';
337                        }
338                        htmlToInject += '<option data-carb="ELEC" data-motor="unknown">je ne sais pas</option></select></div></div></div></div>';
339
340
341                    }
342
343                    if (retour.hasOwnProperty('motorisationHybride')) {
344                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-2"><div class="label">Hybride</div><div class="logo_voiture select_carburant"><div class="col-xs-12 col-sm-6 col-md-4"><div><select>';
345                        htmlToInject += '<option value="def" selected disabled hidden>-- Sélectionnez une motorisation</option>';
346                        for (var l = 0; l < retour.motorisationHybride.length; l++) {
347                            htmlToInject += ' <option data-carb="' + retour.motorisationHybride[l].energy + '" data-motor="' + retour.motorisationHybride[l].motor + '">' + retour.motorisationHybride[l].motor + ' (' + retour.motorisationHybride[l].year + ')</option>';
348                        }
349                        htmlToInject += '<option data-carb="HYB" data-motor="unknown">je ne sais pas</option></select></div></div></div></div>';
350
351                    }
352
353                }
354
355            }, error: function (erreur) {
356                // console.log(erreur);
357                alert('Une erreur est survenue.');
358                return false;
359            }
360        });
361        divEtape4.hide().html(htmlToInject).fadeIn();
362    });
363
364
365// ETAPE 4 : onclique sur le carburant et le moteur
366    $(document).on('change', '.formHome .tab-content>.tab#onglet_vehicule .etape4 select', function (e) {
367        e.preventDefault();
368        $('.etape4').hide();
369        $('.etape5').show()
370        var carb = $(this).find(':selected').data('carb');
371        var motor = $(this).find(':selected').data('motor');
372
373        var htmlToInject = '';
374        //var parameters = '';
375        paramfinauxParModeleDeVehicule.carburant = carb;
376        paramfinauxParModeleDeVehicule.motorisation = motor;
377        modeleArianeAffichage.carburantChoix = carb;
378        filAriane(paramfinauxParModeleDeVehicule, 4);
379        //console.log(paramfinauxParModeleDeVehicule);
380
381        dataLayer.push({
382            'event': 'RecherchePneus',
383            'event_detail':
384                {
385                    'action': 'Step - Motorisation',
386                    'label': motor
387                }
388        });
389        var divEtape5 = $('.et5');
390        divEtape5.empty();
391        var type;
392        /*****
393         * envoi de la motorisation pour choper les dimensiosn adaptées
394         */
395        //console.log(849, carb);
396        //console.log(850, motor);
397        //console.log(851, paramfinauxParModeleDeVehicule.modele);
398        //console.log(852, paramfinauxParModeleDeVehicule);
399        $.ajax({
400            url: 'rechercheParMotorisation',
401            type: 'get',
402            data: {
403                carburant: carb,
404                motorisation: motor,
405                modele: paramfinauxParModeleDeVehicule.modele
406            },
407            dataType: 'json',
408            async: false,
409            success: function (retour) {
410                //console.log(853, retour);
411                if (retour.statut === 'ok') {
412                    var htmltoInjectToutesLesSaisons = '';
413                    var htmltoInjectNeige = '';
414                    var htmltoInjectEte = '';
415                    var htmltoInjectHiver = '';
416                    var htmltoInjectAutres = '';
417
418                    if (retour.dimensions.length > 0) {
419                        if (Array.isArray(retour.listeProdParSaison)) {
420                            if (retour.listeProdParSaison[0].length === 0) {
421                                $('#tyreSelectorNoDimensions').modal("show");
422
423                                $("#tyreSelectorNoDimensions").on('hide.bs.modal', function () {
424                                    location.reload(true);
425                                });
426                            }
427                        }
428
429                        for (var i = 0; i < retour.dimensions.length; i++) {
430                            for (var t = 0; t < retour.listeProdParSaison.length; t++) {
431                                if (typeof retour.listeProdParSaison[i][t] != 'undefined') {
432                                    if (retour.listeProdParSaison[i][t].auto_saison == 'AllSeasons') {
433                                        type = 0;
434                                        htmltoInjectToutesLesSaisons += '<div class="dimension">\n' +
435                                            '                                <div class="haut">\n' +
436                                            '                                    ' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '\n' +
437                                            '                                </div>\n' +
438                                            '                                <a class="btn btn-voir" href="pagerecherche?q=' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '&typeform=modele&auto_saison=' + encodeURIComponent('AllSeasons') + '&tri=price_sort_asc">\n' +
439                                            '                                    voir l\'offre \n' +
440                                            '                                </a>\n' +
441                                            '                            </div>';
442
443                                    }
444                                    else if (retour.listeProdParSaison[i][t].auto_saison == 'Nordic') {
445
446                                        type = 1;
447                                        htmltoInjectNeige += '<div class="dimension">\n' +
448                                            '                                <div class="haut">\n' +
449                                            '                                    ' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '\n' +
450                                            '                                </div>\n' +
451                                            '                                <a class="btn btn-voir" href="pagerecherche?q=' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '&typeform=modele&auto_saison=' + encodeURIComponent('Neige') + '&tri=price_sort_asc">\n' +
452                                            '                                     voir l\'offre \n' +
453                                            '                                </a>\n' +
454                                            '                            </div>';
455                                    }
456                                    else if (retour.listeProdParSaison[i][t].auto_saison == 'Summer') {
457                                        type = 2;
458                                        htmltoInjectEte += '<div class="dimension">\n' +
459                                            '                                <div class="haut">\n' +
460                                            '                                    ' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '\n' +
461                                            '                                </div>\n' +
462                                            '                                <a class="btn btn-voir" href="pagerecherche?q=' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '&typeform=modele&auto_saison=' + encodeURIComponent('Summer') + '&tri=price_sort_asc">\n' +
463                                            '                                    voir l\'offre \n' +
464                                            '                                </a>\n' +
465                                            '                            </div>';
466                                    }
467
468                                    else if (retour.listeProdParSaison[i][t].auto_saison == 'Winter') {
469                                        type = 3;
470                                        htmltoInjectHiver += '<div class="dimension">\n' +
471                                            '                                <div class="haut">\n' +
472                                            '                                    ' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '\n' +
473                                            '                                </div>\n' +
474                                            '                                <a class="btn btn-voir" href="pagerecherche?q=' + retour.dimensions[i].front_width + '/' + retour.dimensions[i].front_ratio + ' ' + retour.rattrapAutoRadial[i] + ' ' + retour.dimensions[i].front_diameter + ' ' + retour.dimensions[i].front_load_index + ' ' + retour.dimensions[i].front_speed_index + '&typeform=modele&auto_saison=' + encodeURIComponent('Winter') + '&tri=price_sort_asc">\n' +
475                                            '                                    voir l\'offre \n' +
476                                            '                                </a>\n' +
477                                            '                            </div>';
478                                    }
479                                }
480                            }
481                        }
482                    } else {
483                        $('#tyreSelectorNoDimensions').modal("show");
484                        $("#tyreSelectorNoDimensions").on('hide.bs.modal', function () {
485                            location.reload(true);
486                        });
487                    }
488                    if (htmltoInjectToutesLesSaisons != "") {
489                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-4 col-lg-3"><div class="label">Dimensions homologuées <b>4 saisons</b></div>' + htmltoInjectToutesLesSaisons + '</div>';
490                    }
491                    if (htmltoInjectNeige != "") {
492                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-4 col-lg-3"><div class="label">Dimensions homologuées <b>Neige</b></div>' + htmltoInjectNeige + '</div>';
493                    }
494                    if (htmltoInjectHiver != "") {
495                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-4 col-lg-3"><div class="label">Dimensions homologuées <b>Hiver</b></div>' + htmltoInjectHiver + '</div>';
496                    }
497                    if (htmltoInjectEte != "") {
498                        htmlToInject += '<div class="modele col-xs-12 col-sm-6 col-md-4 col-lg-3"><div class="label">Dimensions homologuées <b>Eté</b></div>' + htmltoInjectEte + '</div>';
499                    }
500
501                }
502
503            }, error: function (erreur) {
504                alert('Une erreur est survenue.');
505                return false;
506            }
507        });
508        divEtape5.hide().html(htmlToInject).fadeIn();
509
510    });
511});
512
513/***
514 *
515 * @param choix : obj contenant les valeurs
516 * @param etapeActuelle
517 */
518function filAriane(choix, etapeActuelle) {
519    var render = '';
520    var etapeNumero = 1;
521    var souligne = '';
522    var texteToDisplay = '';
523    var choixTampon = choix; // copie
524    if (choixTampon.hasOwnProperty("carburant")) {
525        delete choixTampon["carburant"];
526    }
527
528    for (var categorie in choix) {
529
530        if (etapeNumero === etapeActuelle) {
531            souligne = 'text-decoration:underline;font-weight:600;cursor: pointer;';
532        } else {
533            souligne = 'cursor: pointer;';
534        }
535
536        if (etapeNumero === 3) {
537            texteToDisplay = modeleArianeAffichage.modeleChoix.toUpperCase() + " " + (typeof modeleArianeAffichage.carburantChoix != 'undefined' ? modeleArianeAffichage.carburantChoix.toUpperCase() : "");
538        } else if (etapeNumero === 2) {
539            texteToDisplay = modeleArianeAffichage.typeChoix.toUpperCase();
540        } else {
541            texteToDisplay = choix[categorie].toString().toUpperCase();
542        }
543
544        render += "<span style='" + souligne + "' class='fa-etape-" + etapeNumero + "' onclick='retourArriere(" + etapeNumero + "," + etapeActuelle + ")'>" + texteToDisplay + "</span><span> > </span>";
545        etapeNumero++;
546    }
547    $('.fil-ariane-vehicules').html(render);
548    $('.fil-ariane-vehicules span span').last().remove();
549
550
551}
552
553
554function initSwiper() {
555    swiper = new Swiper('.swiper-container', {
556        slidesPerView: nombreItemsCarrousel,
557        slidesPerColumn: 2,
558        edgeSwipeDetection: false,
559        edgeSwipeThreshold: 20,
560        autoHeight: false,
561        autoplay: {
562            delay: 4000,
563        },
564        spaceBetween: 20,
565        pagination: {
566            el: '.swiper-pagination',
567            clickable: true,
568        },
569        loop: false,
570
571        navigation: {
572            nextEl: '.swiper-button-next',
573            prevEl: '.swiper-button-prev',
574        },
575
576    });
577}
578
579/***
580 * affiche la nouvelle étape cliquée et ferme celle actuelle
581 * @param id : etape où l'on veut aller
582 * @param etapeActuelle
583 */
584function retourArriere(id, etapeActuelle) {
585    if (id !== 5) {
586        var entetesFilter = Object.keys(paramfinauxParModeleDeVehicule);
587        $('.etape').hide();
588        $('.etape' + id).slideDown();
589
590        if (id === 1) {
591            swiper.destroy('.swiper-container');
592        } else if (id === 3) {
593            delete modeleArianeAffichage.carburantChoix;
594            delete modeleArianeAffichage.modeleChoix;
595        }
596        else if (id === 2) {
597            delete modeleArianeAffichage.typeChoix;
598
599        }
600
601        document.querySelectorAll('.fil-ariane-vehicules span').forEach(function (item, index) {
602            if (index >= (id - 1)) {
603                $(item).remove();
604                delete paramfinauxParModeleDeVehicule[entetesFilter[index]];
605            }
606        });
607    }
608
609}
610
611
612function checkImage(urlBase, variable, allgammesMode) {
613    var classe = '';
614    if (allgammesMode) {
615        classe = 'class="img-rendu"';
616    }
617    if (variable == null || variable == 'null') {
618        return "<img src='" + urlBase + "/images/inconnu.png' " + classe + ">";
619    }
620    return "<img src='" + urlBase + "/images/gammes_phares/" + variable + "' " + classe + ">";
621}

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.