1jQuery.noConflict()(function($) { 2 3 "use strict"; 4 5 var offset = '90%', 6 $window = $( window ), 7 $doc = $(document), 8 linden_preloader = $('.art-preloader-holder'), 9 self = this, 10 $body = $('body'), 11 page_preloader = $body.data('page-preloader'), 12 hamburgerButton = $('.hamburger--collapse-r'), 13 TweenMax = window.TweenMax, 14 TweenLite = window.TweenLite, 15 fl_theme = window.fl_theme || {}; 16 17 fl_theme.window = $(window); 18 fl_theme.document = $(document); 19 window.fl_theme = fl_theme; 20 fl_theme.window = $(window); 21 fl_theme.sameOrigin = true; 22 23 24 25 // Loader 26 function artFadeInLogo() { 27 $(".art-preloader-holder img.art-logo-img").fadeIn(800); 28 setTimeout(function(){ 29 $(".art-preloader-holder").fadeOut(400); 30 }, 800); 31 } 32 33 if (!$.cookie('smartCookies')) { 34 setTimeout(artFadeInLogo, 200); 35 36 $.cookie('smartCookies', true, { 37 expires: 1, 38 path: '/' 39 }); 40 } else { 41 $( document ).ready(function() { 42 $(".art-preloader-holder").fadeOut(400); 43 }); 44 } 45 46 fl_theme.initSiteLoader = function() { 47 $("a").on('click', function(event) { 48 let linden_link_ref = $(this).attr('href'); 49 50 if( linden_link_ref !== undefined && linden_link_ref[0] != '#' ) { 51 if(linden_link_ref.indexOf(window.location.href) +1) { 52 53 } else { 54 55 let linden_omg_format = linden_link_ref.substr(linden_link_ref.length - 3); // get image format 56 if(linden_link_ref.indexOf(document.location.host) +1 && (linden_omg_format !== 'png' && linden_omg_format !== 'jpg')) { 57 $(".art-preloader-holder").fadeIn(400); 58 } 59 60 } 61 } 62 }); 63 }; 64 65 66 // blog category dropdown 67 $(document).mouseup(function(e) { 68 let container = $(".art-categories-dropdown"); 69 70 if (!container.is(e.target) && container.has(e.target).length === 0) 71 { 72 container.removeClass('art-cat-open'); 73 } 74 }); 75 76 $('.art-categories-dropdown').on('click', function () { 77 $(this).toggleClass('art-cat-open'); 78 }) 79 80 81// Stiky Header 82 fl_theme.initStikyHeader = function(){ 83 const $header = $('.art-header'), 84 headerHeight = $header.height(), 85 $headerMiddle = $header.find( '.art-header-middle' ); 86 87 let headerMiddleColorScheme = ''; 88 89 if ( $headerMiddle.hasClass( 'art-color-scheme-second' ) ) { 90 headerMiddleColorScheme = 'art-color-scheme-second'; 91 } 92 93 $headerMiddle.on( 'mouseenter', function (e) { 94 if ( $header.hasClass('art-sticky') ) { 95 return; 96 } 97 98 if ( $( e.target ).closest( '.info_block_hamburger' ).length ) { 99 return; 100 } 101 102 const item = this; 103 104 setTimeout(function () { 105 $( item ).removeClass( 'art-color-scheme-second' ); 106 }, 1 ); 107 } ); 108 109 $headerMiddle.on( 'mouseleave', function (e) { 110 if ( $header.hasClass('art-sticky') ) { 111 return; 112 } 113 114 const item = this; 115 116 setTimeout(function () { 117 $( item ).addClass( headerMiddleColorScheme ); 118 }, 1 ); 119 } ); 120 121 $window.on( 'scroll', function() { 122 if ( $window.scrollTop() > headerHeight ) { 123 $header.addClass('art-sticky-hide'); 124 } else { 125 $header.removeClass('art-sticky-hide'); 126 } 127 128 if ( $window.scrollTop() > ( headerHeight * 3 ) ) { 129 $header.addClass('art-sticky'); 130 $headerMiddle.removeClass( 'art-color-scheme-second' ); 131 } else { 132 $header.removeClass('art-sticky'); 133 $headerMiddle.addClass( headerMiddleColorScheme ); 134 } 135 136 if ( $window.scrollTop() > ( headerHeight * 4 ) ) { 137 $header.addClass('art-sticky-show'); 138 } else { 139 $header.removeClass('art-sticky-show'); 140 } 141 } ); 142 }; 143 144 145 // Authorization 146 fl_theme.authorization_modal_handler = function() { 147 let authorization_toggle = $('.authorization-toggle'); 148 149 if (authorization_toggle.length > 0 && !authorization_toggle.hasClass('authorized')) { 150 151 let auth_popup = $('.authorization-popup-overlay'), 152 form_wrapper = auth_popup.find('.form-wrapper'), 153 close_button = auth_popup.find('.close-button'), 154 registration_handler = () => { 155 156 let form = $('.registration-form'), 157 reg_alert = form.find('.reg-alert'); 158 159 form.find('button').on('click', function (e) { 160
161 let $this = $(this).parent(), 162 username = $this.find('input[name=username]').val(), 163 password = $this.find('input[name=password]').val(), 164 password_repeat = $this.find('input[name=repeat-password]').val(), 165 email = $this.find('input[name=email]').val(); 166 167 if (password === password_repeat) { 168 169 let data = new FormData(); 170 171 data.append('action', 'fs_reg'); 172 173 data.append('username', username); 174 175 data.append('password', password); 176 177 data.append('email', email); 178 179 $.ajax({ 180 url: lindenSettings.ajaxurl, 181 type: 'POST', 182 contentType: false, 183 processData: false, 184 data: data, 185 beforeSend: function () { 186 187 $(this).css({ 188 'opacity': '0.7', 189 'pointer-events': 'none' 190 }); 191 192 }, 193 success: function (data) { 194 195 $('html').removeClass('art-main-holder-mask-show'); 196 auth_popup.removeClass('active'); 197 198 $(this).css({ 199 'opacity': '1', 200 'pointer-events': 'auto' 201 }); 202 203 if (data.message) { 204 205 reg_alert.empty(); 206 207 reg_alert.text(data.message); 208 209 } 210 211 if (data) { 212 213 document.location.href = data; 214 215 } 216 217 } 218 219 }); 220 } else { 221 reg_alert.text('Password mismatch!'); 222 } 223 224 e.preventDefault(); 225 226 }); 227 228 }, 229 auth_switcher_handler = () => { 230 231 let auth_switcher = auth_popup.find('.auth-switcher'); 232 233 auth_switcher.on('click', function () { 234 235 let data = new FormData(); 236 237 if (auth_popup.hasClass('login-form')) { 238 239 auth_popup.removeClass('login-form').addClass('reg-form'); 240 241 data.append('action', 'fs_switch_reg'); 242 243 $.ajax({
244 url: lindenSettings.ajaxurl, 245 type: 'POST', 246 contentType: false, 247 processData: false, 248 data: data, 249 beforeSend: function () { 250 251 form_wrapper.css({ 252 'opacity': 0.5, 253 'pointer-events': 'none', 254 }); 255 256 }, 257 success: function (response) { 258 259 form_wrapper.css({ 260 'opacity': 1, 261 'pointer-events': 'auto', 262 }); 263 264 let html = $(response); 265 266 form_wrapper.empty().append(html); 267 268 auth_switcher_handler(); 269 270 registration_handler(); 271 272 } 273 274 }); 275 276 } else if (auth_popup.hasClass('reg-form')) { 277 278 auth_popup.removeClass('reg-form').addClass('login-form'); 279 280 data.append('action', 'fs_switch_login'); 281 282 $.ajax({ 283 url: lindenSettings.ajaxurl, 284 type: 'POST', 285 contentType: false, 286 processData: false, 287 data: data, 288 beforeSend: function () { 289 290 form_wrapper.css({ 291 'opacity': 0.5, 292 'pointer-events': 'none', 293 }); 294 295 }, 296 success: function (response) { 297 298 form_wrapper.css({ 299 'opacity': 1, 300 'pointer-events': 'auto', 301 }); 302 303 let html = $(response); 304 305 form_wrapper.empty().append(html); 306 307 auth_switcher_handler(); 308 309 } 310 311 }); 312 313 } 314 315 }); 316 317 }; 318 319 authorization_toggle.on('click', function () { 320 321 $('html').addClass('art-main-holder-mask-show'); 322 auth_popup.addClass('active'); 323 324 }); 325 326 close_button.on('click', function () { 327 328 $('html').removeClass('art-main-holder-mask-show'); 329 auth_popup.removeClass('active'); 330 331 }); 332 333 auth_switcher_handler(); 334 335 } 336 337 }; 338 339 340 // Resize iframe video 341 fl_theme.initResponsiveIframe = function(){ 342 var resizeitem = $('iframe'); 343 resizeitem.height( 344 resizeitem.attr("height") / resizeitem.attr("width") * resizeitem.width() 345 ); 346 }; 347 348 349 // Side card handler 350 fl_theme.shopping_bag_handler = function() { 351 352 let shopping_bag_toggle = $('.shopping-bag-toggle'), 353 shopping_bag_panel = $('.shopping-bag-panel'), 354 inner_bag = shopping_bag_panel.find('.inner-bag'), 355 bag_body = shopping_bag_panel.find('.bag-body'), 356 update_totals = () => { 357 358 let cart_count = shopping_bag_toggle.find('.cart-count'), 359 bag_header = shopping_bag_panel.find('.bag-header'), 360 bag_footer = shopping_bag_panel.find('.bag-footer'), 361 count = bag_header.find('.cart-count'), 362 subtotal_value = bag_footer.find('.subtotal-numbers'), 363 data1 = new FormData(), 364 data2 = new FormData(); 365 366 data1.append('action', 'fsd_shopping_bag_update_count'); 367 368 data2.append('action', 'fsd_shopping_bag_update_subtotals'); 369 370 $.ajax({
371 url: lindenSettings.ajaxurl, 372 type: 'POST', 373 contentType: false, 374 processData: false, 375 data: data1, 376 beforeSend: function () { 377 378 }, 379 success: function (response) { 380 381 count.empty().text(response); 382 383 cart_count.empty().text(response); 384 385 if (Number(response) === 0) { 386 387 inner_bag.addClass('empty-cart-state'); 388 389 } 390 391 } 392 393 }); 394 395 $.ajax({ 396 url: lindenSettings.ajaxurl, 397 type: 'POST', 398 contentType: false, 399 processData: false, 400 data: data2, 401 beforeSend: function () { 402 403 }, 404 success: function (response) { 405 406 subtotal_value.empty().text(response); 407 408 } 409 410 }); 411 412 }, 413 remove_items_handler = () => { 414 415 let products_list = shopping_bag_panel.find('.products-list'), 416 products = products_list.find('.product'); 417 418 products.each(function () { 419 420 let $this = $(this), 421 id = $this.data('product-id'), 422 remove_button = $this.find('.product-remote-button'); 423 424 remove_button.on('click', function () { 425 426 let data = new FormData(); 427 428 data.append('id', id); 429 430 data.append('action', 'fsd_shopping_bag_remove_item'); 431 432 $.ajax({
433 url: lindenSettings.ajaxurl, 434 type: 'POST', 435 contentType: false, 436 processData: false, 437 data: data, 438 beforeSend: function () { 439 440 products_list.css({ 441 'opacity': '0.3', 442 'pointer-events': 'none' 443 }); 444 445 }, 446 success: function (response) { 447 448 products_list.css({ 449 'opacity': '1', 450 'pointer-events': 'auto' 451 }); 452 453 update_totals(); 454 455 $this.remove(); 456 457 } 458 459 }); 460 461 }); 462 463 }); 464 465 }, 466 change_items_quantity_handler = () => { 467 468 let products_list = shopping_bag_panel.find('.products-list'), 469 products = products_list.find('.product'); 470 471 products.each(function () { 472 473 let $this = $(this), 474 id = $this.data('product-id'), 475 quantity_input = $this.find('.quantity-inner'), 476 input = quantity_input.find('.quantity-input'), 477 decrease = quantity_input.find('.decrease'), 478 value = Number(input.val()), 479 increase = quantity_input.find('.increase'); 480 481 decrease.on('click', function () { 482 483 let data = new FormData(); 484 485 data.append('id', id); 486 487 data.append('old', value); 488 489 data.append('type', 'decrease'); 490 491 data.append('action', 'fsd_shopping_bag_change_quantity'); 492 493 $.ajax({
494 url: lindenSettings.ajaxurl, 495 type: 'POST', 496 contentType: false, 497 processData: false, 498 data: data, 499 beforeSend: function () { 500 501 products_list.css({ 502 'opacity': '0.3', 503 'pointer-events': 'none' 504 }); 505 506 }, 507 success: function () { 508 509 update_totals(); 510 511 products_list.css({ 512 'opacity': '1', 513 'pointer-events': 'auto' 514 }); 515 516 input.val(value - 1); 517 518 value = Number(input.val()); 519 520 } 521 522 }); 523 524 }); 525 526 increase.on('click', function () { 527 528 let data = new FormData(); 529 530 data.append('id', id); 531 532 data.append('old', value); 533 534 data.append('type', 'increase'); 535 536 data.append('action', 'fsd_shopping_bag_change_quantity'); 537 538 $.ajax({ 539 url: lindenSettings.ajaxurl, 540 type: 'POST', 541 contentType: false, 542 processData: false, 543 data: data, 544 beforeSend: function () { 545 546 products_list.css({ 547 'opacity': '0.3', 548 'pointer-events': 'none' 549 });
550 551 }, 552 success: function () { 553 554 update_totals(); 555 556 products_list.css({ 557 'opacity': '1', 558 'pointer-events': 'auto' 559 }); 560 561 input.val(value + 1); 562 563 value = Number(input.val()); 564 565 } 566 567 }); 568 569 }); 570 571 }); 572 573 }, 574 close_handler = () => { 575 $doc.on( 'click', '.shopping-bag-panel .close-button, .art-main-holder-mask', function () { 576 shopping_bag_panel.removeClass('active'); 577 $('html').removeClass('art-main-holder-mask-show'); 578 }); 579 }; 580 581 shopping_bag_toggle.on('click', function () { 582 $('html').addClass('art-main-holder-mask-show'); 583 shopping_bag_panel.addClass('active'); 584 585 let data = new FormData(), 586 loading_message = shopping_bag_panel.find('.loading-message'); 587 588 data.append('action', 'fsd_shopping_bag'); 589 590 $.ajax({ 591 url: lindenSettings.ajaxurl, 592 type: 'POST', 593 contentType: false, 594 processData: false, 595 data: data, 596 beforeSend: function () { 597 598 inner_bag.addClass('loading-state'); 599 600 bag_body.empty(); 601 602 loading_message.css({ 603 'opacity': '1', 604 }); 605 606 }, 607 success: function (response) { 608 609 inner_bag.removeClass('loading-state'); 610 611 loading_message.css({ 612 'opacity': '0', 613 }); 614 615 let html = $(response); 616 617 bag_body.append(html); 618 619 if (bag_body.find('.product').length > 0) { 620 621 inner_bag.removeClass('empty-cart-state'); 622 623 } 624 625 close_handler(); 626 627 remove_items_handler(); 628 629 change_items_quantity_handler(); 630 631 update_totals(); 632 633 } 634 635 }); 636 637 }); 638 639 }; 640 641 // Add to cart handler 642 fl_theme.add_to_cart_handler = function () { 643 const products = $( '.products .product' ); 644 645 if ( products.length > 0 ) { 646 products.each( function () { 647 const $this = $( this ), 648 cart_count = $('.cart-count'), 649 add_to_cart_button = $this.find('.art-add-to-cart-button'); 650 651 add_to_cart_button.on('click', function () { 652 let $this_button = $(this); 653 654 if ( ! $this_button.hasClass( 'already-in-cart' ) ) { 655 let id = $this_button.closest('.product').data('product-id'), 656 data = new FormData(); 657 658 $this_button.addClass('loading'); 659 660 if (!$this_button.hasClass('success')) { 661 662 data.append('product_id', id); 663 664 data.append('action', 'fsd_add_to_cart'); 665 666 $.ajax({
667 url: lindenSettings.ajaxurl, 668 type: 'POST', 669 contentType: false, 670 processData: false, 671 data: data, 672 beforeSend: function () { 673 674 }, 675 success: function (response) { 676 677 $this_button.removeClass('loading'); 678 679 $this_button.addClass('already-in-cart'); 680 681 $this_button.attr('href', $this_button.data('href')); 682 683 cart_count.each(function () { 684 685 let $this_count = $(this), 686 old_count = Number($this_count.text()); 687 688 $this_count.empty().text(old_count + 1); 689 690 }); 691 692 jQuery('.art-global-notification-wrapper').append(response); 693 } 694 695 }); 696 697 } 698 699 } 700 701 }); 702 703 }); 704 705 } 706 }; 707 708 709 // Close Notification 710 fl_theme.close_notification_handler = function () { 711 $(document).on('click', '.art-close-notification', function () { 712 let message = $(this).closest('.woocommerce-error, .woocommerce-message, .woocommerce-info'); 713 714 message.slideUp('fast').remove(); 715 }); 716 }; 717 718 719 // Open Close Mobile Navigation (all states are here) 720 fl_theme.initMobileNavigationOpenClose = function () { 721 let $navbar_wrapper = $('.art-mobile-menu-wrapper'), 722 $navbar_menu_sidebar = $('.art--mobile-menu-navigation-wrapper'), 723 $site_main_holder = $('.art-main-container'), 724 $site_header = $('#art-main-holder header.art-header'), 725 $hamburgerbars = $('.art--hamburger-menu-wrapper'), /* no need ?*/ 726 OpenNavBar = void 0; 727 728 self.fullscreenNavbarIsOpened = function () { 729 return OpenNavBar; 730 }; 731 732 self.toogleOpenCloseMobileMenu = function () { 733 self[OpenNavBar ? 'closeFullscreenNavbar' : 'openFullscreenNavbar'](); 734 }; 735 self.openFullscreenNavbar = function () { 736 737 if (OpenNavBar || !$navbar_wrapper.length) { 738 return; 739 } 740 OpenNavBar = 1; 741 742 743 $hamburgerbars.addClass('opened'); 744 $hamburgerbars.removeClass('closed'); 745 746 $site_main_holder.removeClass('art-no-transform'); 747 748 749 750 // NavBarMenu wrapper Animation 751 TweenMax.set($site_main_holder, { 752 opacity: 1, 753 display: 'block', 754 x: '0' 755 }); 756 757 TweenMax.to($site_main_holder, 0.3, { 758 opacity: 1, 759 x: '-260px', 760 display: 'block', 761 delay: 0 762 }, 0); 763 764 765 // NavBarMenu Items Animation 766 TweenMax.set($navbar_wrapper, { 767 opacity: 1, 768 display: 'none', 769 x: '260px' 770 }); 771 TweenMax.to($navbar_wrapper, 0.3, { 772 opacity: 1, 773 x: '0', 774 display: 'block', 775 delay: 0 776 }, 0); 777 778 $navbar_wrapper.addClass('open'); 779 hamburgerButton.addClass('is-active'); 780 $navbar_menu_sidebar.addClass('sidebar-open'); 781 782 $('html').addClass('art-main-holder-mask-show'); 783 $site_header.addClass('art-menu-open'); 784 }; 785 786 self.closeFullscreenNavbar = function (dontTouchBody) { 787 if (!OpenNavBar || !$navbar_wrapper.length) { 788 return; 789 } 790 OpenNavBar = 0; 791 792 // disactive all togglers 793 $hamburgerbars.removeClass('opened'); 794 $hamburgerbars.addClass('closed'); 795 796 797 // container 798 TweenMax.to($site_main_holder, 0.3, { 799 x: '0', 800 opacity: 1, 801 display: 'block', 802 delay: 0 803 }); 804 805 806 TweenMax.to($navbar_wrapper, 0.3, { 807 x: '260px', 808 opacity: 1, 809 display: 'none', 810 delay: 0 811 }); 812 813 setTimeout(function () { 814 $site_main_holder.addClass('art-no-transform'); 815 }, 300); 816 817 // open navbar block 818 $navbar_wrapper.removeClass('open'); 819 hamburgerButton.removeClass('is-active'); 820 $navbar_menu_sidebar.removeClass('sidebar-open'); 821 822 $('html').removeClass('art-main-holder-mask-show'); 823 $site_header.removeClass('art-menu-open'); 824 }; 825 826 $doc.on('click', '.art--hamburger-menu-wrapper,.art--mobile-menu-icon,.info_block_hamburger', function (e) { 827 self.toogleOpenCloseMobileMenu(); 828 e.preventDefault(); 829 }); 830 831 $doc.on('click', '.art--mobile-menu-navigation li:not(.has-submenu) > a', function (e) { 832 self.toogleOpenCloseMobileMenu(); 833 }); 834 835 $( window ).resize(function() { 836 if( $window.width() > 1240 ) { 837 self.closeFullscreenNavbar(); 838 } 839 }); 840 }; 841 842 843 844// Mobile Menu 845 fl_theme.initMobileNavigationSubMenuAnimation = function () { 846 var $mobileMenu = $('.art--mobile-menu'); 847 848 $mobileMenu.find('li').each(function(){ 849 var $this = $(this); 850 if($this.find('ul').length > 0) { 851 $this.find('> a').append('<span class="fl-menu-flipper-icon fl--open-child-menu"><span class="fl-front-content"></span><span class="fl-back-content"></span></span>'); 852 } 853 }); 854 855 // open -> close sub-menu 856 function toggleSub_menu($sub_menu_find) {
857 var $navigation_Items = $sub_menu_find.find('.sub-nav >.sub-menu >li >a'); 858 859 if (!$sub_menu_find.find('.sub-nav >.sub-menu >li.opened').length) { 860 $navigation_Items = $sub_menu_find.find('.sub-menu >li >a'); 861 } 862 863 TweenMax.set($navigation_Items, { 864 opacity: 0, 865 x: '-20%', 866 force3D: true 867 }, 0.04); 868 869 if ($sub_menu_find.hasClass('opened')) { 870 $sub_menu_find.removeClass('opened'); 871 $sub_menu_find.find('li').removeClass('opened'); 872 $sub_menu_find.find('ul').slideUp(200); 873 TweenMax.staggerTo($navigation_Items, 0.3, { 874 opacity: 0, 875 x: '-20%', 876 force3D: true 877 }, 0.04); 878 } else { 879 TweenMax.staggerTo($navigation_Items, 0.3, { 880 x: '0%', 881 opacity: 1, 882 delay: 0.2 883 }, 0.04); 884 885 $sub_menu_find.addClass('opened'); 886 if (!$sub_menu_find.children('ul').length) { 887 $sub_menu_find.find('div').children('ul').slideDown(); 888 } else { 889 $sub_menu_find.children('ul').slideDown(); 890 } 891 // Sub menu Children 892 $sub_menu_find.siblings('li').children('ul').slideUp(200); 893 $sub_menu_find.siblings('li').removeClass('opened'); 894 $sub_menu_find.siblings('li').find('li').removeClass('opened'); 895 $sub_menu_find.siblings('li').find('ul').slideUp(200); 896 } 897 } 898 899 $mobileMenu.on('click', 'li.has-submenu >a', function (e) { 900 toggleSub_menu($(this).parent()); 901 e.preventDefault(); 902 }); 903 }; 904 905 906 907 908// Velocity Animation Save 909 fl_theme.initVelocityAnimationSave = function(){ 910 var animated_velocity = $('.fl-animated-item-velocity'); 911 912 // Hided item if animated not complete 913 animated_velocity.each(function () { 914 var $this = $(this), 915 $item; 916 917 if ($this.data('item-for-animated')) { 918 $item = $this.find($this.data('item-for-animated')); 919 $item.each(function() { 920 if(!$(this).hasClass('animation-complete')) { 921 $(this).css('opacity','0'); 922 } 923 }); 924 } else { 925 if(!$this.hasClass('animation-complete')) { 926 $this.css('opacity','0'); 927 } 928 } 929 }); 930 931 // animated Function 932 animated_velocity.each(function () { 933 var $this_item = $(this), $item, $animation; 934 $animation = $this_item.data('animate-type'); 935 if ($this_item.data('item-for-animated')) { 936 $item = $this_item.find($this_item.data('item-for-animated')); 937 $item.each(function() { 938 var $this = $(this); 939 var delay=''; 940 if ($this_item.data('item-delay')) { 941 delay = $this_item.data('item-delay'); 942 }else { 943 if ($this.data('item-delay')) { 944 delay = $this.data('item-delay'); 945 } 946 } 947 $this.waypoint(function () { 948 if(!$this.hasClass('animation-complete')) { 949 $this.addClass('animation-complete') 950 .velocity('transition.'+$animation,{delay:delay,display:'undefined',opacity:1}); 951 } 952 }, 953 { 954 offset: offset 955 }); 956 }); 957 } else { 958 $this_item.waypoint(function () { 959 var delay=''; 960 if ($this_item.data('item-delay')) { 961 delay = $this_item.data('item-delay'); 962 } 963 964 if(!$this_item.hasClass('animation-complete')) { 965 $this_item.addClass('animation-complete') 966 .velocity('transition.'+$animation,{ delay:delay,display:'undefined',opacity:1}); 967 } 968 969 }, 970 { 971 offset: offset 972 }); 973 } 974 }); 975 }; 976 977 978 // Load More button for Blog 979 fl_theme.initLoadMoreForBlog = function () { 980 981 let linden_load_next_page; 982 let linden_lmp_ajax_instance; 983 let lmp_is_loading; 984 let linden_blog_pagination_wrapper = $('.art-pagination-wrapper'); 985 986 linden_current_style(); 987 988 $(document).on( 'click', '.art-button-container .art-button-load-more', function (event) { 989 event.preventDefault(); 990 991 linden_load_next_page(); 992 }); 993 994 linden_load_next_page = function () { 995 996 997 var $linden_next_page = linden_jquery_get_next_page(); //.next-page a 998 999 1000 if( $linden_next_page.length > 0 ) { 1001 1002 1003 linden_start_ajax_loading(); // pre loader 1004 1005 var linden_next_page; 1006 linden_next_page = $linden_next_page.attr('href'); 1007 1008 1009 linden_lmp_ajax_instance = $.get( linden_next_page, function( data ) { 1010 1011 1012 linden_lmp_ajax_instance = false; 1013 var $data = $('<div>'+data+'</div>'); 1014 1015 var $posts = $data.find('.art-all-posts-itself').html(); 1016 $('.art-all-posts-itself').append( $posts ); 1017 1018
1019 var $linden_next_page = linden_jquery_get_next_page(); 1020 var $linden_new_next_page = linden_jquery_get_next_page($data); 1021 if( $linden_new_next_page.length ) { 1022 $linden_next_page.replaceWith($linden_new_next_page); 1023 } else { 1024 $linden_next_page.remove(); 1025 } 1026 1027 1028 linden_end_ajax_loading(); 1029 1030 linden_current_style(); 1031 1032 }); 1033 1034 } 1035 1036 }; 1037 1038 function linden_jquery_get_next_page($parent) { 1039 1040 var $next_page; 1041 1042 if( typeof($parent) == 'undefined' ) { 1043 $parent = $(document); 1044 } 1045 1046 var $pagination = $parent.find('.art-pagination'); 1047 1048 if( $pagination.find('.next-page a').length > 0 ) { 1049 1050 $next_page = $pagination.find('.next-page a'); 1051 } else { 1052 1053 $next_page = $parent.find('.next-page a'); 1054 } 1055 1056 1057 return $next_page; 1058 } 1059 1060 function linden_start_ajax_loading() { 1061 linden_blog_pagination_wrapper.addClass('art-is-loading'); 1062 } 1063 1064 function linden_end_ajax_loading() { 1065 linden_blog_pagination_wrapper.removeClass('art-is-loading'); 1066 } 1067 1068 1069 1070 function linden_current_style() { 1071 $( '.art-pagination-wrapper .art-load-more-button-container' ).hide(); 1072 1073 var $linden_next_page = linden_jquery_get_next_page(); 1074 if ( $linden_next_page.length > 0 ) { 1075 $( '.art-pagination-wrapper .art-load-more-button-container' ).show(); 1076 } 1077 1078 } 1079 1080 }; 1081 1082 // Load More button for Shop 1083 fl_theme.initLoadMoreForShop = function () { 1084 var linden_load_next_page; 1085 var linden_lmp_ajax_instance; 1086 var lmp_is_loading; 1087 var linden_blog_pagination_wrapper = $('.art-shop-pagination-wrapper'); 1088 1089 linden_current_style(); 1090 1091 $(document).on( 'click', '.art-button-container .art-button-load-more', function (event) { 1092 event.preventDefault(); 1093 1094 linden_load_next_page(); 1095 }); 1096 1097 linden_load_next_page = function () { 1098 1099 1100 var $linden_next_page = linden_jquery_get_next_page(); // .next-page a; 1101 1102 1103 if( $linden_next_page.length > 0 ) { 1104 1105 1106 linden_start_ajax_loading(); // pre loader 1107 1108 var linden_next_page; 1109 linden_next_page = $linden_next_page.attr('href'); 1110 1111 1112 linden_lmp_ajax_instance = $.get( linden_next_page, function( data ) { 1113 1114 1115 linden_lmp_ajax_instance = false; 1116 var $data = $('<div>'+data+'</div>'); 1117 1118 var $posts = $data.find('ul.products').html(); 1119 $('ul.products').append( $posts ); 1120 1121 1122 var $linden_next_page = linden_jquery_get_next_page(); 1123 var $linden_new_next_page = linden_jquery_get_next_page($data); 1124 if( $linden_new_next_page.length ) { 1125 $linden_next_page.replaceWith($linden_new_next_page); 1126 } else { 1127 $linden_next_page.remove(); 1128 } 1129 1130 1131 linden_end_ajax_loading(); 1132 1133 linden_current_style(); 1134 }); 1135 } 1136 }; 1137 1138 function linden_jquery_get_next_page($parent) { 1139 var $next_page; 1140 1141 if( typeof($parent) == 'undefined' ) { 1142 $parent = $(document); 1143 } 1144 1145 var $pagination = $parent.find('.art-shop-pagination-wrapper .woocommerce-pagination'); 1146 1147 if( $pagination.find('.woocommerce-pagination a.next').length > 0 ) { 1148 1149 $next_page = $pagination.find('.woocommerce-pagination a.next'); 1150 } else { 1151 1152 $next_page = $parent.find('.woocommerce-pagination a.next'); 1153 } 1154 1155 return $next_page; 1156 } 1157 1158 function linden_start_ajax_loading() { 1159 linden_blog_pagination_wrapper.addClass('art-is-loading'); 1160 } 1161 1162 function linden_end_ajax_loading() { 1163 linden_blog_pagination_wrapper.removeClass('art-is-loading'); 1164 } 1165 1166 function linden_current_style() { 1167 $( '.art-shop-pagination-wrapper .art-load-more-button-container' ).hide(); 1168 1169 var $linden_next_page = linden_jquery_get_next_page(); 1170 if ( $linden_next_page.length > 0 ) { 1171 $( '.art-shop-pagination-wrapper .art-load-more-button-container' ).show(); 1172 } 1173 } 1174 }; 1175 1176 1177 // Full Screen Search Blog 1178 fl_theme.initFullScreenSearchBlog = function () { 1179 $( '.art-search-blog-button' ).on( 'click', function(e) { 1180 e.preventDefault(); 1181 1182 $('html').addClass('art-main-holder-mask-show'); 1183 1184 $('.art-search-blog .art-overlay').fadeIn(350); 1185 }); 1186 1187 $( '.art-search-blog .art-overlay-close' ).on( 'click', function(e) { 1188 $('html').removeClass('art-main-holder-mask-show'); 1189 1190 $('.art-search-blog .art-overlay').fadeOut(350); 1191 }); 1192 }; 1193 1194 1195 // Blog Sticky 1196 fl_theme.initBlogStickyArchive = function () { 1197 $('.art-content-left, .art-content-right').theiaStickySidebar(); 1198 }; 1199 1200 1201 // Init custom functions 1202 fl_theme.initCustomFunction = function(){ 1203 // Loader 1204 fl_theme.initSiteLoader(); 1205 1206 // Blog Sticky 1207 fl_theme.initBlogStickyArchive(); 1208 1209 // Load More button for Blog 1210 fl_theme.initFullScreenSearchBlog(); 1211 1212 // Load More button for Blog 1213 fl_theme.initLoadMoreForBlog(); 1214 1215 // Load More button for Blog 1216 fl_theme.initLoadMoreForShop(); 1217 1218 // header 1219 fl_theme.initStikyHeader(); 1220 1221 // Resize iframe video 1222 fl_theme.initResponsiveIframe(); 1223 1224 // Authorization 1225 fl_theme.authorization_modal_handler(); 1226 1227 // Side Cart 1228 fl_theme.shopping_bag_handler(); 1229 1230 fl_theme.add_to_cart_handler(); 1231 1232 fl_theme.close_notification_handler(); 1233 1234 // Open Close Mobile Navigation 1235 fl_theme.initMobileNavigationOpenClose(); 1236 1237 // Sub Menu Animation 1238 fl_theme.initMobileNavigationSubMenuAnimation(); 1239 }; 1240 1241 fl_theme.initCustomFunction(); 1242 1243 $( window ).on('resize', function() { 1244 fl_theme.initResponsiveIframe(); 1245 }); 1246 1247 $( window ).on('load', function() { 1248 $( '.art-accordion__item.art-first-active' ).find( '.art-accordion__item-content' ).slideDown( 'fast' ); 1249 }); 1250 1251 1252 /* Accordion */ 1253 $('.art-accordion__item-title').on( 'click', function() { 1254 const $item = $( this ).closest( '.art-accordion__item' ), 1255 $container = $item.closest( '.art-accordion' ), 1256 $items = $container.find( '.art-accordion__item' ); 1257 1258 $items.removeClass( 'art-first-active' ); 1259 1260 if ( $item.hasClass( 'art-active' ) ) { 1261 $item.removeClass( 'art-active' );
1262 $item.find( '.art-accordion__item-content' ).slideUp( 'fast' ); 1263 1264 return; 1265 } 1266 1267 $items.removeClass( 'art-active' ); 1268 $items.find( '.art-accordion__item-content' ).slideUp( 'fast' ); 1269 1270 $item.addClass( 'art-active' ); 1271 $item.find( '.art-accordion__item-content' ).slideDown( 'fast' ); 1272 } ); 1273 1274 1275 /* Toggle */ 1276 $('.art-toggle__item-title').on( 'click', function() { 1277 const $item = $( this ).closest( '.art-toggle__item' ); 1278 1279 if ( $item.hasClass( 'art-active' ) ) { 1280 $item.removeClass( 'art-active' ); 1281 $item.find( '.art-toggle__item-content' ).slideUp( 'fast' ); 1282 1283 return; 1284 } 1285 1286 $item.addClass( 'art-active' ); 1287 $item.find( '.art-toggle__item-content' ).slideDown( 'fast' ); 1288 } ); 1289 1290 1291 /* Tabs */ 1292 $( '.art-tabs ul.art-tabs__list li a' ).on( 'click', function ( e ) { 1293 e.preventDefault(); 1294 1295 var tabs_parent = $(this).closest('.art-tabs'), 1296 tabs = tabs_parent.find('.art-tabs__wrap'), 1297 index = $(this).closest('li').index(); 1298 1299 1300 tabs_parent.find('.art-tabs__list > .current-tab').removeClass('current-tab'); 1301 1302 1303 $(this).closest('li').addClass('current-tab'); 1304 1305 1306 tabs.find('.cmsmasters_tab').not(':eq(' + index + ')').slideUp('fast', function () { 1307 $(this).removeClass('active_tab'); 1308 } ); 1309 1310 1311 tabs.find('.cmsmasters_tab:eq(' + index + ')').slideDown('fast', function () { 1312 $(this).addClass('active_tab'); 1313 } ); 1314 } ); 1315 1316 1317 /* Scroll Top */ 1318 $( window ).scroll( function () { 1319 if ( $( this ).scrollTop() > 200 ) { 1320 $( '#art-slide-top' ).filter( ':hidden' ).fadeIn( 'fast' ); 1321 } else { 1322 $( '#art-slide-top' ).filter( ':visible' ).fadeOut( 'fast' ); 1323 } 1324 } ); 1325 1326 $( '#art-slide-top' ).on( 'click', function () { 1327 $('html, body').animate( { 1328 scrollTop : 0 1329 }, 'slow' ); 1330 1331 return false; 1332 } ); 1333}); 1334 1335jQuery( document.body ).on( 'updated_cart_totals', function () { 1336 jQuery('#calc_shipping_country').select2(); 1337} );
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.