PageSourceSearch

https://alpperez.ca/wp-content/themes/realestate-7/js/base.js?ver=1.4.27

js alpperez.ca collected 2026-10-09 21:52:42 UTC 38,251 bytes, 1,078 lines download raw bytes

1/**
2 * Base
3 *
4 * @package WP Pro Real Estate 7
5 * @subpackage JavaScript
6 */
7
8jQuery.noConflict();
9
10
11function manageFeaturedTags() {
12
13	// Wrapped this into a function
14	// so that its available in ct.mapping.js
15	jQuery('h6.snipe.status.featured').removeClass('featured');
16
17	jQuery('h6.snipe.status span').text(function (_, txt) {
18		return txt.replace('Featured', '');
19	});
20
21	jQuery('h6.snipe span').text(function (_, txt) {
22		return txt.replace('Ghost', '');
23	});
24
25	jQuery('h6.snipe span').text(function (_, txt) {
26		return txt.replace('Weekly', '');
27	});
28
29	jQuery('h6.snipe span').text(function (_, txt) {
30		return txt.replace('Week', '');
31	});
32
33	jQuery('h6.snipe span').text(function (_, txt) {
34		return txt.replace('Daily', '');
35	});
36
37	jQuery('h6.snipe span').text(function (_, txt) {
38		return txt.replace('Day', '');
39	});
40
41	/* Show once text is replaced */
42	jQuery('h6.snipe').show();
43}
44
45(function ($) {
46
47	"use strict";
48
49	$('.flexslider').resize();
50
51	$(".mo-openid-app-icons a.login-button").removeAttr("style");
52
53	/*-----------------------------------------------------------------------------------*/
54	/* Login/Register Loader */
55	/*-----------------------------------------------------------------------------------*/
56
57	$('#ct_login_submit').click(function () {
58		$('#login-register-progress').css("display", "inline-block");
59		$("#login-register-progress").delay(1700).fadeOut(300);
60	});
61
62	$('#ct_register_submit').click(function () {
63		
64		var targetElement = {
65			submit_button: $('#ct_register_submit')
66		};
67
68		var originalButtonHtml = targetElement.submit_button.html();
69
70		re7MaybeVerifyRequest( targetElement, function(){
71
72			$('#ct_register_submit').html( originalButtonHtml );
73
74			$('#register-progress').css("display", "inline-block");
75			$("#register-progress").delay(1700).fadeOut(300);
76
77			$.ajax({
78				url: mapping_ajax_object.ajax_url,
79				type: 'POST',
80				data: $("#ct_registration_form").serialize() + '&action=ct_add_new_member',
81				success: function (response) {
82					console.log(response);
83					if (response.success) {
84						location.href = response.redirect;
85					} else {
86						let error_text = '';
87						if (response.errors) {
88							$.each(response.errors, function (k, error) {
89								error_text += '<span class="error"><strong>' + error + '</strong></span><br />';
90							});
91						}
92						$('#ct_account_register_errors').html('<div class="ct_errors">' + error_text + '</div>');
93					}
94				}
95			});
96
97		}, function( errors ){
98
99		});
100
101		
102		return false;
103	});
104
105	$(".wp-social-login-provider-list a").addClass("btn");
106
107	/*-----------------------------------------------------------------------------------*/
108	/* Main Nav Setup */
109	/*-----------------------------------------------------------------------------------*/
110
111	$("#masthead ul.sub-menu").closest("li").addClass("drop");
112
113	$('#masthead .multicolumn > ul > li.menu-item-has-children > a').each(function () {
114		if ($(this).attr("href") == "#" || $(this).attr("href") == "") {
115			var $this = $(this);
116			$('<span class="col-title">' + $(this).text() + '</span>').insertAfter($this);
117			$this.remove();
118		}
119	});
120
121	/*-----------------------------------------------------------------------------------*/
122	/* Remove "Ghost" status from Search Select */
123	/*-----------------------------------------------------------------------------------*/
124
125	$("#ct_ct_status option[value='ghost']").remove();
126
127	$(".post-categories").remove();
128
129	/*-----------------------------------------------------------------------------------*/
130	/* CT IDX Pro Disclaimer */
131	/*-----------------------------------------------------------------------------------*/
132
133	$("#disclaimer").html(function (i, html) {
134		return html.replace(/ /g, '');
135	});
136
137	$("#disclaimer").html(function (i, html) {
138		return html.replace('<br>', '');
139	});
140
141	/*-----------------------------------------------------------------------------------*/
142	/* Comparison Slide Out */
143	/*-----------------------------------------------------------------------------------*/
144
145	let ct_compare_toggle = (e) => {
146
147		e.preventDefault();
148
149		// Create menu variables.
150		let slideoutMenu = $('#compare-list'),
151			slideoutMenuWidth = $('#compare-list').width();
152
153		// Toggle open class.
154		slideoutMenu.toggleClass("open");
155		$("i.fa-chevron-left").toggleClass("fa-chevron-right");
156
157		// Slide menu.
158		if (slideoutMenu.hasClass("open")) {
159			slideoutMenu.animate({
160				right: "0px"
161			});
162		} else {
163			slideoutMenu.animate({
164				right: -slideoutMenuWidth
165			}, 240);
166		}
167	}
168
169	$(document).on("click", ".alike-button", function(e){
170		if ( ! $('#compare-list').hasClass("open") ) {
171			ct_compare_toggle(e);
172		}
173	});
174
175	$('#compare-panel-btn').on('click', function(e){
176		ct_compare_toggle(e);
177	});
178
179	/*-----------------------------------------------------------------------------------*/
180	/* Header Search - Status Multi */
181	/*-----------------------------------------------------------------------------------*/
182
183	$("#header_status_multi label[for=ct_status_multi]").click(function () {
184		$('#header_status_multi').toggleClass('open');
185		return false;
186	});
187
188	$(document).click(function () {
189		$('#header_status_multi').removeClass('open');
190	});
191
192	$('#header_status_multi, #header_status_multi label[for=ct_status_multi]').on('click', function (e) {
193		e.stopPropagation();
194	});
195
196	// Status Count Checked Displau
197	var $status_checkboxes = $('#header_status_multi input[type="checkbox"]');
198	var status_num_checked = $status_checkboxes.filter(':checked').length;
199
200	console.log(status_num_checked);
201
202	if(status_num_checked == 0) {
203		$('#ct-status-text').text(object_name.all_statuses);
204		$('#ct-status-count').text('');
205	} else {
206		$('#ct-status-text').text(object_name.status_label);
207		$('#ct-status-count').text('(' + status_num_checked + ')');
208	}
209
210	$status_checkboxes.change(function(){
211        var statusCountCheckedCheckboxes = $status_checkboxes.filter(':checked').length;
212        if(statusCountCheckedCheckboxes == 0) {
213        	$('#ct-status-text').text(object_name.all_statuses);
214			$('#ct-status-count').text('');
215		} else {
216			$('#ct-status-text').text(object_name.status_label);
217			$('#ct-status-count').text('(' + statusCountCheckedCheckboxes + ')');
218		}
219    });
220
221	/*-----------------------------------------------------------------------------------*/
222	/* Header Search - City Multi */
223	/*-----------------------------------------------------------------------------------*/
224
225	$("#header_city_multi label[for=header_city_multi]").click(function () {
226		$('#header_city_multi').toggleClass('open');
227		return false;
228	});
229
230	$(document).click(function () {
231		$('#header_city_multi').removeClass('open');
232	});
233
234	$('#header_city_multi, #header_city_multi label[for=header_city_multi]').on('click', function (e) {
235		e.stopPropagation();
236	});
237
238	// City Count Checked Displau
239	var $city_checkboxes = $('#header_city_multi input[type="checkbox"]');
240	var city_num_checked = $city_checkboxes.filter(':checked').length;
241
242	if(city_num_checked == 0) {
243		$('#ct-city-text').text(object_name.all_cities);
244		$('#ct-city-count').text('');
245	} else {
246		$('#ct-city-text').text(object_name.city_label);
247		$('#ct-city-count').text('(' + city_num_checked + ')');
248	}
249
250	$city_checkboxes.change(function(){
251        var cityCountCheckedCheckboxes = $city_checkboxes.filter(':checked').length;
252        if(cityCountCheckedCheckboxes == 0) {
253        	$('#ct-city-text').text(object_name.all_cities);
254			$('#ct-city-count').text('');
255		} else {
256			$('#ct-city-text').text(object_name.city_label);
257			$('#ct-city-count').text('(' + cityCountCheckedCheckboxes + ')');
258		}
259    });
260
261	/*-----------------------------------------------------------------------------------*/
262	/* Lisitng Single Info Toggle - IDX Interior */
263	/*-----------------------------------------------------------------------------------*/
264
265	$(document).on('click','#idx-interior.info-toggle', function () {
266		$('#idx-interior.info-toggle + .info-inner').slideToggle('fast');
267		$('#idx-interior.info-toggle').toggleClass('info-toggle-open');
268		return false;
269	});
270
271	/*-----------------------------------------------------------------------------------*/
272	/* Lisitng Single Info Toggle - IDX Exterior */
273	/*-----------------------------------------------------------------------------------*/
274
275	$(document).on('click','#idx-exterior.info-toggle', function () {
276		$('#idx-exterior.info-toggle + .info-inner').slideToggle('fast');
277		$('#idx-exterior.info-toggle').toggleClass('info-toggle-open');
278		return false;
279	});
280
281	/*-----------------------------------------------------------------------------------*/
282	/* Lisitng Single Info Toggle - IDX Construction */
283	/*-----------------------------------------------------------------------------------*/
284
285	$(document).on('click','#idx-construction.info-toggle', function () {
286		$('#idx-construction.info-toggle + .info-inner').slideToggle('fast');
287		$('#idx-construction.info-toggle').toggleClass('info-toggle-open');
288		return false;
289	});
290
291	/*-----------------------------------------------------------------------------------*/
292	/* Lisitng Single Info Toggle - IDX Utilities */
293	/*-----------------------------------------------------------------------------------*/
294
295	$(document).on('click','#idx-utilities.info-toggle', function () {
296		$('#idx-utilities.info-toggle + .info-inner').slideToggle('fast');
297		$('#idx-utilities.info-toggle').toggleClass('info-toggle-open');
298		return false;
299	});
300
301	/*-----------------------------------------------------------------------------------*/
302	/* Lisitng Single Info Toggle - IDX Location */
303	/*-----------------------------------------------------------------------------------*/
304
305	$(document).on('click','#idx-location.info-toggle', function () {
306		$('#idx-location.info-toggle + .info-inner').slideToggle('fast');
307		$('#idx-location.info-toggle').toggleClass('info-toggle-open');
308		return false;
309	});
310
311	/*-----------------------------------------------------------------------------------*/
312	/* Lisitng Single Info Toggle - IDX Lot */
313	/*-----------------------------------------------------------------------------------*/
314
315	$(document).on('click','#idx-lot.info-toggle', function () {
316		$('#idx-lot.info-toggle + .info-inner').slideToggle('fast');
317		$('#idx-lot.info-toggle').toggleClass('info-toggle-open');
318		return false;
319	});
320
321	/*-----------------------------------------------------------------------------------*/
322	/* Lisitng Single Info Toggle - IDX Overview */
323	/*-----------------------------------------------------------------------------------*/
324
325	$(document).on('click','#idx-overview.info-toggle', function () {
326		$('#idx-overview.info-toggle + .info-inner').slideToggle('fast');
327		$('#idx-overview.info-toggle').toggleClass('info-toggle-open');
328		return false;
329	});
330
331	/*-----------------------------------------------------------------------------------*/
332	/* Lisitng Single Info Toggle - IDX Features */
333	/*-----------------------------------------------------------------------------------*/
334
335	$(document).on('click', '#idx-features.info-toggle', function () {
336		$('#idx-features.info-toggle + .info-inner').slideToggle('fast');
337		$('#idx-features.info-toggle').toggleClass('info-toggle-open');
338		return false;
339	});
340
341	/*-----------------------------------------------------------------------------------*/
342	/* Lisitng Single Info Toggle - IDX Rooms */
343	/*-----------------------------------------------------------------------------------*/
344
345	$(document).on('click', "#idx-rooms.info-toggle", function () {
346		$('#idx-rooms.info-toggle + .info-inner').slideToggle('fast');
347		$('#idx-rooms.info-toggle').toggleClass('info-toggle-open');
348		return false;
349	});
350
351	/*-----------------------------------------------------------------------------------*/
352	/* Lisitng Single Info Toggle - IDX Schools */
353	/*-----------------------------------------------------------------------------------*/
354
355	$(document).on("click", "#idx-schools.info-toggle", function () {
356		$('#idx-schools.info-toggle + .info-inner').slideToggle('fast');
357		$('#idx-schools.info-toggle').toggleClass('info-toggle-open');
358		return false;
359	});
360
361	/*-----------------------------------------------------------------------------------*/
362	/* Lisitng Single Info Toggle - IDX HOA */
363	/*-----------------------------------------------------------------------------------*/
364
365	$(document).on("click", "#idx-hoa.info-toggle", function () {
366		$('#idx-hoa.info-toggle + .info-inner').slideToggle('fast');
367		$('#idx-hoa.info-toggle').toggleClass('info-toggle-open');
368		return false;
369	});
370
371	/*-----------------------------------------------------------------------------------*/
372	/* Lisitng Single Info Toggle - Book This Listing */
373	/*-----------------------------------------------------------------------------------*/
374
375	$(document).on("click", "#book-this-listing.info-toggle", function () {
376		$('#book-this-listing.info-toggle + .info-inner').slideToggle('fast');
377		$('#book-this-listing.info-toggle').toggleClass('info-toggle-open');
378		return false;
379	});
380
381	/*-----------------------------------------------------------------------------------*/
382	/* Lisitng Single Info Toggle - Multi Floorplan */
383	/*-----------------------------------------------------------------------------------*/
384
385	$(document).on("click", "#listing-floor-plans.info-toggle", function () {
386		$('#listing-floor-plans.info-toggle + .info-inner').slideToggle('fast');
387		$('#listing-floor-plans.info-toggle').toggleClass('info-toggle-open');
388		return false;
389	});
390
391	/*-----------------------------------------------------------------------------------*/
392	/* Lisitng Single Info Toggle - Open House */
393	/*-----------------------------------------------------------------------------------*/
394
395	$(document).on("click", "#open-house-info.info-toggle", function () {
396		$('#open-house-info.info-toggle + .info-inner').slideToggle('fast');
397		$('#open-house-info.info-toggle').toggleClass('info-toggle-open');
398		return false;
399	});
400
401	/*-----------------------------------------------------------------------------------*/
402	/* Lisitng Single Info Toggle - Energy Efficiency */
403	/*-----------------------------------------------------------------------------------*/
404
405	$(document).on("click", "#energy-efficiency.info-toggle", function () {
406		$('#energy-efficiency.info-toggle + .info-inner').slideToggle('fast');
407		$('#energy-efficiency.info-toggle').toggleClass('info-toggle-open');
408		return false;
409	});
410
411	/*-----------------------------------------------------------------------------------*/
412	/* Lisitng Single Info Toggle - Features */
413	/*-----------------------------------------------------------------------------------*/
414
415	$(document).on("click", "#listing-prop-features.info-toggle", function () {
416		$('#listing-prop-features.info-toggle + .info-inner').slideToggle('fast');
417		$('#listing-prop-features.info-toggle').toggleClass('info-toggle-open');
418		return false;
419	});
420
421	/*-----------------------------------------------------------------------------------*/
422	/* Lisitng Single Info Toggle - Attachments */
423	/*-----------------------------------------------------------------------------------*/
424
425	$(document).on("click", "#listing-attachments-info.info-toggle", function () {
426		$('#listing-attachments-info.info-toggle + .info-inner').slideToggle('fast');
427		$('#listing-attachments-info.info-toggle').toggleClass('info-toggle-open');
428		return false;
429	});
430
431	/*-----------------------------------------------------------------------------------*/
432	/* Lisitng Single Info Toggle - Rental Info */
433	/*-----------------------------------------------------------------------------------*/
434
435	$(document).on("click", "#rental-info.info-toggle", function () {
436		$('#rental-info.info-toggle + .info-inner').slideToggle('fast');
437		$('#rental-info.info-toggle').toggleClass('info-toggle-open');
438		return false;
439	});
440
441	/*-----------------------------------------------------------------------------------*/
442	/* Lisitng Single Info Toggle - Reviews */
443	/*-----------------------------------------------------------------------------------*/
444
445	$(document).on("click", "#listing-reviews-info.info-toggle", function () {
446		$('#listing-reviews-info.info-toggle + .info-inner').slideToggle('fast');
447		$('#listing-reviews-info.info-toggle').toggleClass('info-toggle-open');
448		return false;
449	});
450
451	/*-----------------------------------------------------------------------------------*/
452	/* Lisitng Single Info Toggle - Video */
453	/*-----------------------------------------------------------------------------------*/
454
455	$(document).on("click", "#listing-video-heading.info-toggle", function () {
456		$('#listing-video-heading.info-toggle + .info-inner').slideToggle('fast');
457		$('#listing-video-heading.info-toggle').toggleClass('info-toggle-open');
458		return false;
459	});
460
461	/*-----------------------------------------------------------------------------------*/
462	/* Lisitng Single Info Toggle - Virtual Tour */
463	/*-----------------------------------------------------------------------------------*/
464
465	$(document).on("click", "#listing-virtual-tour-heading.info-toggle", function () {
466		$('#listing-virtual-tour-heading.info-toggle + .info-inner').slideToggle('fast');
467		$('#listing-virtual-tour-heading.info-toggle').toggleClass('info-toggle-open');
468		return false;
469	});
470
471	/*-----------------------------------------------------------------------------------*/
472	/* Lisitng Single Info Toggle - What's Nearby */
473	/*-----------------------------------------------------------------------------------*/
474
475	$(document).on("click", "#listing-nearby-heading.info-toggle", function () {
476		$('#listing-nearby-heading.info-toggle + .info-inner').slideToggle('fast');
477		$('#listing-nearby-heading.info-toggle').toggleClass('info-toggle-open');
478		return false;
479	});
480
481	/*-----------------------------------------------------------------------------------*/
482	/* Lisitng Single Info Toggle - Map */
483	/*-----------------------------------------------------------------------------------*/
484
485	$(document).on("click", "#listing-map-heading.info-toggle", function () {
486		$('#listing-map-heading.info-toggle + .info-inner').slideToggle('fast');
487		$('#listing-map-heading.info-toggle').toggleClass('info-toggle-open');
488		return false;
489	});
490
491	/*-----------------------------------------------------------------------------------*/
492	/* Tools Toggle */
493	/*-----------------------------------------------------------------------------------*/
494
495	$(document).on("click", "#tools-toggle", function () {
496		$("#text-toggle").text(function (i, text) {
497			return text === object_name.close_tools ? object_name.open_tools : object_name.close_tools;
498		})
499		$('#tools ul').toggle("fast");
500	});
501
502	/*-----------------------------------------------------------------------------------*/
503	/* Map Toggle */
504	/*-----------------------------------------------------------------------------------*/
505
506	$(document).on("click", ".map-toggle", function () {
507		$("#text-toggle").text(function (i, text) {
508			return text === object_name.close_map ? object_name.open_map : object_name.close_map;
509		})
510		$("i.fa-minus-square").toggleClass("fa-plus-square");
511		$("#map-wrap").slideToggle(200, function () {
512		});
513	});
514
515	/*-----------------------------------------------------------------------------------*/
516	/* Search Toggle */
517	/*-----------------------------------------------------------------------------------*/
518
519	$(document).on("click", ".search-toggle", function () {
520		$("#text-toggle").text(function (i, text) {
521			return text === object_name.open_search ? object_name.close_search : object_name.open_search;
522		})
523		$("i.fa-plus-square").toggleClass("fa-minus-square");
524		$(".advanced-search").slideToggle(200, function () {
525		});
526	});
527
528	/*-----------------------------------------------------------------------------------*/
529	/* Login/Register & Agent Contact Modal Form */
530	/*-----------------------------------------------------------------------------------*/
531
532	$(".login-register").click(function () {
533		$('#overlay').addClass('open');
534		$('body').addClass('noscroll');
535		$('html, body').animate({scrollTop: 0}, 800);
536		return false;
537	});
538
539	$(".close").click(function () {
540		$('body').removeClass('noscroll');
541		$("#overlay").removeClass('open');
542	});
543
544	$(".ct-registration").click(function () {
545		$("#login").slideUp("slow", function () {
546			$("#register").slideDown("slow");
547		});
548	});
549
550	$(".ct-lost-password").click(function () {
551		$("#login").slideUp("slow", function () {
552			$("#lost-password").slideDown("slow");
553		});
554	});
555
556	// On Click SignIn It Will Hide Registration Form and Display Login Form
557	$(".ct-login").click(function () {
558		$("#register").slideUp("slow", function () {
559			$("#login").slideDown("slow");
560		});
561	});
562
563	/*-----------------------------------------------------------------------------------*/
564	/* Listing Modal */
565	/*-----------------------------------------------------------------------------------*/
566
567	$("#overlay.listing-modal .close").click(function () {
568		$("#overlay.listing-modal").removeClass('open');
569		$('body').css('overflow', '');
570	});
571
572	/*-----------------------------------------------------------------------------------*/
573	/* Agent & Brokerage Contact Modal Form */
574	/*-----------------------------------------------------------------------------------*/
575
576	$(".agent-contact").click(function (e) {
577		$("#overlay.contact-modal").addClass('open');
578	});
579
580	$(".brokerage-contact").click(function (e) {
581		e.preventDefault();
582		$("#overlay.contact-modal").addClass('open');
583	});
584
585	$(".close").click(function () {
586		$("#overlay.contact-modal").removeClass('open');
587		$(".formError").hide();
588	});
589
590	/*-----------------------------------------------------------------------------------*/
591	/* Brokerage Contact Modal Form */
592	/*-----------------------------------------------------------------------------------*/
593
594	$(".brokerage-contact").click(function () {
595		$("#overlay.contact-modal").addClass('open');
596	});
597
598	$(".close").click(function () {
599		$("#overlay.contact-modal").removeClass('open');
600		$(".formError").hide();
601	});
602
603	/*-----------------------------------------------------------------------------------*/
604	/* Edit Profile */
605	/*-----------------------------------------------------------------------------------*/
606
607	$("#your-profile h3").addClass("marT0 col span_3 first");
608	$("table.form-table").addClass("col span_9");
609	$("table.form-table tbody").addClass("col span_12");
610	$("#your-profile .description").addClass("muted");
611	$(".user-profile-img").addClass("col span_3 first");
612
613	$("#your-profile").show();
614
615	/*-----------------------------------------------------------------------------------*/
616	/* WPFP Delete Link */
617	/*-----------------------------------------------------------------------------------*/
618
619	$(".wpfp-link.remove-parent:contains('remove')").html("<i class='fa fa-tras
619h-o'></i>");
620
621	$(".wpfp-link.remove-parent").show();
622
623	/*-----------------------------------------------------------------------------------*/
624	/* Add Zoom Class to Default WordPress Gallery */
625	/*-----------------------------------------------------------------------------------*/
626
627	$(".gallery-icon").addClass("zoom");
628
629	/*-----------------------------------------------------------------------------------*/
630	/* Add Btn Class to dsIDXpress Submit */
631	/*-----------------------------------------------------------------------------------*/
632
633	$(".advanced-search.dsidxpress .submit").addClass("btn");
634
635	/*-----------------------------------------------------------------------------------*/
636	/* FitVids */
637	/*-----------------------------------------------------------------------------------*/
638
639	$("article, .videoplayer").fitVids();
640
641	/*-----------------------------------------------------------------------------------*/
642	/* Remove height/width from WP inserted images */
643	/*-----------------------------------------------------------------------------------*/
644
645	$('img').removeAttr('width').removeAttr('height');
646
647	/*-----------------------------------------------------------------------------------*/
648	/* Remove Text from Status Snipes */
649	/*-----------------------------------------------------------------------------------*/
650
651	manageFeaturedTags();
652
653	/*-----------------------------------------------------------------------------------*/
654	/* Initialize FitVids */
655	/*-----------------------------------------------------------------------------------*/
656
657	$(".container").fitVids();
658
659	/*-----------------------------------------------------------------------------------*/
660	/* Add class for prev/next icons */
661	/*-----------------------------------------------------------------------------------*/
662
663	$('.prev-next .nav-prev a').addClass('fa fa-arrow-left');
664	$('.prev-next .nav-next a').addClass('fa fa-arrow-right');
665
666	/*-----------------------------------------------------------------------------------*/
667	/* Add Font Awesome Icon to Sitemap list */
668	/*-----------------------------------------------------------------------------------*/
669
670	$('.page-template-template-sitemap-php #main-content li a').before('<i class="fa fa-caret-right"></i>');
671
672	/*-----------------------------------------------------------------------------------*/
673	/* Add last class to every third related item, and every second testimonial */
674	/*-----------------------------------------------------------------------------------*/
675
676	$('li.related:nth-child(3n+3), .testimonial-home li:nth-child(2n+1)').addClass('last');
677
678	/*-----------------------------------------------------------------------------------*/
679	/* Smooth ScrollTo */
680	/*-----------------------------------------------------------------------------------*/
681
682	$('.est-payment a[href*="#"]:not([href="#"]), .single-listings #listing-map-btn a[href*="#"]:not([href="#"]), .single-listings #listing-sections a[href*="#"]:not([href="#"]), .single-listings #call-email a[href*="#"]:not([href="#"]), .widget_ct_scrolltolistingcontact a[href*="#"]:not([href="#"])').click(function () {
683		if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
684			var target = $(this.hash);
685			target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
686			if (target.length) {
687				$('html, body').animate({
688					scrollTop: target.offset().top - 220
689				}, 1000);
690				return false;
691			}
692		}
693	});
694
695	/*-----------------------------------------------------------------------------------*/
696	/* Toggle Search Listing */
697	/*-----------------------------------------------------------------------------------*/
698
699	$('#listings-results').on('click', '#search-results-layout-toggle > button', function(){
700
701		let $main_content = $('.search-listings-wrap');
702
703		$main_content.attr('data-layout','grid');
704		Cookies.set('ct_search_listing_layout', 'grid');
705
706		if ( $(this).is('#map-layout')) {
707			$main_content.attr('data-layout','map');
708			Cookies.set('ct_search_listing_layout', 'map');
709		}
710
711		$('#search-results-layout-toggle > button').removeClass('current');
712		$(this).addClass('current');
713
714	});
715
716	/*-----------------------------------------------------------------------------------*/
717	/* Additional Features */
718	/*-----------------------------------------------------------------------------------*/
719
720	let ct_keywords_container = $('#ct_keywords_container');
721	let ct_additional_features_keyword_search  = $("#ct_additional_features_keyword_search");
722	$(document).on("click", "#feature-add-btn", function(e){
723		e.preventDefault();
724
725		if ( ct_additional_features_keyword_search.length ) {
726			var value = $.trim( ct_additional_features_keyword_search.val() );
727
728			if( value == '' ){
729				return;
730			}
731
732			ct_additional_features_keyword_search.val( '' ); // reset the text box.
733
734			var lowercase_value = value.toLowerCase();
735			var already_added = $("input.ct_additional_features[type=checkbox][value='"+lowercase_value+"']").prop("checked");
736
737			if( already_added ){
738				return; // bail out.
739			}
740
741			var html = '<span class="additional-feature-tag"><input style="display:none;" checked="checked" type="checkbox" class="ct_additional_features" name="ct_additional_features[]" value="'+lowercase_value+'" />';
742			html += '<span class="ct-keyword-name">'+ value +'</span> '+ $('#ct_additional_features_close_tpl').html() +'</span>';
743
744			var additional_features_tags = $('#additional-features-tags');
745			additional_features_tags.append( html );
746
747			ct_keywords_container.html( '' );
748
749		}
750	});
751
752	$(document).mouseup(function(e){
753	    var container = $("#ct_keywords_container");
754	    var input = $("#ct_additional_features_keyword_search");
755
756	    // if the target of the click isn't the container nor a descendant of the container
757	    if ( container.is(e.target) || container.has(e.target).length || input.is(e.target) || input.has(e.target).length ){
758	       return;
759	    }
760
761	    container.hide();
762	});
763
764	$(document).on("click", ".additional-feature-tag", function(e){
765		e.preventDefault();
766		var self = $( this );
767		self.remove(); 
768	});
769
770	$(document).on("click", "ul.ct-additional-features-list li", function(e){
771		e.preventDefault();
772		var self = $( this );
773		var value = self.text();
774		ct_additional_features_keyword_search.val( value );
775		$("#feature-add-btn").trigger( 'click' );
776		ct_keywords_container.hide();
777	});
778
779	// Init a timeout variable to be used below
780	let keyword_timeout = null;
781	let keyword_xhr = null;
782	var keyword_selected = -1;
783
784	$(document).on("keydown", "#ct_additional_features_keyword_search", function(e){
785		var keycode =  e.which ?  e.which :  e.keyCode;
786		if( keycode == 13 ){
787			e.preventDefault();
788
789			var selected_keyword = $( "ul.ct-additional-features-list li.ct-keyword-selected" );
790			if( selected_keyword.length ){
791				selected_keyword.trigger( 'click' );
792			}else{
793				var first_keyword = $( "ul.ct-additional-features-list li.ct-keyword:first" );
794				if( first_keyword.length ){
795					first_keyword.trigger( 'click' );
796				}
797			}
798		}
799	});
800
801	$(document).on("keyup", "#ct_additional_features_keyword_search", function(e){
802		
803		var self = $( this );
804		var value = $.trim( self.val() );
805
806		if( '' == value || ! value.length ){
807			keyword_selected = -1;
808			ct_keywords_container.hide();
809			return;
810		}
811	
812		var keycode =  e.which ?  e.which :  e.keyCode;
813
814		if(  keycode === 38 || keycode === 40  ){
815			var keywords_nodes = document.querySelectorAll('li.ct-keyword');
816			if(  keywords_nodes.length  ){
817
818				var ul_keywords = document.querySelector('ul.ct-additional-features-list');
819
820				if ( keycode === 38 ) { // up
821					keyword_selected = keyword_selected - 1;
822					if( keyword_selected < 0 ){
823						keyword_selected = 0;
824					}
825			        ct_additional_keyword_select(ul_keywords,keywords_nodes, keywords_nodes[keyword_selected]);
826			        return;
827			    }
828
829			    if ( keycode === 40 ) { // down
830			    	keyword_selected = keyword_selected + 1;
831			    	if( keyword_selected >= keywords_nodes.length ){
832			    		keyword_selected = keywords_nodes.length - 1;
833			    	}
834			        ct_additional_keyword_select(ul_keywords,keywords_nodes, keywords_nodes[keyword_selected]);
835			        return;
836			    }
837		    }
838	    }
839
840		if ( ( keycode <= 90 && keycode >= 48 ) || keycode == 8 ){
841
842 			var data = new Object();
843			data.action = 'ct_additional_feature_search';
844			data.keyword = value;
845
846		 	clearTimeout( keyword_timeout );
847
848			if( keyword_xhr ){
849				keyword_xhr.abort();
850			}
851
852
853			keyword_timeout = setTimeout(function () {
854		       keyword_xhr = $.ajax({
855					type:"post",
856					url:ct_base.ajax_url,
857					dataType: 'json',
858					data:data,
859					beforeSend: function() {
860						keyword_selected = -1;
861						ct_keywords_container.html('<ul id="additional-features-suggested-results" class="ct-features-loading"><li><span id="additional-features-suggested-results-loader"><i class="fas fa-circle-notch fa-spin fa-fw"></i></span></li></ul>');
862						ct_keywords_container.show();
863					},
864					error: function(e) {
865
866					},
867					success: function(jsonR, textStatus, XMLHttpRequest) {
868				        ct_keywords_container.html( jsonR.html );
869				        ct_keywords_container.show();
870				    }
871				});
872		    }, 100);
873		}
874
875	});
876
877})(jQuery);
878
879/*-----------------------------------------------------------------------------------*/
880/* Social Popups */
881/*-----------------------------------------------------------------------------------*/
882
883function popup(pageURL, title, w, h) {
884	var left = (screen.width / 2) - (w / 2);
885	var top = (screen.height / 2) - (h / 2);
886	var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
887}
888
889/*-----------------------------------------------------------------------------------*/
890/* Mouse Over Effect on Featured Images */
891/*-----------------------------------------------------------------------------------*/
892
893jQuery(document).ready(function($){
894	
895	"use strict";
896	// MouseEnter.
897	$(document).on("mouseenter", '#search-listing-mapper li.listing', function(){
898		$(this).parent().css("background", "none");
899		var image = $(this).find('img[data-secondary-img="show-secondary-image-true"]');
900		image.next().css({opacity: 1});
901		image.css({opacity: 0});
902	});
903	// MouseLeave.
904	$(document).on("mouseleave", '#search-listing-mapper li.listing', function(){
905		$(this).parent().css("background", "none");
906		var image = $(this).find('img[data-secondary-img="show-secondary-image-true"]');
907		image.css({opacity: 1});
908		image.next().css({opacity: 0});
909	});
910});
911
912/*-----------------------------------------------------------------------------------*/
913/* Adding custom class to wpadminbar */
914/*-----------------------------------------------------------------------------------*/
915
916jQuery(document).ready(function($){
917	"use strict";
918	// Making theme check happy.
919	$("#"+"wpadminbar").addClass("ct-admin-bar");
920});
921
922/*-----------------------------------------------------------------------------------*/
923/* Google ReCaptcha Verification */
924/*-----------------------------------------------------------------------------------*/
925
926var re7MaybeVerifyRequest = function( targetElements, __callback, __errorCallback ) {
927	
928	console.info('re7MaybeVerifyRequest triggered');
929
930	var $ = jQuery.noConflict();
931	
932	// Skip to callback when module is disabled.
933	if ( "no" === re7GoogleRecaptchaV3.is_enabled ) {
934		console.info('Recaptcha is disabled. Submitting the form...');
935		__callback();
936		return;
937	}
938
939	// Skip to callback if there button is not found.
940	if ( 0 === targetElements.submit_button.length ) {
941		console.warn('Target button is not found in DOM: ' + typeof targetElements.submit_button );
942		__callback();	
943		return;
944	}
945	
946	// The submit button placeholder.
947	var $submitBtn = targetElements.submit_button;
948			
949	// Apply some CSS to make the button.
950	$submitBtn.val( re7GoogleRecaptchaV3.gettext.verifying );
951
952	// Check if button.
953	if ( $submitBtn.is( "button" ) ) {
954		$submitBtn.html( re7GoogleRecaptchaV3.gettext.verifying );
955	}
956
957	// Apple some css.
958	$submitBtn.css({
959		opacity: '0.65',
960		cursor: 'progress'
961	}).attr('disabled', 'disabled');
962
963	// Try Invoking ReCaptcha Manually.
964	try {
965
966		grecaptcha.execute(
967			re7GoogleRecaptchaV3.public_key, 
968			{ action: 'submit' }
969		).then(
970			
971			// Callback function for google recaptcha v3 token.
972			function(token) {
973				
974				// Send request to Google Endpoint.
975				var parameters = {
976					action: 'ct-re-google-verifier',
977					token: token
978				};
979	
980				jQuery.post( re7GoogleRecaptchaV3.ajax_url, parameters, function( response, status ){
981	
982					// Re-apply the button default state.
983					$submitBtn.val( re7GoogleRecaptchaV3.gettext.requesting );
984	
985					$submitBtn.css({
986						opacity: '',
987						cursor: ''
988					}).removeAttr('disabled');
989	
990					// Remove whatever recaptcha message there is.
991					$('.google-recaptcha-response').remove();
992	
993					var $response = $('<div class="google-recaptcha-response"><p>'+response.message+'</p></div>');
994	
995					if ( 'success' === response.type ) {
996	
997						$response.addClass('google-recaptcha-v3-success');
998						$submitBtn.before( $response );
999	
1000						// Do callback.
1001						$('.google-recaptcha-response').remove();
1002						__callback();
1003						
1004					} else {
1005						
1006						$response.addClass('google-recaptcha-v3-error');
1007	
1008						$submitBtn.before( '<div class="google-recaptcha-response google-recaptcha-response-error"><p>Recaptcha Validation Failed: ' + response.message + '</p></div>' );
1009						
1010						__errorCallback( response );
1011	
1012					}
1013	
1014	
1015				}).fail(function( error ){
1016	
1017					// Remove all existing error message.
1018					$('.re7-recaptcha-http-error').remove();
1019									
1020					// Re-apply the button default state.
1021					$submitBtn.val( re7GoogleRecaptchaV3.gettext.requesting );
1022					$submitBtn.css({
1023						opacity: '',
1024						cursor: ''
1025					}).removeAttr('disabled');
1026	
1027					var general_error_message = 'Error ' + error.status + ': ' + error.statusText;
1028	
1029					$submitBtn.before('<div class="google-recaptcha-v3-error re7-recaptcha-http-error"><p>' + general_error_message + '</p></div>');
1030	
1031					__errorCallback( error );
1032	
1033				});
1034			}
1035		);
1036
1037	} catch( err ) {
1038
1039		if ( $('.re7-recaptcha-http-error').length >=1 ) {
1040			$('.re7-recaptcha-http-error').remove();
1041		}
1042
1043		$submitBtn.before('<div class="google-recaptcha-v3-error re7-recaptcha-http-error"><p>' + err + '</p></div>');
1044
1045		// Re-apply the button default state.
1046		$submitBtn.val( re7GoogleRecaptchaV3.gettext.requesting );
1047		$submitBtn.css({
1048			opacity: '',
1049			cursor: ''
1050		}).removeAttr('disabled');
1051
1052		__errorCallback( err );
1053
1054	}
1055}
1056
1057/*-----------------------------------------------------------------------------------*/
1058/* Keywords Select */
1059/*-----------------------------------------------------------------------------------*/
1060
1061function ct_additional_keyword_select(ul_keywords,keywords_nodes,el) {
1062
1063    var s = [].indexOf.call(keywords_nodes, el);
1064    if (s === -1) return;
1065    
1066    keyword_selected = s;
1067    
1068    var elHeight = jQuery(el).height();
1069    var scrollTop = jQuery(ul_keywords).scrollTop();
1070    var viewport = scrollTop + jQuery(ul_keywords).height();
1071    var elOffset = elHeight * keyword_selected;
1072    
1073    if (elOffset < scrollTop || (elOffset + elHeight) > viewport)
1074        jQuery(ul_keywords).scrollTop(elOffset);
1075    
1076    jQuery('li.ct-keyword').removeClass('ct-keyword-selected');
1077    el.classList.add('ct-keyword-selected');
1078}

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.