1/* 2 Theme Name: U-Listing 3 Description: U-Listing Directory - Listing Html Template 4 Version: 1.0.5 5*/ 6 7(function($) { 8 "use strict"; 9 10 $(document).ready(function() { 11 12 /* 13 * ============================================================ 14 * MAGNIFIC POPUP 15 * En üstte çalıÅır. AÅaÄıdaki diÄer JS kodlarından etkilenmez. 16 * #small-dialogXX adresine gitmesini engeller. 17 * ============================================================ 18 */ 19 if (typeof $.fn.magnificPopup === "function") { 20 21 $(document) 22 .off("click.utfPopup", ".popup-with-zoom-anim") 23 .on("click.utfPopup", ".popup-with-zoom-anim", function(e) { 24 25 e.preventDefault(); 26 e.stopPropagation(); 27 28 var target = $(this).attr("href"); 29 30 if (!target || target.charAt(0) !== "#") { 31 return false; 32 } 33 34 $.magnificPopup.open({ 35 items: { 36 src: target, 37 type: "inline" 38 }, 39 fixedContentPos: false, 40 fixedBgPos: true, 41 overflowY: "auto", 42 closeBtnInside: true, 43 preloader: false, 44 midClick: true, 45 removalDelay: 300, 46 mainClass: "my-mfp-zoom-in" 47 }); 48 49 return false; 50 }); 51 52 } else { 53 54 console.error("Magnific Popup yüklenmemiÅ."); 55 56 } 57 58 59 $(function() { 60 61 function mmenuInit() { 62 var wi = $(window).width(); 63 64 if (wi <= 1024) { 65 66 if ($(".mmenu-init").length) { 67 try { 68 $(".mmenu-init").trigger("destroy.mm"); 69 } catch (e) {} 70 71 $(".mmenu-init").remove(); 72 } 73 74 if ($("#navigation").length === 0) { 75 return; 76 } 77 78 var $mobileMenu = $("#navigation") 79 .clone() 80 .addClass("mmenu-init") 81 .insertBefore("#navigation") 82 .removeAttr("id") 83 .removeClass("style-1 style-2"); 84 85 $mobileMenu 86 .find("ul, div") 87 .removeClass( 88 "style-1 style-2 mega-menu mega-menu-content mega-menu-section" 89 ) 90 .removeAttr("id"); 91 92 $mobileMenu.find("ul").addClass("mm-listview"); 93 94 $mobileMenu 95 .find(".mobile-styles .mm-listview") 96 .unwrap(); 97 98 if (typeof $.fn.mmenu !== "function") { 99 console.error("mmenu plugin yüklenemedi."); 100 return; 101 } 102 103 $mobileMenu.mmenu({ 104 counters: true 105 }, { 106 offCanvas: { 107 pageNodetype: "#main_wrapper" 108 } 109 }); 110 111 var mmenuAPI = $mobileMenu.data("mmenu"); 112 113 if (!mmenuAPI && typeof $mobileMenu.data("mmenu") !== "undefined") { 114 mmenuAPI = $mobileMenu.data("mmenu"); 115 } 116 117 var $icon = $(".hamburger"); 118 119 if (!mmenuAPI) { 120 console.error("mmenu API bulunamadı.", $mobileMenu); 121 return; 122 } 123 124 $(".mmenu-trigger") 125 .off("click.mmenuCustom") 126 .on("click.mmenuCustom", function(e) { 127 e.preventDefault(); 128 129 if (typeof mmenuAPI.open === "function") { 130 mmenuAPI.open(); 131 } 132 }); 133 134 if (typeof mmenuAPI.bind === "function") { 135 136 mmenuAPI.bind("open:finish", function() { 137 setTimeout(function() { 138 $icon.addClass("is-active"); 139 }, 0); 140 }); 141 142 mmenuAPI.bind("close:finish", function() { 143 setTimeout(function() { 144 $icon.removeClass("is-active"); 145 }, 0); 146 }); 147 148 } else { 149 150 $mobileMenu.on("open:finish", function() { 151 $icon.addClass("is-active"); 152 }); 153 154 $mobileMenu.on("close:finish", function() { 155 $icon.removeClass("is-active"); 156 }); 157 } 158 } 159 160 $(".mm-next").addClass("mm-fullsubopen"); 161 } 162 163 mmenuInit(); 164 165 $(window).resize(function() { 166 mmenuInit(); 167 }); 168 169 }); 170 171 172 $('.utf_user_menu').on('click', function() { 173 $(this).toggleClass('active'); 174 }); 175 176 $("#header") 177 .not("#header.not-sticky") 178 .clone(true) 179 .addClass('cloned unsticky') 180 .insertAfter("#header"); 181 182 $("#navigation.style-2") 183 .clone(true) 184 .addClass('cloned unsticky') 185 .insertAfter("#navigation.style-2"); 186 187 $("#logo .sticky-logo") 188 .clone(true) 189 .prependTo("#navigation.style-2.cloned ul#responsive"); 190 191 var headerOffset = $("#header_part").height() * 2; 192 193 $(window).scroll(function() { 194 if ($(window).scrollTop() >= headerOffset) { 195 $("#header.cloned").addClass('sticky').removeClass("unsticky"); 196 $("#navigation.style-2.cloned").addClass('sticky').removeClass("unsticky"); 197 } else { 198 $("#header.cloned").addClass('unsticky').removeClass("sticky"); 199 $("#navigation.style-2.cloned").addClass('unsticky').removeClass("sticky"); 200 } 201 }); 202 203 var pxShow = 600; 204 var scrollSpeed = 500; 205 206 $(window).scroll(function() { 207 if ($(window).scrollTop() >= pxShow) { 208 $("#bottom_backto_top").addClass('visible'); 209 } else { 210 $("#bottom_backto_top").removeClass('visible'); 211 } 212 }); 213 214 $('#bottom_backto_top a').on('click', function() { 215 $('html, body').animate({ 216 scrollTop: 0 217 }, scrollSpeed); 218 219 return false; 220 }); 221 222 var radios = document.querySelectorAll('.utf_payment_trigger_tab > input'); 223 224 for (var i = 0; i < radios.length; i++) { 225 radios[i].addEventListener('change', expandAccordion); 226 } 227 228 function expandAccordion(event) { 229 230 var allTabs = document.querySelectorAll('.utf_payment_tab_block'); 231 232 for (var i = 0; i < allTabs.length; i++) { 233 allTabs[i].classList.remove('utf_payment_tab_block_active'); 234 } 235 236 event.target.parentNode.parentNode.classList.add( 237 'utf_payment_tab_block_active' 238 ); 239 } 240 241 function inlineCSS() { 242 243 $(".search_container_block, section.fullwidth_block, .utf_listing_slider .item, .address-container, .img-box-background, .
243image-edge, .edge-bg") 244 .each(function() { 245 246 var attrImageBG = $(this).attr('data-background-image'); 247 var attrColorBG = $(this).attr('data-background-color'); 248 249 if (attrImageBG !== undefined) { 250 $(this).css( 251 'background-image', 252 'url(' + attrImageBG + ')' 253 ); 254 } 255 256 if (attrColorBG !== undefined) { 257 $(this).css( 258 'background', 259 '' + attrColorBG + '' 260 ); 261 } 262 }); 263 } 264 265 inlineCSS(); 266 267 function parallaxBG() { 268 269 $('.parallax').prepend( 270 '<div class="parallax-overlay"></div>' 271 ); 272 273 $(".parallax").each(function() { 274 275 var attrImage = $(this).attr('data-background'); 276 var attrColor = $(this).attr('data-color'); 277 var attrOpacity = $(this).attr('data-color-opacity'); 278 279 if (attrImage !== undefined) { 280 $(this).css( 281 'background-image', 282 'url(' + attrImage + ')' 283 ); 284 } 285 286 if (attrColor !== undefined) { 287 $(this) 288 .find(".parallax-overlay") 289 .css( 290 'background-color', 291 '' + attrColor + '' 292 ); 293 } 294 295 if (attrOpacity !== undefined) { 296 $(this) 297 .find(".parallax-overlay") 298 .css( 299 'opacity', 300 '' + attrOpacity + '' 301 ); 302 } 303 }); 304 } 305 306 var $accor = $('.accordion'); 307 308 $accor.each(function() { 309 310 $(this).toggleClass( 311 'ui-accordion ui-widget ui-helper-reset' 312 ); 313 314 $(this) 315 .find('h3') 316 .addClass( 317 'ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all' 318 ); 319 320 $(this) 321 .find('div') 322 .addClass( 323 'ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom' 324 ); 325 326 $(this).find("div").hide(); 327 }); 328 329 var $trigger = $accor.find('h3'); 330 331 $trigger.on('click', function(e) { 332 333 var location = $(this).parent(); 334 335 if ($(this).next().is(':hidden')) { 336 337 var $triggerloc = $('h3', location); 338 339 $triggerloc 340 .removeClass( 341 'ui-accordion-header-active ui-state-active ui-corner-top' 342 ) 343 .next() 344 .slideUp(300); 345 346 $triggerloc 347 .find('span') 348 .removeClass('ui-accordion-icon-active'); 349 350 $(this) 351 .find('span') 352 .addClass('ui-accordion-icon-active'); 353 354 $(this) 355 .addClass( 356 'ui-accordion-header-active ui-state-active ui-corner-top' 357 ) 358 .next() 359 .slideDown(300); 360 } 361 362 e.preventDefault(); 363 }); 364 365 parallaxBG(); 366 367 $('.category-box').each(function() { 368 369 $(this).append( 370 '<div class="category-box-background"></div>' 371 ); 372 373 $(this) 374 .children('.category-box-background') 375 .css({ 376 'background-image': 377 'url(' + 378 $(this).attr('data-background-image') + 379 ')' 380 }); 381 }); 382 383 $('.img-box').each(function() { 384 385 $(this).append( 386 '<div class="img-box-background"></div>' 387 ); 388 389 $(this) 390 .children('.img-box-background') 391 .css({ 392 'background-image': 393 'url(' + 394 $(this).attr('data-background-image') + 395 ')' 396 }); 397 }); 398 399 try { 400 401 var menu = $('.js-item-menu'); 402 var sub_menu_is_showed = -1; 403 404 for (var i = 0; i < menu.length; i++) { 405 406 $(menu[i]).on('click', function(e) { 407 408 e.preventDefault(); 409 410 $('.js-right-sidebar').removeClass("show-sidebar"); 411 412 if (jQuery.inArray(this, menu) == sub_menu_is_showed) { 413 414 $(this).toggleClass('show-dropdown'); 415 sub_menu_is_showed = -1; 416 417 } else { 418 419 for (var i = 0; i < menu.length; i++) { 420 $(menu[i]).removeClass("show-dropdown"); 421 } 422 423 $(this).toggleClass('show-dropdown'); 424 425 sub_menu_is_showed = 426 jQuery.inArray(this, menu); 427 } 428 }); 429 } 430 431 $(".js-item-menu, .js-dropdown").click(function(event) { 432 event.stopPropagation(); 433 }); 434 435 $("body,html").on("click", function() { 436 437 for (var i = 0; i < menu.length; i++) { 438 menu[i].classList.remove("show-dropdown"); 439 } 440 441 sub_menu_is_showed = -1; 442 }); 443 444 } catch (error) { 445 console.log(error); 446 } 447 448 if ("ontouchstart" in window) { 449 document.documentElement.className = 450 document.documentElement.className + " touch"; 451 } 452 453 if (!$("html").hasClass("touch")) { 454 $(".parallax").css( 455 "background-attachment", 456 "fixed" 457 ); 458 } 459 460 function fullscreenFix() { 461 462 var h = $('body').height(); 463 464 $(".content-b").each(function(i) { 465 466 if ($(this).innerHeight() > h) { 467 $(this) 468 .closest(".fullscreen") 469 .addClass("overflow"); 470 } 471 }); 472 } 473 474 $(window).resize(fullscreenFix); 475 476 fullscreenFix(); 477 478 function backgroundResize() { 479 480 var windowH = $(window).height(); 481 482 $(".parallax").each(function(i) { 483 484 var path = $(this); 485 var contW = path.width(); 486 var contH = path.height(); 487 488 var imgW = path.attr("data-img-width"); 489 var imgH = path.attr("data-img-height"); 490 491 var ratio = imgW / imgH; 492 493 var diff = 100; 494 495 diff = diff ? diff : 0; 496
497 var remainingH = 0; 498 499 if ( 500 path.hasClass("parallax") && 501 !$("html").hasClass("touch") 502 ) { 503 remainingH = windowH - contH; 504 } 505 506 imgH = contH + remainingH + diff; 507 imgW = imgH * ratio; 508 509 if (contW > imgW) { 510 imgW = contW; 511 imgH = imgW / ratio; 512 } 513 514 path.data("resized-imgW", imgW); 515 path.data("resized-imgH", imgH); 516 517 path.css( 518 "background-size", 519 imgW + "px " + imgH + "px" 520 ); 521 }); 522 } 523 524 $(window).resize(backgroundResize); 525 $(window).focus(backgroundResize); 526 527 backgroundResize(); 528 529 function parallaxPosition(e) { 530 531 var heightWindow = $(window).height(); 532 var topWindow = $(window).scrollTop(); 533 var bottomWindow = topWindow + heightWindow; 534 var currentWindow = 535 (topWindow + bottomWindow) / 2; 536 537 $(".parallax").each(function(i) { 538 539 var path = $(this); 540 var height = path.height(); 541 var top = path.offset().top; 542 var bottom = top + height; 543 544 if ( 545 bottomWindow > top && 546 topWindow < bottom 547 ) { 548 549 var imgH = path.data("resized-imgH"); 550 var min = 0; 551 var max = -imgH + heightWindow; 552 553 var overflowH = 554 height < heightWindow 555 ? imgH - height 556 : imgH - heightWindow; 557 558 top = top - overflowH; 559 bottom = bottom + overflowH; 560 561 var value = 0; 562 563 if ($('.parallax').is(".titlebar")) { 564 565 value = 566 min + 567 (max - min) * 568 (currentWindow - top) / 569 (bottom - top) * 570 2; 571 572 } else { 573 574 value = 575 min + 576 (max - min) * 577 (currentWindow - top) / 578 (bottom - top); 579 } 580 581 var orizontalPosition = 582 path.attr("data-oriz-pos"); 583 584 orizontalPosition = 585 orizontalPosition 586 ? orizontalPosition 587 : "50%"; 588 589 $(this).css( 590 "background-position", 591 orizontalPosition + 592 " " + 593 value + 594 "px" 595 ); 596 } 597 }); 598 } 599 600 if (!$("html").hasClass("touch")) { 601 602 $(window).resize(parallaxPosition); 603 $(window).scroll(parallaxPosition); 604 605 parallaxPosition(); 606 } 607 608 if (navigator.userAgent.match(/Trident\/7\./)) { 609 610 $('body').on("mousewheel", function() { 611 612 event.preventDefault(); 613 614 var wheelDelta = event.wheelDelta; 615 var currentScrollPosition = 616 window.pageYOffset; 617 618 window.scrollTo( 619 0, 620 currentScrollPosition - wheelDelta 621 ); 622 }); 623 } 624 625 var config = { 626 627 '.utf_chosen_select': { 628 disable_search_threshold: 10, 629 width: "100%" 630 }, 631 632 '.utf_chosen_select-deselect': { 633 allow_single_deselect: true, 634 width: "100%" 635 }, 636 637 '.utf_chosen_select_single': { 638 disable_search_threshold: 100, 639 width: "100%" 640 }, 641 642 '.utf_chosen_select_single.no-search': { 643 disable_search_threshold: 10, 644 width: "100%" 645 }, 646 647 '.utf_chosen_select-no-results': { 648 no_results_text: 'Oops, nothing found!' 649 }, 650 651 '.utf_chosen_select-width': { 652 width: "95%" 653 } 654 }; 655 656 for (var selector in config) { 657 658 if (config.hasOwnProperty(selector)) { 659 $(selector).chosen(config[selector]); 660 } 661 } 662 663 $("#area-range").each(function() { 664 665 var dataMin = $(this).attr('data-min'); 666 var dataMax = $(this).attr('data-max'); 667 var dataUnit = $(this).attr('data-unit'); 668 669 $(this).append( 670 "<input type='text' class='first-slider-value'disabled/>" + 671 "<input type='text' class='second-slider-value' disabled/>" 672 ); 673 674 $(this).slider({ 675 676 range: true, 677 min: dataMin, 678 max: dataMax, 679 step: 10, 680 values: [dataMin, dataMax], 681 682 slide: function(event, ui) { 683 684 event = event; 685 686 $(this) 687 .children(".first-slider-value") 688 .val( 689 ui.values[0] + 690 " " + 691 dataUnit 692 ); 693 694 $(this) 695 .children(".second-slider-value") 696 .val( 697 ui.values[1] + 698 " " + 699 dataUnit 700 ); 701 } 702 }); 703 704 $(this) 705 .children(".first-slider-value") 706 .val( 707 $(this).slider("values", 0) + 708 " " + 709 dataUnit 710 ); 711 712 $(this) 713 .children(".second-slider-value") 714 .val( 715 $(this).slider("values", 1) + 716 " " + 717 dataUnit 718 ); 719 }); 720 721 $('.utf_gallery_container').each(function() { 722 723 $(this).magnificPopup({ 724 725 type: 'image', 726 delegate: 'a.utf_gallery', 727 fixedContentPos: true, 728 fixedBgPos: true, 729 overflowY: 'auto', 730 closeBtnInside: false, 731 preloader: true, 732 removalDelay: 0, 733 mainClass: 'mfp-fade', 734 735 gallery: { 736 enabled: true, 737 tCounter: '' 738 } 739 }); 740 }); 741 742 /*
743 * ESki popup init kaldırıldı. 744 * Popup artık dosyanın en baÅında delegated olarak açılıyor. 745 */ 746 747 $('.mfp-image').magnificPopup({ 748 type: 'image', 749 closeOnContentClick: true, 750 mainClass: 'mfp-fade', 751 752 image: { 753 verticalFit: true 754 } 755 }); 756 757 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 758 disableOn: 700, 759 type: 'iframe', 760 mainClass: 'mfp-fade', 761 removalDelay: 160, 762 preloader: false, 763 fixedContentPos: false 764 }); 765 766 $('.fullwidth_block-slick-carousel').slick({ 767 centerMode: true, 768 centerPadding: '15%', 769 slidesToShow: 3, 770 dots: true, 771 arrows: false, 772 773 responsive: [{ 774 breakpoint: 1441, 775 settings: { 776 centerPadding: '10%', 777 slidesToShow: 3 778 } 779 }, { 780 breakpoint: 1025, 781 settings: { 782 centerPadding: '10px', 783 slidesToShow: 2 784 } 785 }, { 786 breakpoint: 767, 787 settings: { 788 centerPadding: '10px', 789 slidesToShow: 1 790 } 791 }] 792 }); 793 794 $(".time-slot").each(function() { 795 796 var timeSlot = $(this); 797 798 $(this) 799 .find('input') 800 .on('change', function() { 801 802 var timeSlotVal = 803 timeSlot.find('strong').text(); 804 805 $('.panel-dropdown.time-slots-dropdown a') 806 .html(timeSlotVal); 807 808 $('.panel-dropdown') 809 .removeClass('active'); 810 }); 811 }); 812 813 $('.utf_testimonial_carousel').slick({ 814 centerMode: true, 815 centerPadding: '23%', 816 slidesToShow: 1, 817 dots: true, 818 arrows: false, 819 820 responsive: [{ 821 breakpoint: 1025, 822 settings: { 823 centerPadding: '10px', 824 slidesToShow: 2 825 } 826 }, { 827 breakpoint: 767, 828 settings: { 829 centerPadding: '10px', 830 slidesToShow: 1 831 } 832 }] 833 }); 834 835 $('.utf_listing_slider').slick({ 836 centerMode: true, 837 centerPadding: '20%', 838 slidesToShow: 1, 839 840 responsive: [{ 841 breakpoint: 1367, 842 settings: { 843 centerPadding: '15%' 844 } 845 }, { 846 breakpoint: 1025, 847 settings: { 848 centerPadding: '0' 849 } 850 }, { 851 breakpoint: 767, 852 settings: { 853 centerPadding: '0', 854 slidesToShow: 1 855 } 856 }] 857 }); 858 859 $('.simple-slick-carousel').slick({ 860 infinite: true, 861 slidesToShow: 3, 862 slidesToScroll: 3, 863 dots: true, 864 arrows: true, 865 866 responsive: [{ 867 breakpoint: 992, 868 settings: { 869 slidesToShow: 2, 870 slidesToScroll: 2 871 } 872 }, { 873 breakpoint: 769, 874 settings: { 875 slidesToShow: 1, 876 slidesToScroll: 1 877 } 878 }] 879 }); 880 881 $('.companie-logo-slick-carousel').slick({ 882 infinite: true, 883 slidesToShow: 5, 884 slidesToScroll: 1, 885 dots: true, 886 arrows: true, 887 888 responsive: [{ 889 breakpoint: 992, 890 settings: { 891 slidesToShow: 3, 892 slidesToScroll: 1 893 } 894 }, { 895 breakpoint: 767, 896 settings: { 897 slidesToShow: 2, 898 slidesToScroll: 1 899 } 900 }, { 901 breakpoint: 479, 902 settings: { 903 slidesToShow: 1, 904 slidesToScroll: 1 905 } 906 }] 907 }); 908 909 $('.simple_slick_carousel_block').slick({ 910 infinite: true, 911 slidesToShow: 3, 912 slidesToScroll: 1, 913 dots: true,
914 arrows: false, 915 916 responsive: [{ 917 breakpoint: 1720, 918 settings: { 919 slidesToShow: 3 920 } 921 }, { 922 breakpoint: 1365, 923 settings: { 924 slidesToShow: 3 925 } 926 }, { 927 breakpoint: 1024, 928 settings: { 929 slidesToShow: 2 930 } 931 }, { 932 breakpoint: 768, 933 settings: { 934 slidesToShow: 1 935 } 936 }] 937 }); 938 939 var $tabsNav = $('.utf_tabs_nav'), 940 $tabsNavLis = $tabsNav.children('li'); 941 942 $tabsNav.each(function() { 943 944 var $this = $(this); 945 946 $this 947 .next() 948 .children('.tab_content') 949 .stop(true, true) 950 .hide() 951 .first() 952 .show(); 953 954 $this 955 .children('li') 956 .first() 957 .addClass('active') 958 .stop(true, true) 959 .show(); 960 }); 961 962 $tabsNavLis.on('click', function(e) { 963 964 var $this = $(this); 965 966 $this 967 .siblings() 968 .removeClass('active') 969 .end() 970 .addClass('active'); 971 972 $this 973 .parent() 974 .next() 975 .children('.tab_content') 976 .stop(true, true) 977 .hide() 978 .siblings( 979 $this.find('a').attr('href') 980 ) 981 .fadeIn(); 982 983 e.preventDefault(); 984 }); 985 986 var hash = window.location.hash; 987 988 var anchor = 989 $('.utf_tabs_nav a[href="' + hash + '"]'); 990 991 if (anchor.length === 0) { 992 993 $(".utf_tabs_nav li:first") 994 .addClass("active") 995 .show(); 996 997 $(".tab_content:first").show(); 998 999 } else { 1000 1001 anchor.parent('li').click(); 1002 } 1003 1004 var $accor = $('.accordion'); 1005 1006 $accor.each(function() { 1007 1008 $(this).toggleClass( 1009 'ui-accordion ui-widget ui-helper-reset' 1010 ); 1011 1012 $(this) 1013 .find('h3') 1014 .addClass( 1015 'ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all' 1016 ); 1017 1018 $(this) 1019 .find('div') 1020 .addClass( 1021 'ui-accordion-content ui-helper-reset ui-utf_widget_content ui-corner-bottom' 1022 ); 1023 1024 $(this).find("div").hide(); 1025 }); 1026 1027 $(".toggle-container").hide(); 1028 1029 $('.trigger, .trigger.opened').on('click', function(a) { 1030 $(this).toggleClass('active'); 1031 a.preventDefault(); 1032 }); 1033 1034 $(".trigger").on('click', function() { 1035 $(this).next(".toggle-container").slideToggle(300); 1036 }); 1037 1038 $(".trigger.opened") 1039 .addClass("active") 1040 .next(".toggle-container") 1041 .show(); 1042 1043 $(".tooltip.top").tipTip({ 1044 defaultPosition: "top" 1045 }); 1046 1047 $(".tooltip.bottom").tipTip({ 1048 defaultPosition: "bottom" 1049 }); 1050 1051 $(".tooltip.left").tipTip({ 1052 defaultPosition: "left" 1053 }); 1054 1055 $(".tooltip.right").tipTip({ 1056 defaultPosition: "right" 1057 }); 1058 1059 $('.like-icon, .widget-button, .like-button').on('click', function(e) { 1060 1061 e.preventDefault(); 1062 1063 $(this).toggleClass('liked'); 1064 1065 $(this) 1066 .children('.like-icon') 1067 .toggleClass('liked'); 1068 }); 1069 1070 $('.more-search-options-trigger').on('click', function(e) { 1071 1072 e.preventDefault(); 1073 1074 $('.more-search-options, .more-search-options-trigger') 1075 .toggleClass('active'); 1076 1077 $('.more-search-options.relative') 1078 .animate({ 1079 height: 'toggle', 1080 opacity: 'toggle' 1081 }, 300); 1082 }); 1083 1084 $(window).on('load resize', function() { 1085 1086 var winWidth = $(window).width(); 1087 var headerHeight = $("#header_part").height(); 1088 1089 $('.fs-inner-container, .fs-inner-container.map-fixed, #dashboard'); 1090 1091 if (winWidth < 992) { 1092 1093 $('.fs-inner-container.map-fixed') 1094 .insertBefore('.fs-inner-container.content'); 1095 1096 } else { 1097 1098 $('.fs-inner-container.content') 1099 .insertBefore('.fs-inner-container.map-fixed'); 1100 } 1101 }); 1102 1103 $('.utf_leave_rating input').change(function() { 1104 1105 var $radio = $(this); 1106 1107 $('.utf_leave_rating .selected') 1108 .removeClass('selected'); 1109 1110 $radio 1111 .closest('label') 1112 .addClass('selected'); 1113 }); 1114 1115 $('.utf_dashboard_navigation ul li a').on('click', function() { 1116 1117 if ($(this).closest('li').has('ul').length) { 1118 $(this) 1119 .parent('li') 1120 .toggleClass('active'); 1121 } 1122 }); 1123 1124 $(window).on('load resize', function() { 1125 1126 var main_wrapperHeight = window.innerHeight; 1127 var headerHeight = $("#header_part").height(); 1128 var winWidth = $(window).width(); 1129 1130 if (winWidth > 992) { 1131 1132 $(".utf_dashboard_navigation_inner_block") 1133 .css( 1134 'max-height', 1135 main_wrapperHeight - headerHeight 1136 ); 1137 1138 } else { 1139 1140 $(".utf_dashboard_navigation_inner_block") 1141 .css('max-height', ''); 1142 } 1143 }); 1144 1145 $(".tip").each(function() { 1146 1147 var tipContent = $(this).attr('data-tip-content'); 1148 1149 $(this).append( 1150 '<div class="tip-content">' + 1151 tipContent + 1152 '</div>' 1153 ); 1154 }); 1155 1156 $(".verified-badge.with-tip").each(function() { 1157 1158 var tipContent = 1159 $(this).attr('data-tip-content'); 1160 1161 $(this).append( 1162 '<div class="tip-content">' + 1163 tipContent + 1164 '</div>' 1165 ); 1166 }); 1167 1168 $(window).on('load resize', function() { 1169 1170 var verifiedBadge = 1171 $('.verified-badge.with-tip'); 1172 1173 verifiedBadge.find('.tip-content').css({ 1174 'width': verifiedBadge.outerWidth(), 1175 'max-width': verifiedBadge.outerWidth() 1176 }); 1177 }); 1178 1179 $(".add_utf_listing_section").each(function() { 1180 1181 var switcherSection = $(this);
1182 var switcherInput = 1183 $(this).find('.switch input'); 1184 1185 if (switcherInput.is(':checked')) { 1186 $(switcherSection).addClass('switcher-on'); 1187 } 1188 1189 switcherInput.change(function() { 1190 1191 if (this.checked === true) { 1192 $(switcherSection) 1193 .addClass('switcher-on'); 1194 } else { 1195 $(switcherSection) 1196 .removeClass('switcher-on'); 1197 } 1198 }); 1199 }); 1200 1201 $('.utf_dashboard_nav_responsive').on('click', function(e) { 1202 1203 e.preventDefault(); 1204 1205 $(this).toggleClass('active'); 1206 1207 var dashboardNavContainer = 1208 $('body').find( 1209 ".utf_dashboard_navigation" 1210 ); 1211 1212 if ($(this).hasClass('active')) { 1213 1214 $(dashboardNavContainer) 1215 .addClass('active'); 1216 1217 } else { 1218 1219 $(dashboardNavContainer) 1220 .removeClass('active'); 1221 } 1222 }); 1223 1224 function newMenuItem() { 1225 1226 var newElem = 1227 $('tr.pricing-list-item.pattern') 1228 .first() 1229 .clone(); 1230 1231 newElem.find('input').val(''); 1232 1233 newElem.appendTo( 1234 'table#utf_pricing_list_section' 1235 ); 1236 } 1237 1238 if ($("table#utf_pricing_list_section").is('*')) { 1239 1240 $('.add-pricing-list-item').on('click', function(e) { 1241 1242 e.preventDefault(); 1243 1244 newMenuItem(); 1245 }); 1246 1247 $(document) 1248 .on( 1249 "click", 1250 "#utf_pricing_list_section .delete", 1251 function(e) { 1252 1253 e.preventDefault(); 1254 1255 $(this) 1256 .parent() 1257 .parent() 1258 .remove(); 1259 } 1260 ); 1261 1262 $('.add-pricing-submenu').on('click', function(e) { 1263 1264 e.preventDefault(); 1265 1266 var newElem = $( 1267 '' + 1268 '<tr class="pricing-list-item pricing-submenu">' + 1269 '<td>' + 1270 '<div class="fm-move">' + 1271 '<i class="sl sl-icon-cursor-move"></i>' + 1272 '</div>' + 1273 '<div class="fm-input">' + 1274 '<input type="text" placeholder="Category Title" />' + 1275 '</div>' + 1276 '<div class="fm-close">' + 1277 '<a class="delete" href="#">' + 1278 '<i class="fa fa-remove"></i>' + 1279 '</a>' + 1280 '</div>' + 1281 '</td>' + 1282 '</tr>' 1283 ); 1284 1285 newElem.appendTo( 1286 'table#utf_pricing_list_section' 1287 ); 1288 }); 1289 1290 $('table#utf_pricing_list_section tbody').sortable({ 1291 forcePlaceholderSize: true, 1292 forceHelperSize: false, 1293 placeholder: 'sortableHelper', 1294 zIndex: 999990, 1295 opacity: 0.6, 1296 tolerance: "pointer", 1297 1298 start: function(e, ui) { 1299 1300 ui.placeholder.height( 1301 ui.helper.outerHeight() 1302 ); 1303 } 1304 }); 1305 } 1306 1307 var fieldUnit = 1308 $('.pricing-price') 1309 .children('input') 1310 .attr('data-unit'); 1311 1312 $('.pricing-price') 1313 .children('input') 1314 .before( 1315 '<i class="data-unit">' + 1316 fieldUnit + 1317 '</i>' 1318 ); 1319 1320 $("a.close") 1321 .removeAttr("href") 1322 .on('click', function() { 1323 1324 function slideFade(elem) { 1325 1326 var fadeOut = { 1327 opacity: 0, 1328 transition: 'opacity 0.5s' 1329 }; 1330 1331 elem 1332 .css(fadeOut) 1333 .slideUp(); 1334 } 1335 1336 slideFade($(this).parent()); 1337 }); 1338 1339 function close_panel_dropdown() { 1340 1341 $('.utf_panel_dropdown') 1342 .removeClass("active"); 1343 1344 $('.fs-inner-container.content') 1345 .removeClass("faded-out"); 1346 } 1347 1348 $('.utf_panel_dropdown a').on('click', function(e) { 1349 1350 if ($(this).parent().is(".active")) { 1351 1352 close_panel_dropdown(); 1353 1354 } else { 1355 1356 close_panel_dropdown(); 1357 1358 $(this) 1359 .parent() 1360 .addClass('active'); 1361 1362 $('.fs-inner-container.content') 1363 .addClass("faded-out"); 1364 } 1365 1366 e.preventDefault(); 1367 }); 1368 1369 $('.panel-buttons button').on('click', function(e) { 1370 1371 $('.utf_panel_dropdown') 1372 .removeClass('active'); 1373 1374 $('.fs-inner-container.content') 1375 .removeClass('faded-out'); 1376 }); 1377 1378 var mouse_is_inside = false; 1379 1380 $('.utf_panel_dropdown').hover( 1381 function() { 1382 mouse_is_inside = true; 1383 }, 1384 function() { 1385 mouse_is_inside = false; 1386 } 1387 ); 1388 1389 $("body").mouseup(function() { 1390 1391 if (!mouse_is_inside) { 1392 close_panel_dropdown(); 1393 } 1394 }); 1395 1396 $('.checkboxes.categories input').on('change', function() { 1397 1398 if ($(this).hasClass('all')) { 1399 1400 $(this) 1401 .parents('.checkboxes') 1402 .find('input') 1403 .prop('checked', false); 1404 1405 $(this).prop('checked', true); 1406 1407 } else { 1408 1409 $('.checkboxes input.all') 1410 .prop('checked', false); 1411 } 1412 }); 1413 1414 $('input[type="range"].distance-radius').rangeslider({ 1415 1416 polyfill: false, 1417 1418 onInit: function() { 1419 1420 this.output = 1421 $('<div class="utf_range_output" />') 1422 .insertBefore(this.$range) 1423 .html(this.$element.val()); 1424 1425 var radiustext = 1426 $('.distance-radius').attr('data-title'); 1427 1428 $('.utf_range_output') 1429 .after( 1430 '<i class="data-radius-title">' + 1431 radiustext + 1432 '</i>' 1433 ); 1434 }, 1435 1436 onSlide: function(position, value) { 1437 this.output.html(value); 1438 } 1439 }); 1440 1441 $('.show-more-button').on('click', function(e) { 1442 1443 e.preventDefault(); 1444 1445 $(this).toggleClass('active'); 1446 1447 $('.show-more').toggleClass('visible'); 1448 1449 if ($('.show-more').is(".visible")) { 1450 1451 var el = $('.show-more'); 1452 1453 var curHeight = el.height(); 1454 1455 var autoHeight = 1456 el.css('height', 'auto').height(); 1457 1458 el.height(curHeight).animate({ 1459 height: autoHeight 1460 }, 400); 1461 1462 } else { 1463 1464 $('.show-more').animate({ 1465 height: '370px' 1466 }, 400); 1467 } 1468 }); 1469 1470 $(window).on('load resize', function() { 1471 1472 var containerWidth = $(".container").width(); 1473 1474 $('.listing-nav-container.cloned .listing-nav') 1475 .css( 1476 'width', 1477 containerWidth 1478 ); 1479 }); 1480 1481 if (document.getElementById("listing-nav") !== null) { 1482 1483 $(window).scroll(function() { 1484 1485 var window_top = $(window).scrollTop(); 1486 1487 var div_top = 1488 $('.listing-nav') 1489 .not( 1490 '.listing-nav-container.cloned .listing-nav' 1491 ) 1492 .offset() 1493 .top + 90; 1494 1495 if (window_top > div_top) { 1496 1497 $('.listing-nav-container.cloned') 1498 .addClass('stick'); 1499 1500 } else { 1501 1502 $('.listing-nav-container.cloned') 1503 .removeClass('stick'); 1504 } 1505 }); 1506 } 1507 1508 $(".listing-nav-container") 1509 .clone(true) 1510 .addClass('cloned') 1511 .prependTo("body"); 1512
1513 $('.listing-nav a, a.listing-address, .utf_star_rating_section a') 1514 .on('click', function(e) { 1515 1516 e.preventDefault(); 1517 1518 $('html,body').scrollTo( 1519 this.hash, 1520 this.hash, 1521 { 1522 gap: { 1523 y: -20 1524 } 1525 } 1526 ); 1527 }); 1528 1529 $(".listing-nav li:first-child a, a.utf_add_review-btn, a[href='#utf_add_review']") 1530 .on('click', function(e) { 1531 1532 e.preventDefault(); 1533 1534 $('html,body').scrollTo( 1535 this.hash, 1536 this.hash, 1537 { 1538 gap: { 1539 y: -100 1540 } 1541 } 1542 ); 1543 }); 1544 1545 $(window).on('load resize', function() { 1546 1547 var aChildren = 1548 $(".listing-nav li").children(); 1549 1550 var aArray = []; 1551 1552 for (var i = 0; i < aChildren.length; i++) { 1553 1554 var aChild = aChildren[i]; 1555 1556 var ahref = 1557 $(aChild).attr('href'); 1558 1559 aArray.push(ahref); 1560 } 1561 1562 $(window).scroll(function() { 1563 1564 var windowPos = 1565 $(window).scrollTop(); 1566 1567 for (var i = 0; i < aArray.length; i++) { 1568 1569 var theID = aArray[i]; 1570 1571 var divPos = 1572 $(theID) 1573 .offset() 1574 .top - 150; 1575 1576 var divHeight = 1577 $(theID).height(); 1578 1579 if ( 1580 windowPos >= divPos && 1581 windowPos < (divPos + divHeight) 1582 ) { 1583 1584 $("a[href='" + theID + "']") 1585 .addClass("active"); 1586 1587 } else { 1588 1589 $("a[href='" + theID + "']") 1590 .removeClass("active"); 1591 } 1592 } 1593 }); 1594 }); 1595 1596 $('.utf_progress_button').each(function() { 1597 1598 $(this).append( 1599 '<div class="progress-bar"></div>' 1600 ); 1601 1602 $(this).on('click', function() { 1603 1604 var progressButton = $(this); 1605 1606 progressButton 1607 .children('.progress-bar') 1608 .addClass('active'); 1609 1610 setTimeout(function() { 1611 1612 progressButton 1613 .children('.progress-bar') 1614 .removeClass('active'); 1615 1616 }, 1500); 1617 1618 setTimeout(function() { 1619 1620 progressButton 1621 .children('.progress-bar') 1622 .removeClass('active'); 1623 1624 }, 1500); 1625 1626 setTimeout(function() { 1627 1628 progressButton 1629 .addClass('done'); 1630 1631 }, 1800); 1632 1633 setTimeout(function() { 1634 1635 progressButton 1636 .removeClass('done'); 1637 1638 }, 3500); 1639 }); 1640 }); 1641 1642 var shake = "No"; 1643 1644 $('#message').hide(); 1645 1646 $('#contact input[type=text], #contact input[type=number], #contact input[type=email], #contact input[type=url], #contact input[type=tel], #contact select, #contact textarea') 1647 .each(function() {}); 1648 1649 $('#name, #comments, #subject').focusout(function() { 1650 1651 if (!$(this).val()) { 1652 1653 $(this) 1654 .addClass('error') 1655 .parent() 1656 .find('mark') 1657 .removeClass('valid') 1658 .addClass('error'); 1659 1660 } else { 1661 1662 $(this) 1663 .removeClass('error') 1664 .parent() 1665 .find('mark') 1666 .removeClass('error') 1667 .addClass('valid'); 1668 } 1669 1670 $('#submit') 1671 .prop('disabled', false) 1672 .removeClass('disabled'); 1673 }); 1674 1675 $('#email').focusout(function() { 1676 1677 if ( 1678 !$(this).val() || 1679 !isEmail($(this).val()) 1680 ) { 1681 1682 $(this) 1683 .addClass('error') 1684 .parent() 1685 .find('mark') 1686 .removeClass('valid') 1687 .addClass('error'); 1688 1689 } else { 1690 1691 $(this) 1692 .removeClass('error') 1693 .parent() 1694 .find('mark') 1695 .removeClass('error') 1696 .addClass('valid'); 1697 } 1698 }); 1699 1700 $('#email').focusin(function() { 1701 1702 $('#submit') 1703 .prop('disabled', false) 1704 .removeClass('disabled'); 1705 }); 1706 1707 $('#submit').on('click', function() { 1708 1709 $("#contact-message") 1710 .slideUp(200, function() { 1711 1712 $('#contact-message').hide(); 1713 1714 $('#name, #subject, #phone, #comments, #website, #email') 1715 .triggerHandler("focusout"); 1716 1717 if ($('#contact mark.error').size() > 0) { 1718 1719 if (shake == "Yes") { 1720 1721 $('#contact').effect( 1722 'shake', 1723 { 1724 times: 2 1725 }, 1726 75, 1727 function() { 1728 1729 $('#contact input.error:first, #contact textarea.error:first') 1730 .focus(); 1731 } 1732 ); 1733 1734 } else { 1735 1736 $('#contact input.error:first, #contact textarea.error:first') 1737 .focus(); 1738 } 1739 1740 return false; 1741 } 1742 }); 1743 }); 1744 1745 $('#contactform').submit(function() { 1746 1747 if ($('#contact mark.error').size() > 0) { 1748 1749 if (shake == "Yes") { 1750 1751 $('#contact').effect( 1752 'shake', 1753 { 1754 times: 2 1755 }, 1756 75 1757 ); 1758 } 1759 1760 return false; 1761 } 1762 1763 var action = 1764 $(this).attr('action'); 1765 1766 $('#contact #submit') 1767 .after( 1768 '<img src="images/loader.gif" class="loader" />' 1769 ); 1770 1771 $('#submit') 1772 .prop('disabled', true) 1773 .addClass('disabled'); 1774 1775 $.post( 1776 action, 1777 $('#contactform').serialize(), 1778 function(data) { 1779 1780 $('#contact-message') 1781 .html(data) 1782 .slideDown(); 1783 1784 $('#contactform img.loader') 1785 .fadeOut( 1786 'slow', 1787 function() { 1788 $(this).remove(); 1789 } 1790 ); 1791 1792 if ( 1793 data.match('success') !== null 1794 ) { 1795 $('#contactform').slideUp('slow'); 1796 } 1797 } 1798 ); 1799 1800 return false; 1801 }); 1802 1803 function isEmail(emailAddress) { 1804 1805 var pattern = new RegExp( 1806 /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i 1807 ); 1808 1809 return pattern.test(emailAddress); 1810 } 1811 1812 });
1813 1814})(this.jQuery); 1815 1816 1817$.scrollTo = $.fn.scrollTo = function(x, y, options) { 1818 1819 if (!(this instanceof $)) { 1820 return $.fn.scrollTo.apply( 1821 $('html, body'), 1822 arguments 1823 ); 1824 } 1825 1826 options = $.extend({}, { 1827 gap: { 1828 x: 0, 1829 y: 0 1830 }, 1831 animation: { 1832 easing: 'swing', 1833 duration: 600, 1834 complete: $.noop, 1835 step: $.noop 1836 } 1837 }, options); 1838 1839 return this.each(function() { 1840 1841 var elem = $(this); 1842 1843 elem.stop().animate({ 1844 1845 scrollLeft: 1846 !isNaN(Number(x)) 1847 ? x 1848 : $(y).offset().left + options.gap.x, 1849 1850 scrollTop: 1851 !isNaN(Number(y)) 1852 ? y 1853 : $(y).offset().top + options.gap.y 1854 1855 }, options.animation); 1856 }); 1857}; 1858 1859 1860function numericalRating(ratingElem) { 1861 1862 $(ratingElem).each(function() { 1863 1864 var dataRating = 1865 $(this).attr('data-rating'); 1866 1867 if (dataRating >= 4.0) { 1868 1869 $(this).addClass('high'); 1870 1871 } else if (dataRating >= 3.0) { 1872 1873 $(this).addClass('mid'); 1874 1875 } else if (dataRating < 3.0) { 1876 1877 $(this).addClass('low'); 1878 } 1879 }); 1880} 1881 1882numericalRating('.numerical-rating'); 1883 1884 1885function starRating(ratingElem) { 1886 1887 $(ratingElem).each(function() { 1888 1889 var dataRating = 1890 $(this).attr('data-rating'); 1891 1892 function starsOutput( 1893 firstStar, 1894 secondStar, 1895 thirdStar, 1896 fourthStar, 1897 fifthStar 1898 ) { 1899 1900 return ( 1901 '' + 1902 '<span class="' + firstStar + '"></span>' + 1903 '<span class="' + secondStar + '"></span>' + 1904 '<span class="' + thirdStar + '"></span>' + 1905 '<span class="' + fourthStar + '"></span>' + 1906 '<span class="' + fifthStar + '"></span>' 1907 ); 1908 } 1909 1910 var fiveStars = 1911 starsOutput( 1912 'star', 1913 'star', 1914 'star', 1915 'star', 1916 'star' 1917 ); 1918 1919 var fourHalfStars = 1920 starsOutput( 1921 'star', 1922 'star', 1923 'star', 1924 'star', 1925 'star half' 1926 ); 1927 1928 var fourStars = 1929 starsOutput( 1930 'star', 1931 'star', 1932 'star', 1933 'star', 1934 'star empty' 1935 ); 1936 1937 var threeHalfStars = 1938 starsOutput( 1939 'star', 1940 'star', 1941 'star', 1942 'star half', 1943 'star empty' 1944 ); 1945 1946 var threeStars = 1947 starsOutput( 1948 'star', 1949 'star', 1950 'star', 1951 'star empty', 1952 'star empty' 1953 ); 1954 1955 var twoHalfStars = 1956 starsOutput( 1957 'star', 1958 'star', 1959 'star half', 1960 'star empty', 1961 'star empty' 1962 ); 1963 1964 var twoStars = 1965 starsOutput( 1966 'star', 1967 'star', 1968 'star empty', 1969 'star empty', 1970 'star empty' 1971 ); 1972 1973 var oneHalfStar = 1974 starsOutput( 1975 'star', 1976 'star half', 1977 'star empty', 1978 'star empty', 1979 'star empty' 1980 ); 1981 1982 var oneStar = 1983 starsOutput( 1984 'star', 1985 'star empty', 1986 'star empty', 1987 'star empty', 1988 'star empty' 1989 ); 1990 1991 if (dataRating >= 4.75) { 1992 1993 $(this).append(fiveStars); 1994 1995 } else if (dataRating >= 4.25) { 1996 1997 $(this).append(fourHalfStars); 1998 1999 } else if (dataRating >= 3.75) { 2000 2001 $(this).append(fourStars); 2002 2003 } else if (dataRating >= 3.25) { 2004 2005 $(this).append(threeHalfStars); 2006 2007 } else if (dataRating >= 2.75) { 2008 2009 $(this).append(threeStars); 2010 2011 } else if (dataRating >= 2.25) { 2012 2013 $(this).append(twoHalfStars); 2014 2015 } else if (dataRating >= 1.75) { 2016 2017 $(this).append(twoStars); 2018 2019 } else if (dataRating >= 1.25) { 2020 2021 $(this).append(oneHalfStar); 2022 2023 } else if (dataRating < 1.25) { 2024 2025 $(this).append(oneStar); 2026 } 2027 });
2028} 2029 2030starRating('.utf_star_rating_section');
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.