PageSourceSearch

http://www.tisseomobibus.com/wp-content/themes/mobibus/js/main.js?ver=a8f59e0d275416a107ec79a12094973e

js tisseomobibus.com collected 2026-10-08 19:49:44 UTC 10,171 bytes, 301 lines download raw bytes

1var glide;
2var themeURL = "https://www.tisseomobibus.com/wp-content/themes/mobibus/";
3// ******************
4// READY EVENT
5// ******************
6jQuery(document).ready(function() {
7
8    //showconsole(jQuery( window ).width());
9
10    if(jQuery( window ).width() > 767){
11        if(jQuery('body').hasClass('admin-bar')){
12            jQuery("#nav-fixed").sticky({topSpacing:31});
13        } else {
14            jQuery("#nav-fixed").sticky({topSpacing:0});
15        }
16    }
17
18
19
20    jQuery('.js-scrollTo').on('click', function() { // Au clic sur un élément
21		/*console.log($('#annee-texte-id'));*/
22        var page = $(this).attr('href'); // Page cible
23        var speed = 750; // Durée de l'animation (en ms)
24        $('html, body').animate( { scrollTop: $(page).offset().top }, speed ); // Go
25        return false;
26    });
27
28    // ******************
29    // HOMEPAGE > SLIDESHOW
30    // ******************
31
32    if(jQuery("#glide-tisseo__slides").length === 1) {
33
34        glide = new Glide('.glide', {
35            autoplay: 3000,
36            hoverpause: true
37        });
38        glide.mount();
39
40        var theBgColor = jQuery('#diapo-subtitle-0').data('bgcolor');
41        jQuery('.glide__subtitles').css({'background-color': theBgColor});
42        jQuery('#diapo-subtitle-0').fadeIn();
43
44        var glideNextIndex = 0;
45        var glidePrevIndex = 0;
46
47        glide.on(['run.before'], function () {
48            glidePrevIndex = jQuery('.glide__slide--active').data('subtitleindex');
49        });
50
51        glide.on(['run.after'], function () {
52            glideNextIndex = jQuery('.glide__slide--active').data('subtitleindex');
53            jQuery('#diapo-subtitle-' + glideNextIndex).fadeIn();
54            jQuery('#diapo-subtitle-' + glidePrevIndex).fadeOut();
55            theBgColor = jQuery('#diapo-subtitle-' + glideNextIndex).data('bgcolor');
56            jQuery('.glide__subtitles').css({'background-color': theBgColor});
57        });
58
59
60        // ******************
61        // ACCESSIBILITY
62        // ******************
63        jQuery('#accessibility-tools a').on('click', function () {
64            return false;
65        });
66    }
67
68
69    // -------- ZOOM --------
70    var zoomTarget = jQuery('#page');
71    var actual_zoom = localStorage.getItem('acc-zoom-value');
72
73    if(!parseFloat(actual_zoom)){
74        actual_zoom = 1;
75        localStorage.setItem('acc-zoom-value',actual_zoom);
76    } else {
77        zoomTarget.css('zoom',parseFloat(actual_zoom));
78    }
79
80    jQuery('#acc-zoomin').on('click', function() {
81        newZoom = parseFloat(localStorage.getItem('acc-zoom-value')) + 0.1;
82        if(newZoom > 1.5){ newZoom = 1.5; }
83        zoomTarget.css('zoom',newZoom);
84        localStorage.setItem('acc-zoom-value',newZoom);
85        glide.update({ startAt: 1 })
86
87    });
88    jQuery('#acc-zoomout').on('click', function() {
89        newZoom = parseFloat(localStorage.getItem('acc-zoom-value')) - 0.1;
90        if(newZoom < 0.5){ newZoom = 0.5; }
91        zoomTarget.css('zoom',newZoom);
92        localStorage.setItem('acc-zoom-value',newZoom);
93        glide.update({ startAt: 1 })
94    });
95
96    // -------- CONTRAST --------
97    var actual_contrast = localStorage.getItem('acc-contrast-value');
98
99    switch(actual_contrast){
100        case 'contrastcss' :
101            addCss(themeURL+'assets/css/contrast+.css','contrastcss');
102            switchImages();
103            break;
104        default :
105            jQuery('#contrastcss').remove();
106            localStorage.setItem('acc-contrast-value','');
107            switchImages();
108    }
109
110    jQuery('#acc-contrast-more').on('click', function() {
111        addCss(themeURL+'assets/css/contrast+.css','contrastcss');
112        localStorage.setItem('acc-contrast-value','contrastcss');
113        switchImages();
114    });
115    jQuery('#acc-contrast-less').on('click', function() {
116        jQuery('#contrastcss').remove();
117        localStorage.setItem('acc-contrast-value','');
118        switchImages();
119
120    });
121
122    // ******************
123    // MENU MOBILE
124    // ******************
125
126    jQuery('#menu-checkbox').click(function() {
127        if( jQuery('input[id=menu-checkbox]').is(':checked') ){
128            jQuery('body').addClass('scrollOff');
129            jQuery('#menu-logo').fadeIn();
130            jQuery('.nav-menu').fadeIn();
131
132            // jQuery('#primary-menu').fadeIn();
133            // jQuery('#primary-menu').addClass('smallMenu');
134            jQuery('.menu-menu-principal-container').fadeIn();
135            jQuery('.menu-menu-principal-container').addClass('smallMenu');
136        } else {
137            jQuery('body').removeClass('scrollOff');
138            jQuery('#menu-logo').fadeOut();
139            jQuery('.nav-menu').fadeOut();
140
141            // jQuery('#primary-menu').fadeOut();
142            // jQuery('#primary-menu').removeClass('smallMenu');
143            jQuery('.menu-menu-principal-container').fadeOut();
144            jQuery('.menu-menu-principal-container').removeClass('smallMenu');
145        }
146    });
147
148    // ******************
149    // Lien "MON COMPTE"
150    // ******************
151
152    jQuery('#but-compte').click(function() {
153        console.log('mon compte');
154    });
155
156    // ******************
157    // ACTU A LA UNE
158    // ******************
159
160    // cookies
161    var cookie_array = [];
162    document.cookie.split('; ').forEach(myFunction);
163    function myFunction(val, key) {
164        cookie_val_splited = val.split('=');
165        cookie_array[cookie_val_splited[0]] = cookie_val_splited[1];
166    }
167    if(cookie_array['mobibus-actu-a-la-une'] === undefined){ // le navigateur n'a pas de cookie Mobibus
168        document.cookie = "mobibus-actu-a-la-une="+Date.now(); // création du cookie
169        if(jQuery('#actu-popin-content').html().trim() === ''){ // il n'y a aucune actu
170            window.location.hash = '';
171        }else{ // il y a au moins une actu
172            window.location.hash = 'actu-a-la-une';
173        }
174    }else{ // le navigateur a un cookie Mobibus
175        if((parseInt(Date.now()) - parseInt(cookie_array['mobibus-actu-a-la-une'])) < 86400000){ // cookie < 24 heures
176            window.location.hash = '';
177        }else{ // cookie > 24 heures
178            if(jQuery('#actu-popin-content').html().trim() == ''){ // il n'y a aucune actu
179                window.location.hash = '';
180            }else{ // il ya au moins une actu
181                document.cookie = "mobibus-actu-a-la-une="+Date.now(); // création du nouveau cookie
182                window.location.hash = 'actu-a-la-une';
183            }
184        }
185    }
186
187
188
189});
190
191// ******************
192// RESIZE EVENT
193// ******************
194
195jQuery(window).resize(function() {
196
197
198});
199
200// ******************
201// ON LOAD EVENT
202// ******************
203
204window.onload=function() {
205    /*
206    if(jQuery("#glide-tisseo__slides").length === 1) {
207
208        var glideTisseo = '';
209        var tisseoNewsUrl = themeURL + 'inc/tisseo-news.php';
210        var jqxhr = jQuery.ajax(tisseoNewsUrl)
211            .done(function () {
212                //alert( "success" );
213            })
214            .fail(function () {
215                //alert( "error" );
216            })
217            .always(function (data) {
218                //alert( "complete" );
219                myObj = JSON.parse(data);
220                tab = myObj.children[0].children;
221                //console.log(tab);
222                i = 0;
223                for (line in tab) {
224
225                    glideTisseo += '<li class="glide__slide">';
226                    glideTisseo += '<a href="' + tab[i].children[0].href + '" title="' + tab[i].children[1].children[0].html + '" target="_blank">';
227
228
229                    glideTisseo += '<img src="wp-content/themes/mobibus/assets/img/lazy-loader.gif" alt="' + tab[i].children[1].children[0].html + '" class="lazyload" data-src="https://www.tisseo.fr' + tab[i].children[0].children[0].src + '" data-srcset="https://www.tisseo.fr' + tab[i].children[0].children[0].src + ' 1x" />'
230                    glideTisseo += '<span class="tisseo_news_titre">' + tab[i].children[1].children[0].html + '</span>';
231                    glideTisseo += '<span class="tisseo_news_desc">' + tab[i].children[1].children[2].children[0].children[0].html + '</span></a>';
232                    glideTisseo += '</li>';
233                    //console.log(tab[i].children[0].href); //HREF
234                    //console.log(tab[i].children[1].children[0].html); //TITRE
235                    //console.log(tab[i].children[1].children[2].children[0].children[0].html); //DESC
236                    i = i + 1;
237                }
238
239                jQuery("#glide-tisseo__slides").html(glideTisseo);
240
241            });
242        jqxhr.always(function () {
243            //alert( "second complete" );
244            glideTisseo = new Glide('.glide-tisseo', {
245                autoplay: 4000,
246                type: 'carousel',
247                hoverpause: true
248            });
249            glideTisseo.mount();
250            glideTisseo.update();
251        });
252
253    }
254    */
255    jQuery("#tisseo-news-import").load(
256      "https://www.tisseomobibus.com/wp-content/themes/mobibus/inc/tisseo-news.php"
257    );
258}
259
260
261// ******************
262// FONCTIONS
263// ******************
264
265//Console debug
266function showconsole(str){
267    window.console && console.log(str);
268}
269
270function addCss(cssUrl,id){
271    if(document.getElementById('contrastcss')){
272        showconsole('CSS existant '+id);
273    } else {
274        showconsole('CSS non existant'+id);
275        if (document.createStyleSheet){
276            document.createStyleSheet(cssUrl);
277        }
278        else {
279            jQuery("head").append(jQuery("<link rel='stylesheet' href='"+cssUrl+"' type='text/css' media='screen' id='"+id+"' />"));
280        }
281    }
282
283}
284function switchImages(){
285
286    actual_contrast = localStorage.getItem('acc-contrast-value');
287
288    switch(actual_contrast){
289        case 'contrastcss' :
290            jQuery('#img-logo-site').attr('src',jQuery('#img-logo-site').data('imgnb'));
291            jQuery('#img-logo-acceo').attr('src',jQuery('#img-logo-acceo').data('imgnb'));
292            break;
293        default :
294            jQuery('#img-logo-site').attr('src',jQuery('#img-logo-site').data('imgsrc'));
295            jQuery('#img-logo-acceo').attr('src',jQuery('#img-logo-acceo').data('imgsrc'));
296            break;
297
298    }
299
300
301}

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.