PageSourceSearch

https://tan-sheep-804188.hostingersite.com/wp-content/themes/kinsley-child/js/custom.js?ver=1791003377

js tan-sheep-804188.hostingersite.com collected 2026-10-03 04:56:57 UTC 6,681 bytes, 199 lines download raw bytes

1jQuery(document).ready(function ($) {
2    // Update popup title based on which trigger button was clicked.
3    // Uses direct binding (not delegation) so it fires even when main.js
4    // calls stopPropagation() via return false on the same elements.
5    $('a[href="#booknow"]').on('click', function () {
6        var $link = $(this);
7        var $title = $('#booknow').find('h2');
8        var customTitle = $link.data('popup-title');
9
10        if (!customTitle) {
11            customTitle = $link.closest('.knsl-top-bar').length
12                ? 'Book Now'
13                : ($title.data('default-title') || '');
14        }
15
16        if (customTitle) {
17            $title.text(customTitle);
18        }
19    });
20
21
22    var swiper = new Swiper(".propertyDetailSwiper", {
23        slidesPerView: 1, // Changed to 1 for better mobile view
24        spaceBetween: 20,
25        centeredSlides: true,
26        loop: true,
27        watchSlidesProgress: true,
28
29        navigation: {
30            nextEl: '.knsl-slider-next',
31            prevEl: '.knsl-slider-prev',
32        },
33
34        pagination: {
35            el: '.knsl-slider-pagination',
36            type: 'fraction',
37        },
38
39        breakpoints: {
40            768: {
41                slidesPerView: 2
42            },
43            1200: {
44                slidesPerView: 2.5
45            }
46        },
47        on: {
48            init: function () {
49                // Update custom counter if it exists
50                updateCustomCounter(this);
51            },
52            slideChange: function () {
53                // Update custom counter if it exists
54                updateCustomCounter(this);
55            }
56        }
57    });
58    function updateCustomCounter(swiper) {
59        var $customCounter = $('.image-counter .current-slide');
60        if ($customCounter.length) {
61            var currentIndex = swiper.realIndex + 1;
62            $customCounter.text(currentIndex);
63        }
64    }
65    $('.knsl-slider-prev, .knsl-slider-next').on('click', function () {
66        setTimeout(function () {
67            updateCustomCounter(swiper);
68        }, 50);
69    });
70
71    $('.popup-youtube').magnificPopup({
72        type: 'iframe',
73        iframe: {
74            patterns: {
75                youtube: {
76                    index: 'youtube.com/',
77                    id: function(url) {
78                        var match = url.match(/[\\?\\&]v=([^\\?\\&]+)/);
79                        return match ? match[1] : null;
80                    },
81                    src: 'https://www.youtube.com/embed/%id%?autoplay=1&mute=1'
82                }
83            }
84        },
85
86        mainClass: 'mfp-fade',
87        removalDelay: 300,
88        preloader: false,
89        fixedContentPos: false
90    });
91});
92
93(function ($) {
94    'use strict';
95
96    // ── Beyond Listing filter ────────────────────────────────
97    var $blPropertySelect = $('#blPropertySelect');
98    var $blCategorySelect = $('#blCategorySelect');
99    var $blItems = $('.bl-item');
100    var $blNoRes = $('#blNoResults');
101
102    function filterBeyondItems() {
103        var selectedProperty = $blPropertySelect.val().toString();
104        var selectedCategory = $blCategorySelect.val().toString();
105        var visibleCount = 0;
106
107        $blItems.each(function () {
108            var $item = $(this);
109            var propIds = $item.data('prop-ids');
110            var catIds = $item.data('cat-ids');
111            
112            // Convert to arrays, handling empty/null values
113            var propIdsArr = propIds && propIds.toString() ? propIds.toString().split(',') : [];
114            var catIdsArr = catIds && catIds.toString() ? catIds.toString().split(',') : [];
115            
116            // Check property filter
117            var propertyMatch = (selectedProperty === 'all') || propIdsArr.indexOf(selectedProperty) !== -1;
118            
119            // Check category filter
120            var categoryMatch = (selectedCategory === 'all') || catIdsArr.indexOf(selectedCategory) !== -1;
121            
122            // Show/hide based on both filters
123            if (propertyMatch && categoryMatch) {
124                $item.removeClass('bl-hidden').css('display', '');
125                visibleCount++;
126            } else {
127                $item.addClass('bl-hidden').css('display', 'none');
128            }
129        });
130
131        // Show/hide no results message
132        if (visibleCount === 0) { 
133            $blNoRes.show(); 
134        } else { 
135            $blNoRes.hide(); 
136        }
137    }
138
139    // Attach event listeners to both dropdowns
140    $blPropertySelect.on('change', filterBeyondItems);
141    $blCategorySelect.on('change', filterBeyondItems);
142
143    // Initialize filter on page load
144    if ($blItems.length) {
145        filterBeyondItems();
146    }
147
148    // ── Banyan Circle filter ─────────────────────────────────
149    var $bcPropertySelect = $('#bcPropertySelect');
150    var $bcCategorySelect = $('#bcCategorySelect');
151    var $bcItems = $('.bc-talent-item');
152    var $bcNoRes = $('#bcNoResults');
153
154    function filterBcItems() {
155        var selectedProperty = $bcPropertySelect.val().toString();
156        var selectedCategory = $bcCategorySelect.val().toString();
157        var visibleCount = 0;
158
159        $bcItems.each(function () {
160            var $item = $(this);
161            var propIds = $item.data('prop-ids');
162            var catIds = $item.data('cat-ids');
163            
164            // Convert to arrays
165            var propIdsArr = propIds && propIds.toString() ? propIds.toString().split(',') : [];
166            var catIdsArr = catIds && catIds.toString() ? catIds.toString().split(',') : [];
167            
168            // Check property filter
169            var propertyMatch = (selectedProperty === 'all') || propIdsArr.indexOf(selectedProperty) !== -1;
170            
171            // Check category filter
172            var categoryMatch = (selectedCategory === 'all') || catIdsArr.indexOf(selectedCategory) !== -1;
173            
174            // Show/hide based on both filters
175            if (propertyMatch && categoryMatch) {
176                $item.removeClass('bc-hidden').css('display', '');
177                visibleCount++;
178            } else {
179                $item.addClass('bc-hidden').css('display', 'none');
180            }
181        });
182
183        if (visibleCount === 0) { 
184            $bcNoRes.show(); 
185        } else { 
186            $bcNoRes.hide(); 
187        }
188    }
189
190    // Attach event listeners
191    $bcPropertySelect.on('change', filterBcItems);
192    $bcCategorySelect.on('change', filterBcItems);
193    
194    // Initialize filter
195    if ($bcItems.length) {
196        filterBcItems();
197    }
198
199}(jQuery));

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.