PageSourceSearch

https://culturadom.fr/wp-content/themes/culturadom/js/front.js?ver=20171009-1791421699

js culturadom.fr collected 2026-10-08 01:09:48 UTC 4,875 bytes, 152 lines download raw bytes

1jQuery(document).ready(function(){
2    initGmapsAutoComplete();
3    shokola_newsletter();
4    set_header_fixed();
5    toggle_button_newsletter();
6    mobile_header_search();
7    jQuery('.woocommerce-checkout #jesuis').change();
8});
9
10function initGmapsAutoComplete(){
11    autocomplete = new google.maps.places.Autocomplete(
12        (document.getElementById('pac-input')),
13        { types: ['(regions)'] }
14     );
15    autocomplete.setComponentRestrictions({'country': ['fr']});
16    google.maps.event.addListener(autocomplete, 'place_changed', function() {
17    });
18
19    autocomplete.addListener('place_changed', function () {
20        //alc_place_changed = true;
21
22        // Get the place returned by Google Autocomplete
23        var place = autocomplete.getPlace();
24
25        if (place.address_components)
26        {
27            /* Use full components info and jsonify */
28            address = {};
29
30            for(var i=0; i<place.address_components.length; i++){
31                address[place.address_components[i].types[0]] = place.address_components[i].long_name;
32            }
33
34            address = JSON.stringify(address);
35        }
36        else{
37            // Enable submit button
38            jQuery('#form_map_submit').addClass('disabled');
39            jQuery('#form_map_submit').attr('disabled', 'true');
40
41            // console.warn("Autocomplete's returned place contains no geometry");
42            return;
43        }
44
45        // Fill the hidden fields
46        jQuery('#lat').val(place.geometry.location.lat());
47        jQuery('#lng').val(place.geometry.location.lng());
48        jQuery('#adresse').val(address);
49        jQuery('#fadresse').val(place.formatted_address);
50        jQuery('#search_type').val(place.types[0]);
51
52        // Enable submit button
53        jQuery('#form_map_submit').removeClass('disabled').removeAttr('disabled');
54
55    });
56
57    autocomplete_mobile = new google.maps.places.Autocomplete(
58        (document.getElementById('pac-input-mobile')),
59        { types: ['(regions)'] }
60    );
61    autocomplete_mobile.setComponentRestrictions({'country': ['fr']});
62    google.maps.event.addListener(autocomplete, 'place_changed', function() {
63    });
64
65    autocomplete_mobile.addListener('place_changed', function () {
66        //alc_place_changed = true;
67
68        // Get the place returned by Google Autocomplete
69        var place = autocomplete_mobile.getPlace();
70
71        if (place.address_components)
72        {
73            /* Use full components info and jsonify */
74            address = {};
75
76            for(var i=0; i<place.address_components.length; i++){
77                address[place.address_components[i].types[0]] = place.address_components[i].long_name;
78            }
79
80            address = JSON.stringify(address);
81        }
82        else{
83            // Enable submit button
84            jQuery('#form_map_submit').addClass('disabled');
85            jQuery('#form_map_submit').attr('disabled', 'true');
86
87            // console.warn("Autocomplete's returned place contains no geometry");
88            return;
89        }
90
91        // Fill the hidden fields
92        jQuery('#lat').val(place.geometry.location.lat());
93        jQuery('#lng').val(place.geometry.location.lng());
94        jQuery('#adresse').val(address);
95        jQuery('#fadresse').val(place.formatted_address);
96        jQuery('#search_type').val(place.types[0]);
97
98        // Enable submit button
99        jQuery('#form_map_submit').removeClass('disabled').removeAttr('disabled');
100
101    });
102}
103
104function shokola_newsletter(){
105
106    jQuery('#show_newsletter').click(function(e){
107        e.preventDefault();
108        jQuery('#newsletter').toggleClass('show');
109    });
110}
111
112function set_header_fixed(){
113    jQuery(window).scroll(function () {
114        var scroll = jQuery(window).scrollTop();
115        var $menu_principal = jQuery('.header_top');
116
117        if (scroll >= $menu_principal.innerHeight())
118        {
119            jQuery("body").addClass("fixed-menu");
120        }
121        else
122        {
123            jQuery("body").removeClass("fixed-menu");
124        }
125    });
126
127    jQuery(document).ready(function () {
128        var scroll = jQuery(window).scrollTop();
129        var $menu_principal = jQuery('.header_top');
130
131        if (scroll >= $menu_principal.innerHeight())
132        {
133            jQuery("body").addClass("fixed-menu");
134        }
135        else
136        {
137            jQuery("body").removeClass("fixed-menu");
138        }
139    });
140}
141
142function toggle_button_newsletter(){
143    jQuery('#show_newsletter').click(function(){
144        jQuery(this).toggleClass('open');
145    });
146}
147
148function mobile_header_search(){
149    jQuery('header .search_mobile > label').click(function(){
150         jQuery('header .search_form_wrapper').toggleClass('full_width');
151    });
152}

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.