PageSourceSearch

https://diocese-tournai.be/wp-content/themes/enfold/js/test.js?ver=4.8.2

js diocese-tournai.be collected 2026-10-02 07:26:08 UTC 20,129 bytes, 362 lines download raw bytes

1(function($)
2{   
3    $(document).ready(function()
4    {   
5        $("#sub_menu1").css({"border":"none"});
6
7        // ancien code pour les lignes de couleur 
8            /*var line = '<div class="line_eveche"></div>';
9            var lines_container = '<div id="lines_container"></div>';
10            $("#sub_menu1").append(lines_container);
11            for(i=0;i<5;i++){
12                $("#lines_container").append(line);
13            }
14            var lines = $(".line_eveche");
15            for(i=0;i<lines.length;i++){
16                $(lines[i]).addClass("line_eveche_color_"+i); 
17            }
18            */
19
20        var slider = $(".el_after_av_submenu");
21        var sliderHeight = slider.height();
22        slider.css({"minHeight":sliderHeight});
23
24        // BREAKING NEWS - detect if content inside first breaking news to open or not 
25            var breakingNewsContentText = $("#breaking-news .toggle_content").eq(0).text().trim(); // identify if text inside breakingNews
26            var breakingNewsDataFakeIdOriginal = $('p[data-fake-id="#breaking-news"]');
27            
28            if(breakingNewsContentText == ""){
29                breakingNewsDataFakeIdOriginal.parent().parent().hide();
30            }else{
31                $("#breaking-news").toggleClass("active_tc");
32                $("#breaking-news").show();
33                breakingNewsDataFakeIdOriginal.addClass("activeTitle");
34            }
35
36        var icon_list_child = $("#icons-eveche-custom > ul > li > .iconlist_icon"); // tous les iconlist_icons ! + ne pas oublier de pointer sur chacun après
37        var img1 = '<img src="wp-content/uploads/2022/01/paroisses_new2.png" width="45">';
38        var img2 = '<img src="wp-content/uploads/2022/01/horaires_new.png" width="35">';
39        var img3 = '<img src="wp-content/uploads/2022/01/celebration_new.png" width="30">';
40
41        $(icon_list_child[0]).html(img1);
42        $(icon_list_child[0]).addClass("iconlist_icon1");
43        $(icon_list_child[1]).html(img2);
44        $(icon_list_child[1]).addClass("iconlist_icon2");
45        $(icon_list_child[2]).html(img3);
46        $(icon_list_child[2]).addClass("iconlist_icon3");
47        $(icon_list_child[3]).addClass("iconlist_icon4"); // dernier bouton eveche icones breaking news
48        $(icon_list_child[4]).addClass("iconlist_icon5");
49
50
51        var all_color_icon_accordeon = $('*[class^="color-icon"]')
52        
53        // 11 10 22 - faire apparaître avec un delay le bloc accordeon 
54        $("#aside_bloc_accueil").css({"visibility":"visible"});
55        $("body.home .homepage_title_custom").css({"visibility":"visible"});
56
57        // 09 08 22 - appendTo (càd move) id partenaires to make it editable by admin within the backend 
58            //$("#slider-partenaires").appendTo("#block-18");
59            //$("#slider-partenaires").show(); // rendre visible car invisible lors du appendTo qui est un move! 
60
61        // SLIDER 
62                var slider = $("#post-slider-custom");
63                var img_post = $("#post-slider-custom > .avia-content-slider-inner img")
64                var div_effect = $(".slide-entry-wrap");
65                var figcaption = $("#masonry-home-page figcaption");
66
67                // Build the slider custom 
68                slider.append('<div id="base_slider_custom"></div>');
69                for(i=0;i<img_post.length;i++){
70                    $("#base_slider_custom").append('<div class="img_post_slider"><div class="img_slider_container border-color-slider"><img data-position="'+i+'" src="'+img_post.eq(i).attr('src')+'"></div></div>');
71                }
72
73                // GET slide active = make first miniature active visually 
74                     var img_post_slider = $(".img_post_slider");
75                     //div_effect.eq(0).addClass("active-slide-customB");
76                     img_post_slider.eq(0).find(".img_slider_container").addClass("border-post-slider");
77                     img_post_slider.eq(0).find(".img_slider_container").removeClass("border-color-slider");
78
79
80                $("#a_la_une_accueil_bloc .avia-slideshow-arrows").hide();
81                // GET slide active if next click 
82                /*    $(".next-slide").on("click",function(){
83                        var active_slide = $("#post-slider-custom .active-slide");
84                        var all_slides = $("#post-slider-custom .slide-entry-wrap");
85                        var img_post_slider = $(".img_post_slider");
86
87                        for(a=0;a<all_slides.length;a++){
88                            if(all_slides.eq(a).hasClass("active-slide")){
89                               var count_active_before = a;
90                                (a < 4 ? count_active_now = a+1 : count_active_now = 0);
91                            }
92                        }
93                        console.log(count_active_now);
94                        console.log(img_post_slider.eq(count_active_now));
95                        
96                        img_post_slider.children().eq(count_active_before).removeClass("border-post-slider");
97                        img_post_slider.children().eq(count_active_before).addClass("border-color-slider");
98
99                        img_post_slider.children().eq(count_active_now).addClass("border-post-slider");
100                        img_post_slider.children().eq(count_active_now).removeClass("border-color-slider");
101                    });*/
102
103                // si clic sur miniature slider
104                $(".img_post_slider").click(function(){
105                   var data_position_current = $(this).children().children().eq(0).attr("data-position");
106
107                   for(x=0;x<img_post.length;x++){
108                            div_effect.eq(x).addClass("disactive-slide-custom");
109                            div_effect.eq(x).removeClass("active-slide");
110                            //console.log("je ne sais pas "+data_position_current + '/'+ x);
111                   }
112                   var img_post_slider = $(".img_post_slider");
113                   for(x=0;x<img_post_slider.length;x++){
114                        img_post_slider.children().eq(x).removeClass("border-post-slider");
115                        img_post_slider.children().eq(x).addClass("border-color-slider");
116                   }
117                   $(this).find(".img_slider_container").removeClass("border-color-slider");
118                   $(this).find(".img_slider_container").addClass("border-post-slider");
119                  
120                   div_effect.eq(data_position_current).removeClass("disactive-slide-custom");
121                   div_effect.eq(data_position_current).addClass("active-slide-custom");
122                   div_effect.eq(data_position_current).addClass("active-slide");
123
124                   
125                });
126
127                // classes comportement slider 
128                $("#post-slider-custom > div.avia-slideshow-arrows.avia-slideshow-controls >
128 a.next-slide").click(function(){
129                    for(i=0;i<div_effect.length;i++){
130                        div_effect.eq(i).removeClass("disactive-slide-custom");
131                         div_effect.eq(i).removeClass("active-slide-custom");
132                    }
133                });
134
135                $("#post-slider-custom > div.avia-slideshow-arrows.avia-slideshow-controls > a.prev-slide").click(function(){
136                    for(i=0;i<div_effect.length;i++){
137                        div_effect.eq(i).removeClass("disactive-slide-custom");
138                         div_effect.eq(i).removeClass("active-slide-custom");
139                    }
140                });
141
142                // click outside of #base_slider_custom ! 
143                 /*$(document).on("click", function(event){
144                    if(!$(event.target).closest(".img_post_slider").length && !$(event.target).closest(".next-slide").length){  
145                        var img_post_slider = $(".img_post_slider");
146                       for(x=0;x<img_post_slider.length;x++){
147                            img_post_slider.children().eq(x).removeClass("border-post-slider");
148                            img_post_slider.children().eq(x).addClass("border-color-slider");
149                       }
150                    }
151                });*/
152
153                /* effet zoom si hover sur sur .img_post_slider*/ 
154                $(".img_post_slider img").on("mouseenter",function(){
155                    $(this).removeClass("scale_effect_out");
156                    $(this).addClass("scale_effect_in");
157                });
158
159                 $(".img_post_slider img").on("mouseleave",function(){
160                    $(this).removeClass("scale_effect_in");
161                    $(this).addClass("scale_effect_out");
162                });
163
164        // Ajout barre multicolore en bas de page (juste avant footer)
165        $("#after_submenu").after('<div id="banner_remix" class="avia-image-container  av-styling-    avia-builder-el-0  el_before_av_submenu  avia-builder-el-no-sibling  avia-align- " itemprop="image" itemscope="itemscope" itemtype="https://schema.org/ImageObject"><div class="avia-image-container-inner"><div class="avia-image-overlay-wrap"><img class="wp-image-930 avia-img-lazy-loading-not-930 avia_image" src="/wp-content/uploads/2022/02/maquette_site_web-1-1-1-1500x31.png" alt="" title="banner_remix" height="248" width="1500" itemprop="thumbnailUrl" srcset="/wp-content/uploads/2022/02/maquette_site_web-1-1-1-1500x31.png" sizes="(max-width: 1500px) 100vw, 1500px"></div></div></div>');
166
167        /*for(i=0;i<figcaption.length;i++){
168            figcaption.eq(2).append('<img src="/wp-content/uploads/2022/02/symbol_plus.png" class="symbol_plus_figcaption-red" width="20"/>');
169        }*/
170        
171        // Ajout bouton "+" pour chaque bloc d'actualités 
172            figcaption.eq(1).append('<img src="/wp-content/uploads/2022/02/symbol_plus.png" class="symbol_plus_figcaption" width="20"/>');
173            figcaption.eq(3).append('<img src="/wp-content/uploads/2022/02/symbol_plus.png" class="symbol_plus_figcaption" width="20"/>');
174
175            figcaption.eq(0).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
176            figcaption.eq(2).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
177            figcaption.eq(4).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
178            figcaption.eq(5).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
179            figcaption.eq(6).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
180            figcaption.eq(7).append('<img src="/wp-content/uploads/2022/02/symbol_plus_green.png" class="symbol_plus_figcaption" width="20"/>');
181        
182
183        // RACCOURCIR TEXTE DATE "actualités du diocèse"
184        var actualite_date = $("#masonry-home-page .av-masonry-date");
185        for(i=0;i<actualite_date.length;i++){
186            var actualite_date_split = actualite_date.eq(i).text().split(" ");
187            var actualite_date_reduced = actualite_date_split[1].substring(0, 9);
188            var actualite_date_split_new = []; 
189
190            actualite_date_split_new.push(actualite_date_split[0],actualite_date_reduced);
191            
192            var actualite_date_new = actualite_date_split_new.toString().replace(","," ").replace(","," ");
193            actualite_date.eq(i).text(actualite_date_new); 
194        }
195
196        var parallax_more_top = $("#av_section_1").hasClass("parallax_more_top");
197    
198        if(parallax_more_top){
199              $("#av_section_1 > div > .av-parallax-inner").addClass("parallax_more_top_action");
200        }
201
202        // remove title from bloc actualite du diocese */ 
203        $(".av-masonry-image-container").attr("title","");
204        // remove other title from bloc actualites du diocese 
205        $(".av-masonry-entry ").attr("title","");
206
207        // remove anchor from title article page in breadcrumb
208            var entry_title = $("#main > .title_container .entry-title > a");
209            entry_title.removeAttr("href");
210
211        /* IF wpadminbar exist -> si on regarde le site en étant connecté en backend */ 
212        if($("#wpadminbar").text()){
213           //$("#sub_menu1").css({"top":"154px"});
214            //$("#wrap_all #main #sub_menu1").attr('style', 'top: 177px');
215            $("#main").addClass("backend-mode-on");
216        }else{
217            //$("#sub_menu1").css({"top":"145px"});
218            //$("#wrap_all #main #sub_menu1").attr('style', 'top: 145px');
219            $("#main").addClass("backend-mode-off");
220        }
221
222        /* effet hover amélioré pour bloc actualité */ 
223        $(".av-inner-masonry").on("mouseenter",function(){
224            $(this).addClass("av-inner-masonry-effect");
225            //console.log("mouseenter");
226        });
227
228        $(".av-inner-masonry").on("mouseleave",function(){
229            $(this).removeClass("av-inner-masonry-effect");
230            //console.log("mouseleave oui");
231        });
232
233        /* insta pape redirect */ 
234        $("#insta_pape").on("click",function(){
235            //window.location.href='https://www.instagram.com/franciscus/?hl=en';
236            //window.open('https://www.instagram.com/franciscus/?hl=en');
237        });
238
239         /* replace home icon */ 
240        $(".icon_home_eveche").html('<a href="https://diocese-tournai.be" aria-hidden="false" rel="noopener"><img src="/wp-content/uploads/2022/03/new_home_icon_eveche-36x36.png" width="50"></a>');
241        $(".icon_home_eveche").addClass("icon_home_eveche_opacity_0");
242
243        /* replace text calendar*/ 
244        /*var events_text_old = $("h6.mec-table-side-title");
245        var events_text_new_all = [];
246        for(i=0;i<events_text_old.length;i++){
247            var events_text_old_unit = events_text_old.eq(i).text();
248            var events_text_new_unit = events_text_old_unit.replace("Events for","Événements pour le");
249            var events_text_new_unit = events_text_new_unit.replace("st","");
250            var events_text_new_unit = events_text_new_unit.replace("th","");
251            events_text_old.eq(i).text(events_text_new_unit);
252            //events_text_new_all.push(events_text_new_unit);
253        }*/
254        
255        //console.log(events_text_new_all);
256
257        // masquer le breadcrumbs sur la page d'accueil 
258        if(!$("#actualites_accueil_bloc").text()){
259            $("#main > div.stretch_full.container_wrap.alternate_color.light_bg_color.title_container").show();
260        }
261
262        if($(".breadcrumb-trail a").eq(1).text() == "À la Une"){
263            $(".breadcrumb-trail a").eq(1).attr("href","#");
264            //$("#main > div.stretch_full.container_wrap.alternate_color.light_bg_color.title_container").hide();
265        }
266
267        var spanToHide = $(".spanToHide").parent().parent();
268        spanToHide.hide();
269        spanToHide.next().hide();
270
271       //$(".a2a_overlay").parent().remove();
272       var copyLinkCustom = '<div id="copyLinkCustom"><a class="a2a_button_copy_link" title="Copier URL"><span class="a2a_svg a2a_s__default a2a_s_link" style="background-color: rgb(148, 20, 50);"><img src="/wp-includes/images/copy_link_icon_resized.png"/></span></div>';
273       $(".a2a_kit").append(copyLinkCustom);
274
275       // console.log($(".breadcrumb-trail a").eq(1).text());
276       var buttonCopyLink = document.getElementsByClassName("a2a_button_copy_link")[0];
277       $(buttonCopyLink).on("click",function(){
278           var url = window.location.href;
279           navigator.clipboard.writeText(url);
280           event.preventDefault();
281       });
282
283       // 16 05 22 BSIDE - Recognize menu item selected + open submenu 
284            var mainTitle = $("h1.main-title > a").text(); // Title page 
285            var avia = $(".menu-contextual a > .avia-menu-text"); // text menu item 
286
287            for(i=0;i<avia.length;i++){
288                var aviaSelector = avia.eq(i);
289                if(aviaSelector.text() == mainTitle){
290                    // colorize button in red 
291                        aviaSelector.parent().addClass("background-red");
292                    // check if has to open submenu or not 
293                        var aviaSubMenu = aviaSelector.parent().next();
294                        var aviaSubMenuParent = aviaSelector.parent().parent().parent();
295                        var aviaSubMenuExist = aviaSubMenu.length;
296                        var isContainerParent = aviaSelector.parent().parent().parent().parent().hasClass("container");
297                        //console.log(aviaSubMenuExist);
298                        if(aviaSubMenuExist > 0){               // display sub-menu
299                            //console.log("aviaSubMenuExist");
300                            if($(window).width() < 994){
301                                // ajouter petite flèche sur l'ancre en bout de ligne pour montrer que submenu existe 
302                                    aviaSubMenu.prev().append('<span class="av-submenu-indicator-custom"></span>'); 
303                                // desactiver ancre sur lien de la page actuelle 
304                                    aviaSelector.parent().removeAttr("href");
305                                // Behaviour si clic sur bouton ALORS ouvrir sub-menu 
306                                    var aviaSubMenuPrev = aviaSubMenu.prev();
307                                    aviaSubMenuPrev.on("click",function(){
308                                        aviaSubMenu.toggle();
309                                        aviaSubMenu.prev().find(".av-submenu-indicator-custom").toggleClass("effect-rotate-90d");
310                                    });
311                            }else{
312                                 aviaSubMenu.show();
313                            } 
314                        }else if(isContainerParent == false){   // if inside submenu page, display submenu parent 
315                             //console.log("isContainerParent false");
316                             //console.log(aviaSubMenuParent);
317                             aviaSubMenuParent.show();
318                        }
319                    
320                }else{
321
322                }
323            }
324
325        // 11 08 22 - mettre menu contextual en haut de page en mobile 
326            if($(window).width() < 994){
327                var menuContextual = $(".menu-contextual").eq(0);
328                var av_section_1 = $("#av_section_1").eq(0);
329                console.log("bonsoir mobile");
330                console.log(menuContextual);
331                console.log(av_section_1);
332                av_section_1.after(menuContextual);
333            }
334
335        // 21 03 23 - adapt position of the date because bullshit position relative
336            $(window).scroll(function(){
337                if($(window).width() > 994) {
338                    var masonry_entry_content = $("#masonry-home-page a:nth-child(2) div.av-masonry-entry-content.entry-content");
339                    var masonry_entry_title = $("#masonry-home-page a:nth-child(2) h3.av-masonry-entry-title");
340
341                    var masonry_entry_content_b = $("#masonry-home-page a:nth-child(7) div.av-masonry-entry-content.entry-content");
342                    var masonry_entry_title_b = $("#masonry-home-page a:nth-child(7) h3.av-masonry-entry-title");
343
344                    var total_a = (190 - masonry_entry_content.eq(0).height() - masonry_entry_title.eq(0).height() - 20) * -1;
345                    $("#masonry-home-page a:nth-child(2) .av-masonry-date").css({bottom: total_a + "px"});
346
347                    var total_b = (190 - masonry_entry_content_b.eq(0).height() - masonry_entry_title_b.eq(0).height() - 20) * -1;
348                    $("#masonry-home-page a:nth-child(7) .av-masonry-date").css({bottom: total_b + "px"});
349                    console.log(total_b);
350                }
351            });
352
353
354            setTimeout(function(){
355                console.log("hide free eapps_insta")
356                $("#eapps-twitter-feed-1 > a").hide()
357                $("#eapps-instagram-feed-1 > a").hide()
358            },500)
359
360    });
361
362}(jQuery));

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.