1(function ($) { 2 "use strict"; 3 4 $(".header_menu > ul > li > ul > li:has(ul)").find(":first").append(" <span class='fa fa-caret-right'></span>"); 5 6 $(window).on('load', function () { 7 if (Cookies.get('card-popup') != 'load') { 8 $('#card-popup').modal('show'); 9 } 10 11 $('#card-popup').on('hidden.bs.modal', function (e) { 12 Cookies.set('card-popup', 'load', { expires: 1 }); 13 }); 14 }); 15 16 /*============================== 17 Is mobile 18 ==============================*/ 19 var isMobile = { 20 Android: function () { 21 return navigator.userAgent.match(/Android/i); 22 }, 23 BlackBerry: function () { 24 return navigator.userAgent.match(/BlackBerry/i); 25 }, 26 iOS: function () { 27 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 28 }, 29 Opera: function () { 30 return navigator.userAgent.match(/Opera Mini/i); 31 }, 32 Windows: function () { 33 return navigator.userAgent.match(/IEMobile/i); 34 }, 35 any: function () { 36 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 37 } 38 }; 39 40 if (isMobile.any()) { 41 $("#open").hide(); 42 } 43 44 /* ================================================== 45 Advanced Search 46 ================================================== */ 47 $(window).resize(function () { 48 if ($(window).width() < 991) { 49 $('.mobile-button').insertAfter('.additional'); 50 } else { 51 $('.mobile-button').appendTo('.search-form-inputs'); 52 } 53 }); 54 $('#advanced').click(function () { 55 var target = $(".section-search-form"); 56 var targetH = parseInt(target.outerHeight()); 57 if ($(window).width() > 1199) { 58 if ($(this).hasClass('advanced')) { 59 var bottom = (90 - targetH); 60 $(this).removeClass('advanced'); 61 target.animate({ 62 'bottom': bottom 63 }); 64 $(this).html('<i class="fa fa-plus"></i>'); 65 } else { 66 $(this).addClass('advanced'); 67 target.animate({ 68 'bottom': 0 69 }); 70 $(this).html('<i class="fa fa-minus"></i>'); 71 } 72 } else { 73 if ($(this).hasClass('advanced')) { 74 $(this).removeClass('advanced'); 75 $('.additional').hide(); 76 $(this).html('<i class="fa fa-plus"></i>'); 77 } else { 78 $(this).addClass('advanced'); 79 $('.additional').show(); 80 $(this).html('<i class="fa fa-minus"></i>'); 81 } 82 } 83 return false; 84 }); 85 86 if (!isMobile.any()) { 87 var id; 88 $(window).resize(function () { 89 clearTimeout(id); 90 id = setTimeout(doneResizing, 500); 91 92 }); 93 } 94 95 function doneResizing() { 96 if ($(window).width() > 1199) { 97 $('.additional').show(); 98 } else { 99 $('.additional').hide(); 100 $('.section-search-form').css('bottom', '0'); 101 $('#advanced').removeClass('advanced'); 102 $('#advanced').html('<i class="fa fa-plus"></i>'); 103 } 104 } 105 106 /*============================== 107 Categories on mobile 108 ==============================*/ 109 if (isMobile.any()) { 110 var clicks = 0; 111 $('.property-type').on('click touchstart', function (event) { 112 if (clicks == 0) { 113 event.preventDefault(); 114 } 115 clicks++; 116 }).focusout(function () { 117 clicks--; 118 }); 119 } 120 121 /*============================== 122 Tooltip 123 ==============================*/ 124 $(function () { 125 $('[data-toggle="tooltip"]').tooltip({ 126 container: 'body' 127 }) 128 }); 129 130 /*Accordion*/ 131 Accordion(); 132 function Accordion() { 133 $(".accordion").accordion({ 134 heightStyle: "content" 135 }); 136 } 137 138 /* Tabs */ 139 Tabs(); 140 function Tabs() { 141 $('.tabs').tabs({ 142 show: { effect: "fadeIn", duration: 300 }, 143 hide: { effect: "fadeOut", duration: 300 } 144 }); 145 } 146 147 /* Select */ 148 149 if (isMobile.any()) { 150 aweSelectMobile(); 151 } else { 152 aweSelect(); 153 } 154 155 function aweSelect() { 156 $('.awe-select').each(function (index, el) { 157 $(this).selectpicker({ 158 'container': 'body' 159 }); 160 }); 161 } 162 function aweSelectMobile() { 163 $('.awe-select').each(function (index, el) { 164 $(this).selectpicker({ 165 'container': 'body', 166 'mobile': true 167 }); 168 }); 169 } 170 171 /*Menu Sticky*/ 172 function MenuSticky() { 173 if ($('#header_content').length && $('#header').hasClass('fixed')) { 174 var $this = $('#header_content'), 175 size_point = $this.data().responsive, 176 window_w = $(window).innerWidth(), 177 window_scroll = $(window).scrollTop(), 178 top_h = $('#header .header_top').innerHeight(), 179 this_h = $this.innerHeight(); 180 181 if (size_point == undefined || size_point == '') { 182 size_point = 1199; 183 } 184 185 if (window_scroll > top_h) { 186 187 if (($this).hasClass('header-sticky') == false) { 188 $this.parent().addClass('header-sticky'); 189 190 if (window_w <= size_point) { 191 $this.find('.header_menu').css('top', this_h + 'px'); 192 } 193 } 194 195 } else { 196 $this.parent().removeClass('header-sticky'); 197 198 if (window_w <= size_point) { 199 $this.find('.header_menu').css('top', (this_h + top_h) + 'px'); 200 } 201 } 202 } 203 } 204 205 /* Menu Resize */ 206 function MenuResize() { 207 208 if ($('#header_content').length) { 209 210 var $this = $('#header_content'), 211 size_point = $this.data().responsive, 212 window_scroll = $(window).scrollTop(), 213 top_h = $('#header .header_top').innerHeight(), 214 this_h = $this.innerHeight(), 215 window_w = $(window).innerWidth(); 216 217 if (size_point == undefined || size_point == '') { 218 size_point = 1199; 219 } 220 221 if (window_w <= size_point) { 222 $this.addClass('header_mobile').removeClass('header_content'); 223 } else { 224 $('.menu-bars').removeClass('active'); 225 $this.removeClass('header_mobile').addClass('header_content'); 226 $('#header_content .header_menu').css({ 227 'top': '' 228 }).removeClass('active').find('ul').css('display', ''); 229 } 230 } 231 } 232 233 /* Menu Click */ 234 MenuBar(); 235 function MenuBar() { 236 237 $('.menu-bars').on('click', function (event) { 238 239 if ($('.header_menu').hasClass('active')) { 240 $('.header_menu').removeClass('active'); 241 $(this).removeClass('active'); 242 } else { 243 $('.header_menu').addClass('active'); 244 $(this).addClass('active'); 245 } 246 247 }); 248 249 $('.menu li a').on('click', 'span', function (event) { 250 event.preventDefault(); 251 252 var $this = $(this), 253 $parent_li = $this.parent('a').parent('li'), 254 $parent_ul = $parent_li.parent('ul'); 255 256 if ($parent_li.find('> ul').is(':hidden')) { 257 $parent_ul.find('> li > ul').slideUp(); 258 $parent_li.find('> ul').slideDown(); 259 } else { 260 $parent_li.find('> ul').slideUp(); 261 } 262 263 return false;
264 }); 265 } 266 267 /* AwePopup */ 268 AwePopup(CallBackPopup); 269 270 function CallBackPopup() { 271 PopupCenter(); 272 } 273 274 function AwePopup(callback) { 275 276 $('.awe-ajax').on('click', function (event) { 277 var $this = $(this), 278 link_href = $this.attr('href'); 279 280 $('body').addClass('awe-overflow-h'); 281 $('#awe-popup-overlay, #awe-popup-wrap').addClass('in'); 282 283 getContentAjax(link_href, '#awe-popup-wrap .awe-popup-content', callback); 284 285 return false; 286 }); 287 288 $(document).on('click', '#awe-popup-overlay, #awe-popup-close, #awe-popup-wrap', function (event) { 289 event.preventDefault(); 290 $('#awe-popup-wrap, #awe-popup-overlay').removeClass('in'); 291 $('body').removeClass('awe-overflow-h'); 292 $('#awe-popup-wrap .awe-popup-content').html(''); 293 return false; 294 }); 295 296 $(document).on('click', '#awe-popup-wrap .awe-popup-content', function (event) { 297 event.stopPropagation(); 298 }); 299 } 300 301 function PopupCenter() { 302 if ($('#awe-popup-wrap').hasClass('in')) { 303 304 var $this = $('#awe-popup-wrap .awe-popup-content'), 305 window_h = $(window).innerHeight(), 306 height_e = $this.innerHeight(), 307 height_part = (window_h - height_e) / 2; 308 309 if (height_e < window_h && height_e > 0) { 310 311 $this.parent().css({ 312 'padding-top': height_part + 'px', 313 'padding-bottom': '0' 314 }); 315 316 } else { 317 318 $this.parent().css({ 319 'padding-top': '10px', 320 'padding-bottom': '10px' 321 }); 322 } 323 } 324 } 325 326 /*Banner Slide*/ 327 BannerSlider(); 328 function BannerSlider() { 329 if ($('#banner-slider').length) { 330 var offset_h = $('#header').innerHeight(); 331 $('#banner-slider').owlCarousel({ 332 autoPlay: 5000, 333 navigation: true, 334 singleItem: true, 335 pagination: false, 336 transitionStyle: 'fade', 337 navigationText: ['<i class="lotus-icon-left-arrow"></i>', '<i class="lotus-icon-right-arrow"></i>'], 338 beforeInit: function () { 339 var height = $('#banner-slider').data().height, 340 window_h = $(window).height(), 341 window_w = $(window).width(); 342 343 $('.slider-item').each(function (index, el) { 344 var url = $(this).data().image; 345 346 $(this).css('background-image', 'url(' + url + ')'); 347 348 if (height != '' && height != undefined) { 349 350 if (window_w > 767) { 351 $(this).css('height', height); 352 } else if (window_w <= 767) { 353 $(this).css('height', 500); 354 } else if (window_w <= 480) { 355 $(this).css('height', 400); 356 } 357 358 } else { 359 $(this).css('height', window_h - offset_h); 360 } 361 362 }); 363 364 }, 365 beforeUpdate: function () { 366 var height = $('#banner-slider').data().height, 367 window_w = $(window).width(); 368 369 if (!(height != '' && height != undefined)) { 370 $('.slider-item').each(function (index, el) { 371 var window_h = $(window).height() 372 $(this).css('height', window_h - offset_h + 'px'); 373 }); 374 } else { 375 $('.slider-item').each(function (index, el) { 376 if (window_w > 767) { 377 $(this).css('height', height); 378 } else if (window_w <= 767) { 379 $(this).css('height', 500); 380 } else if (window_w <= 480) { 381 $(this).css('height', 400); 382 } 383 }); 384 } 385 } 386 }); 387 } 388 } 389 390 /*Slider Home*/ 391 SliderRevolution(); 392 function SliderRevolution() { 393 if ($('#slider-revolution').length) { 394 var sdelay = typeof slidesDelay !== typeof undefined ? slidesDelay : 7000; 395 jQuery('#slider-revolution').show().revolution({ 396 dottedOverlay: "none", 397 delay: sdelay, 398 startwidth: 1700, 399 startheight: 700, 400 hideThumbs: 200, 401 402 thumbWidth: 100,
403 thumbHeight: 50, 404 thumbAmount: 5, 405 406 navigationType: "both", 407 navigationArrows: "yes", 408 navigationStyle: "round", 409 410 touchenabled: "on", 411 onHoverStop: "on", 412 413 swipe_velocity: 0.7, 414 swipe_min_touches: 1, 415 swipe_max_touches: 1, 416 drag_block_vertical: false, 417 418 parallax: "mouse", 419 parallaxBgFreeze: "on", 420 parallaxLevels: [7, 4, 3, 2, 5, 4, 3, 2, 1, 0], 421 422 keyboardNavigation: "off", 423 424 navigationHAlign: "center", 425 navigationVAlign: "bottom", 426 navigationHOffset: 0, 427 navigationVOffset: 20, 428 429 soloArrowLeftHalign: "left", 430 soloArrowLeftValign: "center", 431 soloArrowLeftHOffset: 20, 432 soloArrowLeftVOffset: 0, 433 434 soloArrowRightHalign: "right", 435 soloArrowRightValign: "center", 436 soloArrowRightHOffset: 20, 437 soloArrowRightVOffset: 0, 438 439 shadow: 0, 440 fullWidth: "off", 441 fullScreen: "off", 442 443 spinner: "spinner4", 444 445 stopLoop: "off", 446 stopAfterLoops: -1, 447 stopAtSlide: -1, 448 449 shuffle: "off", 450 451 autoHeight: "on", 452 forceFullWidth: "off", 453 454 455 hideThumbsOnMobile: "off", 456 hideNavDelayOnMobile: 1500, 457 hideBulletsOnMobile: "off", 458 hideArrowsOnMobile: "off", 459 hideThumbsUnderResolution: 0, 460 461 hideSliderAtLimit: 0, 462 hideCaptionAtLimit: 0, 463 hideAllCaptionAtLilmit: 0, 464 startWithSlide: 0, 465 fullScreenOffsetContainer: "#header" 466 }); 467 } 468 } 469 470 /* Modal*/ 471 $(".btn-play").click(function (event) { 472 var target = $(this).attr('href'), 473 url = $(target).data('video'); 474 475 var has_query_string = url.split('?', url); 476 if (typeof has_query_string[1] == 'string') { 477 url += '&' + $(target).data('query-string'); 478 } else { 479 url += '?' + $(target).data('query-string'); 480 } 481 $(target).find('iframe').attr('src', url); 482 483 $(target).addClass('opened'); 484 $(target).click(function () { 485 $(this).removeClass('opened').attr('src', ''); 486 }); 487 488 event.preventDefault(); 489 }); 490 491 /* Owl Single */ 492 function OwlSingle() { 493 if ($('.owl-single').length) { 494 $('.owl-single').each(function (index, el) { 495 var $this = $(this); 496 var options = { 497 autoPlay: false, 498 autoplayHoverPause: true, 499 singleItem: true, 500 smartSpeed: 1000, 501 navigation: true, 502 navigationText: ['<i class="lotus-icon-left-arrow"></i>', '<i class="lotus-icon-right-arrow"></i>'] 503 }; 504 var single_item = $this.data('single_item'); 505 506 if (typeof single_item == 'boolean' && single_item == false) { 507 options['singleItem'] = false; 508 var mobile = parseInt($this.data("mobile")), 509 tablet = parseInt($this.data("tablet")), 510 small_desktop = parseInt($this.data("small_desktop")), 511 desktop = parseInt($this.data("desktop")), 512 nav = ($this.data("nav")) ? true : false, 513 pagination = ($this.data("pagination")) ? true : false; 514 options['items'] = desktop; 515 options['itemsDesktop'] = [1200, desktop]; 516 options['itemsDesktopSmall'] = [992, small_desktop]; 517 options['itemsTablet'] = [767, tablet]; 518 options['itemsMobile'] = [600, mobile]; 519 options['navigation'] = nav; 520 options['pagination'] = pagination; 521 } 522 $this.owlCarousel(options); 523 }); 524 } 525 } 526 527 var timeout_slider; 528 $(window).resize(function () { 529 clearTimeout(timeout_slider); 530 timeout_slider = setTimeout(function () { 531 OwlSingle(); 532 }, 500); 533 }).resize(); 534 535 536 537 /* Popup Gallery */ 538 // GalleryPopup(); 539 function GalleryPopup() { 540 541 if ($('.gallery-content').length) { 542 543 $('.gallery-content').each(function (index, el) { 544 $(this).magnificPopup({ 545 delegate: 'a', // the selector for gallery item 546 type: 'image', 547 mainClass: 'mfp-with-zoom', 548 zoom: { 549 enabled: true, 550 duration: 300, 551 easing: 'ease-in-out', 552 }, 553 gallery: { 554 enabled: true, 555 arrowMarkup: '<button title="%title%" type="button" class="mfp-prevent-%dir% lotus-icon-%dir%-arrow"></button>', 556 tPrev: '', 557 tNext: '' 558 } 559 }); 560 }); 561 } 562 } 563 564 /*Gallery Property Detail*/ 565 GalleryRoomDetail(); 566 function GalleryRoomDetail() { 567 568 if ($('.room-detail_img').length) { 569 570 $(".room-detail_img").owlCarousel({ 571 navigation: true, 572 pagination: false, 573 navigationText: ["<i class='fa fa-chevron-left'></i>", "<i class='fa fa-chevron-right'></i>"], 574 singleItem: true, 575 mouseDrag: false, 576 autoHeight: true, 577 transitionStyle: 'fade' 578 }); 579 } 580 581 if ($('.room-detail_thumbs').length) { 582 583 $(".room-detail_thumbs").owlCarousel({ 584 items: 7, 585 pagination: false, 586 navigation: true, 587 mouseDrag: false, 588 navigationText: ["<i class='fa fa-chevron-left'></i>", "<i class='fa fa-chevron-right'></i>"], 589 itemsCustom: [[0, 3], [320, 4], [480, 5], [768, 6], [992, 7], [1200, 7]] 590 }); 591 592 if ($(".room-detail_img").data("owlCarousel") !== undefined && $(".room-detail_thumbs").data("owlCarousel") !== undefined) { 593 $('.room-detail_thumbs').on('click', '.owl-item', function (event) { 594 595 var $this = $(this), 596 index = $this.index(); 597 $('.room-detail_thumbs').find('.active').removeClass('active'); 598 $this.addClass('active'); 599 $(".room-detail_img").data("owlCarousel").goTo(index); 600 if ($(".virtual_tour").length != 0){ 601 $('.virtual_tour').hide(); 602 } 603 return false;
604 }); 605 } 606 } 607 } 608 609 /* SPECIAL OFFERS SLIDE */ 610 SpecialOffers1(); 611 function SpecialOffers1() { 612 if ($('.special-offers-slide_1').length) { 613 614 $(".special-offers-slide_1").owlCarousel({ 615 pagination: true, 616 navigation: false, 617 itemsCustom: [[0, 1], [480, 2], [992, 3], [1200, 3]] 618 }); 619 620 } 621 } 622 623 /* SPECIAL OFFERS SLIDE */ 624 LatestOffers1(); 625 function LatestOffers1() { 626 if ($('.latest-offers-slide_1').length) { 627 628 $(".latest-offers-slide_1").owlCarousel({ 629 pagination: true, 630 navigation: false, 631 itemsCustom: [[0, 1], [480, 2], [992, 3], [1200, 3]] 632 }); 633 634 } 635 } 636 637 638 /* SET BACKGROUND ROOM ITEM */ 639 BackgroundRoomItem(); 640 function BackgroundRoomItem() { 641 $('.room_item-6, .room_item-5').each(function (index, el) { 642 var $this = $(this), 643 link_src = $this.data().background; 644 645 if (link_src != undefined && link_src != '') { 646 $this.css('background-image', 'url(' + link_src + ')'); 647 } 648 }); 649 } 650 651 /* Parallax */ 652 function ParallaxScroll() { 653 if (isMobile.iOS()) { 654 $('.awe-parallax, .awe-static').addClass('fix-background-ios'); 655 } else { 656 $('.awe-parallax').each(function (index, el) { 657 $(this).parallax("50%", 0.2); 658 }); 659 } 660 } 661 662 $(document).ready(function () { 663 // $(window).load(function () { 664 // $('#preloader').delay(1000).fadeOut('400', function () { 665 // $(this).fadeOut() 666 // }); 667 // $('body').append('<div class="awe-popup-overlay" id="awe-popup-overlay"></div><div class="awe-popup-wrap" id="awe-popup-wrap"><div class="awe-popup-content"></div><span class="awe-popup-close" id="awe-popup-close"></div>'); 668 // }); 669 670 $(window).scroll(function (event) { 671 MenuSticky(); 672 }); 673 674 $(window).resize(function (event) { 675 ParallaxScroll(); 676 PopupCenter(); 677 MenuResize(); 678 MenuSticky(); 679 }).trigger('resize'); 680 681 }); 682 683})(jQuery); 684 685$("img.lazy").lazyload({ 686 effect: "fadeIn" 687}); 688 689 690$("#SliderText").owlCarousel({ 691 pagination: false, 692 navigation: false, 693 autoPlay: 5000, 694 singleItem: true, 695 autoWidth: true 696}); 697 698 699function format_number(number, prefix, thousand_separator, decimal_separator) { 700 var thousand_separator = thousand_separator || ',', 701 decimal_separator = decimal_separator || '.', 702 regex = new RegExp('[^' + decimal_separator + '\\d]', 'g'), 703 number_string = number.replace(regex, '').toString(), 704 split = number_string.split(decimal_separator), 705 rest = split[0].length % 3, 706 result = split[0].substr(0, rest), 707 thousands = split[0].substr(rest).match(/\d{3}/g); 708 709 if (thousands) { 710 separator = rest ? thousand_separator : ''; 711 result += separator + thousands.join(thousand_separator); 712 } 713 result = split[1] != undefined ? result + decimal_separator + split[1] : result; 714 return prefix == undefined ? result : (result ? prefix + result : ''); 715}; 716 717function limit_character(event) { 718 key = event.which || event.keyCode; 719 if (key != 188 // Comma 720 && key != 190 // Dot 721 && key != 8 // Backspace 722 && key != 46 // Delete 723 && key != 37 // left 724 && key != 39 // right 725 && key != 17 && key != 86 & key != 67 // Ctrl c, ctrl v 726 && (key < 48 || key > 57) // Non digit 727 && (key < 95 || key > 106) // Numeric keypad 728 // And many more, such as: del, left arrow dan right arrow, tab, etc... 729 ) { 730 event.preventDefault(); 731 return false; 732 } 733} 734 735$('.separator-input') 736 .each(function () { 737 $(this).val(format_number(this.value, '', ' ', ',')); 738 }) 739 .on('keyup', function () { 740 $(this).val(format_number(this.value, '', ' ', ',')); 741 }) 742 .on('keydown', function (event) { 743 limit_character(event); 744 }); 745 746 747var windowWidth = $(window).width(), 748 didScroll = false;
749 750var $arrow = $('#back-to-top'); 751 752$arrow.click(function (e) { 753 $('body,html').animate({ scrollTop: "0" }, 750, 'easeOutExpo'); 754 e.preventDefault(); 755}); 756 757$(window).scroll(function () { 758 didScroll = true; 759}); 760 761setInterval(function () { 762 if (didScroll) { 763 didScroll = false; 764 765 if ($(window).scrollTop() > 200) { 766 $arrow.fadeIn(); 767 } else { 768 $arrow.fadeOut(); 769 } 770 } 771}, 250); 772 773function goToByScroll(selector) { 774 // Scroll 775 $('html,body').animate({ 776 scrollTop: selector.offset().top 777 }, 'slow'); 778} 779 780function scrollToContactForm() { 781 goToByScrollIncludingFixedMenu( 782 $('.contact-agent-content > header').first() 783 ); 784}; 785 786function goToByScrollIncludingFixedMenu(selector) { 787 if ($('#header.fixed').length > 0) { 788 if (!window.matchMedia('(max-width: 1199px)').matches) { 789 var fixedTopHeight = 60; 790 } else { 791 var fixedTopHeight = 80; 792 } 793 } else { 794 var fixedTopHeight = 0; 795 } 796 797 $('html,body').animate({ 798 scrollTop: selector.offset().top - fixedTopHeight 799 }, 'slow'); 800} 801 802function fbs_click() { 803 u = location.href; 804 t = document.title; 805 window.open('https://www.facebook.com/share.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'share', 'toolbar=0,status=0,width=626,height=436'); 806 return false; 807}
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.