1var ajaxurl = suburb_object.ajaxurl; 2 3$(document).ready(function() { 4 /*Buying selling select */ 5 // jQuery('#buying-selling-select').change(function(){ 6 // var bsoption = jQuery(this).val(); 7 // 8 // }); 9 10 $('form.banner-search select#buying-selling-select').on('change', this, function() { 11 var home_url = suburb_object.homeurl; 12 var sel = $(this).val(); 13 //console.log(sel); 14 if (sel == 1) { 15 $('form.banner-search').attr('action', home_url + '/buying-quote'); 16 var quoteType = "buy"; 17 } else { 18 $('form.banner-search').attr('action', home_url + '/selling-quote'); 19 //getPropertyType('selling'); 20 var quoteType = "sell"; 21 } 22 getPropertyType(quoteType); 23 }); 24 25 $('#input-searchsuburb input').on('change', this, function() { 26 var searchVal = $(this).val(); 27 var sel = $('form.banner-search select#buying-selling-select').val(); 28 if (sel == 1) { 29 //var quoteType = "buy"; 30 } else { 31 //var quoteType = "sell"; 32 } 33 34 //var quoteType = $('input[name="quoteType"]').val(); 35 //callAjax(searchVal, quoteType) 36 }); 37 38 $('form.banner-search select#buying-selling-select').on('change', this, function() { 39 var searchVal = $("#input-searchsuburb input").val(); 40 var sel = $(this).val(); 41 if (sel == 1) { 42 var quoteType = "buy"; 43 } else { 44 var quoteType = "sell"; 45 } 46 47 //var quoteType = $('input[name="quoteType"]').val(); 48 //callAjax(searchVal, quoteType) 49 //getPropertyType(quoteType); 50 }); 51 52 function getPropertyType(quoteType) { 53 $.ajax({ 54 url: ajaxurl + '?action=getPropertyType', 55 data: { 56 quoteType: quoteType 57 }, 58 type: 'POST', 59 // contentType: "application/json", 60 datatype: 'JSON', 61 beforeSend: function() { 62 //$('#loader').removeClass('hide'); 63 }, 64 success: function(data) { 65 //$('#loader').addClass('hide'); 66 var dataParsed = JSON.parse(data); 67 //$('input[name="suburb"]').val(data); 68 // console.log(data); 69 //console.log(dataParsed); 70 //console.log(dataParsed.suburbsType); 71 //$('form input[name="suburb-type"]').val(dataParsed.suburbsType); 72 //var parseData = delete dataParsed.suburbsType; 73 //console.log(parseData); 74 var finalhtml = ""; 75 finalhtml = '<select id="property-type-select" class="form-control input-ptype" required="required" name="property-type-select">'; 76 finalhtml += '<option value="" selected="selected">Property type</option>'; 77 for (var i in dataParsed) { 78 //finalhtml += generateHtmlPType(dataParsed[i]); 79 finalhtml += '<option value="' + dataParsed[i] + '">' + dataParsed[i] + '</option>' 80 } 81 finalhtml += '</select>'; 82 $('div.select-style.select-ptype-wrap').html('').html(finalhtml); 83 84 } 85 }); 86 } 87 88 function generateHtmlPType(data) { 89 var $html = '<option value="' + data.key + '">' + data.key + '</option>'; 90 return $html; 91 } 92 93 function callAjax(searchVal, quoteType) { 94 $.ajax({ 95 url: ajaxurl + '?action=getPropertyType', 96 data: { 97 suburbs: searchVal, 98 quoteType: quoteType 99 }, 100 type: 'POST', 101 // contentType: "application/json", 102 datatype: 'JSON', 103 beforeSend: function() { 104 //$('#loader').removeClass('hide'); 105 }, 106 success: function(data) { 107 //$('#loader').addClass('hide'); 108 var dataParsed = JSON.parse(data); 109 $('input[name="suburb"]').val(data); 110 console.log(data); 111 console.log(dataParsed); 112 console.log(dataParsed.suburbsType); 113 $('form input[name="suburb-type"]').val(dataParsed.suburbsType); 114 var parseData = delete dataParsed.suburbsType; 115 console.log(parseData); 116 var finalhtml = ""; 117 finalhtml = '<select id="property-type-select" class="form-control input-ptype" required="required" name="property-type-select">'; 118 finalhtml += '<option value="" selected="selected">Property type</option>'; 119 for (var i in dataParsed) { 120 finalhtml += generateHtml(dataParsed[i]); 121 } 122 finalhtml += '</select>'; 123 $('div.select-style.select-ptype-wrap').html('').html(finalhtml); 124 125 /*set value of selected property price in quote*/ 126 /*$('.input-ptype').change(function(){ 127 var starttotal = $('.input-ptype option:selected').attr('data-price'); 128 $('#totalquote').html(starttotal); 129 $('#totalquote').attr('data-price',starttotal); 130 131 var addressquote = $('.input-ptype option:selected').val(); 132 $('#propertytype').html(addressquote); 133 });*/ 134 135 } 136 }); 137 } 138 139 function generateHtml(data) { 140 var $html = '<option value="' + data.key + '">' + data.key + '</option>'; 141 return $html; 142 } 143 144 $(".slider-block").owlCarousel({ 145 items: 1, 146 nav: false, 147 dots: true, 148 loop: true, 149 autoplay: true, 150 autoplayTimeout: 8000, 151 autoplayHoverPause: true, 152 responsive: { 153 768: { 154 items: 2, 155 margin: 20, 156 }, 157 992: { 158 items: 1, 159 margin: 0, 160 }, 161 } 162 }); 163 164 // Package block show description when clicked on small screen 165 if ($(window).width() < 768) { 166 $('.package-list-block .accordin-btn').click(function() { 167 $(this).siblings('.description').toggleClass("d-block"); 168 $(this).toggleClass("active"); 169 }); 170 } 171 172 $('.suburb-list .load-more').on('click', function() { 173 let $button = $(this); 174 // let loadMore = $('.suburb-list .btn-loading .load-more'); 175 let moreLoading = $('.suburb-list .btn-loading .more-loading'); 176 let perPage = $(this).attr('data-load'); 177 let currentPage = $(this).attr('data-page'); 178 179 $.ajax({ 180 url: ajaxurl + '?action=getSuburbList', 181 type: 'POST', 182 dataType: 'json', 183 data: { 184 perPage: perPage, 185 currentPage: currentPage 186 }, 187 beforeSend: function() { 188 $button.hide(); 189 moreLoading.show(); 190 }, 191 success: function(response) { 192 if ( response.success ) { 193 moreLoading.hide(); 194 $('.suburbs-list-item').html(response.data.html); 195 let nextPage = response.data.next_page; 196 let total = response.data.total; 197 $button.attr('data-page', nextPage); 198 if( total <= (nextPage * perPage) ) { 199 $button.hide(); 200 } else { 201 $button.show(); 202 } 203 } else { 204 $('.suburbs-list-item').html(response.data.html); 205 } 206 moreLoading.hide(); 207 }, 208 error: function(xhr, status, error) { 209 console.log('AJAX error:', error); 210 } 211 }); 212 }); 213 214 215}); 216 217document.addEventListener('DOMContentLoaded', function() { 218 if (window.innerWidth > 767) return; // Mobile only 219 220 document.querySelectorAll('.block-whatwedo').forEach(block => { 221 const desc = block.querySelector('.block-whatwedo-desc'); 222 const ul = block.querySelector('.whatwedo-features.desktop'); 223 if (!desc || !ul) return; 224 225 // Create toggle button 226 const button = document.createElement('button'); 227 button.className = 'toggle-features'; 228 button.setAttribute('aria-label', 'Toggle Details'); 229 button.innerHTML = `<i class="fa fa-chevron-down" aria-hidden="true"></i>`; 230 // button.innerHTML = ` 231 // <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 232 // <path d="M7 10l5 5 5-5z"></path> 233 // </svg> 234 // `; 235 desc.insertAdjacentElement('afterend', button); 236 237 // Click event 238 button.addEventListener('click', function() { 239 const isOpen = block.classList.contains('open'); 240 241 if (!isOpen) { 242 ul.style.height = ul.scrollHeight + 'px'; 243 ul.style.opacity = '1'; 244 block.classList.add('open'); 245 button.classList.add('active'); 246 } else { 247 ul.style.height = '0'; 248 ul.style.opacity = '0'; 249 block.classList.remove('open'); 250 button.classList.remove('active'); 251 } 252 }); 253 }); 254});
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.