PageSourceSearch

https://www.federationpeche77.fr/include/gabarit_site/GAB_DEPARTEMENT/script.js

js federationpeche77.fr collected 2026-10-05 05:26:17 UTC 15,391 bytes, 376 lines download raw bytes

1var fnpf = {
2    mobile: 767,
3    tablet: 1024,
4    win: $(window),
5
6    init: function() {
7
8        fnpf.scrollTopInit();
9        fnpf.setRotationNb();
10
11        fnpf.win.bind('load resize orientationchange', function () {
12            // fnpf.rwdFooter();
13            fnpf.rwdHeader();
14            // fnpf.rwdLink();
15            // fnpf.rwdImage();
16            // fnpf.rwdMap();
17        });
18
19        $('#btnMenu').click(function (e) {
20            e.preventDefault();
21            $('#wrap').toggleClass('visible');
22        });
23
24        $('body').on('click','#cboxClose',function(){
25          $('#diaporamaMain4 .owl-stage').css('display','none');
26          setTimeout(function(){
27            $('#diaporamaMain4 .owl-stage').css('display','block');
28           },400);
29        });
30
31        fnpf.styleListe();
32
33        fnpf.clickCarte();
34
35        fnpf.setMenuBurger();
36
37        if($(window).width() > 767) {
38            if($("#bandeauHaut .header .logoTitre").outerWidth(false) > 90) {
39                var Pl = 120 + ($("#bandeauHaut .header .logoTitre").outerWidth(false) - 90);
40                $("body #bandeauHaut .header .right").css("padding-left",Pl);
41            }
42
43            if($("#bandeauBas .haut .gauche").outerWidth(false) > 90) {
44                var Pl = 130 + ($("#bandeauBas .haut .gauche").outerWidth(false) - 90);
45                $("#bandeauBas .haut .droite").css("padding-left",Pl);
46            }
47        }
48
49        if($("#Accueil").length > 0) {
50            $(window).on('load resize', function(){
51                if($(window).width() > 1024) {
52                    var widthTplG = ($(".TPL_MURIMAGECACCUEIL .innerParagraphe").outerWidth(false)/2) - 6;
53                    var widthTplS = (widthTplG/2)-6;
54                    var heightTplG = widthTplG*(327/594);
55                    var heightTplS = widthTplS*(159/294);
56                    $(".TPL_MURIMAGECACCUEIL .upperRight, .TPL_MURIMAGECACCUEIL .lowerLeft").find("iframe").css({
57                        maxWidth: widthTplS,
58                        height: heightTplS
59                    });
60                    $(".TPL_MURIMAGECACCUEIL .upperLeft, .TPL_MURIMAGECACCUEIL .lowerRight").find("iframe").css({
61                        maxWidth: widthTplG,
62                        height: heightTplG
63                    });
64                } else if($(window).width() > 480) {
65                    var widthTplG = $(".TPL_MURIMAGECACCUEIL .listeContainer").outerWidth(false);
66                    var widthTplS = (widthTplG/2)-6;
67                    var heightTplG = widthTplG*(327/594);
68                    var heightTplS = widthTplS*(159/294);
69                    $(".TPL_MURIMAGECACCUEIL .upperRight, .TPL_MURIMAGECACCUEIL .lowerLeft").find("iframe").css({
70                        maxWidth: widthTplS,
71                        height: heightTplS
72                    });
73                    $(".TPL_MURIMAGECACCUEIL .upperLeft, .TPL_MURIMAGECACCUEIL .lowerRight").find("iframe").css({
74                        maxWidth: widthTplG,
75                        height: heightTplG
76                    });
77                } else {
78                    var widthTplG = $(".TPL_MURIMAGECACCUEIL .listeContainer").outerWidth(false);
79                    var heightTplG = widthTplG*(327/594);
80                    $(".TPL_MURIMAGECACCUEIL .upperRight, .TPL_MURIMAGECACCUEIL .lowerLeft").find("iframe").css({
81                        maxWidth: widthTplG,
82                        height: heightTplG
83                    });
84                    $(".TPL_MURIMAGECACCUEIL .upperLeft, .TPL_MURIMAGECACCUEIL .lowerRight").find("iframe").css({
85                        maxWidth: widthTplG,
86                        height: heightTplG
87                    });
88                }
89            });
90            // .upperRight, .lowerLeft
91            // .upperLeft, .lowerRight
92        }
93
94        if($(".TPL_RESTEZCONECTEGENACCUEIL").length > 0) {
95            if(($(".TPL_RESTEZCONECTEGENACCUEIL div.facebook").length > 0) && !($(".TPL_RESTEZCONECTEGENACCUEIL div.twitter").length > 0)) {
96                $(".TPL_RESTEZCONECTEGENACCUEIL div.facebook").addClass("alone");
97            } else if(!($(".TPL_RESTEZCONECTEGENACCUEIL div.facebook").length > 0) && ($(".TPL_RESTEZCONECTEGENACCUEIL div.twitter").length > 0)) {
98                $(".TPL_RESTEZCONECTEGENACCUEIL div.twitter").addClass("alone");
99            }
100        }
101
102        $(".infoDate").each(function() {
103            if(!$(this).find("> .right").length > 0) {
104                $(this).addClass("dateUnique");
105            }
106        });
107
108        $('.innerParagraphe table').wrap('<div style="overflow-x: auto;width: 100%;"></div>');
109    },
110
111    /* ===================================================================
112     * GESTION DES ONGLETS DU BANDEAU HAUT
113     * =================================================================*/
114    menuGalactique: function() {
115        var menu  = $('.menuGalactique'),
116            barre = $('.sousBarre'),
117            delay = 300;
118
119        menu.find('ul > li > a').each(function(i, element) {
120            var link = $(element),
121                idGal = link.attr('data-gal'),
122                notidGal = barre.find('div:not(' + idGal + ')');
123
124            link.click(function(event) {
125                for (var i = 0 ; i < notidGal.length ; i++) {
126                      $('#' + notidGal[i].id).slideUp(delay);
127                  };
128                  barre.find(idGal).slideToggle(delay);
129            });
130        });
131    },
132
133    setMenuBurger: function() {
134        $("body").on("click",".closeMenu, .maskMenu",function(){
135            fnpf.closeMenu();
136        });
137
138        $("body").on("click","#btnMenu",function(){
139            fnpf.openMenu();
140        });
141
142        $("body").on("click","#menuBurger li a",function(e){
143            curLink = $(this);
144            if(curLink.next(".sousMenu").length > 0) {
145                e.preventDefault();
146                curLink.next(".sousMenu").slideToggle(300);
147            }
148        });
149    },
150
151    closeMenu: function() {
152        $("#menuBurger").animate({"left": -320}, 300, function(){
153            $("#menuBurger").css("display","none");
154        });
155        $(".maskMenu").fadeOut('300');
156    },
157
158    openMenu: function() {
159        $("#menuBurger").css("display","block");
160        $("#menuBurger").animate({"left": 0}, 300);
161        $(".maskMenu").fadeIn('300');
162    },
163
164    /* ===================================================================
165     * MODIFICATION DES ELEMENTS RESPONSIVE
166     * =================================================================*/
167    rwdFooter: function() {
168        var bloc = $("#bandeauBas .droite"),
169            elem = $('.titreFooter');
170
171        fnpf.win.width() <= fnpf.mobile ? bloc.prepend(elem) : bloc.append(elem);
172    },
173    rwdHeader: function() {
174        var wrap = $('#wrap'),      haut = $('#barreHaut'),
175            lang = $('#traduction'), head = $('.header'),
176            sous = $('.sousBarre'), bandeau = $('#bandeauHaut');
177            
178        //fnpf.win.width() <= fnpf.mobile ? wrap.append(haut)  : bandeau.prepend(haut);
179        fnpf.win.width() <= fnpf.tablet ? head.prepend(lang) : haut.prepend(lang);
180        //fnpf.win.width() <= fnpf.mobile ? wrap.append(sous)  : haut.after(sous);
181    },
182    rwdLink: function() {
183        if(fnpf.win.width() <= fnpf.mobile) {
184            $('a[data-gal="#gal-1"]').attr('href', '/');
185            $('a[data-gal="#gal-2"]').attr('href', 'https://generationpeche.fr/');
186            $('a[data-gal="#gal-3"]').attr('href', '/annuaire');
187            $('a[data-gal="#gal-4"]').attr('href', 'https://cartedepeche.fr/');
188            $('a[data-gal="#gal-5"]').click(function(event) {
189              return false;
190            });
191        } else {
192            $('a[data-gal^="#gal-"]').attr('href', '#');
193        }
194    },
195    rwdMap: function() {
196        if($('#contenu').width() > 1199) {
197            $('#map').css({
198              "width": "600px",
199            })
200        } else {
201            $('#map').css({
202              "width": $('#contenu').width() / 2,
203            })
204        }
205    },
206
207    /* ===================================================================
208     * GESTION DU CADRILLAGE DU MUR D'IMAGE
209     * =================================================================*/
210    rwdImage: function() {
211        //NOUVELLE STRUCTURE POUR DEPARTEMENT PLUS BESOIN POUR LE MOMENT
212    },
213
214    /* ===================================================================
215     * GESTION DE LA POSITION DE LA MAP
216     * =================================================================*/
217    initCarto: function(selector) {
218        var win           = $(window),
219            heightCarte   = win.outerHeight(),
220            mapOffset     = $('.listeParcours').offset().top, //on se base sur la liste car elle ne change pas d'offset
221            map           = $('#map'),
222            liste         = $('.listeParcours'),
223            userOffset    = $('.userTools').offset().top,
224            listeHeight   = liste.height();
225
226        win.ready(function() {
227            map.height(heightCarte - 50);
228        });
229
230        win.unbind('scroll');
231
232        if(listeHeight > heightCarte){
233            var heightFromFooter = 0;
234            win.scroll(function(e) {
235                heightFromFooter = win.scrollTop() + win.height()-$('#bandeauBas').offset().top+$('#bandeauBas').outerHeight()-160;
236                if (heightFromFooter > 0) {
237                    liste.css({
238                        "margin-left": "50%",
239                    });
240                    $(selector).css({
241                        "position": "fixed",
242                        "bottom": heightFromFooter+(win.height()-$('.mapBlock').height()),
243                        "top": "inherit",
244                    });
245                } else if (win.scrollTop() >= mapOffset) {
246                    $(selector).css({
247                        "position": "fixed",
248                        "top": "0",
249                        "bottom": "inherit"
250                    });
251                    liste.css({
252                        "margin-left": "50%",
253                    });
254                } else if (win.scrollTop() < mapOffset ) {
255                    $(selector).css({
256                        "position": "static",
257                    });
258                    liste.css({
259                        "margin-left": "0",
260                    });
261                }
262            });
263        }
264    },
265
266    /* ===================================================================
267     * GESTION DE LA VUE D'UN ELEMENT
268     * =================================================================*/
269    isOnScreen: function(elem) {
270        if (elem.length > 0) {
271            var win      = $(window),
272                bounds   = elem.offset(),
273                viewport = {top: win.scrollTop(), left: win.scrollLeft()};
274
275            viewport.right  = viewport.left + win.width();
276            viewport.bottom = viewport.top  + win.height();
277            bounds.right    = bounds.left   + elem.outerWidth();
278            bounds.bottom   = bounds.top    + elem.outerHeight();
279
280            return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
281        }
282
283        return false;
284    },
285    scrollTopInit : function() {
286        $("#bandeauBas").before('<div class="scrollTop"></div>');
287
288        $('.scrollTop').click(function(){
289            $("html, body").animate({ scrollTop: 0 }, 500);
290            return false;
291        });
292
293        $(document).scroll(function () {
294            //stick nav to top of page
295            var y = $(this).scrollTop();
296            if (y > $(window).height()) {
297                $('.scrollTop').addClass('sticky').fadeIn(450);
298            } else {
299                $('.scrollTop').removeClass('sticky').fadeOut(450);
300            }
301        });
302    },
303    setRotationNb : function() {
304        $(".TPL_CHIFFRESCLES #listeContainer").find("> div").each(function() {
305            var current = this;
306
307            $(current).find("> .groupe:not(:first-child)").hide();
308            $(current).find("> .groupe:first-child").addClass('actif');
309
310            if($(current).find("> .groupe").length > 1) {
311                $(current).addClass("parent")
312                $(current).find("> .groupe").last().addClass("last");
313
314                setInterval(function() {
315                    if(!$(current).find("> .actif").hasClass("last")) {
316                        $(current).find("> .actif").removeClass('actif flipOutY').addClass('flipInY').hide().removeClass('actif flipOutY')
317                                  .next(".groupe").show().addClass('actif flipInY');
318                    } else {
319                        $(current).find("> .actif").removeClass('flipInY').addClass('flipOutY').hide().removeClass('actif flipOutY')
320                                  .parent().find("> .groupe:first-child").show().addClass('actif flipInY');
321                    }
322                }, 4750);
323            }
324        });
325    },
326    styleListe : function() {
327      $('.listePublication').find('.item').each(function() {
328        if($(this).next().hasClass('dossier')){
329          $(this).css('border-bottom', 'none');
330        }
331      });
332    },
333
334    clickCarte : function() {
335        $(".deptList .item").append('<div class="closeDept">X</div>');
336        $('g.departementCliquable').on('click',function(){
337            $('g.departementCliquable').attr("class","departementCliquable");
338            $(this).attr("class","departementCliquable clicked");
339            if(typeof $(this).data("dept") != "undefined") {
340                var deptClick = $(this).data("dept");
341                $(".deptList .item img").each(function() {
342                    var departement = $(this).attr('src').split('GAB_GENERATION/')[1].split('_')[0];
343                    if(departement == deptClick) {
344                        $(".deptList .item").removeClass('shown');
345                        $(this).parent().addClass('shown');
346                    }
347                });
348            }
349        });
350
351        $("#carteDepartementForm select").change(function(){
352            $(".deptList .item img").each(function() {
353                var departement = $(this).attr('src').split('GAB_GENERATION/')[1].split('_')[0];
354                if(departement == $("#carteDepartementForm select").val()) {
355                    $(".deptList .item").removeClass('shown');
356                    $(this).parent().addClass('shown');
357                    $('g.departementCliquable').attr("class","departementCliquable");
358                    $('g.departementCliquable').each(function() {
359                        if($(this).data("dept") == $("#carteDepartementForm select").val()) {
360                            $(this).attr("class","departementCliquable clicked");
361                        }
362                    });
363                }
364            });
365        });
366
367
368        $('.deptList .item').on('click','.closeDept',function(){
369            $(this).parent().removeClass("shown");
370        });
371
372
373    }
374}
375
376$(document).ready(fnpf.init);

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.