PageSourceSearch

https://www.mylifesacage.com/wp-content/themes/mylifeisacage/js/page-main.js?ver=22

js mylifesacage.com collected 2026-10-07 17:42:30 UTC 10,142 bytes, 318 lines download raw bytes

1jQuery(document).ready(function($){
2    var easing= 'easeInOutQuad' ;
3    var atHome = function(){
4        if(window.location.href.match(/mlac(\.([a-z]{2,3}))?(\.([a-z]{5}))?(\/)?([a-z]{2})?(\/)?(#([a-z])*)?$/g) === null){
5            return false ;
6        }else{
7            return true ;
8        }        
9    };
10    var setMetaFb = function(){
11        $('meta[property="og:url"]').attr('content', window.location.href);
12    };
13    var indexBg = 0 ;
14    posLogo = new Array() ;
15    posLogo[0] = '65%';
16    posLogo[1] = '45%';
17    posLogo[2] = '35%';
18    posLogo[3] = '40%';
19    posLogo[4] = '70%';
20    posLogo[5] = '60%';
21
22    images = $('.bgImage');
23
24    var homeLayoutLogo = function(){
25        $('.bgLogo').removeClass('bgLogoPage');
26    };
27    var homeLayout = function(){
28        homeLayoutLogo();
29        $('.row-content').queue(function(){
30            $(this).animate({'opacity': '0'}, 600);
31            $(this).dequeue();
32        });
33        $('.row-content').queue(function(){
34            $('.bgActors, .bgCredit').show(600);
35            $(this).dequeue();            
36        });
37        indexBg = 0;
38        if(categorizr.isDesktop === true){
39            $passive = images.filter(':not(.activeBg)');
40            $active = images.filter('.activeBg');
41            $passive.attr('src').replace(/bg[1-9]/, 'bg0');
42            $passive.imagesLoaded(function(){
43                $active.animate({
44                    opacity : 0
45                }, 2000, easing);            
46                $passive.animate({
47                    opacity : 1
48                }, 2000, easing);
49            });
50            $passive.addClass('activeBg');
51            $active.removeClass('activeBg');
52            setInterval(function(){
53                $passive = images.filter(':not(.activeBg)');
54                $active = images.filter('.activeBg');
55                indexBg = (indexBg === 5) ? 0 : indexBg + 1 ;                
56                $passive.attr('src', $passive.attr('src').replace(/bg[0-9]/, 'bg'+indexBg));
57                imagesLoaded($passive, function(){
58                    $active.animate({
59                        opacity : 0
60                    }, 2000, easing);
61                    $passive.animate({
62                        opacity : 1
63                    }, 2000, easing);                    
64                });
65                $passive.addClass('activeBg');
66                $active.removeClass('activeBg');    
67/*
68                if(atHome()){
69                    $('.bgLogo').animate({'top' : posLogo[index]}, 1200, easing);            
70                }*/
71            }, 12000); 
72        }
73    };
74    var pageLayoutLogo = function(){
75        $('.bgLogo').addClass('bgLogoPage');       
76    };
77    var pageLayout = function(){
78        pageLayoutLogo();
79        $('.row-content').queue(function(){
80            $(this).animate({'opacity': '1'}, 600);
81            $(this).dequeue();
82        });
83        $('.row-content').queue(function(){
84            $('.bgActors, .bgCredit').hide(600);
85            $(this).dequeue();            
86        });
87    };
88    // loader
89    var positionLoader = function(){
90        parentHeight = $('.main-loader').parent().height();
91        posTop = ((( parentHeight - $('.main-loader').height() ) /2))+'px' ;
92        $('.main-loader').css('top', posTop) ;                
93    };
94    var showLoader = function(){
95        $('.main-loader').css('display', 'block');
96        $('.main-loader').animate({'opacity': '0.85'}, 300);
97    };
98    var hideLoader = function(){
99        if($('.main-loader').css('display') === 'block'){
100            $('.main-loader').animate({'opacity': '0'},{
101                'duration': 300,
102                'complete': function(){
103                    $('.main-loader').css('display', 'none');
104                }
105            });            
106        }
107    };
108    
109    // background
110    var positionBg = function(){
111        if(atHome()){
112            homeLayoutLogo();
113        }else{
114            pageLayoutLogo();
115        }
116    };
117
118    // background pages
119    if(atHome()){
120        homeLayout();
121    }else{
122        pageLayout();
123    }
124    $('.row-content').customScrollbar({
125        'updateOnWindowResize': true
126    });
127
128    var menu = $('.navMenu') ;
129
130    // burger
131    var clicked = false ;
132    var closeMenu = function(){
133            menu.removeClass("menu-open") ;
134            menu.addClass("menu-closed") ;
135            $('.social-head').removeClass("menu-open");
136    };
137    var openMenu = function(){
138            menu.removeClass("menu-closed") ;
139            menu.addClass("menu-open") ;
140            $('.social-head').addClass("menu-open");
141    };
142    var toggleMenu = function(){
143        if(clicked){
144            closeMenu() ;
145            clicked = false ;
146        }else{
147            openMenu();
148            clicked = true ;
149        }        
150    };
151    var lis = $('li.menu-item a, .menu-home');
152    $('li.menu-item a, .navRight a').on('click', function(e){
153        closeMenu();
154        if($(this).parent('li').hasClass('current-menu-item')){
155            return;
156        }
157        showLoader();
158        lis.parent('li').removeClass('current-menu-item');
159        $(this).parent('li').addClass('current-menu-item');
160        pageLayout();
161    });
162    $('.menu-home').on('click', function(){
163        closeMenu();
164        if($(this).parent('li').hasClass('current-menu-item')){
165            return;
166        }
167        lis.parent('li').removeClass('current-menu-item');
168        $(this).parent('li').addClass('current-menu-item');
169        showLoader();
170        homeLayout();
171    });
172    $('.menu-trigger').on('click', function(){
173        toggleMenu();
174    });
175    $('li.menu-item a').on('touchend', function(e){
176        e.preventDefault();
177        $(this).trigger('click');
178    });
179    $('.menu-trigger').on('touchend', function(e){
180        e.preventDefault();
181        $(this).trigger('click');
182    });
183    $('.menu-home').on('touchend', function(e){
184        e.preventDefault();
185        $(this).trigger('click');
186    });
187    
188    $('.menu-trigger').hover(function(){
189        if(menu.hasClass('menu-closed')){
190            $('.navTrigger').addClass('triggerHover') ;            
191        }
192    }, function(){
193        $('.navTrigger').removeClass('triggerHover') ;            
194    });
195    
196    $('.navTrigger').addClass('triggerHover') ;
197    setTimeout(function(){
198        $('.navTrigger').removeClass('triggerHover') ;
199    }, 2000);
200    
201    setTooltip = function(){
202        $('[data-toggle="tooltip"]').tooltip();
203    };
204    var setZoomin = function(){
205        $('.use-zoom').lightbox({
206            'childSelector': 'img',
207            'targetFilter': function(src){
208                return src.replace(/-\d{2,4}x\d{2,4}/i, '');
209            },
210            'zoomin': true,
211            'zoomerRatio': 2,
212            'zoomerSize': ($(window).height() * 0.5)
213        });        
214    };
215    var initClassLightbox = function(){
216        if($('.use-jerzy-lightbox').size() > 0){
217            $('.use-jerzy-lightbox').lightbox({
218                'targetFilter': function(src){
219                    return src.replace(/(-e\d+)?-\d{2,4}x\d{2,4}/i, '');
220                }
221            });
222        }        
223    };
224    var scrolling = false ;
225    var timer_check;
226    var t_on = false;
227    var timerFooter = function(){
228        if(t_on === false){
229            t_on = true;
230            timer_check = setTimeout(function(){
231                $('.footer.visible-xs-block, .bgLogo').removeClass('footer-bottom');
232                scrolling = false;
233                t_on = false;
234            }, 5000);
235        }
236    };
237    var clearTimerFooter = function(){
238        if(t_on === true){
239            t_on = false;
240            clearTimeout(timer_check);
241        }
242    };
243    $('.footer').on({
244        mouseover: clearTimerFooter,
245        mouseout: timerFooter
246    });
247    $('.wp_mandrilloptin input').on({
248        focus: clearTimerFooter,
249        blur: timerFooter
250    });
251    $('.footer').on('hover', clearTimerFooter, timerFooter);
252    var toggleFooter = function(){
253        if(scrolling === false){
254            scrolling = true;
255            $('.footer.visible-xs-block, .bgLogo')
256                    .addClass('footer-bottom');
257            timerFooter();
258        }else{
259            timerFooter();
260        }
261    };
262    var initMainNav = function(){
263        $('.ssba img').attr('data-toggle', 'tooltip').each(function(){
264            $(this).attr('title', $(this).attr('alt'));
265        });
266        $('.bgOuter').on('customScroll', '.row-content', toggleFooter);        
267    };
268    var initNewsletter = function(){
269        $('#mandrill_add_email').on('click', function(){
270            
271        });
272    };
273    var updateBaliseFacebook = function(){
274        $('meta[property="og:url"]').attr('content', window.location.href);
275    };
276    var updateLinkDeveloper = function(prenom, nom, domaine){
277        $('.linkDeveloper').wrap($('<a/>').attr('href', 'mail'+'to: '+prenom+'_'+nom+'@'+domaine));
278    };
279    updateLinkDeveloper('benjamin', 'pottel', 'hotmail.com');
280    $(window).on('statechangecomplete', function(){
281        $('.row-content').customScrollbar('resize', true) ;
282        setMetaFb();
283        hideLoader();
284        setTooltip();
285        setZoomin();
286        initClassLightbox();
287        updateBaliseFacebook();
288        if($('.overview').height() > $('.viewport').height()){
289            $('.row-content').customScrollbar('scrollToY', 0);            
290        }
291   });    
292    var resizeContent = function(){
293        $('.row-content').customScrollbar('resize', true);
294        positionLoader() ;
295        positionBg() ;
296    };
297    $('.bgImages').imagefill();
298    loaded = false;
299    $('.container-fluid').imagesLoaded(function(){
300        loaded = true;
301        resizeContent() ;
302        hideLoader();    
303        setZoomin();
304    });
305    initClassLightbox();
306    initMainNav();
307    setMetaFb();
308    setTooltip();
309    setTimeout(function(){
310        if(loaded === false){
311            resizeContent() ;
312            hideLoader();    
313            setZoomin();        
314        }        
315    }, 10000);
316    $(window).on('resize', resizeContent);
317    $('.lang-item, .lang-item a, .lang-item a img').addClass('no-ajaxy');
318});

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.