PageSourceSearch

https://ville-bessancourt.fr/sites/bessancourt/themes/bootstrap_barrio_subtheme/js/global.js?v=11.4.7

js ville-bessancourt.fr collected 2026-09-25 05:07:07 UTC 4,840 bytes, 140 lines download raw bytes

1/**
2 * @file
3 * Global utilities.
4 *
5 */
6(function ($, Drupal) {
7	'use strict';
8	Drupal.behaviors.bootstrap_barrio_site = {
9		attach: function (context, settings) {
10		}
11	};
12
13	function getCookie(cname) {
14		var name = cname + "=";
15		var decodedCookie = decodeURIComponent(document.cookie);
16		var ca = decodedCookie.split(';');
17		for(var i = 0; i <ca.length; i++) {
18			var c = ca[i];
19			while (c.charAt(0) == ' ') {
20				c = c.substring(1);
21			}
22			if (c.indexOf(name) == 0) {
23				return c.substring(name.length, c.length);
24			}
25		}
26		return "";
27	}
28        $('#block-bootstrap-barrio-subtheme-menuprincipal ul.menu li.menu-item--expanded > a').click(function(e) {
29                e.preventDefault();
30                var $this = $(this);
31                if ($this.next().hasClass('show')) {
32                        $this.next().removeClass('show');
33                        $this.parent().removeClass('accordion');
34                } else {
35                        $this.parent().parent().find('#block-nicemenus-menu-principal ul.nice-menu > li ul ul').removeClass('show');
36                        $this.next().toggleClass('show');
37                        $this.parent().toggleClass('accordion');
38                }
39        });
40
41	$("#block-notificationwebpush").hide();
42
43	if (document.cookie.match(/^(?:.*;)?\s*cookie_pushpad\s*=\s*([^;]+)(?:.*)?$/) === null) {
44		var web_push_compatibility = false;
45		(function(p,u,s,h,x){p.pushpad=p.pushpad||function(){(p.pushpad.q=p.pushpad.q||[]).push(arguments)};h=u.getElementsByTagName('head')[0];x=u.createElement('script');x.async=1;x.src=s;h.appendChild(x);})(window,document,'https://pushpad.xyz/pushpad.js');
46		pushpad('init', 7611,{ hostname: "partenaire-gc-ng-dv.gallimedia.info", serviceWorkerPath: '/serviceworker-pwa'});
47		pushpad('status', function(isSubscribed) {
48			web_push_compatibility = true;
49			console.log("check status pushpad ici");
50			document.cookie = "cookie_pushpad=1; path=/";
51			if (isSubscribed) {
52				$("#web_push_state").text('Gérez votre abonnement');
53			}
54			else {
55				$("#web_push_state").text('Abonnement');
56			}
57
58			$("#block-notificationwebpush").show();
59		});
60
61		if (web_push_compatibility == false) {
62			document.cookie = "cookie_pushpad=0; path=/";
63		}
64		else {
65			document.cookie = "cookie_pushpad=1; path=/";
66		}
67	}
68
69	if (getCookie("cookie_pushpad") == 1) $("#block-notificationwebpush").show();
70
71	//toolbar open
72	var body= $('body');
73	var prev= $('.path-frontpage .block-views-blockactualites-block-prestations .view-actualites .jcarousel-control-prev');
74	var next= $('.path-frontpage .block-views-blockactualites-block-prestations .view-actualites .jcarousel-control-next');
75	//prev.addClass('wow fadeInLeft');
76	//next.addClass('wow fadeInRight');
77	window.onload = function() {
78		//putHeight();
79	}
80	/* Moteur de recherche */
81	var searchInput = $('.block-views-exposed-filter-blockrecherche-globale-page-search .form-type-textfield input');
82	searchInput.attr('placeholder','Rechercher…');
83
84	/* Input Newsletter*/
85	var NewsInput = $('.block-simplenews .form-type-email input');
86	NewsInput.attr('placeholder','Votre adresse mail…');
87
88	/* menu principal  mobile*/
89	var rubrique = $('#block-bootstrap-barrio-subtheme-menumobile .menu--menu-principal > ul > li.menu-item--expanded > a');
90	rubrique.click(function(event) {
91		event.preventDefault();
92		$(this).siblings('ul').slideToggle('slow');
93		$(this).toggleClass( "open" );
94		return false;
95	});
96	function isInstalled() {
97  		// For iOS
98  		if(window.navigator.standalone) return true
99  		// For Android
100  		if(window.matchMedia('(display-mode: standalone)').matches) return true
101  		// If neither is true, it's not installed
102  		return false
103	}
104	if(isInstalled()) {
105                body.addClass("ispwa");
106        }
107	$(document).ready(function() {
108		$(".menu-mobile").attr("data-action","click");
109                $(".we-mega-menu-li[href='#0']").click(function(event) {
110                        event.preventDefault();
111                        $(this).toggleClass( "clicked" );
112                        return false;
113                });
114		//new WOW().init();
115
116		//$('.path-frontpage .block-views-blocktemoignages-block-temoignages').parallax({imageSrc: '/sites/template-entreprise/themes/bootstrap_barrio_site/images/parallax.jpg'});
117
118		/* fix menu to-top*/
119		/*$(window).scroll(function () {
120			if ($(this).scrollTop() > 150 ) {
121				body.addClass("scrolling");
122			} else {
123				body.removeClass("scrolling");
124			}
125		 });*/
126
127		/* Retour vers le haut */
128		$('body').append('<a href="#top" class="to_top" title="Revenir en haut de page">Haut</a>');
129		$(".to_top").click(function(){
130			$("html, body").animate({scrollTop: 0},"slow");
131		});
132
133		/* theme navbar toggler */
134		/*
135		$('button.navbar-toggler').click(function(){
136			$('.navbar-collapse').toggleClass( "show" );
137                });
138*/
139	});
140})(jQuery, Drupal);

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.