PageSourceSearch

https://www.everymanracing.co.uk/wp-content/themes/everyman/js/hood.wordpress.js?ver=1.0.0.1687979278

js everymanracing.co.uk collected 2026-10-04 10:20:57 UTC 20,674 bytes, 644 lines download raw bytes

1(function ($) {
2    $.fn.coverImage = function (contain) {
3        this.each(function () {
4            var $this = $(this),
5                src = $this.get(0).src,
6                $wrapper = $this.parent();
7
8            if (src.includes("//everyman.local.hooddigital.com/wp-content/uploads/")) {
9                src = src.replace("//everyman.local.hooddigital.com/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
10            }
11
12            if (src.includes("//everyman.vps.hooddigital.com/wp-content/uploads/")) {
13                src = src.replace("//everyman.vps.hooddigital.com/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
14            }
15
16            if (contain) {
17                $wrapper.css({
18                    'background': 'url(' + src + ') 50% 50%/contain no-repeat'
19                });
20            } else {
21                $wrapper.css({
22                    'background': 'url(' + src + ') 50% 50%/cover no-repeat'
23                });
24            }
25
26            $this.remove();
27        });
28
29        return this;
30    };
31    $.fn.replaceUrls = function (contain) {
32        this.each(function () {
33            var $this = $(this),
34                src = $this.get(0).src;
35
36            if (src.includes("//everyman.local.hooddigital.com/wp-content/uploads/")) {
37                src = src.replace("//everyman.local.hooddigital.com/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
38            }
39
40            if (src.includes("//everyman.vps.hooddigital.com/wp-content/uploads/")) {
41                src = src.replace("//everyman.vps.hooddigital.com/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
42            }
43
44            $(this).attr('src', src);
45            $(this).attr('srcset', src);
46
47        });
48
49        return this;
50    };
51})(jQuery);
52
53if (!$.hood)
54    $.hood = {};
55
56$.hood.Wordpress = {
57    Init: function () {
58        // Add any init time functionality here - when the code is first loaded.
59    },
60    Ready: function () {
61        $.hood.Wordpress.Resize();
62        //$('.wc-block-grid__product-image img').coverImage();
63        //$('.woocommerce ul.products li.product img').replaceUrls();
64
65        //$('.product-featured-image').each(function () {
66        //    var $this = $(this),
67        //        src = $this.attr('style');
68
69        //    src = src.replace("/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
70
71        //    $(this).attr('style', src);
72        //});
73
74        //$('.product-thumbnail').each(function () {
75        //    var $this = $(this),
76        //        src = $this.attr('src');
77
78        //    src = src.replace("/wp-content/uploads/", "//everymanracing.co.uk/wp-content/uploads/");
79
80        //    $(this).attr('src', src);
81        //});
82
83        $('.wp-block-button__link.add_to_cart_button').wrapInner("<span class='skew-back'></span>");
84        $('.woocommerce ul.products li.product a.add_to_cart_button').wrap("<div class='add_to_cart_button'></div>");
85
86        $('body').on('click', '.scroll-body-to', function (e) {
87            e.preventDefault();
88            let offset = $(this).data('offset') || 0;
89            let top = $($(this).attr('href')).offset().top;
90            let final = top - offset;
91            $('html, body').animate({
92                scrollTop: final
93            }, 500);
94        });
95
96        $('.clickable .dropdown-menu a.dropdown-toggle').on('click', function (e) {
97            if (!$(this).next().hasClass('show')) {
98                $(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
99            }
100            var $subMenu = $(this).next(".dropdown-menu");
101            $subMenu.toggleClass('show');
102
103
104            $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) {
105                $('.dropdown-submenu .show').removeClass("show");
106            });
107
108
109            return false;
110        });
111
112        $(".hoverable .dropdown-toggle").on("mouseenter", function () {
113            // make sure it is not shown:
114            if (!$(this).parent().hasClass("show") && !$(this).parent().hasClass("dropdown-submenu")) {
115                $(this).click();
116            }
117        });
118
119        $(".hoverable .dropdown").on("mouseleave", function () {
120            // make sure it is shown:
121            if ($(this).hasClass("show")) {
122                $(this).children('.dropdown-toggle').first().click();
123            }
124        });
125
126
127        //$('.wc-block-grid').addClass('container');
128        //$('.wc-block-grid .wc-block-grid__products').addClass('card-deck');
129        //$('.has-3-columns .wc-block-grid__products').addClass('card-deck-3');
130        //$('.wc-block-grid__product').addClass('card');
131
132        $('.owl-carousel.experiences').owlCarousel({
133            loop: true,
134            autoplay: true,
135            autoplayTimeout: 5000,
136            autoplayHoverPause: true,
137            margin: 0,
138            responsiveClass: true,
139            responsive: {
140                0: {
141                    items: 1,
142                    nav: true
143                },
144                576: {
145                    items: 2,
146                    nav: true
147                },
148                768: {
149                    items: 3,
150                    nav: true
151                },
152                1200: {
153                    items: 4,
154                    nav: true
155                },
156                1600: {
157                    items: 5,
158                    nav: true
159                },
160                2200: {
161                    items: 6,
162                    nav: true
163                }
164            }
165        });
166
167        $('.owl-carousel.news-carousel').owlCarousel({
168            loop: true,
169            autoplay: true,
170            autoplayTimeout: 5000,
171            autoplayHoverPause: true,
172            margin: 0,
173            items: 1,
174            dots: false,
175            nav: true
176        })
177
178        $('.owl-carousel.reviews').owlCarousel({
179            loop: true,
180            autoplay: true,
181            autoplayTimeout: 5000,
182            autoplayHoverPause: true,
183            margin: 0,
184            items: 1,
185            dots: false,
186            nav: false
187        })
188
189        $('.owl-carousel.main-slider').owlCarousel({
190            loop: true,
191            autoplay: true,
192            autoplayTimeout: 10000,
193            autoplayHoverPause: true,
194            margin: 0,
195            items: 1,
196            dots: false,
197            nav: true
198        })
199
200        $('.owl-carousel.instagram').owlCarousel({
201            loop: true,
202            autoplay: true,
203            autoplayTimeout: 5000,
204            autoplayHoverPause: true,
205            responsiveClass: true,
206            dots: false,
207            nav: false,
208            responsive: {
209                0: {
210                    margin: 10,
211                    items: 3
212                },
213                576: {
214                    margin: 10,
215                    items: 5
216                },
217                768: {
218                    margin: 10,
219                    items: 6
220                },
221                996: {
222                    margin: 10,
223                    items: 7
224                },
225                1200: {
226                    margin: 20,
227                    items: 8
228                },
229                1600: {
230                    margin: 20,
231                    items: 10
232                },
233                2200: {
234                    margin: 20,
235                    items: 14
236                }
237            }
238        });
239
240        $('.product-gallery').owlCarousel({
241            loop: false,
242            autoplay: true,
243            autoplayTimeout: 5000,
244            autoplayHoverPause: true,
245            responsiveClass: true,
246            dots: false,
247            nav: false,
248            responsive: {
249                0: {
250                    margin: 10,
251                    items: 2
252                },
253                576: {
254                    margin: 10,
255                    items: 3
256                },
257                768: {
258                    margin: 10,
259                    items: 3
260                },
261                996: {
262                    margin: 10,
263                    items: 3
264                },
265                1200: {
266                    margin: 20,
267                    items: 4
268                },
269                1600: {
270                    margin: 20,
271                    items: 4
272                },
273                2200: {
274                    margin: 20,
275                    items: 5
276                }
277            }
278        });
279
280        $(".colorbox-full-image").colorbox({
281            rel: 'gallery',
282            maxWidth: "90%",
283            maxHeight: "90%"
284        });
285
286        $('.owl-carousel.gallery-1').owlCarousel({
287            loop: true,
288            autoplay: true,
289            autoplayTimeout: 5000,
290            autoplayHoverPause: true,
291            autoHeight: true,
292            responsiveClass: true,
293            dots: false,
294            nav: false,
295            responsive: {
296                0: {
297                    margin: 10,
298                    items: 1
299                },
300                576: {
301                    margin: 10,
302                    items: 1
303                },
304                768: {
305                    margin: 10,
306                    items: 2
307                },
308                996: {
309                    margin: 10,
310                    items: 3
311                },
312                1200: {
313                    margin: 20,
314                    items: 4
315                },
316                1600: {
317                    margin: 20,
318                    items: 5
319                },
320                2200: {
321                    margin: 20,
322                    items: 6
323                }
324            }
325        });
326
327        $('.owl-carousel.gallery-2').owlCarousel({
328            loop: true,
329            autoplay: true,
330            autoplayTimeout: 5000,
331            autoplayHoverPause: true,
332            responsiveClass: true,
333            dots: false,
334            nav: false,
335            autoHeight: true,
336            responsive: {
337                0: {
338                    margin: 10,
339                    items: 1
340                },
341                576: {
342                    margin: 10,
343                    items: 1
344                },
345                768: {
346                    margin: 10,
347                    items: 2
348                },
349                996: {
350                    margin: 10,
351                    items: 3
352                },
353                1200: {
354                    margin: 20,
355                    items: 4
356                },
357                1600: {
358                    margin: 20,
359                    items: 5
360                },
361                2200: {
362                    margin: 20,
363                    items: 6
364                }
365            }
366        });
367
368		// Prevent mini cart from closing when clicked inside.
369        $(document).on('click', '.mini-cart .dropdown-menu', function (e) {
370            e.stopPropagation();
371        });
372    },
373    Load: function () {
374        // Add any load time functionality here - when the document is loaded.
375
376    },
377    Resize: function () {
378        // Add any resize functionality here - whenever the window is resized.
379
380    },
381    Google: {
382        Map: null,
383        MapElement: null,
384        Markers: [],
385        LocationMap: function () {
386
387            $.hood.Wordpress.Google.MapElement = $('#location-map');
388            if (!$.hood.Wordpress.Google.MapElement.length)
389                return;
390
391            var scrollWheel = false;
392            if ($.hood.Wordpress.Google.MapElement.attr('data-scrollwheel'))
393                scrollWheel = $.hood.Wordpress.Google.MapElement.data('scrollwheel');
394
395            var zoom = false;
396            if ($.hood.Wordpress.Google.MapElement.attr('data-zoom'))
397                zoom = $.hood.Wordpress.Google.MapElement.data('zoom');
398
399            $.hood.Wordpress.Google.Map = new google.maps.Map(document.getElementById('location-map'), {
400                zoom: zoom,
401                maxZoom: 18,
402                scrollwheel: scrollWheel,
403                center: { lat: $.hood.Wordpress.Google.MapElement.data('lat'), lng: $.hood.Wordpress.Google.MapElement.data('long') },
404                styles: $.hood.Wordpress.Google.Styles
405            });
406            var infowindow = null;
407
408            for (var i = 0; i < $.hood.Wordpress.Google.Markers.length; i++) {
409                $.hood.Wordpress.Google.Markers[i].setMap(null);
410            }
411            $.hood.Wordpress.Google.Markers = [];
412
413            if (mapLocations) {
414                mapLocations.map(function (location, i) {
415                    let marker = new google.maps.Marker({
416                        position: new google.maps.LatLng(location.lat, location.lng),
417                        map: $.hood.Wordpress.Google.Map
418                    });
419
420                    marker.setIcon({
421                        url: '/wp-content/themes/everyman/images/map-marker.png',
422                        size: new google.maps.Size(40, 40),
423                        anchor: new google.maps.Point(20, 20),
424                        scaledSize: new google.maps.Size(40, 40)
425                    });
426
427                    marker.info = '<div class="card border-0">' +
428                        '    <div style="background-image:url(' + location.image_url + ')" class="card-img-top rounded-0 img img-wide mb-0"></div>' +
429                        '    <div class="card-body border-0 pb-0">' +
430                        '    <span class="d-block font-weight-bold text-center">' +
431                        '            <h5 class="font-weight-bold">' + location.title + '</h5>' +
432                        '        </span>' +
433                        '    </div>' +
434                        '    <div class="card-body border-0">' +
435                        '        <a href="' + location.url + '" class="btn btn-block btn-primary">More info...</a>' +
436                        '    </div>' +
437                        '</div>';
438
439                    google.maps.event.addListener(marker, 'click', function (e) {
440                        if (infowindow) {
441                            infowindow.close();
442                        }
443                        infowindow = new google.maps.InfoWindow({
444                            content: this.info
445                        });
446                        infowindow.open($.hood.Wordpress.Google.Map, this);
447                    });
448
449                    $.hood.Wordpress.Google.Markers.push(marker);
450
451                });
452            }
453        },
454        Styles:  [
455            {
456                "featureType": "administrative",
457                "elementType": "labels.text",
458                "stylers": [
459                    {
460                        "visibility": "simplified"
461                    },
462                    {
463                        "color": "#ddd6d6"
464                    }
465                ]
466            },
467            {
468                "featureType": "administrative",
469                "elementType": "labels.text.fill",
470                "stylers": [
471                    {
472                        "color": "#ffffff"
473                    },
474                    {
475                        "weight": "1"
476                    }
477                ]
478            },
479            {
480                "featureType": "administrative.country",
481                "elementType": "labels.text",
482                "stylers": [
483                    {
484                        "visibility": "simplified"
485                    },
486                    {
487                        "color": "#ffffff"
488                    }
489                ]
490            },
491            {
492                "featureType": "administrative.province",
493                "elementType": "labels.text",
494                "stylers": [
495                    {
496                        "visibility": "simplified"
497                    }
498                ]
499            },
500            {
501                "featureType": "landscape",
502                "elementType": "all",
503                "stylers": [
504                    {
505                        "color": "#222739"
506                    }
507                ]
508            },
509            {
510                "featureType": "poi",
511                "elementType": "all",
512                "stylers": [
513                    {
514                        "visibility": "off"
515                    },
516                    {
517                        "color": "#ff0000"
518                    }
519                ]
520            },
521            {
522                "featureType": "poi.attraction",
523                "elementType": "labels",
524                "stylers": [
525                    {
526                        "visibility": "off"
527                    },
528                    {
529                        "color": "#ffffff"
530                    }
531                ]
532            },
533            {
534                "featureType": "road",
535                "elementType": "all",
536                "stylers": [
537                    {
538                        "saturation": -100
539                    },
540                    {
541                        "lightness": "0"
542                    },
543                    {
544                        "color": "#383f5c"
545                    }
546                ]
547            },
548            {
549                "featureType": "road",
550                "elementType": "labels.text",
551                "stylers": [
552                    {
553                        "visibility": "simplified"
554                    },
555                    {
556                        "color": "#ffffff"
557                    }
558                ]
559            },
560            {
561                "featureType": "road.highway",
562                "elementType": "all",
563                "stylers": [
564                    {
565                        "visibility": "off"
566                    }
567                ]
568            },
569            {
570                "featureType": "road.arterial",
571                "elementType": "labels.icon",
572                "stylers": [
573                    {
574                        "visibility": "off"
575                    }
576                ]
577            },
578            {
579                "featureType": "transit",
580                "elementType": "all",
581                "stylers": [
582                    {
583                        "visibility": "off"
584                    },
585                    {
586                        "lightness": "-17"
587                    }
588                ]
589            },
590            {
591                "featureType": "transit.line",
592                "elementType": "all",
593                "stylers": [
594                    {
595                        "visibility": "simplified"
596                    },
597                    {
598                        "color": "#626d8a"
599                    }
600                ]
601            },
602            {
603                "featureType": "water",
604                "elementType": "all",
605                "stylers": [
606                    {
607                        "color": "#000000"
608                    },
609                    {
610                        "visibility": "on"
611                    }
612                ]
613            }
614        ]
615    }
616};
617
618// Initialise
619$(function () { $.hood.Wordpress.Ready(); });
620$(window).on('load', $.hood.Wordpress.Load);
621$(window).on('resize', $.hood.Wordpress.Resize);
622
623function initMap() {
624    $.hood.Wordpress.Google.LocationMap();
625}
626
627function scrollToInvalid(e) {
628    // Height of your nav bar plus a bottom margin
629    var navHeight = 300;
630    // Offset of the first input element minus your nav height
631    var invalid_el = $(e.target).offset().top - navHeight;
632
633    // If the invalid element is already within the window view, return true. If you return false, the validation will stop.
634    if (invalid_el > (window.pageYOffset - navHeight) && invalid_el < (window.pageYOffset + window.innerHeight - navHeight)) {
635        return true;
636    } else {
637        // If the first invalid input is not within the current view, scroll to it.
638        $('html, body').animate({
639            scrollTop: invalid_el
640        }, 500);
641    }
642}
643
644$('input').on('invalid', scrollToInvalid);

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.