PageSourceSearch

https://johnstanaland.com/wp-content/themes/johnstanaland-new2.com/js/scripts.js

js johnstanaland.com collected 2026-10-05 20:47:48 UTC 10,350 bytes, 357 lines download raw bytes

1(function () {
2
3	var app = {
4
5		initAOS: function () {
6			AOS.init({ disable: 'mobile' });
7		},
8		initNavigation: function () {
9			var $nav = jQuery('#nav');
10			if ($nav.length > 0) $nav.navTabDoubleTap();
11		},
12		initFeaturedProperties: function () {
13			jQuery('.fp-slick-slider').slick({
14				dots: false,
15				infinite: true,
16				speed: 1000,
17				arrows: false,
18				// slidesToShow: 3,
19				slidesToScroll: 1,
20				slidesPerRow: 3,
21				rows: 3,
22				autoplay: true,
23				autoplaySpeed: 5000,
24				adaptiveHeight: true,
25				responsive: [
26					{
27						breakpoint: 992,
28						settings: {
29							slidesToShow: 1,
30							slidesToScroll: 1,
31							slidesPerRow: 1,
32							rows: 1,
33						}
34					},
35				],
36			});
37		},
38		initFeaturedCommunities: function () {
39			/* Put featured communities code here */
40		},
41		initPress: function () {
42			jQuery('.press2-list').slick({
43				dots: true,
44				infinite: true,
45				speed: 1000,
46				arrows: false,
47				slidesPerRow: 3,
48				rows: 2,
49				autoplay: true,
50				autoplaySpeed: 5000,
51				responsive: [
52					{
53						breakpoint: 992,
54						settings: {
55							slidesPerRow: 2,
56							rows: 3,
57						}
58					},
59				],
60			});
61		},
62		initTestimonials: function () {
63			jQuery('.testi-slick-slider').slick({
64				dots: true,
65				infinite: true,
66				speed: 1000,
67				arrows: false,
68				slidesToShow: 1,
69				slidesToScroll: 1,
70				autoplay: true,
71				autoplaySpeed: 8000,
72				responsive: [
73					{
74						breakpoint: 992,
75						settings: {
76							slidesToShow: 1,
77							slidesToScroll: 1,
78							adaptiveHeight: true,
79						}
80					},
81				],
82
83				/* nextArrow: '.testi-next',
84				prevArrow: '.testi-prev', */
85			});
86		},
87		initQuickSearch: function () {
88			/* Put quick search code here */
89		},
90		initMouseScrollDown: function () {
91
92			function fixedHeader() {
93
94				var headerHeight = jQuery("header.main-header").outerHeight();
95
96				if
97					(jQuery(document).scrollTop() > headerHeight) {
98					jQuery(".fixed-header").addClass("show-fixed");
99				}
100				else {
101					jQuery(".fixed-header").removeClass("show-fixed");
102				}
103
104				if
105					(jQuery(document).scrollTop() > 10) {
106					jQuery(".side-fixed-contact").addClass("black");
107				}
108				else {
109					jQuery(".side-fixed-contact").removeClass("black");
110				}
111
112			}
113
114			jQuery(document).on("scroll orientationchange resize load", function () {
115
116				fixedHeader();
117
118			});
119
120			fixedHeader();
121		},
122		siteOffcanvas: function () {
123			var _this = this,
124				$offcanvas = jQuery('.site-offcanvas');
125
126			this.slide = function () {
127				jQuery('[data-offcanvas-slide]').on('click', function () {
128					var $this = jQuery(this),
129						slideType = $this.attr('data-offcanvas-slide');
130
131					if (slideType == 'out') {
132						$offcanvas.find('.offcanvas-backdrop').addClass('active');
133						$offcanvas.find('.slide-menu-content').addClass('active');
134						jQuery('.header-burger-menu').addClass('open');
135						jQuery('.header-burger-menu').attr('data-offcanvas-slide', 'in');
136						jQuery('body').addClass('body-overflow');
137
138						// setTimeout(function(){
139						// 	jQuery('.b-menu').addClass('show');
140						// },500);
141
142						// jQuery('.b-menu').addClass('show');
143
144					}
145
146					if (slideType == 'in') {
147						$offcanvas.find('.slide-menu-content').removeClass('active');
148						$offcanvas.find('.offcanvas-backdrop').removeClass('active');
149						jQuery('.header-burger-menu').removeClass('open');
150						jQuery('.header-burger-menu').attr('data-offcanvas-slide', 'out');
151						jQuery('body').removeClass('body-overflow');
152
153						// jQuery('.b-menu').removeClass('show');
154					}
155				});
156			}
157
158			this.outsideClick = function () {
159				jQuery('.offcanvas-backdrop').on('click', function () {
160					$offcanvas.find('.slide-menu-content').removeClass('active');
161					$offcanvas.find('.offcanvas-backdrop').removeClass('active');
162					jQuery('.header-burger-menu').removeClass('open');
163					jQuery('.header-burger-menu').attr('data-offcanvas-slide', 'out');
164					jQuery('body').removeClass('body-overflow');
165
166					jQuery('.b-menu').removeClass('show');
167				});
168			}
169
170			this.init = function () {
171				_this.slide();
172				_this.outsideClick();
173			}
174			this.init();
175		},
176		statisticsCounter: function () {
177			jQuery('.track-records-area').elementPeek({
178				onViewportIn: function (object) {
179					/* Show the element when it enters the viewport */
180					if (!jQuery('.track-records-area').hasClass('counted')) {
181						setTimeout(function () {
182							var options = {
183								useEasing: true,
184								useGrouping: true,
185								decimalPlaces: 1,
186							};
187
188							jQuery('.tr-stats-number').each(function () {
189								var num_id = jQuery(this).find('span').attr('id');
190								var num_start = jQuery(this).find('span').attr('data-start');
191								var num_end = jQuery(this).find('span').attr('data-end');
192								var numAnim = new CountUp(num_id, num_start, num_end, 0, 2.5, options);
193								numAnim.start();
194							});
195
196							jQuery('.track-records-area').addClass('counted');
197						}, 500);
198					}
199				},
200				peekAmountToTrigger: 0.2 /* Only show the element when its top reaches the middle part of the viewport */
201			});
202		},
203		initSocialMedia: function () {
204			jQuery('.sm-slick-slider').slick({
205				dots: false,
206				infinite: true,
207				speed: 1000,
208				arrows: false,
209				slidesPerRow: 2,
210				rows: 2,
211				autoplay: true,
212				autoplaySpeed: 5000,
213				// 		responsive: [
214				//     {
215				//       breakpoint: 992,
216				//       settings: {
217				//         slidesPerRow: 2,
218				//         rows: 1,
219				//       }
220				//     },
221				//     {
222				//       breakpoint: 481,
223				//       settings: {
224				//         slidesPerRow: 1,
225				//         rows: 1,
226				//       }
227				//     },
228				// ],
229			});
230		},
231		idxBreadcrumbs: function () {
232			setTimeout(function () {
233				if (window.location.href.indexOf('idx/details/listing') > -1) {
234					var url = window.location.origin;
235					jQuery('.breadcrumbs').html('<span><span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" href=""' + url + '""><span property="name">Home</span></a><meta property="position" content="1"></span> » <span class="breadcrumb_last" property="itemListElement" typeof="ListItem"><span property="name">' + jQuery('.listings-address strong').text() + ', ' + jQuery('.listings-address span').text() + '</span><meta property="position" content="2"></span></span>');
236
237					if (jQuery('.IDX-field-price').hasClass('IDX-field-rntLsePrice')) {
238						var $priceEl = jQuery('.listings-price');
239						var priceText = $priceEl.text();
240
241						if (!priceText.includes('/ month')) {
242							$priceEl.text(priceText + '/month');
243						}
244					}
245
246				}
247			}, 1000);
248		},
249
250	}
251
252
253	jQuery(document).ready(function () {
254		if (window.location.href.indexOf('/idx/details/listing/') > -1) {
255			var breadCrumbs = jQuery('#breadcrumbs').html();
256			jQuery('<p class="breadcrumbs">' + breadCrumbs + '</p>').insertAfter('.listings-hero');
257		}
258		if (window.location.href.indexOf('/idx/') > -1) {
259			var url = window.location.origin;
260			var listinTitle = jQuery('title').text();
261			jQuery('h1.entry-title').text(listinTitle);
262			jQuery('#breadcrumbs').html('<span><span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" href=""' + url + '""><span property="name">Home</span></a><meta property="position" content="1"></span> » <span class="breadcrumb_last" property="itemListElement" typeof="ListItem"><span property="name">' + listinTitle + '</span><meta property="position" content="2"></span></span>');
263		}
264		if (window.location.href.indexOf('/i/') > -1) {
265			var url = window.location.origin;
266			var listinTitle = jQuery('title').text();
267			jQuery('h1.entry-title').text(listinTitle);
268			jQuery('#breadcrumbs').html('<span><span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" href=""' + url + '""><span property="name">Home</span></a><meta property="position" content="1"></span> » <span class="breadcrumb_last" property="itemListElement" typeof="ListItem"><span property="name">' + listinTitle + '</span><meta property="position" content="2"></span></span>');
269		}
270		if (window.location.href.indexOf('/idx/moreinfo/') > -1) {
271			jQuery('h1.entry-title').text('Request More Information');
272			jQuery('.breadcrumb_last span').text('Request More Information');
273			document.title = 'Request More Information';
274		}
275		if (window.location.href.indexOf('idx/soldpending') > -1) {
276			jQuery('.ip-properties-title span').html('<i></i>Sold<i></i>');
277			document.title = 'Sold Listings';
278		}
279		if (window.location.href.indexOf('/idx/scheduleshowing/') > -1) {
280			// jQuery('h1.entry-title').text('Schedule A Showing');
281			jQuery('.breadcrumb_last span').text('Schedule A Showing');
282			document.title = 'Schedule A Showing';
283		}
284
285		jQuery('.ip-team-list').each(function () {
286			var agentLink = "https://johnstanaland.com/about/";
287
288			if (jQuery(this).find('.ip-team-list-name a').text().trim() == 'John Stanaland') {
289				jQuery(this).find('.ip-team-list-name a').attr('href', agentLink);
290				jQuery(this).find('.ip-team-list-photo a').attr('href', agentLink);
291				jQuery(this).find('.ip-team-list-link a').attr('href', agentLink);
292			}
293		})
294
295		app.initAOS();
296
297		/* Initialize navigation */
298		app.initNavigation();
299
300		/* Initialize featured properties */
301		app.initFeaturedProperties();
302
303		/* Initialize featured communities */
304		app.initFeaturedCommunities();
305
306		app.initPress();
307
308		/* Initialize testimonials */
309		app.initTestimonials();
310
311		/* Initialize quick search */
312		app.initQuickSearch();
313
314		app.initMouseScrollDown();
315
316		app.siteOffcanvas();
317
318		app.statisticsCounter();
319
320		app.initSocialMedia();
321
322		app.idxBreadcrumbs();
323
324	});
325
326	jQuery(window).on('load', function () {
327
328		if (window.location.href.indexOf('/idx/details/listing/') > -1) {
329			var $listingCourtesy = jQuery('#listing-courtesy');
330			var originalText = $listingCourtesy.text();
331
332			if (originalText.indexOf('#01223768') !== -1) {
333				var splitIndex = originalText.search(/From\s+The\s+Agency/i);
334				var modifiedText;
335
336				if (splitIndex !== -1) {
337					modifiedText = originalText.substring(0, splitIndex).trim();
338				} else {
339					modifiedText = originalText.trim();
340				}
341
342				modifiedText = modifiedText.replace(/\bfrom\s*$/i, '').trim();
343
344				if (modifiedText.length > 0) {
345					modifiedText += '<br>';
346				}
347
348				modifiedText += 'From The Agency: 949-689-9047';
349
350				$listingCourtesy.html(modifiedText);
351			}
352		}
353
354	})
355
356
357})();

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.