PageSourceSearch

https://crownhillhf.org/wp-content/themes/crown-hill-hf/js/main.js?ver=1790936366

js crownhillhf.org collected 2026-10-02 10:33:50 UTC 13,357 bytes, 346 lines download raw bytes

1jQuery(document).ready(function($) {
2    console.log('loaded');
3    // $('.searchMe a').prepend('<i class="fas fa-search"></i>');
4    // $('.donate a').append('<i class="fas fa-dollar-sign"></i>');
5
6    $('.menu-item:not(:last-child):not(:first) a').before('<span class="sep">|</span>');
7
8    // $('.homeDown').click(function () {
9    //   $('html, body').animate({scrollTop:$(document).height()}, 1300);
10    //   return false;
11    // });
12
13    $('.customMapMarker').click(function() {
14        var lat = $(this).attr('data-lat');
15        var long = $(this).attr('data-long');
16        var marker;
17
18        console.log(lat + "," + long);
19        var mapStyle = [{ 'featureType': 'administrative', 'elementType': 'labels.text.fill', 'stylers': [{ 'color': '#444444' }] }, { 'featureType': 'landscape', 'elementType': 'all', 'stylers': [{ 'color': '#f2f2f2' }] }, { 'featureType': 'poi', 'elementType': 'all', 'stylers': [{ 'visibility': 'off' }] }, { 'featureType': 'road', 'elementType': 'all', 'stylers': [{ 'saturation': -100 }, { 'lightness': 45 }] }, { 'featureType': 'road.highway', 'elementType': 'all', 'stylers': [{ 'visibility': 'simplified' }] }, { 'featureType': 'road.arterial', 'elementType': 'labels.icon', 'stylers': [{ 'visibility': 'off' }] }, { 'featureType': 'transit', 'elementType': 'all', 'stylers': [{ 'visibility': 'off' }] }, { 'featureType': 'water', 'elementType': 'all', 'stylers': [{ 'color': '#4f595d' }, { 'visibility': 'on' }] }];
20
21        var mapProp = {
22            //center: new google.maps.LatLng(39.825539, -86.1743157),
23            mapTypeId: google.maps.MapTypeId.ROADMAP,
24            styles: mapStyle,
25            zoom: 17,
26        };
27        var customMap = new google.maps.Map(document.getElementById("map"), mapProp);
28
29        marker = new google.maps.Marker({
30            position: new google.maps.LatLng(lat, long),
31            map: customMap,
32
33        });
34
35    });
36
37
38    $('.selectTour').click(function() {
39        title = $(this).attr('data-title');
40        console.log(title);
41        title = title.replace(/\s+/g, '');
42
43        addTourLocalStorage('tour', title);
44
45
46    })
47    $('.backIntro').click(function() {
48        $('.tourLoadScreen').css('display', 'flex');
49        $('.tourIntroScreen').css('display', 'none');
50
51    })
52    $('.backLocations').click(function() {
53        $('.tourIntroScreen').css('display', 'flex');
54        $('.tourLocations').css('display', 'none');
55
56    })
57    $('.backLocationList').click(function() {
58        var tourName = localStorage.getItem("tour");
59
60        $('.tourLocationList').css('display', 'none');
61        $('.tourLocations').css('display', 'block');
62        $('.tourItems').text('');
63        removeMapMarker();
64        removeAll();
65        checkLS(tourName + 'tourItems');
66
67        addItemCount = 1;
68
69    })
70    $('.backBio').click(function() {
71
72        $('.tourBio').css('display', 'none');
73        $('.tourLocationList').css('display', 'block');
74
75    })
76    $('.backSingleBio').click(function() {
77
78        $('.tourSingleBio').css('display', 'none');
79        $('.tourLocations').css('display', 'block');
80
81    })
82    $('.detailsBtn').click(function() {
83        $('.tourLoadScreen').css('display', 'none');
84        $('.tourIntroScreen').css('display', 'flex');
85
86    })
87    $('.createBtn').click(function() {
88
89        title = $(this).attr('data-tour');
90        console.log(title);
91        title = title.replace(/\s+/g, '');
92
93        addTourLocalStorage('tour', title);
94
95        var tourName = localStorage.getItem("tour");
96
97        $('.tourIntroScreen').css('display', 'none');
98        $('.tourLocations').css('display', 'block');
99        checkLS(tourName + 'tourItems');
100
101    })
102    $('.generateBtn').click(function() {
103        $('.tourLocations').css('display', 'none');
104        $('.tourLocationList').css('display', 'block');
105        generateMap();
106
107    })
108    var currentLocations = [];
109
110    function addTourItems(single, itemIndex) {
111
112        console.log(itemIndex);
113        var itemCount = 1;
114
115        if (single) {
116            console.log(itemCount);
117
118            $('.tourItems').append("<div class='tourItem" + itemIndex + "'>\
119      <span class='tourImage' style='display:block;background-image:url(" + tourLocationsArray[itemIndex].image + ")'/><img src='" + tourLocationsArray[itemIndex].image + "'/></span>\
120      <h3 class='tourName'>" + tourLocationsArray[itemIndex].firstName + " " + tourLocationsArray[itemIndex].middleName + " " + tourLocationsArray[itemIndex].lastName + "\
121      <a class='bioBtn' data-index='" + itemIndex + "'>View Bio</a></h3>\
122      </div>");
123        } else {
124            $(tourLocationsArray).each(function(index) {
125                $('.tourItems').append("<div class='each tourItem" + index + "'>\
126      <span class='tourImage' style='display:block;background-image:url(" + tourLocationsArray[index].image + ")'/><img src='" + tourLocationsArray[index].image + "'/></span>\
127      <h3 class='tourName'>" + tourLocationsArray[index].firstName + " " + tourLocationsArray[index].middleName + " " + tourLocationsArray[index].lastName + "\
128      <a class='bioBtn' data-index='" + index + "'>View Bio</a></h3>\
129      </div>");
130                itemCount++;
131            })
132        }
133    }
134    $('.allBtn').click(function() {
135        $('.tourLocations').css('display', 'none');
136        $('.tourLocationList').css('display', 'block');
137        $('.tourItems').text('');
138        addTourItems();
139        generateMap(true);
140
141    })
142    var addItemCount = 1;
143    $('.addMarker').click(function() {
144
145        var index = $(this).attr('data-index');
146        $(this).css('display', 'none');
147        console.log(index);
148        //console.log(tourLocationsArray[index].image);
149        //addTourItems(true, index, addItemCount);
150
151        addLocalStorage('tourItems', index);
152
153        addItemCount++;
154
155
156    })
157
158    function popMap(index) {
159        current = [
160            //info: '<?php print get_sub_field('first_name'); ?> <?php print get_sub_field('middle_name'); ?> <?php print get_sub_field('last_name'); ?>',
161
162            '<div style="display:flex;flex-direction:column;">' +
163            '<h3 class="markerName">' + tourLocationsArray[index].firstName + " " + tourLocationsArray[index].middleName + " " + tourLocationsArray[index].lastName + '</h3>' +
164            '<div style="" class="markerSection">Section: ' + tourLocationsArray[index].section + '</div>' +
165            //'<a target="_blank" class="markerDirections" href="https://www.google.com/maps/place/' + tourLocationsArray[index].latitude + ',' + tourLocationsArray[index].longitude + '">Get Directions (opens in new tab)</a></div>' +
166            '<div style="" class="markerImage"><img style="" src="' + tourLocationsArray[index].image + '"/></div><br/>' +
167            '<div style="" class="markerBio"><p style="margin-top:0;">' + tourLocationsArray[index].information + '</p></div>' +
168            '</div>',
169            tourLocationsArray[index].latitude,
170            tourLocationsArray[index].longitude,
171            index,
172        ]
173        locationListArray.push(current);
174        console.log(locationListArray);
175    }
176    $('.removeMarker').click(function() {
177        var index = $(this).attr('data-index');
178        $(this).siblings('.addMarker').css('display', 'inline-block');
179
180        removeLocalStorage('tourItems', index);
181
182        console.log(index);
183        console.log(tourLocationsArray[index].firstName);
184
185        $('.tourItem' + index).remove();
186        // Need to remove location map point also/// 
187        for (i = 0; i < locationListArray.length; i++) {
188            var locationItemArray = locationListArray[i][3];
189            if (locationItemArray == index) {
190                console.log('before');
191                console.log(locationListArray[i][3]);
192                locationListArray.splice(i, 1);
193                console.log('after');
194                console.log(locationListArray);
195
196            }
197
198        }
199
200    })
201
202    function checkLS(storageItem) {
203        // Get the existing data
204        //var tourName = localStorage.getItem("tour");
205        //var existing = localStorage.getItem(tourName + storageItem);
206        var existing = localStorage.getItem(storageItem);
207
208        // If no existing data, create an array
209        // Otherwise, convert the localStorage string to an array
210        existing = existing ? existing.split(',') : [];
211        var singleValue = "";
212        for (var i = 0; i < existing.length; i++) {
213            console.log("checkLS: " + existing[i]);
214            singleValue = existing[i];
215            $('.addMarker[data-index="' + singleValue + '"]').css('display', 'none');
216
217            addTourItems(true, singleValue);
218            popMap(singleValue)
219                //if (existing[i] === index) {
220                //existing.splice(i, 1);
221                //}
222        }
223        // Add new data to localStorage Array
224        //existing.push(index);
225
226
227        // Save back to localStorage
228        //localStorage.setItem('tourItems', existing.toString());
229    }
230
231    function addTourLocalStorage(storageItem, index) {
232        // Get the existing data
233        console.log('addLS ' + storageItem + " title:" + index);
234
235
236        // Add new data to localStorage Array
237        // Save back to localStorage
238        localStorage.setItem(storageItem, index);
239    }
240
241    function addLocalStorage(storageItem, index) {
242        // Get the existing data
243        var tourName = localStorage.getItem("tour");
244        var existing = localStorage.getItem(tourName + storageItem);
245
246        // If no existing data, create an array
247        // Otherwise, convert the localStorage string to an array
248        existing = existing ? existing.split(',') : [];
249
250        // Add new data to localStorage Array
251        existing.push(index);
252        addTourItems(true, index);
253        popMap(index);
254        // Save back to localStorage
255        localStorage.setItem(tourName + storageItem, existing.toString());
256    }
257
258    function removeLocalStorage(storageItem, index) {
259        // Get the existing data
260        var tourName = localStorage.getItem("tour");
261
262        var existing = localStorage.getItem(tourName + storageItem);
263
264        // If no existing data, create an array
265        // Otherwise, convert the localStorage string to an array
266        existing = existing ? existing.split(',') : [];
267
268        for (var i = 0; i < existing.length; i++) {
269            if (existing[i] === index) {
270                existing.splice(i, 1);
271            }
272        }
273        //$('.tourItem' + index).remove();
274
275        // Save back to localStorage
276        localStorage.setItem(tourName + storageItem, existing.toString());
277    }
278
279    function removeMapMarker() {
280        for (i = 0; i < locationListArray.length; i++) {
281            console.log('before');
282            console.log(locationListArray[i][3]);
283            locationListArray.splice(i, 1);
284            console.log('after');
285            console.log(locationListArray);
286        }
287    }
288
289    function removeAll() {
290        $('.addMarker').each(function(index) {
291            $(this).css('display', 'inline-block');
292        })
293        locationListArray = [];
294
295    }
296    $(document).on('click', '.bioBtn', function() {
297        $('.tourLocationList').css('display', 'none');
298        $('.tourBio').css('display', 'block');
299        console.log('this');
300        var index = $(this).attr('data-index');
301        console.log(index);
302        $('.tourBioName').html("<h3 class='tourName'>" + tourLocationsArray[index].firstName + " " + tourLocationsArray[index].middleName + " " + tourLocationsArray[index].lastName + "</h3>");
303        $('.tourBioImage').html("<span class='tourImage' style='display:block;background-image:url(" + tourLocationsArray[index].image + ")'/><img src='" + tourLocationsArray[index].image + "'/></span>");
304        $('.tourBioText').html(tourLocationsArray[index].information);
305        $('.tourBioSection').html("Section: " + tourLocationsArray[index].section);
306
307    })
308    $(document).on('click', '.bioLink', function() {
309        $('.tourLocations').css('display', 'none');
310        $('.tourSingleBio').css('display', 'block');
311        console.log('this');
312        var index = $(this).attr('data-index');
313        console.log(index);
314        $('.tourSingleBioName').html("<h3 class='tourName index" + index + "'>" + tourLocationsArray[index].firstName + " " + tourLocationsArray[index].middleName + " " + tourLocationsArray[index].lastName + " (" + tourLocationsArray[index].dates + ") </h3>");
315        $('.tourSingleBioImage').html("<span class='tourImage' style='display:block;background-image:url(" + tourLocationsArray[index].image + ")'/><img src='" + tourLocationsArray[index].image + "'/></span>");
316        $('.tourSingleBioText').html(tourLocationsArray[index].information);
317        $('.tourSingleBioSection').html("Section: " + tourLocationsArray[index].section);
318
319    })
320
321
322
323
324});
325
326function scrollWin(x, y) {
327    window.scrollBy(x, y);
328}
329
330// sticky nav 
331jQuery(function($) {
332    $(document).ready(function() {
333        var scrollTop = 0;
334        $(window).scroll(function() {
335            scrollTop = $(window).scrollTop();
336            $('.counter').html(scrollTop);
337
338            if (scrollTop >= 150) {
339                $('.site-header').addClass('scrolled-nav');
340            } else if (scrollTop < 150) {
341                $('.site-header').removeClass('scrolled-nav');
342            }
343
344        });
345    });
346});

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.