1function aios_listing_map( address, infobox, zoom, map_type ){ 2 lat_lng= ''; 3 zoom = ( zoom )?zoom:5; 4 map_type= ( map_type )?map_type:1; 5 geocoder = new google.maps.Geocoder(); 6 geocoder.geocode( { 'address': address }, function(results, status) { 7 if (status == google.maps.GeocoderStatus.OK) { 8 var sel_map_type = google.maps.MapTypeId.ROADMAP; 9 switch( map_type ){ 10 case '1': 11 sel_map_type = google.maps.MapTypeId.ROADMAP; 12 break; 13 case '2': 14 sel_map_type = google.maps.MapTypeId.SATELLITE; 15 break; 16 case '3': 17 sel_map_type = google.maps.MapTypeId.HYBRID; 18 break; 19 case '4': 20 sel_map_type = google.maps.MapTypeId.TERRAIN; 21 break; 22 default: 23 sel_map_type = google.maps.MapTypeId.ROADMAP; 24 break; 25 } 26 lat_lng = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng() ); 27 map_options = { 28 zoom: parseInt( zoom ), 29 center: lat_lng, 30 mapTypeId: sel_map_type 31 } 32 map = new google.maps.Map(document.getElementById('listing-map-canvas'), map_options); 33 34 if( map_type == 5 ){ 35 //panoramic street view 36 panorama = new google.maps.StreetViewPanorama( 37 document.getElementById('listing-map-canvas'), { 38 position: lat_lng, 39 pov: { 40 heading: 34, 41 pitch: 10 42 } 43 }); 44 map.setStreetView(panorama); 45 } 46 //normal map 47 marker = new google.maps.Marker({ 48 position: { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }, 49 map: map, 50 title: 'marker' 51 }); 52 53 infowindow = new google.maps.InfoWindow({ 54 content: infobox 55 }); 56 57 google.maps.event.addListener(marker, 'click', function() { 58 infowindow.open(map,marker); 59 }); 60 61 } else { 62 console.log("Geocode was not successful for the following reason: " + status); 63 } 64 }); 65} 66 67function aios_listing_map_leaflet() { 68 69} 70 71function aios_listing_change_view(){ 72 /** adjust margin */ 73 jQuery('.grid li:nth-child(3n)').next().addClass('re-margin') 74 75 /** list */ 76 jQuery('.list-bttn').click(function(){ 77 jQuery(this).addClass('active'); 78 jQuery('.grid-bttn').removeClass('active'); 79 jQuery('.tabled-bttn').removeClass('active'); 80 81 jQuery('.list').stop(true).fadeIn(); 82 jQuery('.grid').stop(true).fadeOut(); 83 jQuery('.list-wrapper').stop(true).fadeOut(); 84 return false; 85 86 }) 87 88 /** grid */ 89 jQuery('.grid-bttn').click(function(){ 90 jQuery(this).addClass('active'); 91 jQuery('.list-bttn').removeClass('active'); 92 jQuery('.tabled-bttn').removeClass('active'); 93 94 jQuery('.list').stop(true).fadeOut(); 95 jQuery('.grid').stop(true).fadeIn(); 96 jQuery('.list-wrapper').stop(true).fadeOut(); 97 if(jQuery(window).width() > 991){ 98 99 jQuery(".grid-property-content").aiosListingsChainHeight({refreshDelay:0}); 100 jQuery(".grid-property-others").aiosListingsChainHeight({refreshDelay:0}); 101 } 102 return false; 103 }) 104 105 /** tabled */ 106 jQuery('.tabled-bttn').click(function(){ 107 jQuery(this).addClass('active'); 108 jQuery('.list-bttn').removeClass('active'); 109 jQuery('.grid-bttn').removeClass('active'); 110 111 jQuery('.list').stop(true).fadeOut(); 112 jQuery('.grid').stop(true).fadeOut(); 113 jQuery('.list-wrapper').stop(true).fadeIn(); 114 return false; 115 }) 116} 117 118function aios_listing_slideshow( ){ 119 jQuery('.photo-slideshow').slick({ 120 dots: false, 121 infinite: true, 122 speed: 500, 123 fade: true, 124 cssEase: 'linear', 125 asNavFor: '.pop-gallery', 126 focusOnSelect: true 127 }); 128 129 jQuery('.pop-gallery').slick({ 130 slidesToShow: 1, 131 slidesToScroll: 1, 132 speed: 500, 133 fade: true, 134 asNavFor: '.photo-slideshow', 135 dots: false, 136 arrows: true, 137 }); 138 139 jQuery('.photo-list a').click(function(e){ 140 e.preventDefault(); 141 jQuery('.pop-gallery-wrap').css({ 142 "top": "0" 143 }); 144 jQuery('.pop-container').css({ 145 "top": "50%" 146 }) 147 jQuery('.pop-gallery-wrap').animate({ 148 opacity: 1 149 }) 150 }); 151 152 jQuery('.close-pop, .pop-outside').click(function(e){ 153 e.preventDefault(); 154 jQuery('.pop-gallery-wrap').css({ 155 "top": "-100%" 156 }); 157 jQuery('.pop-container').css({ 158 "top": "0" 159 }) 160 jQuery('.pop-gallery-wrap').animate({ 161 opacity: 0 162 }) 163 }); 164} 165 166function aios_listing_popup(){ 167 jQuery('.mortage-calculator-bttn, .requ-info, .sc-showing').click(function(e){ 168 e.preventDefault(); 169 jQuery('.' + jQuery(this).data('popup')).fadeIn(); 170 }) 171 172 jQuery('.close').click(function(e){ 173 jQuery('.' + jQuery(this).data('class')).fadeOut(); 174 }); 175} 176 177function aios_listing_scroll_by_height(){
178 innerHeight = jQuery(window).innerHeight() 179 if( innerHeight < 768){ 180 jQuery('.scroll-wrap ').addClass('scroll-parent') 181 } else { 182 jQuery('.scroll-wrap ').removeClass('scroll-parent') 183 } 184} 185 186function aios_listing_fetch_sold( ){ 187 jQuery('.listing-item').click( function( ){ 188 jQuery('#pop-light').find('.popup-holder').html('').css('opacity',0); 189 jQuery('#pop-light').prepend('<div class="loading"></div>'); 190 listing_id = jQuery(this).data('listing-id'); 191 jQuery.post( 192 shared_var.ajax_url, 193 { 194 'action': 'sold_popup', 195 'data': { id: listing_id } 196 }, 197 function(response){ 198 jQuery('#pop-light .popup-holder').html(response).css('opacity',1); 199 jQuery('.loading').remove(); 200 201 aios_listing_slideshow(); 202 } 203 ); 204 } ); 205 206 /** popsold */ 207 jQuery('.pop-sold').click(function(){ 208 jQuery('.property-pop').fadeIn(); 209 }); 210 jQuery('.close-pop, .pop-bg').click(function(){ 211 jQuery('.property-pop').fadeOut(); 212 }); 213} 214 215function aios_listing_tab_order( default_view ){ 216 217 /** List */ 218 if( default_view == 'List' ){ 219 jQuery('.list-bttn').addClass('active'); 220 jQuery('.grid-bttn').removeClass('active'); 221 jQuery('.tabled-bttn').removeClass('active'); 222 223 jQuery('.list').stop(true).fadeIn(); 224 jQuery('.grid').stop(true).fadeOut(); 225 jQuery('.list-wrapper').stop(true).fadeOut(); 226 227 } 228 229 /** grid */ 230 else if( default_view == 'Grid' ){ 231 jQuery('.grid-bttn').addClass('active'); 232 jQuery('.list-bttn').removeClass('active'); 233 jQuery('.tabled-bttn').removeClass('active'); 234 235 jQuery('.list').stop(true).fadeOut(); 236 jQuery('.grid').stop(true).fadeIn(); 237 jQuery('.list-wrapper').stop(true).fadeOut(); 238 239 240 } 241 242 /** tabled */ 243 else if( default_view == 'Table' ){ 244 jQuery('.tabled-bttn').addClass('active'); 245 jQuery('.list-bttn').removeClass('active'); 246 jQuery('.grid-bttn').removeClass('active'); 247 248 jQuery('.list').stop(true).fadeOut(); 249 jQuery('.grid').stop(true).fadeOut(); 250 jQuery('.list-wrapper').stop(true).fadeIn(); 251 } 252} 253 254function aios_listing_sorting( ){ 255 jQuery(".aios-listings-sorter").change( function(){ 256 if( jQuery(".aios-listings-sorter").val() != '' ) { 257 window.location.href = jQuery(this).val() + '&view=' + jQuery('.sort-left').find('.active').data('view'); 258 } 259 }); 260 261 jQuery('.page-nation a').click(function(){ 262 view = ''; 263 264 to_replace = ['&view=Table' ,'&view=Grid', '&view=List', '?view=Table', '?view=Grid', '?view=List']; 265 anchor = jQuery(this).attr('href').replace( '#038;', '&' ); 266 for( i=0;i<6;i++){ 267 anchor = anchor.replace( to_replace[i], '' ); 268 } 269 270 if( anchor.indexOf("?") >= 0 ){ 271 view = '&view='; 272 } else { 273 view = '?view='; 274 } 275 276 jQuery(this).attr('href', anchor + view + jQuery('.sort-left').find('.active').data('view') ); 277 278 return true; 279 }); 280 281} 282 283function aios_listing_form_defaults( address ){ 284 sched = "Please Schedule me a Showing of " + address + "\n\n" + jQuery(location).attr('href'); 285 req = "Please send me more information of " + address + "\n\n" + jQuery(location).attr('href');; 286 jQuery('.popup-wrap-schedule>.schedule-showing .message textarea').val(sched); 287 jQuery('.popup-wrap-request>.request-more-info .message textarea').val(req); 288} 289 290/** Detach popup on ready */ 291function single_addition(){ 292 jQuery('#pop-light').prependTo('body') 293 jQuery('.pop-wrap').prependTo('body') 294 jQuery('.pop-gallery-wrap').prependTo('body') 295 296 /** close popup when you click outside the white area. */ 297 jQuery('.pop-outside').click(function(){ 298 jQuery('.pop-wrap').fadeOut(); 299 }) 300} 301 302function aios_listing_map_alternative( _maplat, _maplon, zoom = 17 ) { 303 if ( _maplat == '' && _maplon == '' ) { 304 console.log( 'Set the latitude and longitude of property.' ); 305 } else { 306 var _attribution = '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>', 307 _mapStyle = 'https://api.maptiler.com/maps/streets/style.json?key=3i8dcrACEAmtPrc6lzeW'; 308 coor = [ _maplat, _maplon ]; 309 310 /** Initialize Map */ 311 var mapid = L.map( 'listing-map-canvas' ).setView( coor, zoom ); 312 313 /** Create marker */ 314 var marker = L.marker( coor, { 315 draggable: true, 316 riseOnHover:true, 317 riseOffset: 500 318 } ).addTo( mapid ); 319 320 /** Add map data */ 321 L.mapboxGL( { 322 attribution: _attribution, 323 accessToken: 'not-needed', 324 style: _mapStyle 325 } ).addTo( mapid ); 326 } 327}
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.