PageSourceSearch

https://www.parasandbaz.com.au/wp-content/themes/paras-and-baz/custom.js?ver=1.0.0

js parasandbaz.com.au collected 2026-10-09 00:58:04 UTC 13,299 bytes, 430 lines download raw bytes

1jQuery(document).ready(function($){
2	
3	 $('.map-toggle').hide();
4	 if(is_auctionsale){
5	 	$('.wpsight-listings').addClass('list');
6	 }
7
8	 $('.select-location').select2({placeholder: "Select Suburb",allowClear: true});
9	 $('a.search').click(function(e){
10	 	e.preventDefault();
11	 	if($(this).parent('.menu-search').hasClass('show_search')){
12	 		$(this).parent('.menu-search').removeClass('show_search');
13	 	}else{
14	 		$(this).parent('.menu-search').addClass('show_search');
15	 	}
16	 	
17	 });
18
19	if(page_name  == 'finance'){
20		var financeHash = window.location.hash;
21		if(financeHash){
22			$('html, body').animate({
23		        scrollTop: $(financeHash).offset().top
24		    }, 'slow');
25		}
26	}
27
28	//jQuery("#home-search select[name=listing-category]").empty();
29	//jQuery("#home-search select[name=listing-category]").append( jQuery('<option>').val("for-sale").html('For Sale') );
30	//jQuery("#home-search select[name=listing-category]").append( jQuery('<option>').val("for-rent").html('For Rent') );
31	jQuery("form.wpsight-listings-search select[name=listing-category]").change(function() {
32		var _offer = jQuery(this).val();
33		var price_obj_min = jQuery("form.wpsight-listings-search select[name=min]");
34		var price_obj_max = jQuery("form.wpsight-listings-search select[name=max]");
35
36		var price_sale = {
37			'50000' : '$50,000',
38			'100000' : '$100,000',
39			'150000' : '$150,000',
40			'200000' : '$200,000',
41			'250000' : '$250,000',
42			'300000' : '$300,000',
43			'350000' : '$350,000',
44			'400000' : '$400,000',
45			'450000' : '$450,000',
46			'500000' : '$500,000',
47			'550000' : '$550,000',
48			'600000' : '$600,000',
49			'650000' : '$650,000',
50			'700000' : '$700,000',
51			'750000' : '$750,000',
52			'800000' : '$800,000',
53			'850000' : '$850,000',
54			'900000' : '$900,000',
55			'950000' : '$950,000',
56			'1000000' : '$1,000,000',
57			'1100000' : '$1,100,000',
58			'1200000' : '$1,200,000',
59			'1300000' : '$1,300,000',
60			'1400000' : '$1,400,000',
61			'1500000' : '$1,500,000',
62			'1600000' : '$1,600,000',
63			'1700000' : '$1,700,000',
64			'1800000' : '$1,800,000',
65			'1900000' : '$1,900,000',
66			'2000000' : '$2,000,000',
67			'2250000' : '$2,250,000',
68			'2500000' : '$2,500,000',
69			'2750000' : '$2,750,000',
70			'3000000' : '$3,000,000',
71			'3500000' : '$3,500,000',
72			'4000000' : '$4,000,000',
73			'5000000' : '$5,000,000',
74			'6000000' : '$6,000,000',
75			'7000000' : '$7,000,000',
76			'8000000' : '$8,000,000',
77			'9000000' : '$9,000,000',
78			'10000000' : '$10,000,000',
79			'11000000' : '$11,000,000',
80			'12000000' : '$12,000,000'
81		};
82
83		var price_rent = {
84    	'50'      : '$50',
85      '100'     : '$100',
86      '150'     : '$150',
87    	'200'     : '$200',
88    	'250'     : '$250',
89      '300'     : '$300',
90      '350'     : '$350',
91    	'400'     : '$400',
92      '450'     : '$450',
93      '500'     : '$500',
94    	'550'     : '$550',
95      '600'     : '$600',
96      '650'    	: '$650',
97    	'700'    	: '$700',
98      '750'    	: '$750',
99      '800'    	: '$800',
100    	'850'     : '$850',
101    	'900'     : '$900',
102    	'950'     : '$950',
103			'1000'    : '$1,000',
104			'1500'    : '$1,500',
105			'2000'    : '$2,000',
106			'3000'    : '$3,000',
107			'4000'    : '$4,000',
108			'5000'    : '$5,000'
109		};
110		console.log(_offer);	
111		var price_default = price_sale;
112
113		price_obj_min.empty();
114		price_obj_max.empty();
115
116		if ('for-rent' == _offer || 'rental' == _offer) {
117			price_default = price_rent;
118		}
119		console.log(price_default);
120		price_obj_min.append( jQuery('<option>').val("").html('Price from') );
121		price_obj_max.append( jQuery('<option>').val("").html('Price to') );
122		jQuery.each(price_default, function(idx, val) {
123			price_obj_min.append( jQuery('<option>').val(idx).html(val) );
124                	price_obj_max.append( jQuery('<option>').val(idx).html(val) );
125		});
126		//price_obj_min.selectpicker('refresh');
127		//price_obj_max.selectpicker('refresh');
128	});
129
130	
131	jQuery(".listings-search-reset").click(function() {
132		var _offer = jQuery(this).val();
133		var price_obj_min = jQuery("form.wpsight-listings-search select[name=min]");
134		var price_obj_max = jQuery("form.wpsight-listings-search select[name=max]");
135		console.log('reset');
136		var price_sale = {
137			'50000' : '$50,000',
138			'100000' : '$100,000',
139			'150000' : '$150,000',
140			'200000' : '$200,000',
141			'250000' : '$250,000',
142			'300000' : '$300,000',
143			'350000' : '$350,000',
144			'400000' : '$400,000',
145			'450000' : '$450,000',
146			'500000' : '$500,000',
147			'550000' : '$550,000',
148			'600000' : '$600,000',
149			'650000' : '$650,000',
150			'700000' : '$700,000',
151			'750000' : '$750,000',
152			'800000' : '$800,000',
153			'850000' : '$850,000',
154			'900000' : '$900,000',
155			'950000' : '$950,000',
156			'1000000' : '$1,000,000',
157			'1100000' : '$1,100,000',
158			'1200000' : '$1,200,000',
159			'1300000' : '$1,300,000',
160			'1400000' : '$1,400,000',
161			'1500000' : '$1,500,000',
162			'1600000' : '$1,600,000',
163			'1700000' : '$1,700,000',
164			'1800000' : '$1,800,000',
165			'1900000' : '$1,900,000',
166			'2000000' : '$2,000,000',
167			'2250000' : '$2,250,000',
168			'2500000' : '$2,500,000',
169			'2750000' : '$2,750,000',
170			'3000000' : '$3,000,000',
171			'3500000' : '$3,500,000',
172			'4000000' : '$4,000,000',
173			'5000000' : '$5,000,000',
174			'6000000' : '$6,000,000',
175			'7000000' : '$7,000,000',
176			'8000000' : '$8,000,000',
177			'9000000' : '$9,000,000',
178			'10000000' : '$10,000,000',
179			'11000000' : '$11,000,000',
180			'12000000' : '$12,000,000'
181		};
182
183		var price_default = price_sale;
184
185		price_obj_min.empty();
186		price_obj_max.empty();
187
188
189		price_obj_min.append( jQuery('<option>').val("").html('Price from') );
190		price_obj_max.append( jQuery('<option>').val("").html('Price to') );
191		jQuery.each(price_default, function(idx, val) {
192			price_obj_min.append( jQuery('<option>').val(idx).html(val) );
193                	price_obj_max.append( jQuery('<option>').val(idx).html(val) );
194		});
195		//price_obj_min.selectpicker('refresh');
196		//price_obj_max.selectpicker('refresh');
197	});
198
199
200	// form submit
201	// $(document).on('submit', '#frmEstimateproperty', function(e){
202	// 	e.preventDefault();
203	// 	$(this).hide();
204	// 	$('.loader').show();
205	// 	setTimeout(function(){
206	// 		$('.loader').hide();
207	// 		$('#request_appraisal_form').show();
208	// 	}, 2000);
209	// });
210
211	// chart graph
212	if ( jQuery("#chartContainer").length ) {
213		CanvasJS.addColorSet("yellowOrange",
214					["#F3A225"]);
215		var chart = new CanvasJS.Chart('chartContainer',
216			{
217				animationEnabled: true,
218				colorSet: "yellowOrange",
219				theme: 'theme1',
220				title: { text: '' },
221				dataPointMaxWidth: 18,
222				axisY: {
223					maximum: pf_year_maximum,
224					labelFontSize: 12,
225					tickLength: 0,
226					tickThickness: 5,
227					gridThickness: 1,
228					lineThickness: 0,
229				},
230				axisX:{
231				  interval: 1,
232				  labelFontSize: 10,
233				  tickLength: 7,
234				  tickThickness: 0,
235				  tickColor: "#fff"
236				 },
237				data: [{
238					type: 'column',
239					indexLabelPlacement: 'outside',
240					indexLabelOrientation: 'horizontal',
241					dataPoints: pf_year_median
242					}]
243		   });
244		chart.render();
245	}
246
247	$(document).on('click', '.listings-view-action button', function(){
248		var view = $(this).attr('data-view');
249		var listings = $('.wpsight-listings');
250
251		listings.removeClass(view == 'list' ? 'grid' : 'list');
252		listings.addClass(view);
253		if (view == 'list' || view == 'grid') {
254		  $('.map-toggle').hide();
255		}
256	});
257
258	function wpsight_reset_form($form) {
259        $form.find('.listings-search-field .text').val('');
260        $form.find('.listings-search-field-operator').val('');
261        $form.find('select').val('');
262        $form.find('select option[data-default="true"]').attr('selected',true);
263        $form.find('input:checkbox').removeAttr('checked');
264        $form.find('input:radio').removeAttr('checked');
265        $form.find('input:checkbox[data-default="true"]').attr('checked',true);
266        $form.find('input:radio[data-default="true"]').attr('checked',true);
267        jQuery('.listings-search-advanced-toggle.open').trigger('click');
268    }
269
270    wpsight_reset_form(jQuery('.wpsight-listings-search'));
271
272    function extendMagnificIframe(){
273        var $start = 0;
274        var $iframe = {
275            markup: '<div class="mfp-iframe-scaler">' +
276                    '<div class="mfp-close"></div>' +
277                    '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' +
278                    '</div>' +
279                    '<div class="mfp-bottom-bar">' +
280                    '<div class="mfp-title"></div>' +
281                    '</div>',
282            patterns: {
283                youtube: {
284                    index: 'youtu', 
285                    id: function(url) {   
286
287                        var m = url.match( /^.*(?:youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/ );
288                        if ( !m || !m[1] ) return null;
289
290                            if(url.indexOf('t=') != - 1){
291
292                                var $split = url.split('t=');
293                                var hms = $split[1].replace('h',':').replace('m',':').replace('s','');
294                                var a = hms.split(':');
295
296                                if (a.length == 1){
297
298                                    $start = a[0]; 
299
300                                } else if (a.length == 2){
301
302                                    $start = (+a[0]) * 60 + (+a[1]); 
303
304                                } else if (a.length == 3){
305
306                                    $start = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); 
307
308                                }
309                            }                                   
310
311                            var suffix = '?autoplay=1&loop=1&showinfo=0&controls=0&rel=0&playlist='+m[1];
312
313                            if( $start > 0 ){
314
315                                suffix = '?start=' + $start + '&autoplay=1&loop=1&showinfo=0&controls=0&rel=0&playlist='+m[1];
316                            }
317
318                        return m[1] + suffix;
319                    },
320                    src: '//www.youtube.com/embed/%id%'
321                },
322                vimeo: {
323                    index: 'vimeo.com/', 
324                    id: function(url) {        
325                        var m = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/);
326                        if ( !m || !m[5] ) return null;
327                        return m[5];
328                    },
329                    src: '//player.vimeo.com/video/%id%?autoplay=1'
330                }
331            }
332        };
333
334        return $iframe;     
335    }
336
337    jQuery('.popup-video-property').magnificPopup({
338		disableOn: 700,
339		type: 'iframe',
340		iframe: extendMagnificIframe(),
341		mainClass: 'mfp-fade',
342		removalDelay: 160,
343		preloader: false,
344		fixedContentPos: false
345    });
346
347    $('.opensale-contact-agent').magnificPopup({
348		type: 'inline',
349		preloader: false,
350		closeBtnInside: true,
351		modal: true,
352		callbacks: {
353		    open: function() {
354		    	var address = this.st.el.attr('data-address');
355		    	var agents = this.st.el.attr('data-agents');
356              	$('#property_address').val(address);
357              	$('#agent_email').val(agents);
358		    },
359  			close: function() {
360              	$('#property_address').val('');
361              	$('#agent_email').val('');
362            }
363		}
364	});
365	
366	
367	$('.child-1').hide();
368	$('.child-2').hide();
369	$('.child-3').hide();
370	$('.child-4').hide();
371	$('.child-5').hide();
372	$('.child-6').hide();
373	
374	$('.num-child').on('change', function(){
375	    var num_val = $(this).val();
376	    
377	    if(num_val == 1) {
378	        $('.child-1').show();
379        	$('.child-2').hide();
380        	$('.child-3').hide();
381        	$('.child-4').hide();
382        	$('.child-5').hide();
383        	$('.child-6').hide();
384        	
385        // 	$('.child-1 input, .child-1 select').attr('aria-required',true);
386        // 	$('.child-2 input, .child-2 select').attr('aria-required',false);
387        // 	$('.child-3 input, .child-3 select').attr('aria-required',false);
388        // 	$('.child-4 input, .child-4 select').attr('aria-required',false);
389        // 	$('.child-5 input, .child-5 select').attr('aria-required',false);
390        //     $('.child-6 input, .child-6 select').attr('aria-required',false);
391            
392        //     $('.child-1 input, .child-1 select').addClass('wpcf7-validates-as-required');
393	    } else if(num_val == 2) {
394	        $('.child-1').show();
395        	$('.child-2').show();
396        	$('.child-3').hide();
397        	$('.child-4').hide();
398        	$('.child-5').hide();
399        	$('.child-6').hide();
400	    } else if(num_val == 3) {
401	        $('.child-1').show();
402        	$('.child-2').show();
403        	$('.child-3').show();
404        	$('.child-4').hide();
405        	$('.child-5').hide();
406        	$('.child-6').hide();
407	    } else if(num_val == 4) {
408	        $('.child-1').show();
409        	$('.child-2').show();
410        	$('.child-3').show();
411        	$('.child-4').show();
412        	$('.child-5').hide();
413        	$('.child-6').hide();
414	    } else if(num_val == 5) {
415	        $('.child-1').show();
416        	$('.child-2').show();
417        	$('.child-3').show();
418        	$('.child-4').show();
419        	$('.child-5').show();
420        	$('.child-6').hide();
421	    } else if(num_val == 6) {
422	        $('.child-1').show();
423        	$('.child-2').show();
424        	$('.child-3').show();
425        	$('.child-4').show();
426        	$('.child-5').show();
427        	$('.child-6').show();
428	    }
429	});
430});

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.