1var wdtPortfolioSinglePageUtils = { 2 3 wdtPortfolioMapInitialize : function(this_item) { 4 5 var listing_latitude = this_item.attr('data-latitude'); 6 var listing_longitude = this_item.attr('data-longitude'); 7 var map_color = this_item.attr('data-mapcolor'); 8 9 if(map_color == '') { 10 map_color = wdtmapobject.defaultMapColor; 11 } 12 13 var default_zoom_level = wdtmapobject.defaultZoomLevel; 14 var default_map_type = wdtmapobject.defaultMapType; 15 16 var enableMapTypeControl = wdtmapobject.enableMapTypeControl; 17 var enableZoomControl = wdtmapobject.enableZoomControl; 18 var enableScaleControl = wdtmapobject.enableScaleControl; 19 var enableStreetViewControl = wdtmapobject.enableStreetViewControl; 20 var enableFullscreenControl = wdtmapobject.enableFullscreenControl; 21 22 var mapOptions = { 23 flat:false, 24 noClear:false, 25 zoom: parseInt(default_zoom_level, 10), 26 scrollwheel: false, 27 draggable: true, 28 disableDefaultUI:false, 29 center: new google.maps.LatLng(listing_latitude, listing_longitude), 30 mapTypeId: default_map_type.toLowerCase(), 31 styles: [ 32 {stylers: [{hue: map_color}]}, 33 ], 34 35 mapTypeControl: enableMapTypeControl, 36 zoomControl: enableZoomControl, 37 scaleControl: enableScaleControl, 38 streetViewControl: enableStreetViewControl, 39 fullscreenControl: enableFullscreenControl 40 }; 41 42 43 var map_id = this_item.find('.wdt-listings-map-holder').attr('id'); 44 if(document.getElementById(map_id)) { 45 var map_sp = new google.maps.Map(document.getElementById(map_id), mapOptions); 46 } else { 47 return; 48 } 49 50 google.maps.visualRefresh = true; 51 52 var point = new google.maps.LatLng(listing_latitude, listing_longitude); 53 54 wdtPortfolioSinglePageUtils.wdtPortfolioMapLocationMarker(point, map_sp, this_item); 55 56 }, 57 58 wdtPortfolioMapLocationMarker : function(location, map_sp, this_item) { 59 60 var marker_image = this_item.attr('data-markerimage'); 61 62 var mapMarker = new wdtPortfolioCustomMarker( 63 location, 64 map_sp, 65 { 66 map_icon: marker_image, 67 add_info: false, 68 }, 69 '' 70 ); 71 72 return mapMarker; 73 74 }, 75 76 wdtPortfolioCheckReadyState : function(printWindow) { 77 78 //if (printWindow.document.readyState == "complete") { 79 printWindow.focus(); // necessary for IE >= 10 80 printWindow.print(); 81 printWindow.close(); 82 //} 83 84 }, 85 86}; 87 88var wdtPortfolioSinglePage = { 89 90 dtInit : function() { 91 92 // Initialze Map 93 94 jQuery('.wdt-listings-map-container').each(function() { 95 google.maps.event.addDomListener(window, 'load', wdtPortfolioSinglePageUtils.wdtPortfolioMapInitialize(jQuery(this))); 96 }); 97 98 99 // Add to favourite list 100 101 jQuery( 'body' ).delegate( '.wdt-listings-utils-favourite-item', 'click', function(e) { 102 103 var this_item = jQuery(this); 104 105 if(jQuery(this).hasClass('wdt-login-link')) { 106 107 this_item.parents('.wdt-listings-utils-favourite').prepend( '<span class="wdt-fav-please-login">'+ wdtfrontendobject.pleaseLogin +'</span>' ); 108 window.setTimeout(function(){ 109 this_item.parents('.wdt-listings-utils-favourite').find('span.wdt-fav-please-login').remove(); 110 }, 2000); 111 112 } else { 113 114 var listing_id = this_item.attr('data-listingid'); 115 var user_id = this_item.attr('data-userid'); 116 117 if(jQuery(this).hasClass('addtofavourite')) { 118 var favourite_label = 'addtofavourite'; 119 } else { 120 var favourite_label = 'removefavourite'; 121 } 122 123 jQuery.ajax({ 124 type: "POST", 125 url: wdtfrontendobject.ajaxurl, 126 data: 127 { 128 action: 'wdt_listing_favourite_marker', 129 listing_id: listing_id, 130 user_id: user_id, 131 }, 132 beforeSend: function(){ 133 this_item.parents('.wdt-listings-utils-favourite').prepend( '<span><i class="fa fa-spinner fa-spin"></i></span>' ); 134 }, 135 success: function (response) { 136 if(favourite_label == 'addtofavourite') { 137 this_item.html('<span class="fa fa-heart"></span>'); 138 this_item.removeClass('addtofavourite'); 139 this_item.addClass('removefavourite'); 140 } else { 141 this_item.html('<span class="far fa-heart"></span>'); 142 this_item.removeClass('removefavourite'); 143 this_item.addClass('addtofavourite'); 144 } 145 }, 146 complete: function(){ 147 this_item.parents('.wdt-listings-utils-favourite').find("span:first").remove(); 148 } 149 });
150 151 } 152 153 e.preventDefault(); 154 155 }); 156 157 // Print page 158 159 jQuery( 'body' ).delegate( '.wdt-listings-utils-print-item', 'click', function(e) { 160 161 var data = jQuery('body').find('#main').html(); 162 163 var printWindow = window.open('', wdtfrontendobject.printerTitle, 'height=600,width=1900'); 164 printWindow.document.write('<html><head><title>'+wdtfrontendobject.printerTitle+'</title>'); 165 166 // Directory Plugin CSS 167 jQuery('link[id$="-css"]').each(function () { 168 printWindow.document.write('<link rel="stylesheet" href="'+jQuery(this).attr('href')+'" type="text/css" media="all" />'); 169 }); 170 171 // Inline CSS 172 jQuery('style[id$="-css"]').each(function () { 173 printWindow.document.write('<style id="'+jQuery(this).attr('id')+'" type="text/css">'+jQuery(this).html()+'</style>'); 174 }); 175 176 printWindow.document.write('<link rel="stylesheet" href="'+wdtfrontendobject.pluginPath+'assets/css/print.css" type="text/css" media="all" />'); 177 178 printWindow.document.write('</head><body>'); 179 printWindow.document.write(data);
180 printWindow.document.write('</body></html>'); 181 printWindow.document.close(); 182 183 setTimeout(function() { 184 wdtPortfolioSinglePageUtils.wdtPortfolioCheckReadyState(printWindow); 185 }, 1200); 186 187 e.preventDefault(); 188 189 }); 190 191 192 // Contact form submit 193 194 jQuery( 'body' ).delegate( '.wdt-contactform-submit-button', 'click', function(e) { 195 196 var this_item = jQuery(this); 197 var notification_box = this_item.parents('.wdt-listings-contactform').find('.wdt-contactform-notification-box'); 198 199 var form = jQuery('.wdt-listings-contactform')[0]; 200 var data = new FormData(form); 201 data.append('action', 'wdt_process_listing_contactform'); 202 203 jQuery.ajax({ 204 type: "POST", 205 url: wdtfrontendobject.ajaxurl, 206 data: data, 207 processData: false, 208 contentType: false, 209 cache: false, 210 dataType: "JSON", 211 beforeSend: function() { 212 this_item.prepend( '<span><i class="fa fa-spinner fa-spin"></i></span>' ); 213 }, 214 success: function (response) { 215 notification_box.removeClass('wdt-success wdt-failure'); 216 if(response.success) { 217 notification_box.addClass('wdt-success'); 218 notification_box.html(response.message); 219 } else { 220 notification_box.addClass('wdt-failure'); 221 notification_box.html(response.message); 222 } 223 }, 224 complete: function() { 225 this_item.find('span').remove(); 226 } 227 }); 228 229 e.preventDefault(); 230 231 }); 232 233 234 // Send request to view contact details 235 236 jQuery( 'body' ).delegate( '.wdt-listings-contactdetails-request', 'click', function(e) { 237 238 var this_item = jQuery(this); 239 var listing_id = this_item.attr('data-listingid'); 240 241 jQuery.ajax({ 242 type: "POST", 243 url: wdtfrontendobject.ajaxurl, 244 data: 245 { 246 action: 'wdt_listing_contactdetails_request', 247 listing_id: listing_id, 248 }, 249 dataType: "JSON", 250 beforeSend: function() { 251 this_item.prepend( '<span><i class="fa fa-spinner fa-spin"></i></span>' ); 252 }, 253 success: function (response) { 254 if(response.success) { 255 location.reload(); 256 } else { 257 this_item.parents('.wdt-listings-contactdetails-request-container').append('<div class="wdt-contactdetails-request-notification-box">'+response.message+'</div>'); 258 window.setTimeout(function(){ 259 this_item.parents('.wdt-listings-contactdetails-request-container').find('.wdt-contactdetails-request-notification-box').remove(); 260 }, 2000); 261 } 262 }, 263 complete: function() { 264 this_item.find('span').remove(); 265 } 266 }); 267 268 e.preventDefault(); 269 270 }); 271 272 273 // Activity Tracker - Website Visit, Phone & Mobile Click 274 275 jQuery( 'body' ).delegate( '.wdt-listings-contactdetails-list a.web, .wdt-listings-contactdetails-list a.phone, .wdt-listings-contactdetails-list a.mobile', 'click', function(e) { 276 277 var this_item = jQuery(this); 278 var listing_id = this_item.attr('data-listingid'); 279 var user_id = this_item.attr('data-userid'); 280 281 var activity_type = ''; 282 if(this_item.hasClass('web')) { 283 activity_type = 'website'; 284 } else if(this_item.hasClass('phone')) { 285 activity_type = 'phone'; 286 } else if(this_item.hasClass('mobile')) { 287 activity_type = 'mobile'; 288 } 289 290 jQuery.getJSON('https://geoip-db.com/json/geoip.php?jsonp=?').done(function(location) { 291 292 var country = location.country_name; 293 var city = location.city; 294 var zip = location.postal; 295 296 jQuery.ajax({ 297 type: "POST", 298 url: wdtfrontendobject.ajaxurl, 299 data: 300 { 301 action : 'wdt_listing_activity_tracker_contactdetails', 302 activity_type: activity_type, 303 listing_id : listing_id, 304 user_id : user_id, 305 country : country, 306 city : city, 307 zip : zip 308 }, 309 dataType: "JSON", 310 success: function (response) { 311 } 312 }); 313 314 }); 315 316 }); 317 318 319 if(jQuery('.wdt-portfolio-sticky-section').length) { 320 let $stickyInstanceOptions = { 321 topSpacing: 0, 322 bottomSpacing: 0, 323 containerSelector: '.wdt-portfolio-sticky-section-container', 324 innerWrapperSelector: '.wdt-portfolio-sticky-section-inner', 325 }; 326 $stickyInstance = new StickySidebar(jQuery('.wdt-portfolio-sticky-section')[0], $stickyInstanceOptions); 327 } 328 329 } 330 331}; 332 333jQuery(document).ready(function() { 334 335 if(!wdtfrontendobject.elementorPreviewMode) { 336 wdtPortfolioSinglePage.dtInit(); 337 } 338 339}); 340 341 342( function( $ ) { 343 344 var wdtPortfolioSinglePageJs = function($scope, $){ 345 wdtPortfolioSinglePage.dtInit(); 346 }; 347 348 $(window).on('elementor/frontend/init', function(){ 349 if(wdtfrontendobject.elementorPreviewMode) { 350 elementorFrontend.hooks.addAction('frontend/element_ready/wdt-widget-sp-map.default', wdtPortfolioSinglePageJs); 351 } 352 }); 353 354} )( jQuery );
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.