PageSourceSearch

https://oceanhousemarina.com/wp-content/themes/oceanhouse/assets/js/custom.js?ver=7.1.2

js oceanhousemarina.com collected 2026-09-30 12:01:48 UTC 14,952 bytes, 590 lines download raw bytes

1jQuery(function ($) {
2
3
4    $(document).ready(function () {
5        $(window).scroll(function () {
6            if ($(window).scrollTop() >= 300) {
7                $('header#header').addClass('fixed-header');
8            } else {
9                $('header#header').removeClass('fixed-header');
10            }
11        });
12
13        // jQuery('.all-services').scwStickySidebar({
14        //     // Settings
15        //     additionalMarginTop: 30
16        // });
17
18
19        if ($('.grid-col-2.isotope').length) {
20            var $grid2 = $('.grid-col-2.isotope').isotope({
21
22                layoutMode: 'fitRows',
23
24                columnWidth: '.grid-sizer',
25
26                itemSelector: '.grid-item',
27
28                percentPosition: true,
29
30                fitRows: {
31
32                    gutter: '.gutter-sizer'
33
34                }
35
36            });
37
38            $grid2.imagesLoaded().progress(function () {
39
40                $grid2.isotope('layout');
41
42            });
43        }
44
45        if ($('.grid-col-3.isotope').length) {
46            var $grid3 = $('.grid-col-3.isotope').isotope({
47
48                layoutMode: 'fitRows',
49
50                columnWidth: '.grid-sizer',
51
52                itemSelector: '.grid-item',
53
54                percentPosition: true,
55
56                fitRows: {
57
58                    gutter: '.gutter-sizer'
59
60                }
61
62            });
63
64            $grid3.imagesLoaded().progress(function () {
65
66                $grid3.isotope('layout');
67
68            });
69        }
70
71        if ($('.grid-col-4.isotope').length) {
72            var $grid4 = $('.grid-col-4.isotope').isotope({
73
74                layoutMode: 'fitRows',
75
76                columnWidth: '.grid-sizer',
77
78                itemSelector: '.grid-item',
79
80                percentPosition: true,
81
82                fitRows: {
83
84                    gutter: '.gutter-sizer'
85
86                }
87
88            });
89
90            $grid4.imagesLoaded().progress(function () {
91
92                $grid4.isotope('layout');
93
94            });
95        }
96    });
97
98});
99
100
101$(document).ready(function () {
102
103    $('.social-share-toggle').on('click', function (e) {
104        e.preventDefault();
105        $('#social-share').toggleClass('d-none');
106    });
107
108    $('.lazy').lazy();
109
110    $('.lazy-h').lazy({
111
112        direction: "horizontal",
113
114        effect: "fadeIn",
115
116        effectTime: 2000,
117
118        threshold: 0
119
120    });
121
122
123    if (('[data-fancybox="images"]').length) {
124        $('[data-fancybox="images"]').fancybox({
125            thumbs: {
126                autoStart: true
127            }
128        });
129    }
130
131});
132
133
134(function () {
135
136
137    // store the slider in a local variable
138
139    var $window = $(window),
140
141        flexslider = {
142
143            vars: {}
144
145        };
146
147
148    // tiny helper function to add breakpoints
149
150    function getGridSize() {
151
152        return (window.innerWidth < 600) ? 2 :
153
154            (window.innerWidth < 900) ? 4 : 6;
155
156    }
157
158
159    $(window).on('load', function () {
160        if ($('#inv-carousel').length) {
161            $('#inv-carousel').flexslider({
162
163                animation: "slide",
164
165                controlNav: false,
166
167                animationLoop: false,
168
169                slideshow: false,
170
171                itemWidth: 120,
172
173                itemMargin: 5,
174
175                minItems: getGridSize(),
176
177                maxItems: getGridSize(),
178
179                asNavFor: "#inv-slider",
180
181
182            });
183        }
184        if ($('#inv-slider').length) {
185
186            $('#inv-slider').flexslider({
187
188                animation: "slide",
189
190                controlNav: false,
191
192                animationLoop: false,
193
194                slideshow: false,
195
196                sync: "#inv-carousel",
197
198
199            });
200        }
201
202
203    });
204
205
206    // check grid size on resize event
207
208    $window.resize(function () {
209
210        var gridSize = getGridSize();
211
212        flexslider.vars.minItems = gridSize;
213
214        flexslider.vars.maxItems = gridSize;
215
216    });
217
218}());
219
220
221jQuery(window).resize(function () {
222
223    var windowWidth = window.innerWidth;
224
225    if (windowWidth > 768) {
226
227        jQuery(".widget_inventory_search form").removeClass("wis-dis-n");
228
229        jQuery(".widget_inventory_search form").addClass("wis-dis-b");
230
231    } else {
232
233        jQuery(".widget_inventory_search form").removeClass("wis-dis-b");
234
235        jQuery(".widget_inventory_search form").addClass("wis-dis-n");
236
237    }
238
239});
240
241
242jQuery(document).ready(function () {
243
244    var facebook_share_button = $('.fb-share-button a');
245
246    facebook_share_button.click(function () {
247
248        window.open($(this).data('link'), "Share on Facebook", "width=500,height=500");
249        return false;
250
251    });
252
253
254    var twitter_share_button = $('.twitter-share-button a');
255
256    twitter_share_button.click(function () {
257
258        window.open($(this).data('link'), "Share on Twitter", "width=500,height=500");
259        return false;
260    });
261
262
263    $(".widget_inventory_search h3").click(function (e) {
264
265        var windowWidth = window.innerWidth;
266
267        if (windowWidth < 768) {
268
269            $(".widget_inventory_search form").slideToggle();
270
271            $(this).toggleClass("wis-turn");
272
273        }
274
275    });
276
277});
278
279
280jQuery(document).ready(function () {
281
282    $(function () {
283
284        var inputs = $('.input');
285
286        var paras = $('.description-flex-container').find('p');
287
288        $(inputs).click(function () {
289
290            var t = $(this),
291
292                ind = t.index(),
293
294                matchedPara = $(paras).eq(ind);
295
296
297            $(t).add(matchedPara).addClass('active');
298
299            $(inputs).not(t).add($(paras).not(matchedPara)).removeClass('active');
300
301        });
302
303    });
304
305});
306
307
308// external js: isotope.pkgd.js
309
310// init Isotope
311
312if ($('.grid-brands').length) {
313    var $grid = $('.grid-brands').isotope({
314        itemSelector: '.brand-item',
315        layoutMode: 'fitRows'
316    });
317
318    // bind filter button click
319    $('.filters-button-group').on('click', 'button', function () {
320        var filterValue = $(this).attr('data-filter');
321        // use filterFn if matches value
322        if (filterValue == ".Boat") {
323            $grid.isotope({ filter: filterValue });
324            $('.brandFilteringSelect').fadeIn();
325        } else {
326            $grid.isotope({ filter: filterValue });
327            $('.brandFilteringSelect').fadeOut();
328        }
329    });
330
331    // bind filter on select change
332    $('.filters-select').on('change', function () {
333        // get filter value from option value
334        var filterValue = this.value;
335        $grid.isotope({ filter: filterValue });
336    });
337
338}
339
340// change is-checked class on buttons
341$('.button-group').each(function (i, buttonGroup) {
342    var $buttonGroup = $(buttonGroup);
343    $buttonGroup.on('click', 'button', function () {
344        $buttonGroup.find('.is-checked').removeClass('is-checked');
345        $(this).addClass('is-checked');
346    });
347});
348
349
350jQuery(document).ready(function () {
351
352
353    const swiper = new Swiper('.home-slider', {
354        preloadImages: false,
355        lazy: true,
356        loop: true,
357        speed: 650,
358        autoplay: {
359            delay: 7000
360        },
361        navigation: {
362            nextEl: $('.slider-arrow-right'),
363            prevEl: $('.slider-arrow-left'),
364        },
365    });
366
367
368    $(".season-switcher .off-season").removeClass('active');
369    $(".business-hour .off-season").hide();
370    $(".business-hour-notes.off-season").hide();
371
372    $(".season-switcher .in-season").addClass('active');
373    $(".business-hour .in-season").show();
374    $(".business-hour-notes.in-season").show();
375
376    $(".season-switcher .in-season").click(function () {
377
378        $(".season-switcher .off-season").removeClass('active');
379        $(".business-hour .off-season").hide();
380        $(".business-hour-notes.off-season").hide();
381
382        $(".season-switcher .in-season").addClass('active');
383        $(".business-hour .in-season").show();
384        $(".business-hour-notes.in-season").show();
385
386    });
387    $(".season-switcher .off-season").click(function () {
388
389        $(".season-switcher .in-season").removeClass('active');
390        $(".business-hour .in-season").hide();
391        $(".business-hour-notes.in-season").hide();
392
393        $(".season-switcher .off-season").addClass('active');
394        $(".business-hour .off-season").show();
395        $(".business-hour-notes.off-season").show();
396
397
398    });
399
400    $("#field_14_37 .ginput_quantity_label").text("Hours:");
401    $("#field_14_217 .ginput_quantity_label").text("Hours:");
402    $("#field_14_218 .ginput_quantity_label").text("Hours:");
403    $("#field_14_219 .ginput_quantity_label").text("Hours:");
404
405    // ...
406    // function hourSwiperMode() {
407    //     let mobile = window.matchMedia('(min-width: 0px) and (max-width: 768px)');
408    //     let tablet = window.matchMedia('(min-width: 769px) and (max-width: 1024px)');
409    //     let desktop = window.matchMedia('(min-width: 1025px)');
410    //
411    //     // Enable (for mobile)
412    //     if (mobile.matches) {
413    //         $('.hours-swiper .col').removeClass('col');
414    //         $('.hours-swiper').each(function (key, item) {
415    //             var $this = $(this);
416    //
417    //             console.log(item);
418    //             swiper = new Swiper(this, {
419    //                 slidesPerView: 1,
420    //                 loop: false,
421    //                 spaceBetween: 20,
422    //                 paginationClickable: true,
423    //                 pagination: {
424    //                     el: '.swiper-pagination',
425    //                 },
426    //             });
427    //         })
428    //
429    //     }
430    //
431    //     // Disable (for tablet)
432    //     else if (tablet.matches) {
433    //         swiper.destroy();
434    //         init = false;
435    //     }
436    //
437    //     // Disable (for desktop)
438    //     else if (desktop.matches) {
439    //         swiper.destroy();
440    //         init = false;
441    //     }
442    // }
443    // hourSwiperMode()
444});
445
446
447if ($('.repowers-item').length) {
448    $(".repowers-item").matchHeight({
449        byRow: true,
450        property: 'height',
451    });
452}
453
454/**
455 * Don't hide the date picker when clicking a date
456 */
457
458
459jQuery(function ($) {
460    $('#inventory-sorting').val($('#search-filter-form-8929 > ul > li.sf-field-sort_order > label > select').val());
461    $('#inventory-sorting').on('change', function () {
462        if ($(this).val() !== '') {
463            $('#search-filter-form-8929 > ul > li.sf-field-sort_order > label > select').val($(this).val());
464            $('#search-filter-form-8929').submit();
465        }
466    });
467
468
469    $('#inventory-sorting').val($('#search-filter-form-8929 > ul > li.sf-field-sort_order > label > select').val());
470    $('#inventory-sorting').on('change', function () {
471        if ($(this).val() !== '') {
472            $('#search-filter-form-8929 > ul > li.sf-field-sort_order > label > select').val($(this).val());
473            $('#search-filter-form-8929').submit();
474        }
475    });
476});
477
478// Rescale reCaptcha function
479jQuery(document).ready(function ($) {
480    $(function () {
481        function rescaleCaptcha() {
482            var ginput_recaptchas = $('.ginput_recaptcha');
483            for (var recaptcha of ginput_recaptchas) {
484                var width = recaptcha.parentElement.getBoundingClientRect().width;
485                var scale;
486
487                if (width < 302 && width !== 0) {
488                    scale = width / 302;
489                } else {
490                    scale = 1.0;
491                }
492
493                $('#' + recaptcha.id).css('transform', 'scale(' + scale + ')');
494                $('#' + recaptcha.id).css('-webkit-transform', 'scale(' + scale + ')');
495                $('#' + recaptcha.id).css('transform-origin', '0 0');
496                $('#' + recaptcha.id).css('-webkit-transform-origin', '0 0');
497            }
498
499        }
500
501        rescaleCaptcha();
502        $(window).resize(function () {
503            rescaleCaptcha();
504        });
505    });
506
507    if (jQuery('.isotope').length) {
508        jQuery('.isotope').fuelmBricks({
509            itemSelector: '.grid-item',
510            loadMoreSelector: '.loadMoreButton',
511            postPerPage: 9,
512            loadMoreText: 'Load More Posts',
513            loadNoMoreText: 'There is no more posts',
514            adminAjaxUrl: 'https://wordpress-1087720-6413047.cloudwaysapps.com/wp-admin/admin-ajax.php',
515            itemTemplate: [
516                '<div class="entry {{#categories}}{{slug}} {{/categories}} grid-item shadow">',
517                '<div class="entry-image mb-0">',
518                '<a href="{{link}}">',
519                '{{#image}}',
520                '<img src="{{image}}" alt="{{title}}">',
521                '{{/image}}',
522                '{{^image}}',
523                '<img src="https://wordpress-1087720-6413047.cloudwaysapps.com/wp-content/themes/oceanhouse/assets/img/no-image.jpg" alt="{{title}}">',
524                '{{/image}}',
525                '</a>',
526                '</div>',
527                '<div class="entry-content p-4">',
528                '<ul class="entry-meta clearfix">',
529                '{{#categories}}<li><a href="#" data-fb-filter="{{slug}}">{{name}}</a></li>{{/categories}}',
530                '</ul>',
531                '<div class="entry-title">',
532                '<h4>',
533                '<a href="{{link}}">{{{title}}}</a>',
534                '</h4>',
535                '</div>',
536                '<a href={{link}}" class="detail-link m-0">Read More <i aria-hidden="true" class="icon-arrow-right1"></i></a>',
537                '</div>',
538                '</div>',
539
540
541            ].join(''),
542            postAction: 'get_ajax_posts',
543        })
544    }
545
546
547    function injectUserway(d, s, id) {
548        var js, fjs = d.getElementsByTagName(s)[0];
549        if (d.getElementById(id)) return;
550        js = d.createElement(s);
551        js.id = id;
552        js.src = 'https://cdn.userway.org/widget.js';
553        fjs.parentNode.insertBefore(js, fjs);
554    };
555    const $userWayFakeButton = $('#userway-fake img');
556    $userWayFakeButton.on('click', function () {
557        $userWayFakeButton.css({ opacity: 0.4 });
558        injectUserway(document, 'script', 'userway-jssdk');
559
560        // Callback on Facebook SDK init, that fires up the Messanger plugin
561        document.addEventListener("userway:init_completed", function (event) {
562            var instance = event.detail.userWayInstance;
563            $userWayFakeButton.css({ display: 'none' });
564            UserWay.widgetOpen();
565        });
566
567    });
568
569
570});
571jQuery.event.special.touchstart = {
572    setup: function (_, ns, handle) {
573        this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
574    }
575};
576jQuery.event.special.touchmove = {
577    setup: function (_, ns, handle) {
578        this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });
579    }
580};
581jQuery.event.special.wheel = {
582    setup: function (_, ns, handle) {
583        this.addEventListener("wheel", handle, { passive: true });
584    }
585};
586jQuery.event.special.mousewheel = {
587    setup: function (_, ns, handle) {
588        this.addEventListener("mousewheel", handle, { passive: true });
589    }
590};

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.