1/** ********************************************** ** 2 @Author Dorin Grigoras 3 @Website www.stepofweb.com 4 @Last Update Thursay, February 22, 2018 5 6 NOTE! Do not change anything here if you want to 7 be able to update in the future! Please use 8 your custom script (eg. custom.js). 9 10 11 TABLE CONTENTS 12 ------------------------------- 13 14 15 INLINE SCRIPTS 16 ------------------------------- 17 COUNT TO 18 https://github.com/mhuggins/jquery-countTo 19 20 BROWSER DETECT 21 22 Appear 23 https://github.com/bas2k/jquery.appear/ 24 25 Parallax v1.1.3 26 http://www.ianlunn.co.uk/plugins/jquery-parallax/ 27 28 jQuery Easing v1.3 29 http://gsgd.co.uk/sandbox/jquery/easing/ 30 31 WOW - v1.0.3 32 http://mynameismatthieu.com/WOW/ 33 34 Modernizr 3.3.1 35 http://modernizr.com/download/#-csstransforms3d-csstransitions-video-touch-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 36 37 Popper - required by bootstrap 38 https://popper.js.org/ 39*************************************************** **/ 40 window.width = jQuery(window).width(); 41 window.height = jQuery(window).height(); 42 43 44 /* Init */ 45 jQuery(window).ready(function () { 46 47 // jQuery 3.x do no support size() - should be replaceced with .length 48 // We use this hack to make old plugins working 49 jQuery.fn.extend({ 50 size: function() { 51 return this.length; 52 } 53 }); 54 55 // Popper user by Bootstrap 56 _loadPopperBS4(); 57 58 // Load Bootstrap JS 59 loadScript(plugin_path + 'bootstrap/js/bootstrap.min.js', function() { 60 61 // Load Material Design Js 62 if(jQuery("body").hasClass('enable-materialdesign')) { 63 loadScript(plugin_path + 'mdl/material.min.js'); 64 } 65 66 // Init 67 Init(false); 68 69 }); 70 71 72 /* --- */ 73 if(jQuery("body").hasClass("smoothscroll") && navigator.platform.indexOf('Mac') < 0) { 74 75 loadScript(plugin_path + 'smoothscroll.js', function() { 76 jQuery.smoothScroll(); 77 }); 78 79 } 80 /* --- */ 81 }); 82 83 84/** Init 85 Ajax Reinit: Init(true); 86 **************************************************************** **/ 87 function Init(is_ajax) { 88 89 // First Load Only 90 if(is_ajax != true) { 91 92 _afterResize(); 93 _slider_full(); 94 _topNav(); 95 _megaNavHorizontal(); 96 _sideNav(); 97 _stickyFooter(); 98 _infiniteScroll(); 99 100 } 101 102 // Reinit on Ajax 103 _owl_carousel(); 104 _flexslider(); 105 _lightbox(); 106 _mixitup(); 107 _animate(); 108 _onepageNav(); 109 _scrollTo(false, 0); 110 _parallax(); 111 _video(); 112 _youtubeBG(); 113 _toggle(); 114 _placeholder(); 115 _wrotate(); 116 _lazyload(); 117 _misc(); 118 _countDown(); 119 _masonryGallery(); 120 _toastr(false,false,false,false); 121 _charts(); 122 _select2(); 123 _form(); 124 _pickers(); 125 _editors(); 126 _pajinate(); 127 _zoom(); 128 _autosuggest(); 129 _stepper(); 130 _slimScroll(); 131 _modalAutoLoad(); 132 _bgimage(); 133 _cookie_alert(); 134 _widget_flickr(); 135 _widget_twitter(); 136 _widget_facebook(); 137 _widget_dribbble(); 138 _widget_media(); 139 140 /** Bootstrap Tooltip **/ 141 jQuery("[data-toggle=tooltip]").tooltip(); 142 143 /** Bootstrap Popover **/ 144 jQuery("[data-toggle=popover]").popover(); 145 146 } 147 148 149 150/** Preloader 151 **************************************************************** **/ 152 if(jQuery('#preloader').length > 0) { 153 154 jQuery(window).on("load", function() { 155 156 jQuery('#preloader').fadeOut(1000, function() { 157 jQuery('#preloader').remove(); 158 }); 159 160 // setTimeout(function() {}, 1000); 161 162 }); 163 164 } 165 166 167 168/** After Resize 169 **************************************************************** **/ 170 function _afterResize() { 171 172 jQuery(window).on("load", function() { 173 "use strict"; 174 175 // On Resize 176 jQuery(window).resize(function() { 177 178 if(window.afterResizeApp) { 179 clearTimeout(window.afterResizeApp); 180 } 181 182 window.afterResizeApp = setTimeout(function() { 183 184 /** 185 After Resize Code 186 ................. 187 **/ 188 189 _slider_full(); 190 191 window.width = jQuery(window).width(); 192 window.height = jQuery(window).height(); 193 194 // Resize Flex Slider if exists! 195 if(jQuery('.flexslider').length > 0) { 196 jQuery('.flexslider').resize(); 197 } 198 199 200 }, 300); 201 202 }); 203 204 }); 205 206 } 207 208 209 210/** Load Script 211 212 USAGE 213 var pageInit = function() {} 214 loadScript(plugin_path + "script.js", function); 215
216 Load multiple scripts and call a final function 217 loadScript(plugin_path + "script1.js", function(){ 218 loadScript(plugin_path + "script2.js", function(){ 219 loadScript(plugin_path + "script3.js", function(){ 220 loadScript(plugin_path + "script4.js", function); 221 }); 222 }); 223 }); 224 **************************************************************** **/ 225 var _arr = {}; 226 function loadScript(scriptName, callback) { 227 228 if (!_arr[scriptName]) { 229 _arr[scriptName] = true; 230 231 var body = document.getElementsByTagName('body')[0]; 232 var script = document.createElement('script'); 233 script.type = 'text/javascript'; 234 script.src = scriptName; 235 236 // then bind the event to the callback function 237 // there are several events for cross browser compatibility 238 // script.onreadystatechange = callback; 239 script.onload = callback; 240 241 // fire the loading 242 body.appendChild(script); 243 244 } else if (callback) { 245 246 callback(); 247 248 } 249 250 }; 251 252 253 254 255 256 257 258/** 00. Slider Full Height 259 **************************************************************** **/ 260 function _slider_full() { 261 _headerHeight = 0; 262 263 if(jQuery("#header").hasClass('transparent') || jQuery("#header").hasClass('translucent')) { 264 _headerHeight = 0; 265 } else { 266 _headerHeight = jQuery("#header").outerHeight() || 0; 267 268 if(jQuery("#topBar").length > 0) { 269 _topBarHeight = jQuery("#topBar").outerHeight() || 0; 270 _headerHeight = _headerHeight + _topBarHeight; 271 } 272 } 273 274 _screenHeight = jQuery(window).height() - _headerHeight; 275 276 if(jQuery("#header").hasClass('static')) 277 _screenHeight = jQuery(window).height(); 278 279 if(jQuery("#slider").hasClass('halfheight')) { 280 jQuery("#slider.halfheight").height(_screenHeight / 2); 281 } 282 283 if(jQuery("#slider").hasClass('thirdheight')) { 284 jQuery("#slider.thirdheight").height(_screenHeight / 1.5); 285 } 286 287 if(jQuery("#slider").hasClass('fullheight')) { 288 jQuery("#slider.fullheight").height(_screenHeight); 289 jQuery("#slider.fullheight-min").css({"min-height":_screenHeight + "px"}); 290 } 291 292 if(window.width < 960) { 293 jQuery("#slider.mobile-fullheight").height(_screenHeight); 294 } 295 } 296 297 298 299 300 301 302 303 304/** 01. Top Nav 305 **************************************************************** **/ 306 function _topNav() { 307 window.scrollTop = 0; 308 window._cmScroll = 0; 309 var _header_el = jQuery("#header"); 310 311 312 jQuery(window).scroll(function() { 313 _toTop(); 314 }); 315 316 /* Scroll To Top */ 317 function _toTop() { 318 _scrollTop = jQuery(document).scrollTop(); 319 320 if(_scrollTop > 100) { 321 322 if(jQuery("#toTop").is(":hidden")) { 323 jQuery("#toTop").show(); 324 } 325 326 } else { 327 328 if(jQuery("#toTop").is(":visible")) { 329 jQuery("#toTop").hide(); 330 } 331 332 } 333 334 } 335 336 337 // Mobile Submenu 338 var addActiveClass = false; 339 jQuery("#topMain a.dropdown-toggle").bind("click", function(e) { 340 341 if(jQuery(this).attr('href') == "#") { 342 e.preventDefault(); 343 } 344 345 addActiveClass = jQuery(this).parent().hasClass("resp-active"); 346 jQuery("#topMain").find(".resp-active").removeClass("resp-active"); 347 348 if(!addActiveClass) { 349 jQuery(this).parents("li").addClass("resp-active"); 350 } 351 352 return; 353 354 }); 355 356 357 // Srearch 358 jQuery('li.search i.fa').click(function () { 359 if(jQuery('#header .search-box').is(":visible")) { 360 jQuery('#header .search-box').fadeOut(300); 361 } else { 362 jQuery('.search-box').fadeIn(300); 363 jQuery('#header .search-box form input').focus(); 364 365 // hide quick cart if visible 366 if (jQuery('#header li.quick-cart div.quick-cart-box').is(":visible")) { 367 jQuery('#header li.quick-cart div.quick-cart-box').fadeOut(300); 368 } 369 } 370 }); 371 372 // close search box on body click 373 if(jQuery('#header li.search i.fa').size() != 0) { 374 jQuery('#header .search-box, #header li.search i.fa').on('click', function(e){ 375 e.stopPropagation(); 376 }); 377 378 jQuery('body').on('click', function() { 379 if(jQuery('#header li.search .search-box').is(":visible")) { 380 jQuery('#header .search-box').fadeOut(300); 381 } 382 }); 383 } 384 385 jQuery(document).bind("click", function() { 386 if(jQuery('#header li.search .search-box').is(":visible")) { 387 jQuery('#header .search-box').fadeOut(300); 388 } 389 }); 390 391 392 // Close Fullscreen Search 393 jQuery("#closeSearch").bind("click", function(e) { 394 e.preventDefault(); 395 396 jQuery('#header .search-box').fadeOut(300); 397 }); 398 399 400 401 // Page Menu [mobile] 402 jQuery("button#page-menu-mobile").bind("click", function() { 403 jQuery(this).next('ul').slideToggle(150); 404 }); 405 406 407 // Quick Cart 408 jQuery('li.quick-cart>a').click(function (e) { 409 e.preventDefault(); 410 411 var _quick_cart_box = jQuery('li.quick-cart div.quick-cart-box'); 412 413 if(_quick_cart_box.is(":visible")) { 414 _quick_cart_box.fadeOut(300); 415 } else { 416 _quick_cart_box.fadeIn(300); 417 418 // close search if visible 419 if(jQuery('li.search .search-box').is(":visible")) { 420 jQuery('.search-box').fadeOut(300); 421 } 422 } 423 }); 424 // close quick cart on body click 425 if(jQuery('li.quick-cart>a').size() != 0) { 426 jQuery('li.quick-cart').on('click', function(e){ 427 e.stopPropagation(); 428 }); 429 430 jQuery('body').on('click', function() { 431 if (jQuery('li.quick-cart div.quick-cart-box').is(":visible")) { 432 jQuery('li.quick-cart div.quick-cart-box').fadeOut(300); 433 } 434 }); 435 } 436 437 438 // Page Menu [scrollTo] 439 jQuery("#page-menu ul.menu-scrollTo>li").bind("click", function(e) { 440 441 // calculate padding-top for scroll offset 442 var _href = jQuery('a', this).attr('href'); 443 444 if(!jQuery('a', this).hasClass('external')) { 445 e.preventDefault(); 446 447 jQuery("#page-menu ul.menu-scrollTo>li").removeClass('active'); 448 jQuery(this).addClass('active'); 449 450 if(jQuery(_href).length > 0) { 451 452 _padding_top = 0; 453 454 if(jQuery("#header").hasClass('sticky')) { 455 _padding_top = jQuery(_href).css('padding-top'); 456 _padding_top = _padding_top.replace('px', ''); 457 } 458 459 jQuery('html,body').animate({scrollTop: jQuery(_href).offset().top - _padding_top}, 800, 'easeInOutExpo'); 460 461 } 462 463 } 464 465 }); 466 467 468 469 470 // MOBILE TOGGLE BUTTON 471 window.currentScroll = 0; 472 jQuery("button.btn-mobile").bind("click", function(e) { 473 e.preventDefault(); 474 475 jQuery(this).toggleClass('btn-mobile-active'); 476 jQuery('html').removeClass('noscroll'); 477 jQuery('#menu-overlay').remove(); 478 jQuery("#topNav div.nav-main-collapse").hide(0); 479 480 if(jQuery(this).hasClass('btn-mobile-active')) { 481 jQuery("#topNav div.nav-main-collapse").show(0); 482 jQuery('body').append('<div id="menu-overlay"></div>'); 483 484 if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */ 485 jQuery('html').addClass('noscroll'); 486 window.currentScroll = jQuery(window).scrollTop(); 487 } 488 489 } else { 490 491 if(!jQuery("#topMain").hasClass('nav-onepage') || window.width > 960) { /* onepage fix */ 492 jQuery('html,body').animate({scrollTop: currentScroll}, 300, 'easeInOutExpo'); 493 } 494 495 } 496 }); 497 498 499 500 501 // BOTTOM NAV 502 if(_header_el.hasClass('bottom')) { 503 504 // Add dropup class 505 _header_el.addClass('dropup'); 506 window.homeHeight = jQuery(window).outerHeight() - 55; 507 508 509 // sticky header 510 if(_header_el.hasClass('sticky')) { 511 window.isOnTop = true; 512 513 514 // if scroll is > 60%, remove class dropup 515 jQuery(window).scroll(function() { 516 if(jQuery(document).scrollTop() > window.homeHeight / 2) { 517 _header_el.removeClass('dropup'); 518 } else { 519 _header_el.addClass('dropup'); 520 } 521 }); 522 523
524 // Add fixed|not fixed & dropup|no dropup 525 jQuery(window).scroll(function() { 526 if(jQuery(document).scrollTop() > window.homeHeight) { 527 if(window.isOnTop === true) { 528 jQuery('#header').addClass('fixed'); 529 _header_el.removeClass('dropup'); 530 window.isOnTop = false; 531 } 532 } else { 533 if(window.isOnTop === false) { 534 jQuery('#header').removeClass('fixed'); 535 _header_el.addClass('dropup'); 536 window.isOnTop = true; 537 } 538 } 539 }); 540 541 // get window height on resize 542 jQuery(window).resize(function() { 543 window.homeHeight = jQuery(window).outerHeight(); 544 }); 545 546 } 547 548 } else 549 550 // STICKY 551 if(_header_el.hasClass('sticky')) { 552 553 _topBar_H = jQuery("#topBar").outerHeight() || 0; 554 555 // Force fixed header on mobile to avoid "jump" effect. 556 if(window.width <= 992 && _topBar_H < 1) { 557 558 var _scrollTop = jQuery(document).scrollTop(); 559 _header_H = _header_el.outerHeight() || 0; 560 561 _header_el.addClass('fixed'); 562 jQuery('body').css({"padding-top":_header_H+"px"}); 563 564 } 565 566 567 // Header Switch - outside of scroll 568 if(_header_el.hasClass('transparent')) { 569 var _el = jQuery("#topNav div.nav-main-collapse"), 570 _data_switch_default = _el.attr('data-switch-default') || '', 571 _data_switch_scroll = _el.attr('data-switch-scroll') || ''; 572 } 573 574 575 576 jQuery(window).scroll(function() { 577 578 if((window.width > 992 && _topBar_H < 1) || _topBar_H > 0) { // 992 to disable on mobile 579 580 var _scrollTop = jQuery(document).scrollTop(); 581 582 if(_scrollTop > _topBar_H) { 583 _header_el.addClass('fixed'); 584 585 _header_H = _header_el.outerHeight() || 0; 586 587 if(!_header_el.hasClass('transparent') && !_header_el.hasClass('translucent')) { 588 jQuery('body').css({"padding-top":_header_H+"px"}); 589 } 590 591 } else { 592 if(!_header_el.hasClass('transparent') && !_header_el.hasClass('translucent')) { 593 jQuery('body').css({"padding-top":"0px"}); 594 } 595 596 _header_el.removeClass('fixed'); 597 } 598 599 } 600 601 602 603 // SWITCH DROPDOWN MENU CLASS ON SCROLL 604 if(_header_el.hasClass('transparent')) { 605 606 607 if(_data_switch_default != '' || _data_switch_scroll != '') { 608 609 if(_scrollTop > 0) { 610 611 if(window._cmScroll < 1) { 612 613 _el.removeClass(_data_switch_default, _data_switch_scroll).addClass(_data_switch_scroll); 614 615 // set to 1, we want to change classes once, not for each pixel on scroll 616 window._cmScroll = 1; 617 618 } 619 620 } else 621 622 if(_scrollTop < 1) { 623 624 _el.removeClass(_data_switch_default, _data_switch_scroll).addClass(_data_switch_default); 625 626 // Set back to 0 627 window._cmScroll = 0; 628 629 } 630 631 } 632 633 634 } 635 636 637 }); 638 639 } else 640 641 642 // REVEAL ON SCROLL UP 643 if(_header_el.hasClass('scroll')) { 644 jQuery('body').addClass('header-scroll-reveal'); 645 646 647 // Hide Header on on scroll down 648 var didScroll; 649 var lastScrollTop = 0; 650 var delta = 5; 651 var _header_H = _header_el.outerHeight() || 0; 652 653 654 jQuery(window).scroll(function(event){ 655 didScroll = true; 656 }); 657 658 setInterval(function() { 659 if (didScroll) { 660 hasScrolled(); 661 didScroll = false; 662 } 663 }, 100); 664 665 function hasScrolled() { 666 var st = $(this).scrollTop(); 667 668 // Make sure they scroll more than delta 669 if(Math.abs(lastScrollTop - st) <= delta) 670 return; 671 672 // If they scrolled down and are past the navbar, add class .nav-up. 673 // This is necessary so you never see what is "behind" the navbar. 674 if (st > lastScrollTop && st > _header_H){ 675 676 // Scroll Down 677 _header_el.removeClass('nav-down').addClass('nav-up'); 678 679 } else { 680 681 // Scroll Up 682 if(st + jQuery(window).height() < jQuery(document).height()) { 683 _header_el.removeClass('nav-up').addClass('nav-down'); 684 } 685 686 } 687 688 lastScrollTop = st; 689 } 690 691 } else 692 693 694 // STATIC + TRANSPARENT 695 if(_header_el.hasClass('static') && _header_el.hasClass('transparent')) { 696 697 _topBar_H = jQuery("#topBar").outerHeight() || 0; 698 699 // Force fixed header on mobile to avoid "jump" effect. 700 if(window.width <= 992 && _topBar_H < 1) { 701 702 var _scrollTop = jQuery(document).scrollTop(); 703 _header_H = _header_el.outerHeight() || 0; 704 705 _header_el.addClass('fixed'); 706 707 } 708 709 710 711 jQuery(window).scroll(function() { 712 713 if((window.width > 992 && _topBar_H < 1) || _topBar_H > 0) { // 992 to disable on mobile 714 715 var _scrollTop = jQuery(document).scrollTop(); 716 717 if(_scrollTop > _topBar_H) { 718 _header_el.addClass('fixed'); 719 720 _header_H = _header_el.outerHeight() || 0; 721 722 } else { 723 724 725 _header_el.removeClass('fixed'); 726 } 727 728 } 729 730 }); 731 732 733 734 } else 735 736 if(_header_el.hasClass('static')) { 737 // _header_H = _header_el.outerHeight() + "px"; 738 // jQuery('body').css({"padding-top":_header_H}); 739 } 740 741 742 743 // Slide Top 744 jQuery("#slidetop a.slidetop-toggle").bind("click", function() { 745 jQuery("#slidetop .container").slideToggle(150, function() { 746 747 if(jQuery("#slidetop .container").is(":hidden")) { 748 jQuery("#slidetop").removeClass('active'); 749 } else { 750 jQuery("#slidetop").addClass('active'); 751 } 752 753 }); 754 }); 755 // 'esc' key 756 jQuery(document).keyup(function(e) { 757 if(e.keyCode == 27) { 758 if(jQuery("#slidetop").hasClass("active")) { 759 jQuery("#slidetop .container").slideToggle(150, function() { 760 jQuery("#slidetop").removeClass('active'); 761 }); 762 } 763 } 764 }); 765 766 // Slide Panel 767 jQuery("a#sidepanel_btn").bind("click", function(e) { 768 e.preventDefault(); 769 770 _pos = "right"; 771 if(jQuery("#sidepanel").hasClass('sidepanel-inverse')) { 772 _pos = "left"; 773 } 774 775 if(jQuery("#sidepanel").is(":hidden")) { 776 777 jQuery("body").append('<span id="sidepanel_overlay"></span>'); 778 779 if(_pos == "left") { 780 jQuery("#sidepanel").stop().show().animate({"left":"0px"}, 150); 781 } else { 782 jQuery("#sidepanel").stop().show().animate({"right":"0px"}, 150); 783 } 784 785 } else { 786 787 jQuery("#sidepanel_overlay").remove(); 788 789 if(_pos == "left") { 790 jQuery("#sidepanel").stop().animate({"left":"-300px"}, 300); 791 } else { 792 jQuery("#sidepanel").stop().animate({"right":"-300px"}, 300); 793 } 794 795 setTimeout(function() { 796 jQuery("#sidepanel").hide(); 797 }, 500); 798 799 } 800 801 _sidepanel_overlay(); 802 803 }); 804 // button close 805 jQuery("#sidepanel_close").bind("click", function(e) { 806 e.preventDefault(); 807 jQuery("a#sidepanel_btn").trigger('click'); 808 }); 809 // overlay click 810 function _sidepanel_overlay() { 811 jQuery("#sidepanel_overlay").unbind(); 812 jQuery("#sidepanel_overlay").bind("click", function() { 813 jQuery("a#sidepanel_btn").trigger('click'); 814 }); 815 } 816 // 'esc' key 817 jQuery(document).keyup(function(e) { 818 if(e.keyCode == 27) { 819 if(jQuery("#sidepanel").is(":visible")) { 820 jQuery("a#sidepanel_btn").trigger('click'); 821 } 822 } 823 }); 824 825 826 827 /** OVERLAY MENU 828 *************************** **/ 829 if(jQuery("#menu_overlay_open").length > 0) { 830 var is_ie9 = jQuery('html').hasClass('ie9') ? true : false;
831 832 if(is_ie9 == true) { 833 jQuery("#topMain").hide(); 834 } 835 836 // open 837 jQuery("#menu_overlay_open").bind("click", function(e) { 838 e.preventDefault(); 839 840 jQuery('body').addClass('show-menu'); 841 842 if(is_ie9 == true) { 843 jQuery("#topMain").show(); 844 } 845 846 }); 847 848 // close 849 jQuery("#menu_overlay_close").bind("click", function(e) { 850 e.preventDefault(); 851 852 if(jQuery('body').hasClass('show-menu')) { 853 jQuery('body').removeClass('show-menu'); 854 } 855 856 if(is_ie9 == true) { 857 jQuery("#topMain").hide(); 858 } 859 860 }); 861 862 // 'esc' key 863 jQuery(document).keyup(function(e) { 864 if(e.keyCode == 27) { 865 if(jQuery('body').hasClass('show-menu')) { 866 jQuery('body').removeClass('show-menu'); 867 } 868 869 if(is_ie9 == true) { 870 jQuery("#topMain").hide(); 871 } 872 } 873 }); 874 875 } 876 877 /** VERTICAL MENU SHOW|HIDE 878 *************************** **/ 879 // RTL supported! 880 if(jQuery("#sidebar_vertical_btn").length > 0) { 881 if(jQuery("body").hasClass('menu-vertical-hide')) { 882 883 // Determine the position (left or right?) 884 _paddingStatusL = jQuery("#mainMenu.sidebar-vertical").css('left'); 885 _paddingStatusR = jQuery("#mainMenu.sidebar-vertical").css('right'); 886 887 if(parseInt(_paddingStatusL) < 0) { 888 var _pos = "left"; 889 } else 890 891 if(parseInt(_paddingStatusR) < 0) { 892 var _pos = "right"; 893 } 894 895 else { 896 var _pos = "left"; 897 } 898 899 // Show|Hide Vertical Menu 900 jQuery("#sidebar_vertical_btn").bind("click", function(e) { 901 902 _paddingStatus = jQuery("#mainMenu.sidebar-vertical").css(_pos); 903 904 if(parseInt(_paddingStatus) < 0) { 905 if(_pos == "right") { 906 jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"0px"}, 200); 907 } else { 908 jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"0px"}, 200); 909 } 910 } else { 911 if(_pos == "right") { 912 jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"-263px"}, 200); 913 } else { 914 jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"-263px"}, 200); 915 } 916 } 917 }); 918 919 // Hide on scroll 920 jQuery(window).scroll(function() { 921 922 _paddingStatus = parseInt(jQuery("#mainMenu.sidebar-vertical").css(_pos)); 923 924 if(_paddingStatus >= 0) { 925 if(_pos == "right") { 926 jQuery("#mainMenu.sidebar-vertical").stop().animate({"right":"-263px"}, 200); 927 } else { 928 jQuery("#mainMenu.sidebar-vertical").stop().animate({"left":"-263px"}, 200); 929 } 930 } 931 932 }); 933 934 } 935 } 936 937 // quick cart & search for mobile - top calculate 938 // Quick Cart & top Search Fix (if #topBar exists). 939 if(jQuery("#topBar").length > 0) { 940 jQuery("#topNav ul").addClass('has-topBar'); 941 } 942 943 // Hide Cart & Search on Scroll 944 jQuery(window).scroll(function() { 945 if(window.width < 769) { 946 // hide quick cart if visible 947 if (jQuery('#header li.quick-cart div.quick-cart-box').is(":visible")) { 948 jQuery('#header li.quick-cart div.quick-cart-box').fadeOut(0); 949 } 950 // hide search if visible 951 if(jQuery('#header li.search .search-box').is(":visible")) { 952 jQuery('#header .search-box').fadeOut(0); 953 } 954 } 955 }); 956 } 957 958 959 960 961 962 963 964/** Mega Horizontal Navigation 965 **************************************************************** **/ 966 function _megaNavHorizontal() { 967 968 // WRAPPER MAIN MENU 969 if(jQuery("#wrapper nav.main-nav").length > 0) { 970 971 var _sliderWidth = jQuery("#slider").width(), 972 _sliderHeight = jQuery("#wrapper nav.main-nav").height(); 973 974 // Submenu widh & height 975 jQuery("#wrapper nav.main-nav>div>ul>li>.main-nav-submenu").css({"min-height":_sliderHeight+"px"}); 976 jQuery("#wrapper nav.main-nav>div>ul>li.main-nav-expanded>.main-nav-submenu").css({"width":_sliderWidth+"px"}); 977 978 // SUBMENUS 979 jQuery("#wrapper nav.main-nav>div>ul>li").bind("click", function(e) { 980 var _this = jQuery(this); 981 982 if(!jQuery('div', _this).hasClass('main-nav-open')) { 983 jQuery("#wrapper nav.main-nav>div>ul>li>.main-nav-submenu").removeClass('main-nav-open'); 984 } 985 986 jQuery('div', _this).toggleClass('main-nav-open'); 987 }); 988 989 } 990 991 992 993 994 995 996 // HEADER MAIN MENU 997 var _hsliderWidth = jQuery("#header>.container").width() - 278, 998 _hsliderHeight = jQuery("#header nav.main-nav").height(); 999 1000 // Submenu widh & height 1001 jQuery("#header nav.main-nav>div>ul>li>.main-nav-submenu").css({"min-height":_hsliderHeight+"px"}); 1002 jQuery("#header nav.main-nav>div>ul>li.main-nav-expanded>.main-nav-submenu").css({"width":_hsliderWidth+"px"}); 1003 1004 1005 // SUBMENUS 1006 jQuery("#header nav.main-nav>div>ul>li").bind("click", function(e) { 1007 var _this = jQuery(this); 1008 1009 if(!jQuery('div', _this).hasClass('main-nav-open')) { 1010 jQuery("#header nav.main-nav>div>ul>li>.main-nav-submenu").removeClass('main-nav-open'); 1011 } 1012 1013 jQuery('div', _this).toggleClass('main-nav-open'); 1014 }); 1015 1016 1017 1018 1019 // HEADER MAIN MENU 1020 if(window.width > 767) { // desktop|tablet 1021 1022 jQuery("#header button.nav-toggle").mouseover(function(e) { 1023 e.preventDefault(); 1024 1025 _initMainNav(); 1026 1027 }); 1028 1029 1030 } else { // mobile 1031 1032 jQuery("#header button.nav-toggle").bind("click", function(e) { 1033 e.preventDefault(); 1034 1035 _initMainNav(); 1036 1037 }); 1038 1039 } 1040 1041 jQuery('body').on('click', '#header button.nav-toggle, #header nav.main-nav', function (e) { 1042 e.stopPropagation(); 1043 }); 1044 1045 jQuery("#header button.nav-toggle, #header nav.main-nav").mouseover(function(e) { 1046 e.stopPropagation(); 1047 }); 1048 1049 1050 jQuery(document).bind("click", function() { 1051 1052 _hideMainNav(); 1053 1054 }); 1055 1056 1057 1058 function _initMainNav() { 1059 1060 // remove overlay first, no matter what 1061 jQuery("#main-nav-overlay").remove(); 1062 1063 // open menu 1064 jQuery("#header nav.main-nav").addClass('min-nav-active'); 1065 1066 // add overlay 1067 jQuery('body').append('<div id="main-nav-overlay"></div>'); 1068 1069 // Mobile menu open|close on click 1070 jQuery('#header button.nav-toggle-close').bind("click", function() { 1071 jQuery("#header nav.main-nav").removeClass('min-nav-active'); 1072 }); 1073 1074 // Close menu on hover 1075 jQuery("#main-nav-overlay, #header").mouseover(function() { 1076 1077 _hideMainNav(); 1078 1079 }); 1080 1081 } 1082 1083 function _hideMainNav() { 1084 jQuery("#main-nav-overlay").remove(); 1085 jQuery("#header nav.main-nav").removeClass('min-nav-active'); 1086 } 1087 1088 1089 // Menu Click 1090 jQuery("nav.main-nav>div>ul>li a").bind("click", function(e) { 1091 var _href = jQuery(this).attr('href'); 1092 1093 if(_href == '#') { 1094 e.preventDefault(); 1095 } 1096 }); 1097 } 1098 1099 1100 1101 1102 1103 1104 1105/** 02. Side Nav 1106 **************************************************************** **/ 1107 function _sideNav() { 1108 1109 1110 /* Mobile Button */ 1111 jQuery("div.side-nav").each(function() { 1112 var _t = jQuery('ul', this); 1113 jQuery('button', this).bind("click", function() { 1114 _t.slideToggle(300); 1115 }); 1116 }); 1117 1118 1119 /* Submenus */ 1120 jQuery("div.side-nav li>a.dropdown-toggle").bind("click", function(e) { 1121 e.preventDefault(); 1122 1123 jQuery(this).next('ul').slideToggle(200); 1124 jQuery(this).closest('li').toggleClass('active'); 1125 }); 1126 1127 } 1128 1129 1130 1131/** 02. Animate 1132 1133 EXAMPLE USAGE 1134 <img class="wow fadeInUp" data-wow-delay="0.1s" src="image.jpg" alt="" /> 1135 **************************************************************** **/ 1136 function _animate() { 1137 1138 if(jQuery("body").hasClass('enable-animation')) { 1139 1140 var wow = new WOW({ 1141 boxClass: 'wow', 1142 animateClass: 'animated', 1143 offset: 15, 1144 mobile: false, 1145 live: true 1146 }); 1147 1148 wow.init(); 1149 1150 } 1151 1152 // Count To 1153 jQuery(".countTo").appear(function(){ 1154 var _t = jQuery(this), 1155 _from = _t.attr('data-from') || 0, 1156 _speed = _t.attr('data-speed') || 1300, 1157 _refreshInterval = _t.attr('data-refreshInterval') || 60; 1158 1159 1160 _t.countTo({ 1161 from: parseInt(_from), 1162 to: _t.html(), 1163 speed: parseInt(_speed), 1164 refreshInterval: parseInt(_refreshInterval), 1165 }); 1166 1167 }); 1168 } 1169 1170 1171 1172/** Onepage Nav 1173 **************************************************************** **/ 1174 function _onepageNav() { 1175 1176 1177 // Top Navigation 1178 var _container1 = jQuery(".nav-onepage"); 1179 1180 if(_container1.length > 0) { 1181 1182 loadScript(plugin_path + 'jquery.nav.min.js', function() { 1183 1184 jQuery(_container1).onePageNav({ 1185 currentClass: 'active', 1186 changeHash: false, 1187 scrollSpeed: 750, 1188 scrollThreshold: 0.5, 1189 filter: ':not(.external)', 1190 easing: 'easeInOutExpo' 1191 }); 1192 1193 // Close Nav on menu click 1194 jQuery("#topMain.nav-onepage li>a").bind("click", function() { 1195 if(window.width < 960) { 1196 jQuery("button.btn-mobile").trigger('click'); 1197 } 1198 }); 1199 1200 }); 1201 1202 } 1203 1204 1205 // Bullet Navigation 1206 var _container2 = jQuery("#nav-bullet"); 1207 1208 if(_container2.length > 0) { 1209 1210 loadScript(plugin_path + 'jquery.nav.min.js', function() { 1211 1212 jQuery(_container2).onePageNav({ 1213 currentClass: 'active', 1214 changeHash: false, 1215 scrollSpeed: 750, 1216 scrollThreshold: 0.5, 1217 filter: ':not(.external)', 1218 easing: 'easeInOutExpo' 1219 }); 1220 1221 }); 1222 1223 } 1224 1225 1226 } 1227 1228 1229 1230/** 03. OWL Carousel
1231 **************************************************************** **/ 1232 function _owl_carousel() { 1233 1234 1235 // OWL CAROUSEL 1 1236 var _container = jQuery("div.owl-carousel"); 1237 1238 if(_container.length > 0) { 1239 1240 loadScript(plugin_path + 'owl-carousel/owl.carousel.min.js', function() { 1241 1242 _container.each(function() { 1243 1244 var slider = jQuery(this); 1245 var options = slider.attr('data-plugin-options'); 1246 1247 // Progress Bar 1248 var $opt = eval('(' + options + ')'); // convert text to json 1249 1250 if($opt.progressBar == 'true') { 1251 var afterInit = progressBar; 1252 } else { 1253 var afterInit = false; 1254 } 1255 1256 var defaults = { 1257 items: 5, 1258 itemsCustom: false, 1259 itemsDesktop: [1199,4], 1260 itemsDesktopSmall: [980,3], 1261 itemsTablet: [768,2], 1262 itemsTabletSmall: false, 1263 itemsMobile: [479,1], 1264 singleItem: true, 1265 itemsScaleUp: false, 1266 1267 slideSpeed: 200, 1268 paginationSpeed: 800, 1269 rewindSpeed: 1000, 1270 1271 autoPlay: false, 1272 stopOnHover: false, 1273 1274 navigation: false, 1275 navigationText: [ 1276 '<i class="fa fa-angle-left"></i>', 1277 '<i class="fa fa-angle-right"></i>' 1278 ], 1279 rewindNav: true, 1280 scrollPerPage: false, 1281 1282 pagination: true, 1283 paginationNumbers: false, 1284 1285 responsive: true, 1286 responsiveRefreshRate: 200, 1287 responsiveBaseWidth: window, 1288 1289 baseClass: "owl-carousel", 1290 theme: "owl-theme", 1291 1292 lazyLoad: false, 1293 lazyFollow: true, 1294 lazyEffect: "fade", 1295 1296 autoHeight: false, 1297 1298 jsonPath: false, 1299 jsonSuccess: false, 1300 1301 dragBeforeAnimFinish: true, 1302 mouseDrag: true, 1303 touchDrag: true, 1304 1305 transitionStyle: false, 1306 1307 addClassActive: false, 1308 1309 beforeUpdate: false, 1310 afterUpdate: false, 1311 beforeInit: false, 1312 afterInit: afterInit, 1313 beforeMove: false, 1314 afterMove: (afterInit == false) ? false : moved, 1315 afterAction: false, 1316 startDragging: false, 1317 afterLazyLoad: false 1318 } 1319 1320 var config = jQuery.extend({}, defaults, options, slider.data("plugin-options")); 1321 slider.owlCarousel(config).addClass("owl-carousel-init"); 1322 1323 1324 // Progress Bar 1325 var elem = jQuery(this); 1326 1327 //Init progressBar where elem is $("#owl-demo") 1328 function progressBar(elem){ 1329 $elem = elem; 1330 //build progress bar elements 1331 buildProgressBar(); 1332 //start counting 1333 start(); 1334 } 1335 1336 //create div#progressBar and div#bar then prepend to $("#owl-demo") 1337 function buildProgressBar(){ 1338 $progressBar = jQuery("<div>",{ 1339 id:"progressBar" 1340 }); 1341 $bar = jQuery("<div>",{ 1342 id:"bar" 1343 }); 1344 $progressBar.append($bar).prependTo($elem); 1345 } 1346 1347 function start() { 1348 //reset timer 1349 percentTime = 0; 1350 isPause = false; 1351 //run interval every 0.01 second 1352 tick = setInterval(interval, 10); 1353 }; 1354 1355 1356 var time = 7; // time in seconds 1357 function interval() { 1358 if(isPause === false){ 1359 percentTime += 1 / time; 1360 $bar.css({ 1361 width: percentTime+"%" 1362 }); 1363 //if percentTime is equal or greater than 100 1364 if(percentTime >= 100){ 1365 //slide to next item 1366 $elem.trigger('owl.next') 1367 } 1368 } 1369 } 1370 1371 //pause while dragging 1372 function pauseOnDragging(){ 1373 isPause = true; 1374 } 1375 1376 //moved callback 1377 function moved(){ 1378 //clear interval 1379 clearTimeout(tick); 1380 //start again 1381 start(); 1382 } 1383 1384 }); 1385 1386 }); 1387 1388 } 1389 1390 1391 1392 // OWL CAROUSEL 2 1393 var _container2 = jQuery("div.owl-carousel-2"); 1394 1395 if(_container2.length > 0) { 1396 1397 loadScript(plugin_path + 'owl-carousel-2/owl.carousel.min.js', function() { 1398 1399 1400 _container2.each(function() { 1401 var _this = jQuery(this), 1402 _options = _this.attr('data-plugin-options'); 1403 1404 _defaults = { 1405 loop: true, 1406 margin: 10, 1407 nav: true, 1408 1409 center: false, 1410 mouseDrag: true, 1411 touchDrag: true, 1412 pullDrag: true, 1413 freeDrag: false, 1414 stagePadding: 0, 1415 merge: false, 1416 mergeFit: true, 1417 autoWidth: false, 1418 startPosition: 0, 1419 URLhashListener: false, 1420 navRewind: true, 1421 navText: [ 1422 '<i class="fa fa-angle-left"></i>', 1423 '<i class="fa fa-angle-right"></i>' 1424 ], 1425 slideBy: 1, 1426 dots: true, 1427 dotsEach: false, 1428 dotData: false, 1429 lazyLoad: false, 1430 lazyContent: false, 1431 autoplay: false, 1432 autoplayTimeout: 3000, 1433 autoplayHoverPause: false, 1434 smartSpeed: 250, 1435 //fluidSpeed: 'Number', 1436 autoplaySpeed: false, 1437 navSpeed: false, 1438 //dotsSpeed: 'Number/Boolean', 1439 dragEndSpeed: false, 1440 callbacks: true, 1441 responsiveRefreshRate: 200, 1442 responsiveBaseElement: '#wrapper', 1443 responsiveClass: true, 1444 video: false, 1445 videoHeight: false, 1446 videoWidth: false, 1447 animateOut: false, 1448 animateIn: false, 1449 fallbackEasing: 'swing', 1450 info: false, 1451 nestedItemSelector: false, 1452 itemElement: 'div', 1453 navContainer: false, 1454 dotsContainer: false, 1455 1456 animateOut: "slideOutDown",
1457 animateIn: "flipInX", 1458 1459 responsive:{ 1460 0:{ 1461 items:1 1462 }, 1463 600:{ 1464 items:2 1465 }, 1466 1000:{ 1467 items:5 1468 } 1469 } 1470 }; 1471 1472 1473 var _config = jQuery.extend({}, _defaults, JSON.parse(_options)); 1474 _this.owlCarousel(_config).addClass("owl-loaded"); 1475 1476 1477 }); 1478 1479 1480 }); 1481 1482 } 1483 1484 1485 } 1486 1487 1488/** 04. Flexslider 1489 **************************************************************** **/ 1490 function _flexslider() { 1491 var _container = jQuery(".flexslider"); 1492 1493 if(_container.length > 0) { 1494 1495 loadScript(plugin_path + 'slider.flexslider/jquery.flexslider-min.js', function() { 1496 1497 if(jQuery().flexslider) { 1498 var _controlNav = _container.attr('data-controlNav'), 1499 _slideshowSpeed = _container.attr('data-slideshowSpeed') || 7000, 1500 _pauseOnHover = _container.attr('data-pauseOnHover') || false; 1501 1502 if(_pauseOnHover == "true") { 1503 _pauseOnHover = true; 1504 } else{ 1505 _pauseOnHover = false; 1506 } 1507 1508 if(_controlNav == 'thumbnails') { 1509 _controlNav = 'thumbnails'; 1510 } else 1511 if(_controlNav == 'true') { 1512 _controlNav = true; 1513 } else 1514 if(_controlNav == 'false') { 1515 _controlNav = false; 1516 } else { 1517 _controlNav = true; 1518 } 1519 1520 if(_controlNav == 'thumbnails' || _controlNav == false) { 1521 _directionNav = false;
1522 } else { 1523 _directionNav = true; 1524 } 1525 1526 jQuery(_container).flexslider({ 1527 animation : "slide", 1528 controlNav : _controlNav, 1529 slideshowSpeed : parseInt(_slideshowSpeed) || 7000, 1530 directionNav : _directionNav, 1531 pauseOnHover : _pauseOnHover, 1532 start: function(slider){ 1533 jQuery('.flex-prev').html('<i class="fa fa-angle-left"></i>'); 1534 jQuery('.flex-next').html('<i class="fa fa-angle-right"></i>'); 1535 } 1536 }); 1537 1538 // Resize Flex Slider if exists! 1539 _container.resize(); 1540 1541 } 1542 1543 }); 1544 } 1545 } 1546 1547 1548 1549 1550 1551/** 05. LightBox 1552 **************************************************************** **/ 1553 function _lightbox() { 1554 var _el = jQuery(".lightbox"); 1555 1556 if(_el.length > 0) { 1557 1558 loadScript(plugin_path + 'magnific-popup/jquery.magnific-popup.min.js', function() { 1559 1560 if(typeof(jQuery.magnificPopup) == "undefined") { 1561 return false; 1562 } 1563 1564 jQuery.extend(true, jQuery.magnificPopup.defaults, { 1565 tClose: 'Close', 1566 tLoading: 'Loading...', 1567 1568 gallery: { 1569 tPrev: 'Previous', 1570 tNext: 'Next', 1571 tCounter: '%curr% / %total%' 1572 }, 1573 1574 image: { 1575 tError: 'Image not loaded!' 1576 }, 1577 1578 ajax: { 1579 tError: 'Content not loaded!' 1580 } 1581 }); 1582 1583 _el.each(function() { 1584 1585 var _t = jQuery(this), 1586 options = _t.attr('data-plugin-options'), 1587 config = {}, 1588 defaults = { 1589 type: 'image', 1590 fixedContentPos: false, 1591 fixedBgPos: false, 1592 mainClass: 'mfp-no-margins mfp-with-zoom', 1593 closeOnContentClick: true, 1594 closeOnBgClick: true, 1595 image: { 1596 verticalFit: true 1597 }, 1598 1599 zoom: { 1600 enabled: false, 1601 duration: 300 1602 }, 1603 1604 gallery: { 1605 enabled: false, 1606 navigateByImgClick: true, 1607 preload: [0,1], 1608 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 1609 tPrev: 'Previous', 1610 tNext: 'Next', 1611 tCounter: '<span class="mfp-counter">%curr% / %total%</span>' 1612 }, 1613 }; 1614 1615 if(_t.data("plugin-options")) { 1616 config = jQuery.extend({}, defaults, options, _t.data("plugin-options")); 1617 } 1618 1619 jQuery(this).magnificPopup(config); 1620 1621 }); 1622 1623 }); 1624 1625 } 1626 1627 } 1628 1629 1630 1631 1632/** 06. ScrollTo 1633 **************************************************************** **/ 1634 function _scrollTo(to, offset) { 1635 1636 if(to == false) { 1637 1638 jQuery("a.scrollTo").bind("click", function(e) { 1639 e.preventDefault(); 1640 1641 var href = jQuery(this).attr('href'), 1642 _offset = jQuery(this).attr('data-offset') || 0; 1643 1644 if(href != '#' && href != '#top') { 1645 jQuery('html,body').animate({scrollTop: jQuery(href).offset().top - parseInt(_offset)}, 800, 'easeInOutExpo'); 1646 } 1647 1648 if(href == '#top') { 1649 jQuery('html,body').animate({scrollTop: 0}, 800, 'easeInOutExpo'); 1650 } 1651 }); 1652 1653 jQuery("#toTop").bind("click", function(e) { 1654 e.preventDefault(); 1655 jQuery('html,body').animate({scrollTop: 0}, 800, 'easeInOutExpo'); 1656 }); 1657 1658 } else { 1659 1660 // USAGE: _scrollTo("#footer", 150); 1661 jQuery('html,body').animate({scrollTop: jQuery(to).offset().top - offset}, 800, 'easeInOutExpo'); 1662 1663 } 1664 } 1665 1666 1667 1668 1669/** 07. Parallax 1670 **************************************************************** **/ 1671 function _parallax() { 1672 1673 1674 if(jQuery().parallax) { 1675 1676 jQuery(".parallax-auto, .parallax-1, .parallax-2, .parallax-3, .parallax-4, section.page-header.page-header-parallax").each(function() { 1677 var _t = jQuery(this); 1678 1679 jQuery(this).parallax("50%","0.2"); 1680 }); 1681 1682 } 1683 1684 1685 1686 1687 /** Slider Parallax 1688 Do not use overlay - will be very slow! 1689 **************************** **/ 1690 var _slider = jQuery('#slider'); 1691 1692 if(_slider.length > 0) { 1693 if(_slider.hasClass('parallax-slider')) { 1694 1695 if(window.width < 768 && _slider.hasClass('pallax-slider-mobile-deisable')) { 1696 return false; 1697 } 1698 1699 var block_intro_top = _slider.offset().top; 1700 1701 jQuery(window).scroll(function() { 1702 1703 var _currentTop = jQuery(document).scrollTop(), 1704 _offset = _slider.attr('data-parallax-offset') || 0; 1705 1706 if(_currentTop < 768) { 1707 var _sliderH = jQuery('#slider').height(); 1708 1709 jQuery('#slider>div').css('top', (_currentTop*0.5 - Number(_offset))); 1710 if(!_slider.hasClass('parallax-slider-noopacity')) { 1711 jQuery('#slider>div').css('opacity', (1 - _currentTop/_sliderH*1)); 1712 } 1713 } 1714 1715 }); 1716 1717 } 1718 } 1719 1720 } 1721 1722 1723 1724 1725/** 07. Video 1726 **************************************************************** **/ 1727 function _video() { 1728
1729 if(jQuery("section.section-video").length > 0) { 1730 var _t = jQuery("section.section-video .section-container-video>video"); 1731 _w = jQuery(window).width(); 1732 1733 _t.width(_w); 1734 1735 } 1736 1737 } 1738 1739 1740 1741/** 07. Youtube Backround 1742 **************************************************************** **/ 1743 function _youtubeBG() { 1744 var _container = jQuery('#YTPlayer'); 1745 1746 if(_container.length > 0) { 1747 loadScript(plugin_path + 'jquery.mb.YTPlayer.min.js', function() { 1748 1749 1750 if(jQuery().mb_YTPlayer) { 1751 var disableMobile = false; 1752 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { 1753 // disableMobile = true; 1754 } 1755 1756 if(disableMobile === false) { 1757 1758 jQuery(".player").mb_YTPlayer(); 1759 1760 jQuery("#video-volume").bind("click", function(e) { 1761 e.preventDefault(); 1762 1763 jQuery('#YTPlayer').toggleVolume(); 1764 }); 1765 1766 // audio control 1767 jQuery("#video-volume").bind("click", function() { 1768 if(jQuery('i.fa', this).hasClass('fa-volume-down')) { 1769 jQuery('i.fa', this).removeClass('fa-volume-down'); 1770 jQuery('i.fa', this).removeClass('fa-volume-up'); 1771 jQuery('i.fa', this).addClass('fa-volume-up'); 1772 } else { 1773 jQuery('i.fa', this).removeClass('fa-volume-up'); 1774 jQuery('i.fa', this).removeClass('fa-volume-v'); 1775 jQuery('i.fa', this).addClass('fa-volume-down'); 1776 } 1777 }); 1778 1779 } else { 1780 1781 jQuery(".player , #video-volume").hide(); 1782 1783 } 1784 1785 } 1786 1787 }); 1788 } 1789 } 1790 1791 1792/** 08. Mixitup Filter 1793 **************************************************************** **/ 1794 function _mixitup() { 1795 var _container = jQuery('.mix-grid'); 1796 1797 if(_container.length > 0) { 1798 loadScript(plugin_path + 'mixitup/jquery.mixitup.min.js', function() { 1799 1800 if(jQuery().mixitup) { 1801 1802 _container.mixitup(); 1803 jQuery("ul.mix-filter a").bind("click", function(e) { 1804 e.preventDefault(); 1805 }); 1806 1807 } 1808 1809 }); 1810 1811 } 1812 1813 } 1814 1815 1816 1817/** 09. Toggle 1818 **************************************************************** **/ 1819 function _toggle() { 1820 1821 var $_t = this, 1822 previewParClosedHeight = 25; 1823 1824 jQuery("div.toggle.active > p").addClass("preview-active"); 1825 jQuery("div.toggle.active > div.toggle-content").slideDown(400); 1826 jQuery("div.toggle > label").click(function(e) { 1827 1828 var parentSection = jQuery(this).parent(), 1829 parentWrapper = jQuery(this).parents("div.toggle"), 1830 previewPar = false, 1831 isAccordion = parentWrapper.hasClass("toggle-accordion"); 1832 1833 if(isAccordion && typeof(e.originalEvent) != "undefined") { 1834 parentWrapper.find("div.toggle.active > label").trigger("click"); 1835 } 1836 1837 parentSection.toggleClass("active"); 1838 1839 if(parentSection.find("> p").get(0)) { 1840 1841 previewPar = parentSection.find("> p"); 1842 var previewParCurrentHeight = previewPar.css("height"); 1843 var previewParAnimateHeight = previewPar.css("height"); 1844 previewPar.css("height", "auto"); 1845 previewPar.css("height", previewParCurrentHeight); 1846 1847 } 1848 1849 var toggleContent = parentSection.find("> div.toggle-content"); 1850 1851 if(parentSection.hasClass("active")) { 1852 1853 jQuery(previewPar).animate({height: previewParAnimateHeight}, 350, function() {jQuery(this).addClass("preview-active");}); 1854 toggleContent.slideDown(350); 1855 1856 } else { 1857 1858 jQuery(previewPar).animate({height: previewParClosedHeight}, 350, function() {jQuery(this).removeClass("preview-active");}); 1859 toggleContent.slideUp(350); 1860 1861 } 1862 1863 }); 1864 } 1865 1866 1867 1868/** 11. Placeholder 1869 **************************************************************** **/ 1870 function _placeholder() { 1871 1872 //check for IE 1873 if(navigator.appVersion.indexOf("MSIE")!=-1) { 1874 1875 jQuery('[placeholder]').focus(function() { 1876 1877 var input = jQuery(this); 1878 if (input.val() == input.attr('placeholder')) { 1879 input.val(''); 1880 input.removeClass('placeholder'); 1881 } 1882 1883 }).blur(function() { 1884 1885 var input = jQuery(this); 1886 if (input.val() == '' || input.val() == input.attr('placeholder')) { 1887 input.addClass('placeholder'); 1888 input.val(input.attr('placeholder')); 1889 } 1890 1891 }).blur(); 1892 1893 } 1894 1895 } 1896 1897 1898 1899/** 12. Word Rotate 1900 **************************************************************** **/ 1901 function _wrotate() { 1902 jQuery(".word-rotator").each(function() { 1903 1904 var _t = jQuery(this),
1905 _items = _t.find(".items"), 1906 items = _items.find("> span"), 1907 firstItem = items.eq(0), 1908 firstItemClone = firstItem.clone(), 1909 _iHeight = jQuery(this).height(), 1910 _cItem = 1, 1911 _cTop = 0, 1912 _delay = jQuery(this).attr('data-delay') || 2000; 1913 1914 _items.append(firstItemClone); 1915 _t.height(_iHeight).addClass("active"); 1916 1917 setInterval(function() { 1918 _cTop = (_cItem * _iHeight); 1919 1920 _items.animate({top: - (_cTop) + "px"}, 300, "easeOutQuad", function(){ 1921 _cItem++; 1922 1923 if(_cItem > items.length) { 1924 _items.css("top", 0); 1925 _cItem = 1; 1926 } 1927 1928 }); 1929 1930 }, _delay); 1931 1932 }); 1933 1934 1935 var _container = jQuery('span.rotate'); 1936 1937 if(_container.length > 0) { 1938 1939 loadScript(plugin_path + 'text-rotator/jquery.simple-text-rotator.min.js', function() { 1940 1941 _container.each(function() { 1942 var _t = jQuery(this), 1943 _animation = _t.attr('data-animation') || 'fade', // fade|flip|flipCube|flipUp|spin 1944 _speed = _t.attr('data-speed') || 2000; 1945 1946 _t.textrotator({ 1947 animation: _animation, 1948 speed: parseInt(_speed) 1949 }); 1950 1951 }); 1952 1953 }); 1954 1955 } 1956 } 1957 1958 1959 1960 1961/** 08. Lazy Load 1962 <img class="lazy" data-original="img/example.jpg" width="765" height="574"> 1963 **************************************************************** **/ 1964 function _lazyload() { 1965 var _container = jQuery('img.lazy'); 1966 1967 if(_container.length > 0) { 1968 loadScript(plugin_path + 'lazyload/jquery.lazyload.min.js', function() { 1969 1970 if(jQuery().lazyload) { 1971 1972 _container.each(function () { 1973 var _t = jQuery(this), 1974 _effect = _t.attr('data-effect') || 'fadeIn'; 1975 1976 _t.lazyload({ 1977 effect : _effect 1978 }); 1979 }); 1980 1981 } 1982 1983 }); 1984 1985 } 1986 1987 } 1988 1989 1990 1991 1992 1993/** 13. Misc 1994 **************************************************************** **/ 1995 function _misc() { 1996 1997 1998 /** Portfolio Bugfix 1999 *********************** **/ 2000 if(jQuery("#portfolio").length > 0) { 2001 jQuery("#portfolio .item-box .owl-carousel").each(function() { 2002 2003 // Fix if has owl-carousel slider! 2004 jQuery(this).parent().parent().find('.item-box-desc').css({"padding-top":"29px"}); 2005 2006 }); 2007 } 2008 2009 /** Masonry 2010 *********************** **/ 2011 if(jQuery().masonry) { 2012 jQuery(".masonry").masonry(); 2013 } 2014 2015 2016 2017 /** Isotope Portfolio 2018 *********************** **/ 2019 var portfolio_isotope_container = jQuery("#portfolio.portfolio-isotope"); 2020 2021 if(portfolio_isotope_container.length > 0) { 2022 loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() { 2023 2024 // Isotope Portfolio 2025 if(jQuery().isotope) { 2026 2027 var _container = jQuery('#portfolio'); 2028 2029 // Calculate Item Width on Fullwidth portfolio 2030 if(_container.hasClass('portfolio-isotope-2')) { 2031 _cols = 2; 2032 } else 2033 if(_container.hasClass('portfolio-isotope-3')) { 2034 _cols = 3; 2035 } else 2036 if(_container.hasClass('portfolio-isotope-4')) { 2037 _cols = 4; 2038 } else 2039 if(_container.hasClass('portfolio-isotope-5')) { 2040 _cols = 5; 2041 } else 2042 if(_container.hasClass('portfolio-isotope-6')) { 2043 _cols = 6; 2044 } else { _cols = 4; } 2045 2046 2047 2048 function _recalcW() { 2049 _dw = jQuery(document).width(); 2050 2051 if(_container.hasClass('fullwidth')) { // Fullwidth 2052 2053 // _w = jQuery(document).width(); // NOT USED - problems on aside header 2054 _w = _container.width(); 2055 _wItem = (_w/_cols); 2056 2057 if(_dw < 760) { 2058 _wItem = (_w/2); 2059 } 2060 if(_dw < 480) { 2061 _wItem = jQuery("#portfolio").width(); 2062 } 2063 2064 // Apply item width 2065 jQuery("#portfolio>.portfolio-item").css({"width":_wItem}); 2066 2067 } else { // Non Fullwidth 2068 2069 _mR = parseInt(jQuery("#portfolio>.portfolio-item").css('margin-right')); 2070 _w = jQuery("#portfolio").closest('.container').width(); 2071 _wItem = _w / _cols - _mR; 2072 2073 if(_dw < 760) { 2074 _wItem = (_w/2 - _mR); 2075 } 2076 if(_dw < 480) { 2077 _wItem = _w; 2078 } 2079 2080 // Apply item & container width 2081 jQuery("#portfolio.portfolio-isotope").css({"width":_w}); 2082 jQuery("#portfolio>.portfolio-item").css({"width":_wItem}); 2083 2084 } 2085 2086 // Resize Flex Slider if exists! 2087 if(jQuery('.flexslider').length > 0) { 2088 jQuery('.flexslider').resize(); 2089 } 2090 2091 } _recalcW(); 2092 2093 2094 2095 jQuery(window).on("load", function(){ 2096 2097 var _t = setTimeout(function(){ 2098 2099 _container.isotope({ 2100 masonry: {}, 2101 2102 filter: '*', 2103 animationOptions: { 2104 duration: 750, 2105 easing: 'linear', 2106 queue: false 2107 } 2108 }); 2109 2110 jQuery('#portfolio_filter>li>a').bind("click", function(e){ 2111 e.preventDefault(); 2112 2113 jQuery('#portfolio_filter>li.active').removeClass('active'); 2114 jQuery(this).parent('li').addClass('active'); 2115 2116 var selector = jQuery(this).attr('data-filter'); 2117 _container.isotope({ 2118 filter: selector, 2119 animationOptions: { 2120 duration: 750, 2121 easing: 'linear', 2122 queue: false 2123 } 2124 }); 2125 2126 }); 2127 2128 2129 }, 50 ); 2130 2131 setTimeout(function() { 2132 _container.isotope('layout'); 2133 }, 300); 2134 2135 }); 2136 2137 2138 2139 // On Resize 2140 jQuery(window).resize(function() { 2141 2142 if(window.afterResizeApp2) { 2143 clearTimeout(window.afterResizeApp2); 2144 } 2145 2146 window.afterResizeApp2 = setTimeout(function() { 2147 2148 _recalcW(); 2149 2150 setTimeout(function() { 2151 _container.isotope('layout'); 2152 }, 300); 2153 2154 }, 300); 2155 2156 }); 2157 2158 2159 } 2160 2161 2162 }); 2163 } /** end isotope **/ 2164 2165 2166 2167 2168 /** Isotope Blog 2169 *********************** **/ 2170 var blog_isotope_container = jQuery("#blog.blog-isotope"); 2171 2172 if(blog_isotope_container.length > 0) { 2173 loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() { 2174 2175 // Isotope blog 2176 if(jQuery().isotope) { 2177 2178 var _container = jQuery('#blog'); 2179 2180 // Calculate Item Width on Fullwidth Blog 2181 if(_container.hasClass('blog-isotope-2')) { 2182 _cols = 2; 2183 } else 2184 if(_container.hasClass('blog-isotope-3')) { 2185 _cols = 3; 2186 } else 2187 if(_container.hasClass('blog-isotope-4')) { 2188 _cols = 4; 2189 } else { _cols = 4; } 2190 2191 2192 function _recalcW() { 2193 _dw = jQuery(document).width(); 2194 2195 if(_container.hasClass('fullwidth')) { // Fullwidth 2196 2197 _w = jQuery(document).width(); 2198 _wItem = (_w/_cols); 2199 2200 if(_dw < 760) { 2201 _wItem = (_w/2); 2202 } 2203 if(_dw < 480) { 2204 _wItem = jQuery("#blog").width(); 2205 } 2206 2207 // Apply item width 2208 jQuery("#blog>.blog-post-item").css({"width":_wItem}); 2209 2210 } else { // Non Fullwidth 2211
2212 _mR = parseInt(jQuery("#blog>.blog-post-item").css('margin-right')); 2213 _w = jQuery("#blog").closest('.container').width(); 2214 _wItem = _w / _cols - _mR; 2215 2216 if(_dw < 760) { 2217 _wItem = (_w/2 - _mR); 2218 } 2219 if(_dw < 480) { 2220 _wItem = _w; 2221 } 2222 2223 // Apply item & container width 2224 jQuery("#blog.blog-isotope").css({"width":_w}); 2225 jQuery("#blog>.blog-post-item").css({"width":_wItem}); 2226 2227 } 2228 2229 // Resize Flex Slider if exists! 2230 if(jQuery('.flexslider').length > 0) { 2231 jQuery('.flexslider').resize(); 2232 } 2233 2234 } _recalcW(); 2235 2236 2237 2238 jQuery(window).on("load", function(){ 2239 2240 var _t = setTimeout(function(){ 2241 2242 _container.isotope({ 2243 masonry: {}, 2244 2245 filter: '*', 2246 animationOptions: { 2247 duration: 750, 2248 easing: 'linear', 2249 queue: false 2250 } 2251 }); 2252 2253 jQuery('#blog_filter>li>a').bind("click", function(e){ 2254 e.preventDefault(); 2255 2256 jQuery('#blog_filter>li.active').removeClass('active'); 2257 jQuery(this).parent('li').addClass('active'); 2258 2259 var selector = jQuery(this).attr('data-filter'); 2260 _container.isotope({ 2261 filter: selector, 2262 animationOptions: { 2263 duration: 750, 2264 easing: 'linear', 2265 queue: false 2266 } 2267 }); 2268 2269 }); 2270 2271 2272 }, 50 ); 2273 2274 setTimeout(function() { 2275 _container.isotope('layout'); 2276 }, 300); 2277 2278 }); 2279 2280 2281 2282 // On Resize 2283 jQuery(window).resize(function() { 2284 2285 if(window.afterResizeApp2) { 2286 clearTimeout(window.afterResizeApp2); 2287 } 2288 2289 window.afterResizeApp2 = setTimeout(function() { 2290 2291 _recalcW(); 2292 2293 setTimeout(function() { 2294 _container.isotope('layout'); 2295 }, 300); 2296 2297 }, 300); 2298 2299 }); 2300 2301 2302 } 2303 2304 2305 }); 2306 } /** end isotope **/ 2307 2308 2309 2310 2311 /** Flip Boxes 2312 *********************** **/ 2313 if(jQuery('.box-flip').length > 0) { 2314 2315 jQuery('.box-flip').each(function() { 2316 _height1 = jQuery('.box1',this).outerHeight(); 2317 _height2 = jQuery('.box2',this).outerHeight(); 2318 2319 if(_height1 >= _height2) { 2320 _height = _height1; 2321 } else { 2322 _height = _height2; 2323 } 2324 2325 jQuery(this).css({"min-height":_height+"px"}); 2326 jQuery('.box1',this).css({"min-height":_height+"px"}); 2327 jQuery('.box2',this).css({"min-height":_height+"px"}); 2328 }); 2329 2330 jQuery('.box-flip').hover(function() { 2331 jQuery(this).addClass('flip'); 2332 },function(){ 2333 jQuery(this).removeClass('flip'); 2334 }); 2335 } 2336 2337 2338 2339 2340 /** Sticky Side (social icons) 2341 *********************** **/ 2342 if(jQuery("div.sticky-side").length > 0) { 2343 2344 var _t = jQuery("div.sticky-side"); 2345 _h = _t.height() / 2; 2346 2347 _t.css({"margin-top":"-"+_h+"px"}); 2348 } 2349 2350 2351 2352 2353 /** Increase / Decrease No. 2354 Example: shop-single-left.html 2355 *********************** **/ 2356 jQuery(".incr").bind("click", function(e) { 2357 e.preventDefault(); 2358 2359 var _for = jQuery(this).attr('data-for'), 2360 _max = parseInt(jQuery(this).attr('data-max')), 2361 _curVal = parseInt(jQuery("#" + _for).val()); 2362 2363 if(_curVal < _max) { 2364 jQuery("#" + _for).val(_curVal + 1); 2365 } 2366 }); 2367 2368 jQuery(".decr").bind("click", function(e) { 2369 e.preventDefault(); 2370 2371 var _for = jQuery(this).attr('data-for'), 2372 _min = parseInt(jQuery(this).attr('data-min')), 2373 _curVal = parseInt(jQuery("#" + _for).val()); 2374 2375 if(_curVal > _min) { 2376 jQuery("#" + _for).val(_curVal - 1); 2377 } 2378 }); 2379 2380 2381 2382 2383 2384 /** Default Button Toggle 2385 *********************** **/ 2386 jQuery("a.toggle-default").bind("click", function(e) { 2387 e.preventDefault(); 2388 2389 var _href = jQuery(this).attr('href'); 2390 2391 if(jQuery(_href).is(":hidden")) { 2392 2393 jQuery(_href).slideToggle(200); 2394 jQuery('i.fa', this).removeClass('fa-plus-square').addClass('fa-minus-square'); 2395 2396 } else { 2397 2398 jQuery(_href).slideToggle(200); 2399 jQuery('i.fa', this).removeClass('fa-minus-square').addClass('fa-plus-square'); 2400 2401 } 2402 2403 }); 2404 2405 2406 2407 2408 2409 /** Custom File Upload 2410 <input class="custom-file-upload" type="file" id="file" name="myfiles[]" multiple /> 2411 *********************** **/ 2412 var file_container = jQuery("input[type=file]"); 2413 2414 if(file_container.length > 0) { 2415 loadScript(plugin_path + 'custom.fle_upload.js'); 2416 } 2417 2418 2419 2420 /** Textarea Words Limit 2421 *********************** **/ 2422 jQuery("textarea.word-count").on('keyup', function() { 2423 var _t = jQuery(this), 2424 words = this.value.match(/\S+/g).length, 2425 _limit = _t.attr('data-maxlength') || 200; 2426 2427 if (words > parseInt(_limit)) { 2428 2429 // Split the string on first 200 words and rejoin on spaces 2430 var trimmed = _t.val().split(/\s+/, 200).join(" "); 2431 // Add a space at the end to keep new typing making new words 2432 _t.val(trimmed + " "); 2433 2434 } else { 2435 2436 var _data_info = _t.attr('data-info'); 2437 2438 if(_data_info == '' || _data_info == undefined) { 2439 var _infoContainer = _t.next('div'); 2440 jQuery('span', _infoContainer).text(words + '/' + _limit); 2441 } else { 2442 jQuery('#' +_data_info).text(words + '/' + _limit); 2443 } 2444 2445 2446 } 2447 }); 2448 2449 2450 2451 2452 } 2453 2454 2455 2456/** Sticky Footer 2457 **************************************************************** **/ 2458 function _stickyFooter() { 2459 if(jQuery("#footer").hasClass('sticky')) { 2460 2461 var footerHeight = 0, 2462 footerTop = 0, 2463 _footer = jQuery("#footer.sticky"); 2464 2465 positionFooter(); 2466 2467 function positionFooter() { 2468 footerHeight = _footer.height(); 2469 footerTop = (jQuery(window).scrollTop()+jQuery(window).height()-footerHeight)+"px"; 2470 2471 if((jQuery(document.body).height()+footerHeight) > jQuery(window).height()) { 2472 _footer.css({ 2473 position: "absolute" 2474 }).stop().animate({ 2475 top: footerTop 2476 },0); 2477 } else { 2478 _footer.css({position: "static"}); 2479 } 2480 2481 } 2482 2483 jQuery(window).scroll(positionFooter).resize(positionFooter); 2484 2485 } 2486 } 2487 2488 2489 2490 2491 2492/** Countdown 2493 **************************************************************** **/ 2494 function _countDown() { 2495 var _container = jQuery(".countdown"), 2496 _container2 = jQuery(".countdown-download"); 2497 2498 if(_container.length > 0 || _container2.length > 0) { 2499 2500 loadScript(plugin_path + 'countdown/jquery.countdown.pack.min.js', function() { 2501 2502 /** On Page Load **/ 2503 _container.each(function() { 2504 var _t = jQuery(this), 2505 _date = _t.attr('data-from'), 2506 _labels = _t.attr('data-labels'); 2507 2508 if(_labels) { 2509 _labels = _labels.split(","); 2510 } 2511 2512 if(_date) { 2513 var _d = new Date(_date); 2514 jQuery(this).countdown({ 2515 until: new Date(_d), 2516 labels: _labels || ["Years","Months","Weeks","Days","Hours","Minutes","Seconds"] 2517 }); 2518 } 2519 }); 2520 2521 2522 /** Download **/ 2523 _container2.bind("click", function(e){ 2524 e.preventDefault(); 2525 2526 var _t = jQuery(this), 2527 cd_container = _t.attr('data-for'), 2528 _countdown = jQuery("#"+cd_container+' span.download-wait>.countdown'), 2529 _seconds = parseInt(_t.attr('data-seconds')), 2530 _dataURL = _t.attr('href'); 2531 2532 _t.fadeOut(250, function(){ 2533 jQuery("#"+cd_container).fadeIn(250, function() { 2534 2535 var currentDate = new Date(); 2536 currentDate.setSeconds(currentDate.getSeconds() + _seconds); 2537 2538 _countdown.countdown({ 2539 until: currentDate, 2540 format: 'S', 2541 expiryUrl: _dataURL, 2542 onExpiry: function(){ 2543 jQuery("#"+cd_container+' span.download-message').removeClass('hide'); 2544 jQuery("#"+cd_container+' span.download-wait').addClass('hide'); 2545 } 2546 }); 2547 2548 }); 2549 }); 2550 2551 return false;
2552 2553 }); 2554 2555 2556 }); 2557 2558 } 2559 2560 } 2561 2562 2563 2564/** Masonry Gallery 2565 **************************************************************** **/ 2566 function _masonryGallery() { 2567 2568 if(jQuery(".masonry-gallery").length > 0) { 2569 2570 jQuery(".masonry-gallery").each(function() { 2571 var _container = jQuery(this), 2572 columns = 4; 2573 2574 if(_container.hasClass('columns-2')) columns = 2; 2575 else if(_container.hasClass('columns-3')) columns = 3; 2576 else if(_container.hasClass('columns-4')) columns = 4; 2577 else if(_container.hasClass('columns-5')) columns = 5; 2578 else if(_container.hasClass('columns-6')) columns = 6; 2579 2580 var _firstElemWidth = _container.find('a:eq(0)').outerWidth(), 2581 _bigImageNo = _container.attr('data-img-big'), 2582 _containerWidth = _container.width(); 2583 2584 2585 // Fix margins & Width 2586 var postWidth = (_containerWidth/columns); 2587 postWidth = Math.floor(postWidth); 2588 if((postWidth * columns) >= _containerWidth) { 2589 _container.css({ 'margin-right': '-1px' }); 2590 } 2591 if(columns < 6) { 2592 _container.children('a').css({"width":postWidth+"px"}); 2593 } 2594 2595 2596 // Set Big Image 2597 if(parseInt(_bigImageNo) > 0) { 2598 2599 _bigImageNo = Number(_bigImageNo) - 1; 2600 _container.find('a:eq('+_bigImageNo+')').css({ width: _firstElemWidth*2 + 'px'}); 2601 2602 loadScript(plugin_path + 'isotope/isotope.pkgd.min.js', function() { 2603 2604 setTimeout( function() { 2605 _container.isotope({ 2606 masonry: { 2607 columnWidth: _firstElemWidth 2608 } 2609 }); 2610 2611 _container.isotope('layout'); 2612 2613 }, 1000); 2614 2615 }); 2616 2617 } 2618 2619 }); 2620 2621 2622 } 2623 2624 } 2625 2626 2627 2628 2629/** Toastr 2630 2631 TYPE: 2632 primary 2633 info 2634 error 2635 sucess 2636 warning 2637 2638 POSITION 2639 top-right 2640 top-left 2641 top-center 2642 top-full-width 2643 bottom-right 2644 bottom-left 2645 bottom-center 2646 bottom-full-width 2647 2648 USAGE: 2649 _toastr("My Message here","top-right","error",false); 2650 2651 NOTE: 2652 _onclick = url to redirect (example: http://www.stepofweb.com) 2653 **************************************************************** **/ 2654 function _toastr(_message,_position,_notifyType,_onclick) { 2655 var _btn = jQuery(".toastr-notify"); 2656 2657 if(_btn.length > 0 && _message != false) { 2658 2659 loadScript(plugin_path + 'toastr/toastr.js', function() { 2660 // toastr.clear(); 2661 2662 /** BUTTON CLICK 2663 ********************* **/ 2664 _btn.bind("click", function(e) { 2665 e.preventDefault(); 2666 2667 2668 var _message = jQuery(this).attr('data-message'), 2669 _notifyType = jQuery(this).attr('data-notifyType') || "default", 2670 _position = jQuery(this).attr('data-position') || "top-right", 2671 _progressBar = jQuery(this).attr('data-progressBar') == "true" ? true : false, 2672 _closeButton = jQuery(this).attr('data-closeButton') == "true" ? true : false, 2673 _debug = jQuery(this).attr('data-debug') == "true" ? true : false, 2674 _newestOnTop = jQuery(this).attr('data-newestOnTop') == "true" ? true : false, 2675 _preventDuplicates = jQuery(this).attr('data-preventDuplicates') == "true" ? true : false, 2676 _showDuration = jQuery(this).attr('data-showDuration') || "300", 2677 _hideDuration = jQuery(this).attr('data-hideDuration') || "1000", 2678 _timeOut = jQuery(this).attr('data-timeOut') || "5000", 2679 _extendedTimeOut = jQuery(this).attr('data-extendedTimeOut') || "1000", 2680 _showEasing = jQuery(this).attr('data-showEasing') || "swing", 2681 _hideEasing = jQuery(this).attr('data-hideEasing') || "linear", 2682 _showMethod = jQuery(this).attr('data-showMethod') || "fadeIn", 2683 _hideMethod = jQuery(this).attr('data-hideMethod') || "fadeOut"; 2684 2685 toastr.options = { 2686 "closeButton": _closeButton, 2687 "debug": _debug, 2688 "newestOnTop": _newestOnTop, 2689 "progressBar": _progressBar, 2690 "positionClass": "toast-" + _position, 2691 "preventDuplicates": _preventDuplicates, 2692 "onclick": null, 2693 "showDuration": _showDuration, 2694 "hideDuration": _hideDuration, 2695 "timeOut": _timeOut, 2696 "extendedTimeOut": _extendedTimeOut, 2697 "showEasing": _showEasing, 2698 "hideEasing": _hideEasing, 2699 "showMethod": _showMethod, 2700 "hideMethod": _hideMethod 2701 } 2702 2703 toastr[_notifyType](_message); 2704 }); 2705 2706 2707 /** JAVSCRIPT / ON LOAD 2708 ************************* **/ 2709 if(_message != false) { 2710 2711 if(_onclick != false) { 2712 onclick = function() { 2713 window.location = _onclick; 2714 } 2715 } else { 2716 onclick = null 2717 } 2718 2719 toastr.options = { 2720 "closeButton": true, 2721 "debug": false, 2722 "newestOnTop": false, 2723 "progressBar": true, 2724 "positionClass": "toast-" + _position, 2725 "preventDuplicates": false, 2726 "onclick": onclick, 2727 "showDuration": "300", 2728 "hideDuration": "1000", 2729 "timeOut": "5000", 2730 "extendedTimeOut": "1000", 2731 "showEasing": "swing", 2732 "hideEasing": "linear", 2733 "showMethod": "fadeIn", 2734 "hideMethod": "fadeOut" 2735 } 2736 2737 setTimeout(function(){ 2738 toastr[_notifyType](_message); 2739 }, 1500); // delay 1.5s 2740 } 2741 }); 2742 2743 } 2744 2745 } 2746 2747 2748/** Chart 2749 **************************************************************** **/ 2750 function _charts() { 2751 2752 /** Easy Pie Chart 2753 ************************* **/ 2754 var _container = jQuery(".piechart"); 2755 2756 if(_container.length > 0) { 2757 2758 loadScript(plugin_path + 'chart.easypiechart/dist/jquery.easypiechart.min.js', function() { 2759 2760 jQuery(".piechart").each(function() { 2761 var _t = jQuery(this), 2762 _size = _t.attr('data-size') || 150, 2763 _animate = _t.attr('data-animate') || "3000"; 2764 2765 _t.easyPieChart({ 2766 size: _size, 2767 animate: _animate, 2768 scaleColor: false, 2769 trackColor: _t.attr('data-trackcolor') || 'rgba(0,0,0,0.04)', 2770 lineWidth: _t.attr('data-width') || '2', 2771 lineCap: 'square', 2772 barColor: _t.attr('data-color') || '#0093BF' 2773 }); 2774 2775 /* fix element positioning */ 2776 jQuery("*", this).attr('style', "line-height:"+_size+"px !important; height:"+_size+"px !important; width:"+_size+"px !important"); 2777 2778 }); 2779 2780 }); 2781 2782 } 2783 2784 2785 } 2786 2787 2788 2789/** Select2 2790 **************************************************************** **/ 2791 function _select2() { 2792 var _container = jQuery('select.select2'); 2793
2794 if(_container.length > 0) { 2795 2796 loadScript(plugin_path + 'select2/js/select2.full.min.js', function() { 2797 2798 _container.each(function() { 2799 var _t = jQuery(this); 2800 2801 if(!_t.hasClass('select2-custom')) { 2802 _t.select2(); 2803 } 2804 2805 }) 2806 2807 }); 2808 } 2809 2810 } 2811 2812 2813 2814 2815/** Form [form plugin + validation plugin] 2816 **************************************************************** **/ 2817 function _form() { 2818 2819 2820 /** Form Validate 2821 LOAD PLUGIN ONLY! 2822 ************************ **/ 2823 if(jQuery('form.validate-plugin').length > 0) { 2824 2825 loadScript(plugin_path + 'form.validate/jquery.form.min.js', function() { 2826 loadScript(plugin_path + 'form.validate/jquery.validation.min.js'); 2827 }); 2828 2829 } 2830 2831 2832 2833 /** Form Validate 2834 ************************ **/ 2835 if(jQuery('form.validate').length > 0) { 2836 2837 loadScript(plugin_path + 'form.validate/jquery.form.min.js', function() { 2838 loadScript(plugin_path + 'form.validate/jquery.validation.min.js', function() { 2839 2840 if(jQuery().validate) { 2841 2842 jQuery('form.validate').each(function() { 2843 2844 var _t = jQuery(this), 2845 _Smessage = _t.attr('data-success') || "Successfully! Thank you!", 2846 _Cmessage = _t.attr('data-captcha') || "Invalid Captcha!", 2847 _Tposition = _t.attr('data-toastr-position') || "top-right", 2848 _Ttype = _t.attr('data-toastr-type') || "success"; 2849 _Turl = _t.attr('data-toastr-url') || false; 2850 2851 // Append 'is_ajax' hidden input field! 2852 _t.append('<input type="hidden" name="is_ajax" value="true" />'); 2853 2854 _t.validate({ 2855 submitHandler: function(form) { 2856 2857 // Show spin icon 2858 jQuery(form).find('.input-group-addon').find('.fa-envelope').removeClass('fa-envelope').addClass('fa-refresh fa-spin'); 2859 2860 jQuery(form).ajaxSubmit({ 2861 2862 target: jQuery(form).find('.validate-result').length > 0 ? jQuery(form).find('.validate-result') : '', 2863 2864 error: function(data) { 2865 _toastr("Sent Failed!",_Tposition,"error",false); 2866 }, 2867 2868 success: function(data) { 2869 var data = data.trim(); 2870 2871 // SMTP ERROR 2872 if(data == '_failed_') { 2873 _toastr("SMTP ERROR! Please, check your config file!",_Tposition,"error",false); 2874 } 2875 2876 // CAPTCHA ERROR 2877 else if(data == '_captcha_') { 2878 _toastr("Invalid Captcha!",_Tposition,"error",false); 2879 2880 2881 // SUCCESS 2882 } else { 2883 2884 // Remove spin icon 2885 jQuery(form).find('.input-group-addon').find('.fa-refresh').removeClass('fa-refresh fa-spin').addClass('fa-envelope'); 2886 2887 // Clear the form 2888 jQuery(form).find('input.form-control').val(''); 2889 2890 // Toastr Message 2891 _toastr(_Smessage,_Tposition,_Ttype,_Turl); 2892 2893 } 2894 } 2895 }); 2896 2897 } 2898 }); 2899 2900 }); 2901 2902 } 2903 2904 }); 2905 }); 2906 2907 } 2908 2909 2910 2911 2912 /** Masked Input 2913 ************************ **/ 2914 var _container = jQuery('input.masked'); 2915 if(_container.length > 0) { 2916 2917 loadScript(plugin_path + 'form.masked/jquery.maskedinput.js', function() { 2918 2919 _container.each(function() { 2920 2921 var _t = jQuery(this); 2922 _format = _t.attr('data-format') || '(999) 999-999999', 2923 _placeholder = _t.attr('data-placeholder') || 'X'; 2924 2925 jQuery.mask.definitions['f'] = "[A-Fa-f0-9]"; 2926 _t.mask(_format, {placeholder:_placeholder}); 2927 2928 }); 2929 2930 }); 2931 2932 } 2933 2934 } 2935 2936 2937 2938 2939 2940/** Pickers 2941 **************************************************************** **/ 2942 function _pickers() { 2943 2944 /** Date Picker 2945 <input type="text" class="form-control datepicker" data-format="yyyy-mm-dd" data-lang="en" data-RTL="false"> 2946 ******************* **/ 2947 var _container_1 = jQuery('.datepicker'); 2948 2949 if(_container_1.length > 0) { 2950 loadScript(plugin_path + 'bootstrap.datepicker/js/bootstrap-datepicker.min.js', function() { 2951 2952 if(jQuery().datepicker) { 2953 2954 _container_1.each(function() { 2955 var _t = jQuery(this), 2956 _lang = _t.attr('data-lang') || 'en'; 2957 2958 if(_lang != 'en' && _lang != '') { // load language file 2959 loadScript(plugin_path + 'bootstrap.datepicker/locales/bootstrap-datepicker.'+_lang+'.min.js'); 2960 } 2961 2962 jQuery(this).datepicker({ 2963 format: _t.attr('data-format') || 'yyyy-mm-dd', 2964 language: _lang, 2965 rtl: _t.attr('data-RTL') == "true" ? true : false, 2966 changeMonth: _t.attr('data-changeMonth') == "false" ? false : true, 2967 todayBtn: _t.attr('data-todayBtn') == "false" ? false : "linked", 2968 calendarWeeks: _t.attr('data-calendarWeeks') == "false" ? false : true, 2969 autoclose: _t.attr('data-autoclose') == "false" ? false : true, 2970 todayHighlight: _t.attr('data-todayHighlight') == "false" ? false : true, 2971 2972 onRender: function(date) { 2973 // return date.valueOf() < nowDate.valueOf() ? 'disabled' : ''; 2974 } 2975 }).on('changeDate', function(ev) { 2976 2977 // AJAX POST - OPTIONAL 2978 2979 }).data('datepicker'); 2980 }); 2981 2982 } 2983 2984 }); 2985 } 2986 2987 2988 2989 2990 /** Range Picker 2991 <input type="text" class="form-control rangepicker" value="2015-01-01 - 2016-12-31" data-format="yyyy-mm-dd" data-from="2015-01-01" data-to="2016-12-31"> 2992 ******************* **/ 2993 var _container_2 = jQuery('.rangepicker'); 2994
2995 if(_container_2.length > 0) { 2996 loadScript(plugin_path + 'bootstrap.daterangepicker/moment.min.js', function() { 2997 loadScript(plugin_path + 'bootstrap.daterangepicker/daterangepicker.js', function() { 2998 2999 if(jQuery().datepicker) { 3000 3001 _container_2.each(function() { 3002 3003 var _t = jQuery(this), 3004 _format = _t.attr('data-format').toUpperCase() || 'YYYY-MM-DD'; 3005 3006 _t.daterangepicker( 3007 { 3008 format: _format, 3009 startDate: _t.attr('data-from'), 3010 endDate: _t.attr('data-to'), 3011 3012 ranges: { 3013 'Today': [moment(), moment()], 3014 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 3015 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 3016 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 3017 'This Month': [moment().startOf('month'), moment().endOf('month')], 3018 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] 3019 } 3020 }, 3021 function(start, end, label) { 3022 // alert("A new date range was chosen: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); 3023 }); 3024 3025 }); 3026 3027 } 3028 3029 }); 3030 }); 3031 } 3032 3033 3034 3035 /** Time Picker 3036 <input type="text" class="form-control timepicker" value="11 : 55 : PM"> 3037 ******************* **/ 3038 var _container_3 = jQuery('.timepicker'); 3039 3040 if(_container_3.length > 0) { 3041 loadScript(plugin_path + 'timepicki/timepicki.min.js', function() { 3042 3043 if(jQuery().timepicki) { 3044 3045 _container_3.timepicki(); 3046 3047 } 3048 3049 }); 3050 } 3051 3052 3053 3054 /** Color Picker 3055 ******************* **/ 3056 var _container_4 = jQuery('.colorpicker'); 3057 3058 if(_container_4.length > 0) { 3059 loadScript(plugin_path + 'spectrum/spectrum.min.js', function() { 3060 3061 if(jQuery().spectrum) { 3062 3063 _container_4.each(function() { 3064 var _t = jQuery(this), 3065 _preferredFormat = _t.attr('data-format') || "hex", // hex, hex3, hsl, rgb, name 3066 _palletteOnly = _t.attr('data-palletteOnly') || "false", 3067 _fullPicker = _t.attr('data-fullpicker') || "false", 3068 _allowEmpty = _t.attr('data-allowEmpty') || false; 3069 _flat = _t.attr('data-flat') || false; 3070 3071 if(_palletteOnly == "true" || _fullPicker == "true") { 3072 3073 var _palette = [ 3074 ["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"], 3075 ["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"], 3076 ["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"], 3077 ["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"], 3078 ["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"], 3079 ["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"], 3080 ["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"], 3081 ["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"] 3082 ]; 3083 3084 } else { 3085 _palette = null; 3086 } 3087 3088 if(_t.attr('data-defaultColor')) { 3089 _color = _t.attr('data-defaultColor'); 3090 } else { 3091 _color = "#ff0000"; 3092 } 3093 3094 if(!_t.attr('data-defaultColor') && _allowEmpty == "true") { 3095 _color = null; 3096 } 3097 3098 _t.spectrum({ 3099 showPaletteOnly: _palletteOnly == "true" ? true : false, 3100 togglePaletteOnly: _palletteOnly == "true" ? true : false, 3101 3102 flat: _flat == "true" ? true : false, 3103 showInitial: _allowEmpty == "true" ? true : false, 3104 showInput: _allowEmpty == "true" ? true : false, 3105 allowEmpty: _allowEmpty == "true" ? true : false, 3106 3107 chooseText: _t.attr('data-chooseText') || "Coose", 3108 cancelText: _t.attr('data-cancelText') || "Cancel", 3109 3110 color: _color, 3111 showInput: true, 3112 showPalette: true, 3113 preferredFormat: _preferredFormat, 3114 showAlpha: _preferredFormat == "rgb" ? true : false, 3115 palette: _palette 3116 }); 3117 3118 }); 3119 3120 } 3121 3122 }); 3123 } 3124 3125 } 3126 3127 3128 3129 3130 3131/** Editors 3132 **************************************************************** **/ 3133 function _editors() { 3134 3135 /** Summernote HTML Editor 3136 <textarea class="summernote form-control" data-height="200"></textarea> 3137 ***************************** **/ 3138 var _container_1 = jQuery('textarea.summernote'); 3139 3140 if(_container_1.length > 0) { 3141 3142 loadScript(plugin_path + 'editor.summernote/summernote.min.js', function() { 3143 3144 if(jQuery().summernote) { 3145 3146 _container_1.each(function() { 3147 3148 var _lang = jQuery(this).attr('data-lang') || 'en-US'; 3149 3150 if(_lang != 'en-US') { // Language! 3151 alert(_lang); 3152 loadScript(plugin_path + 'editor.summernote/lang/summernote-'+_lang+'.js'); 3153 } 3154 3155 jQuery(this).summernote({ 3156 height: jQuery(this).attr('data-height') || 200, 3157 lang: jQuery(this).attr('data-lang') || 'en-US', // default: 'en-US' 3158 toolbar: [ 3159 /* [groupname, [button list]] */ 3160 ['style', ['style']], 3161 ['fontsize', ['fontsize']], 3162 ['style', ['bold', 'italic', 'underline','strikethrough', 'clear']], 3163 ['color', ['color']], 3164 ['para', ['ul', 'ol', 'paragraph']], 3165 ['table', ['table']], 3166 ['media', ['link', 'picture', 'video']], 3167 ['misc', ['codeview', 'fullscreen', 'help']] 3168 ] 3169 }); 3170 }); 3171 3172 } 3173 }); 3174 } 3175 3176 3177 3178 3179 3180 /** Markdown HTML Editor 3181 <textarea class="markdown" data-height="300" name="content" data-provide="markdown" data-lang="en" rows="10"></textarea> 3182 ***************************** **/ 3183 var _container_2 = jQuery('textarea.markdown'); 3184 3185 if(_container_2.length > 0) { 3186 3187 loadScript(plugin_path + 'editor.markdown/js/bootstrap-markdown.min.js', function() { 3188 3189 if(jQuery().markdown) { 3190 3191 _container_2.each(function() { 3192 var _t = jQuery(this); 3193 3194 var _lang = _t.attr('data-lang') || 'en'; 3195 3196 if(_lang != 'en') { // Language! 3197 loadScript(plugin_path + 'editor.markdown/locale/bootstrap-markdown.'+_lang+'.js'); 3198 } 3199 3200 jQuery(this).markdown({ 3201 autofocus: _t.attr('data-autofocus') == "true" ? true : false, 3202 savable: _t.attr('data-savable') == "true" ? true : false, 3203 height: _t.attr('data-height') || 'inherit', 3204 language: _lang == 'en' ? null : _lang 3205 }); 3206 3207 }); 3208 3209 } 3210 3211 }); 3212 3213 } 3214 3215 } 3216 3217 3218 3219 3220 3221 3222/** Pajinate [jQuery Pagination] 3223 USAGE 3224 3225 <div class="pajinate" data-pajinante-items-per-page="8" data-pajinate-container=".pajinate-container"> 3226 3227 <div class="pajinate-container"> 3228 3229 <div>item1</div> 3230 <div>item2</div> 3231 <div>item3</div> 3232 ..... 3233 3234 </div> 3235 3236 <div class="pajinate-nav"> 3237 <ul class="pagination"><!-- pages added by pajinate plugin --></ul> 3238 </div> 3239 3240 </div> 3241 **************************************************************** **/ 3242 function _pajinate() { 3243 var _container = jQuery('div.pajinate'); 3244 3245 if(_container.length > 0) { 3246 3247 loadScript(plugin_path + 'pajinate/jquery.pajinate.bootstrap.min.js', function() { 3248 3249 if(jQuery().pajinate) { 3250 3251 _container.each(function() { 3252 var _t = jQuery(this), 3253 _perPage = _t.attr('data-pajinante-items-per-page') || 8; 3254 _numLinks = _t.attr('data-pajinante-num-links') || 5; 3255 3256 _t.pajinate({ 3257 items_per_page : parseInt(_perPage), 3258 num_page_links_to_display : parseInt(_numLinks), 3259 item_container_id : _t.attr('data-pajinate-container') || '.pajinate-container', 3260 nav_panel_id : '.pajinate-nav ul', 3261 show_first_last : false, 3262 wrap_around : true, 3263 abort_on_small_lists : true, 3264 start_page : 0, 3265 nav_label_prev : '«', 3266 nav_label_next : '»' 3267 }); 3268 3269 }); 3270 } 3271 3272 }); 3273 3274 } 3275 3276 } 3277 3278 3279 3280 3281 3282/** Infininte Scroll 3283 **************************************************************** **/ 3284 function _infiniteScroll() { 3285 var _container = jQuery(".infinite-scroll"); 3286 3287 if(_container.length > 0) { 3288 3289 loadScript(plugin_path + 'infinite-scroll/jquery.infinitescroll.min.js', function() { 3290 3291 _navSelector = _container.attr('data-nextSelector') || "#inf-load-nex", 3292 _itemSelector = _container.attr('data-itemSelector') || ".item", 3293 _nextSelector = _navSelector + " a"; 3294 3295 _container.infinitescroll({ 3296 loading: { 3297 finishedMsg : '<i class="fa fa-check"></i>', 3298 msgText : '<i class="fa fa-refresh fa-spin"></i>', 3299 img : "data:image/gif;base64,R0lGODlhGAAYAPUAABQSFCwuLBwaHAwKDKyurGxqbNze3CwqLCQmJLS2tOzu7OTi5JyenBweHBQWFJyanPz+/HRydLSytFxeXPz6/ExOTKSmpFRSVHR2dAwODAQCBOzq7PTy9ISChPT29IyKjIyOjISGhOTm5GRiZJSWlJSSlFRWVMTCxNza3ExKTNTS1KyqrHx6fGRmZKSipMzOzMTGxDQyNDw+PAQGBDQ2NERCRFxaXMzKzGxubDw6PCQiJLy+vERGRLy6vHx+fNTW1CH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBQAAACwAAAAAGAAYAEAGqECAcAhoRAiojQJFiAiI0Kh0qOsZOhqhDMK9ZadgAI0WBmhAXAhFVm5HbZR0aTYdsFpSkwqjo5sRLAtpIjxuUzZpECmGjI1QA4JcKH5lGVICDHFpGyoqGx4uDWENFh4iKjcbiR4MT1ItLJSPJWkUNo9uAyhpBpaOGjdpOY7ExcYaIQs9OsUpibfENZoQIF9gY1EpqlwiLAh+M4AqJmUCOBJJGz8EOKJRQQAh+QQJBQABACwAAAAAGAAYAAAGp8CAcBhoRBILDgdFKAiI0KHAB5rUZBUWDALxMJ5R4SCmiWpoJ67iEm4TZx0upOCuB1jyir2tuXE3DnthE3IlglENchwDh0QDG3ITjUQ7ciGTQxFybJgBGkcYGhoYPaGdARdyOKchcjunhH8znQAccmCYJZGnDpAQN2WdFXI+pwEFch2znRe+MDTBbzGMbQIPHlwwLBcyNSMgLIF2Ai0WKAocBhI4uERBACH5BAkFACwALAAAAAAYABgAAAaoQJZwyNIEJiAJCpWICIjQKFGD6Gw8D4d0C3UQIJsKd1wsQSgFMldjgUAu6q1jA27EpRg34x5FUCAeT3xDAx5uBQAMJyZ8GRxuFiRuFAF3B24QKguYE3cpmAubbil3I5gGKpgIdwF/EA9tgAN8JicMGQVuHLODQgKGEKu9QgxuGMNCDQpgAMgsF38rGs4Ffx/TyBUiECtayAIPHgohAdi9DRFKTCAj5VJBACH5BAkFAAAALAAAAAAYABgAAAa0QIBwSAQMaphHoVFsOoezlsEleFqJDsnmcu1qLJBW9zpQUSpjqwyycQgPBAIiLYRBGIDMAgJRaegREB4CE3wQFAN0NHwRYHwwdAANfBIqhlx0AXwGCnx+kQV8Cp0QBZEaL3wbBnwBkReGKgl8TGkadnwugRA0dBkUhhMNHhARdBqWEAsZAAwQkHQIEgQHQgIbFDKRTRUUL4nbRC0QFjPhRBcbEm7nQg0uBi3g7Q0RDxEyzFdBACH5BAkFAAgALAAAAAAYABgAAAaxQIRwSCwKHMWkssgLCZbQYmNnUgpMh6gQoIoUZQqIh6ZFHDjV7QLCLpURIcUTAWKzvWUBhYFwcOwnA28IOx4CBXY3AIMIJRAFEmwoSIwYEAQGbDWMQiwQBh4QKpxCjhyhbqQqEByZLKQ1bAaRr4wOKGwSiKlvADd2BQIeJ4MDJ3YcSA8UlFqWdiBCAgohbyR2C4tCJhwBZTQUEAo5RQUqzVAHJuhDJjsNpFIhKfFG7FFBACH5BAkFAAAALAAAAQAYABYAAAa3QIBQmEnlNMOkcgmoGSCQEJNIY048UIhhKqS1lClKFtLjClmmoWAzvunMgJmqIWRkDTYkHIBxARpiECUDe0MIHg0RUCV6hQAaGxESEAszjkkvEk8sl0kqKgoQCJ1CGiIKChuNlwcQCigvpGcQKBKxpAMLEBI4IpaXGiVQODoeb44DwhAUAgAuGIUaEyhZDEINKr9
3299cCDdjG81CJpxmO2MUPEojVVy6UBQ2TDGEUyFQCzKyjzk880NBACH5BAkFAAEALAAAAAAYABgAAAazwIBwGABMOhcNcckUOkoKiJTVrAYqG6k2YWXiKFptpEs0gbWbXmFmHQwbWcjNJlCSYwIhQ9qxk4UaVAIeEB1/TCANBRAnfodCExEEEDSPSzUJKCeWSzQGHBicRBUcHimiQywKC5WoGjAoCTKoATQUBBETqDMnEAUNH6ghEBQOAT6OZBo+UgxCAjF/Mw0TN1IKeUJuVTMFPSJhEBePGOHEBZYJ4SI8nCxaHB/GnBoXISYATUEAIfkECQUAKgAsAAAAABgAGAAABqpAlXCoErQsr4WBlCE6nQ2XB0Ktup5Yk6LKhZywzgKlyplSKRfwsELdYA6DDCI1OaiFgg2EALirHxAfGn5gDR4rg4RPGhEbDopYAQkdkFgjBnaVTiEoiZpDCQmfRBooIKNDBwYjqEIdCQGtDgoFnpoaEh4NqBogEA+oDisQjn4xExUIAAMILCIQFBV+JmNUHh7VEAWEMF1VCmmELt4UDAKQGSUoCy8WI+dPQQAh+QQJBQAJACwAAAAAGAAYAAAGrMCEcJhoRCQoxUblmmSI0KGA4YFYr9bFIUqsbLBgK4ErLFAosEiuESi8sBKyifKqRTWXk+el4zYULgNkQhkaZBYShoOLOigAi5ARE5CQDzOUixGYi3abXANPnlE5olyapUQzD6hELaesDgYNrAkzEi5kMwOKnxYbs1EIKh4wF5dQNSoQF2QSWC8FATo0GDcUHi2DBGFgGymLBwvcEBQPDpQZNi4qGxsoEjgCXEEAIfkEBQUACAAsAAAAABgAGAAABqZAhHCIEBQIBg/HICk4iNCh4OGBWK9WTgkQHZoUlFMJwyKpsJCFrBvhhJ7QGgqrgA9tr0BX6HhhTUQNO3Z7ADBWFAdEIQJ7UAMRJTREAjyOl0MNmJucnZ6foKGio6SdmqQphDljA5wCIUQBVRAwXJcAO6dCJlg3tl0BPxdQAgpYKDVRAh8cOF05C2g/JSw+JTAeCsOFJRxoVx4PjZgORygcHCgETl1BADs=", 3300 speed : 'normal' 3301 }, 3302 nextSelector : _nextSelector, 3303 navSelector : _navSelector, 3304 itemSelector : _itemSelector, 3305 behavior : '', 3306 3307 state: { 3308 isDone : false 3309 } 3310 }, 3311 3312 function(newElements) { 3313 3314 Init(true); 3315 3316 if(jQuery().isotope) { 3317 3318 _container.isotope('appended', jQuery(newElements)); 3319 3320 setTimeout( function(){ 3321 _container.isotope('layout'); 3322 }, 2000); 3323 3324 } 3325 3326 }); 3327 3328 }); 3329 3330 } 3331 3332 } 3333 3334 3335 3336 3337 3338/** Image Zoom 3339 **************************************************************** **/ 3340 function _zoom() { 3341 var _container = jQuery('figure.zoom'); 3342 3343 if(_container.length > 0) { 3344 3345 loadScript(plugin_path + 'image.zoom/jquery.zoom.min.js', function() { 3346 3347 if(jQuery().zoom) { 3348 3349 _container.each(function() { 3350 var _t = jQuery(this), 3351 _mode = _t.attr('data-mode'), 3352 _id = _t.attr('id'); 3353 3354 if(_mode == 'grab') { 3355 _t.zoom({ on:'grab' }); 3356 } else 3357 3358 if(_mode == 'click') { 3359 _t.zoom({ on:'click' }); 3360 } else 3361 3362 if(_mode == 'toggle') { 3363 _t.zoom({ on:'toggle' }); 3364 } else { 3365 _t.zoom(); 3366 } 3367 3368 if(isMobile.any()) { 3369 _t.zoom({ on:'toggle' }); 3370 } 3371 3372 // Thumbnails 3373 if(_id) { 3374 jQuery('.zoom-more[data-for='+_id+'] a').bind("click", function(e) { 3375 e.preventDefault(); 3376 3377 var _href = jQuery(this).attr('href'); 3378 3379 if(_href != "#") { 3380 jQuery('.zoom-more[data-for='+_id+'] a').removeClass('active'); 3381 jQuery(this).addClass('active'); 3382 3383 jQuery('figure#'+_id + '>.lightbox').attr('href', _href); 3384 3385 jQuery('figure#'+_id + '>img').fadeOut(0, function() { 3386 jQuery('figure#'+_id + '>img').attr('src', _href); 3387 }).fadeIn(500); 3388 3389 3390 } 3391 }); 3392 } 3393 3394 }); 3395 3396 } 3397 3398 }); 3399 3400 } 3401 3402 } 3403 3404 3405 3406 3407 3408/** Autosuggest 3409 http://twitter.github.io/typeahead.js/ 3410 **************************************************************** **/ 3411 function _autosuggest() { 3412 _container = jQuery('div.autosuggest'); 3413 3414 if(_container.length > 0) { 3415 3416 loadScript(plugin_path + 'typeahead.bundle.js', function() { 3417 3418 if(jQuery().typeahead) { 3419 3420 _container.each(function() { 3421 var _t = jQuery(this), 3422 _minLength = _t.attr('data-minLength') || 1, 3423 _qryURL = _t.attr('data-queryURL'), 3424 _limit = _t.attr('data-limit') || 10, 3425 _autoload = _t.attr('data-autoload'); 3426 3427 if(_autoload == "false") { 3428 return false; 3429 } 3430 3431 /** **/ 3432 /* Bloodhound (Suggestion Engine) */ 3433 var _typeahead = new Bloodhound({ 3434 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), 3435 queryTokenizer: Bloodhound.tokenizers.whitespace, 3436 limit: _limit, 3437 remote: { 3438 url: _qryURL + '%QUERY', 3439 }, 3440 }); 3441 3442 jQuery('.typeahead', _t).typeahead({ 3443 limit: _limit, 3444 hint: _t.attr('data-hint') == "false" ? false : true, 3445 highlight: _t.attr('data-highlight') == "false" ? false : true, 3446 minLength: parseInt(_minLength), 3447 3448 cache: false, 3449 }, 3450 { 3451 name: '_typeahead', 3452 source: _typeahead 3453 }); 3454 /** **/ 3455 3456 }); 3457 3458 3459 } 3460 3461 }); 3462 3463 } 3464 3465 } 3466 3467 3468 3469 3470 3471 3472/** Form Stepper
3473 **************************************************************** **/ 3474 function _stepper() { 3475 var _container = jQuery('input.stepper'); 3476 3477 if(_container.length > 0) { 3478 3479 loadScript(plugin_path + 'form.stepper/jquery.stepper.min.js', function() { 3480 3481 if(jQuery().stepper) { 3482 3483 jQuery(_container).each(function() { 3484 var _t = jQuery(this), 3485 _min = _t.attr('min') || null, 3486 _max = _t.attr('max') || null; 3487 3488 _t.stepper({ 3489 limit: [_min,_max], 3490 floatPrecission: _t.attr('data-floatPrecission') || 2, 3491 wheel_step: _t.attr('data-wheelstep') || 0.1, 3492 arrow_step: _t.attr('data-arrowstep') || 0.2, 3493 allowWheel: _t.attr('data-mousescrool') == "false" ? false : true, 3494 UI: _t.attr('data-UI') == "false" ? false : true, 3495 // -- 3496 type: _t.attr('data-type') || "float", 3497 preventWheelAcceleration: _t.attr('data-preventWheelAcceleration') == "false" ? false : true, 3498 incrementButton: _t.attr('data-incrementButton') || "▴", 3499 decrementButton: _t.attr('data-decrementButton') || "▾", 3500 onStep: null, 3501 onWheel: null, 3502 onArrow: null, 3503 onButton: null, 3504 onKeyUp: null 3505 }); 3506 3507 }); 3508 3509 } 3510 3511 }); 3512 3513 } 3514 3515 } 3516 3517 3518 3519 3520 3521 3522/** Slimscroll 3523 **************************************************************** **/ 3524 function _slimScroll() { 3525 var _container = jQuery('.slimscroll'); 3526 3527 if(_container.length > 0) { 3528 3529 loadScript(plugin_path + 'slimscroll/jquery.slimscroll.min.js', function() { 3530 3531 if(jQuery().slimScroll) { 3532 3533 jQuery('.slimscroll').each(function () { 3534 3535 var height; 3536 if (jQuery(this).attr("data-height")) { 3537 height = jQuery(this).attr("data-height"); 3538 } else { 3539 height = jQuery(this).height(); 3540 } 3541 3542 jQuery(this).slimScroll({ 3543 size: jQuery(this).attr("data-size") || '5px', 3544 opacity: jQuery(this).attr("data-opacity") || .6, 3545 position: jQuery(this).attr("data-position") || 'right', 3546 allowPageScroll: false, // not working 3547 disableFadeOut: false, 3548 railVisible: true, 3549 railColor: jQuery(this).attr("data-railColor") || '#222', 3550 railOpacity: jQuery(this).attr("data-railOpacity") || 0.05, 3551 alwaysVisible: (jQuery(this).attr("data-alwaysVisible") != "false" ? true : false), 3552 railVisible: (jQuery(this).attr("data-railVisible") != "false" ? true : false), 3553 color: jQuery(this).attr("data-color") || '#333', 3554 wrapperClass: jQuery(this).attr("data-wrapper-class") || 'slimScrollDiv', 3555 railColor: jQuery(this).attr("data-railColor") || '#eaeaea', 3556 height: height 3557 }); 3558 3559 3560 // Disable body scroll on slimscroll hover 3561 if(jQuery(this).attr('disable-body-scroll') == 'true') { 3562 3563 jQuery(this).bind('mousewheel DOMMouseScroll', function(e) { 3564 var scrollTo = null; 3565 3566 if (e.type == 'mousewheel') { 3567 scrollTo = (e.originalEvent.wheelDelta * -1); 3568 } 3569 else if (e.type == 'DOMMouseScroll') { 3570 scrollTo = 40 * e.originalEvent.detail; 3571 } 3572 3573 if (scrollTo) { 3574 e.preventDefault(); 3575 jQuery(this).scrollTop(scrollTo + jQuery(this).scrollTop()); 3576 } 3577 }); 3578 3579 } 3580 3581 }); 3582 3583 } 3584 3585 }); 3586 3587 } 3588 3589 } 3590 3591 3592 3593 3594/** Modal Autoload 3595 3596 USAGE: 3597 3598 <div id="MODAL-ID-REQUIRED" class="modal fade" data-autoload="true" data-autoload-delay="2000"> 3599 ... 3600 </div> 3601 **************************************************************** **/ 3602 function _modalAutoLoad() { 3603 if(jQuery("div.modal").length > 0) { 3604 3605 jQuery("div.modal").each(function() { 3606 var _t = jQuery(this), 3607 _id = _t.attr('id'), 3608 _autostart = _t.attr('data-autoload') || false; 3609 3610 3611 // reset allow 3612 // localStorage.removeItem(_id); 3613 3614 3615 if(_id != '') { // rewrite if set to hidden by the user 3616 if(localStorage.getItem(_id) == 'hidden') { 3617 _autostart = 'false'; 3618 } 3619 } 3620 3621 3622 if(_autostart == 'true') { 3623 3624 jQuery(window).on("load", function() { // required on load!
3625 var _delay = _t.attr('data-autoload-delay') || 1000; // delay when modal apprear 3626 3627 setTimeout( 3628 function() { 3629 3630 _t.modal('toggle'); 3631 3632 }, parseInt(_delay)); 3633 3634 }); 3635 3636 } 3637 3638 // LOCAL STORAGE - DO NOT HIDE ON NEXT PAGE LOAD! 3639 jQuery("input.loadModalHide", this).bind("click", function() { 3640 var _tt = jQuery(this); 3641 3642 if(_tt.is(":checked")) { 3643 localStorage.setItem(_id, 'hidden'); 3644 console.log('[Modal Autoload #'+_id+'] Added to localStorage'); 3645 } else { 3646 localStorage.removeItem(_id); 3647 console.log('[Modal Autoload #'+_id+'] Removed from localStorage'); 3648 } 3649 3650 }); 3651 3652 }); 3653 3654 } 3655 } 3656 3657 3658 3659 3660 3661/** 10. Background Image 3662 class="boxed" should be added to body. 3663 Add to body - example: data-background="assets/images/boxed_background/1.jpg" 3664 **************************************************************** **/ 3665 function _bgimage() { 3666 3667 3668 // Section Background Slideshow 3669 var _t = jQuery('section[data-background], section div[data-background]'); 3670 3671 if(_t.length > 0) { 3672 3673 loadScript(plugin_path + 'jquery.backstretch.min.js', function() { 3674 3675 jQuery(_t).each(function() { 3676 var _this = jQuery(this), 3677 data_background = _this.attr('data-background') || ''; 3678 3679 3680 if(data_background != '') { 3681 3682 var data_background_delay = _this.attr('data-background-delay') || 3000, 3683 data_background_fade = _this.attr('data-background-fade') || 750; 3684 var instance; 3685 3686 3687 3688 var _db = data_background.split(','); 3689 var _db = data_background.replace(" ", "").split(','); 3690 3691 if(_db[1]) { 3692 _this.backstretch(_db, {duration: parseInt(data_background_delay), fade: parseInt(data_background_fade)}); 3693 } else { 3694 _this.backstretch(_db); 3695 } 3696 3697 3698 /** NEXT|PREV 3699 <!-- Backstretch Navigation --> 3700 <a id="bs-next" href="#"></a> 3701 <a id="bs-prev" href="#"></a> 3702 **/ 3703 jQuery(".bs-next", _this).bind("click", function(e) { 3704 e.preventDefault(); 3705 3706 _this.data('backstretch').next(); 3707 }); 3708 3709 jQuery(".bs-prev", _this).bind("click", function(e) { 3710 e.preventDefault(); 3711 3712 _this.data('backstretch').prev(); 3713 }); 3714 3715 3716 /** BACKSTRETCH BUGFIX 3717 For some reason, this plugin has some issues on window resize 3718 We use a small trick to force it to resize the background 3719 **/ 3720 jQuery(window).resize(function() { 3721 3722 if(window.afterResizeBkstr) { 3723 clearTimeout(window.afterResizeBkstr); 3724 } 3725 3726 window.afterResizeBkstr = setTimeout(function() { 3727 3728 _this.data('backstretch').next(); 3729 3730 }, 350); 3731 3732 }); 3733 3734 3735 } 3736 3737 }) 3738 3739 }); 3740 3741 3742 3743 3744 } 3745 3746 3747 // BODY BACKGROUND ONLY 3748 var data_background = jQuery('body').attr('data-background') || ''; 3749 3750 if(data_background != '') { 3751 3752 loadScript(plugin_path + 'jquery.backstretch.min.js', function() { 3753 3754 if(data_background) { 3755 jQuery.backstretch(data_background); 3756 jQuery('body').addClass('transparent'); // remove backround color of boxed class 3757 } 3758 3759 }); 3760 3761 } 3762 } 3763 3764 3765 3766 3767 3768/** Cookie Alert 3769 **************************************************************** **/ 3770 function _cookie_alert() { 3771 3772 var _el = jQuery('#cookie-alert'), 3773 _elCookie = _getCookie('cookie-alert'); 3774 3775 if(_el.length > 0 && _elCookie == null) { // only if cookie is not set 3776 var _expire = _el.attr('data-expire') || 30; 3777 3778 if(_el.hasClass('alert-position-bottom')){ 3779 3780 _el.animate({"bottom":"0px"}, 800, 'easeInOutExpo'); 3781 3782 } else { 3783 3784 _el.animate({"top":"0px"}, 800, 'easeInOutExpo'); 3785 3786 } 3787 3788 // on close, set cookie as closed 3789 jQuery('button', _el).bind('click', function() { 3790 _setCookie('cookie-alert','closed',Number(_expire)) 3791 }); 3792 3793 } 3794 3795 // reset cookie on request 3796 if(_el.length > 0 && _el.hasClass('cookie-reset')) { 3797 _delCookie('cookie-alert'); 3798 } 3799 3800 } 3801 3802 3803 3804 3805 3806/** Flickr Widget 3807 <div class="widget-flickr clearfix lightbox margin-bottom-60" data-id="37304598@N02" data-limit="16" data-plugin-options='{"delegate": "a", "gallery": {"enabled": true}}'></div> 3808 **************************************************************** **/ 3809 function _widget_flickr() { 3810 var _container = jQuery('.widget-flickr'); 3811 3812 if(_container.length > 0) { 3813 3814 loadScript(plugin_path + 'widget.jflickr/jflickrfeed.min.js', function() { 3815 3816 if(jQuery().jflickrfeed) { 3817 if(jQuery('.widget-flickr')) { 3818 3819 /** **/ 3820 _container.each(function() { 3821 var _t = jQuery(this), 3822 _id = _t.attr('data-id'), 3823 _limit = _t.attr('data-limit') || 14; 3824 3825 _t.jflickrfeed({ 3826 limit: parseInt(_limit), 3827 qstrings: { 3828 id: _id 3829 }, 3830 itemTemplate: '<li>'+ 3831 '<a href="{{image}}" title="{{title}}">' + 3832 '<img src="{{image_s}}" alt="{{title}}" width="63" height="63" />' + 3833 '</a>' + 3834 '</li>' 3835 }, function(data) { 3836 _lightbox(); 3837 }); 3838 3839 }); 3840 /** **/ 3841 3842 } 3843 } 3844 3845 }); 3846 3847 } 3848 3849 } 3850 3851 3852 3853 3854/** Twitter Widget 3855 **************************************************************** **/ 3856 function _widget_twitter() { 3857 var _container = jQuery(".widget-twitter"); 3858 3859 if(_container.length > 0) { 3860 3861 loadScript(plugin_path + 'widget.twittie/twittie.min.js', function() { 3862 3863 if(jQuery().twittie) { 3864 // jQuery('.example1 .tweet').twittie({ 3865 // dateFormat: '%b. %d, %Y', 3866 // template: '{{tweet}} <div class="date">{{date}}</div>', 3867 // count: 1, 3868 // loadingText: 'Loading!' 3869 // }); 3870 3871 _container.each(function() { 3872 var _t = jQuery(this), 3873 _php = _t.attr('data-php'), // PHP Script Path 3874 _usr = _t.attr('data-username'), // Twitter Username 3875 _lmt = _t.attr('data-limit') || 3, // Tweets Limit 3876 3877 _url = _php + "?username=" + _usr + "&limit=" + _lmt; 3878 3879 jQuery.getJSON(_url, function(tweets){ 3880 _t.html(format_twitter(tweets)); 3881 }); 3882 3883 }); 3884 3885 } 3886 3887 }); 3888 3889 } 3890 3891 } 3892 3893 function format_twitter(twitt) { 3894 var statusHTML = []; 3895 3896 for(var i=0; i<twitt.length; i++) { 3897 var username = twitt[i].user.screen_name; 3898 3899 var status = twitt[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { 3900 return '<a href="'+url+'" target="_blank">
3900'+url+'</a>'; 3901 }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { 3902 return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>'; 3903 }); 3904 3905 statusHTML.push('<li><i class="fa fa-twitter"></i><span>'+status+'</span><small><a href="http://twitter.com/'+username+'/statuses/'+twitt[i].id_str+'" target="_blank">'+relative_time(twitt[i].created_at)+'</a></small></li>'); 3906 } 3907 3908 return statusHTML.join(''); 3909 } 3910 3911 3912 function relative_time(time_value) { 3913 var values = time_value.split(" "), 3914 parsed_date = Date.parse(time_value), 3915 relative_to = (arguments.length > 1) ? arguments[1] : new Date(), 3916 delta = parseInt((relative_to.getTime() - parsed_date) / 1000); 3917 3918 time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3]; 3919 delta = delta + (relative_to.getTimezoneOffset() * 60); 3920 3921 if (delta < 60) { 3922 return 'less than a minute ago'; 3923 } else if(delta < 120) { 3924 return 'about a minute ago'; 3925 } else if(delta < (60*60)) { 3926 return (parseInt(delta / 60)).toString() + ' minutes ago'; 3927 } else if(delta < (120*60)) { 3928 return 'about an hour ago'; 3929 } else if(delta < (24*60*60)) { 3930 return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago'; 3931 } else if(delta < (48*60*60)) { 3932 return '1 day ago'; 3933 } else { 3934 return (parseInt(delta / 86400)).toString() + ' days ago'; 3935 } 3936 } 3937 3938 3939 3940 3941/** Facebook Widget 3942 <div class="fb-like" data-href="http://www.stepofweb.com" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div> 3943 **************************************************************** **/ 3944 function _widget_facebook() { 3945 3946 /** Like & Share Button 3947 ************************ **/ 3948 var _container_1 = jQuery('div.fb-like'); 3949 var _container_2 = jQuery('div.fb-share-button'); 3950 3951 if(_container_1.length > 0 || _container_2.length > 0) { 3952 3953 jQuery('body').append('<div id="fb-root"></div>'); 3954 3955 (function(d, s, id) { 3956 var js, fjs = d.getElementsByTagName(s)[0]; 3957 if (d.getElementById(id)) return; 3958 js = d.createElement(s); js.id = id; 3959 js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; 3960 fjs.parentNode.insertBefore(js, fjs); 3961 }(document, 'script', 'facebook-jssdk')); 3962 3963 } 3964 3965 } 3966 3967 3968 3969 3970 3971/** Dribbble Widget 3972 **************************************************************** **/ 3973 function _widget_dribbble() { 3974 var _container = jQuery(".widget-dribbble"); 3975 3976 if(_container.length > 0) { 3977 3978 loadScript(plugin_path + 'widget.dribbble/jribbble.min.js', function() { 3979 3980 var _token = _container.attr('data-token') || 'f688ac519289f19ce5cebc1383c15ad5c02bd58205cd83c86cbb0ce09170c1b4', // demo default 3981 _target = _container.attr('data-target') || '_blank', 3982 _shots = _container.attr('data-shots') || 2046896; // demo default 3983 3984 jQuery.jribbble.setToken(_token); 3985 3986 jQuery.jribbble.shots(_shots).rebounds().then(function(res) { 3987 var html = []; 3988 3989 res.forEach(function(shot) { 3990 html.push('<li>'); 3991 html.push('<a href="' + shot.html_url + '" target="' + _target + '">'); 3992 html.push('<img class="img-fluid" src="' + shot.images.normal + '" alt="image">'); 3993 html.push('</a></li>'); 3994 }); 3995 3996 _container.html(html.join('')); 3997 }); 3998 3999 4000 }); 4001 4002 } 4003 4004 } 4005 4006 4007 4008 4009 4010/** Media Widget [mediaelement plugin] 4011 **************************************************************** **/ 4012 function _widget_media() { 4013 var _container = jQuery(".widget-media"); 4014 4015 if(_container.length > 0) { 4016 4017 loadScript(plugin_path + 'widget.mediaelementbuild/mediaelement-and-player.min.js', function() { 4018 4019 4020 4021 }); 4022 4023 } 4024 4025 } 4026 4027 4028 4029/** **************************************************************************************************************** **/ 4030/** **************************************************************************************************************** **/ 4031/** **************************************************************************************************************** **/ 4032/** **************************************************************************************************************** **/ 4033 4034 4035 /* 4036 Mobile Check 4037 4038 if( isMobile.any() ) alert('Mobile'); 4039 if( isMobile.iOS() ) alert('iOS'); 4040 */ 4041 4042 var isMobile = { 4043 iOS: function() { 4044 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 4045 }, 4046 Android: function() { 4047 return navigator.userAgent.match(/Android/i); 4048 }, 4049 BlackBerry: function() { 4050 return navigator.userAgent.match(/BlackBerry/i); 4051 }, 4052 Opera: function() { 4053 return navigator.userAgent.match(/Opera Mini/i); 4054 }, 4055 Windows: function() { 4056 return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i); 4057 }, 4058 any: function() { 4059 return (isMobile.iOS() || isMobile.Android() || isMobile.BlackBerry() || isMobile.Opera() || isMobile.Windows()); 4060 } 4061 }; 4062 4063 4064 4065 4066 // Number Format 4067 Number.prototype.formatMoney = function(c, d, t){ 4068 var n = this, 4069 c = isNaN(c = Math.abs(c)) ? 2 : c, 4070 d = d == undefined ? "." : d, 4071 t = t == undefined ? "," : t, 4072 s = n < 0 ? "-" : "", 4073 i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))), 4074 j = (j = i.length) > 3 ? j % 3 : 0; 4075 return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); 4076 }; 4077 4078 4079 // scroll 4080 function wheel(e) { 4081 e.preventDefault(); 4082 } 4083 4084 function disable_scroll() { 4085 if (window.addEventListener) { 4086 window.addEventListener('DOMMouseScroll', wheel, false); 4087 } 4088 window.onmousewheel = document.onmousewheel = wheel; 4089 } 4090 4091 function enable_scroll() { 4092 if (window.removeEventListener) { 4093 window.removeEventListener('DOMMouseScroll', wheel, false); 4094 } 4095 window.onmousewheel = document.onmousewheel = document.onkeydown = null; 4096 } 4097 4098 // overlay 4099 function enable_overlay() { 4100 jQuery("span.global-overlay").remove(); // remove first! 4101 jQuery('body').append('<span class="global-overlay"></span>'); 4102 } 4103 function disable_overlay() { 4104 jQuery("span.global-overlay").remove(); 4105 } 4106 4107 4108 4109 4110 4111 4112 4113/** Cookies 4114 **************************************************************** **/ 4115function _setCookie(name,value,days) { 4116 var expires = ""; 4117 if (days) { 4118 var date = new Date(); 4119 date.setTime(date.getTime() + (days*24*60*60*1000)); 4120 expires = "; expires=" + date.toUTCString(); 4121 } 4122 document.cookie = name + "=" + value + expires + "; path=/"; 4123} 4124 4125function _getCookie(name) { 4126 var nameEQ = name + "="; 4127 var ca = document.cookie.split(';'); 4128 for(var i=0;i < ca.length;i++) { 4129 var c = ca[i]; 4130 while (c.charAt(0)==' ') c = c.substring(1,c.length); 4131 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 4132 } 4133 return null; 4134} 4135 4136
4137function _delCookie(name) { 4138 _setCookie(name,"",-1); 4139} 4140 4141 4142 4143/** COUNT TO 4144 https://github.com/mhuggins/jquery-countTo 4145 **************************************************************** **/ 4146 (function ($) { 4147 $.fn.countTo = function (options) { 4148 options = options || {}; 4149 4150 return jQuery(this).each(function () { 4151 // set options for current element 4152 var settings = jQuery.extend({}, $.fn.countTo.defaults, { 4153 from: jQuery(this).data('from'), 4154 to: jQuery(this).data('to'), 4155 speed: jQuery(this).data('speed'), 4156 refreshInterval: jQuery(this).data('refresh-interval'), 4157 decimals: jQuery(this).data('decimals') 4158 }, options); 4159 4160 // how many times to update the value, and how much to increment the value on each update 4161 var loops = Math.ceil(settings.speed / settings.refreshInterval), 4162 increment = (settings.to - settings.from) / loops; 4163 4164 // references & variables that will change with each update 4165 var self = this, 4166 $self = jQuery(this), 4167 loopCount = 0, 4168 value = settings.from, 4169 data = $self.data('countTo') || {}; 4170 4171 $self.data('countTo', data); 4172 4173 // if an existing interval can be found, clear it first 4174 if (data.interval) { 4175 clearInterval(data.interval); 4176 } 4177 data.interval = setInterval(updateTimer, settings.refreshInterval); 4178 4179 // __construct the element with the starting value 4180 render(value); 4181 4182 function updateTimer() { 4183 value += increment; 4184 loopCount++; 4185 4186 render(value); 4187
4188 if (typeof(settings.onUpdate) == 'function') { 4189 settings.onUpdate.call(self, value); 4190 } 4191 4192 if (loopCount >= loops) { 4193 // remove the interval 4194 $self.removeData('countTo'); 4195 clearInterval(data.interval); 4196 value = settings.to; 4197 4198 if (typeof(settings.onComplete) == 'function') { 4199 settings.onComplete.call(self, value); 4200 } 4201 } 4202 } 4203 4204 function render(value) { 4205 var formattedValue = settings.formatter.call(self, value, settings); 4206 $self.html(formattedValue); 4207 } 4208 }); 4209 }; 4210 4211 $.fn.countTo.defaults = { 4212 from: 0, // the number the element should start at 4213 to: 0, // the number the element should end at 4214 speed: 1000, // how long it should take to count between the target numbers 4215 refreshInterval: 100, // how often the element should be updated 4216 decimals: 0, // the number of decimal places to show 4217 formatter: formatter, // handler for formatting the value before rendering 4218 onUpdate: null, // callback method for every time the element is updated 4219 onComplete: null // callback method for when the element finishes updating 4220 }; 4221 4222 function formatter(value, settings) { 4223 return value.toFixed(settings.decimals); 4224 } 4225}(jQuery)); 4226 4227 4228 4229/** ããã¡ãã¥ã¼PC表示æã®ã¿ç¹å®ã®href屿§ãæå¹ 4230 **************************************************************** **/ 4231$(document).ready(function() { 4232 $('.dropdown-toggle.pc-only').each(function() { 4233 var href = $(this).attr('href'); 4234 $(this).removeAttr('href'); // ã¾ãhrefãåé¤ 4235 $(this).click(function(e) { 4236 if ($(window).width() >= 768) { // PC表示æ 4237 window.location.href = href; // hrefãæå¹ã«ãã 4238 } else { 4239 e.preventDefault(); // ã¢ãã¤ã«è¡¨ç¤ºæã¯hrefãç¡å¹ã«ãã 4240 } 4241 }); 4242 }); 4243}); 4244 4245 4246 4247/** page header tabs PC 横ã¹ã¯ãã¼ã«ãç¢å°ãã¿ã³ æ¼ä¸ ç§»å 4248 **************************************************************** **/ 4249$('.pc-next-btn-left-in').click(function () { 4250ãã$('.pc-scroll-nav').animate({ 4251ãããããscrollLeft: $('.pc-scroll-nav').scrollLeft() - 100 //ããpxå·¦ã«ã¹ã¯ãã¼ã«ãã 4252ãã}, 500); //ã¹ã¯ãã¼ã«ã«ãããæé 4253}); 4254$('.pc-next-btn-right-in').click(function () { 4255ãã$('.pc-scroll-nav').animate({ 4256ããããscrollLeft: $('.pc-scroll-nav').scrollLeft() + 100 //ããpxå³ã«ã¹ã¯ãã¼ã«ãã 4257ãã}, 500); //ã¹ã¯ãã¼ã«ã«ãããæé 4258}); 4259 4260 4261 4262/** page header tabs ã¹ãã æ¨ªã¹ã¯ãã¼ã«ãç¢å°ãã¿ã³ æ¼ä¸ ç§»å 4263 **************************************************************** **/ 4264$('.next-btn-left-in').click(function () { 4265ãã$('.scroll-nav').animate({ 4266ãããããscrollLeft: $('.scroll-nav').scrollLeft() - 150 //ããpxå·¦ã«ã¹ã¯ãã¼ã«ãã 4267ãã}, 600); //ã¹ã¯ãã¼ã«ã«ãããæé 4268}); 4269$('.next-btn-right-in').click(function () { 4270ãã$('.scroll-nav').animate({ 4271ããããscrollLeft: $('.scroll-nav').scrollLeft() + 150 //ããpxå³ã«ã¹ã¯ãã¼ã«ãã 4272ãã}, 600); //ã¹ã¯ãã¼ã«ã«ãããæé 4273}); 4274 4275 4276 4277/** page header tabs PC 横ã¹ã¯ãã¼ã«ãç¢å°ãã¿ã³ 表示ï¼é表示 4278 **************************************************************** **/ 4279window.onload = function() { 4280 $(".pc-next-btn-left-in").css("visibility", "hidden"); 4281 $(".next-btn-left-in").css("visibility", "hidden"); 4282}; 4283 4284$('.pc-scroll-nav').on('scroll', function () { 4285 var scrollPosition = $('.pc-scroll-nav').scrollLeft(); 4286 var maxPostion = $('.pc-scroll-nav').get(0).scrollWidth - $('.pc-scroll-nav').get(0).clientWidth; 4287 if (scrollPosition === 0) { 4288 $('.pc-next-btn-left-in').css('visibility', 'hidden'); 4289 $('.pc-next-btn-right-in').css('visibility', 'visible'); 4290 } else if (scrollPosition === maxPostion) { 4291 $('.pc-next-btn-right-in').css('visibility', 'hidden'); 4292 $('.pc-next-btn-left-in').css('visibility', 'visible'); 4293 } else if (scrollPosition > 0 & scrollPosition < maxPostion) { 4294 $('.pc-next-btn-right-in').css('visibility', 'visible'); 4295 $('.pc-next-btn-left-in').css('visibility', 'visible'); 4296 4297 }; 4298}); 4299 4300 4301
4302/** page header tabs ã¹ãã æ¨ªã¹ã¯ãã¼ã«ãç¢å°ãã¿ã³ 表示ï¼é表示 4303 **************************************************************** **/ 4304$('.scroll-nav').on('scroll', function () { 4305 var scrollPosition = $('.scroll-nav').scrollLeft(); 4306 var maxPostion = $('.scroll-nav').get(0).scrollWidth - $('.scroll-nav').get(0).clientWidth; 4307 if (scrollPosition === 0) { 4308 $('.next-btn-left-in').css('visibility', 'hidden'); 4309 $('.next-btn-right-in').css('visibility', 'visible'); 4310 } else if (scrollPosition === maxPostion) { 4311 $('.next-btn-right-in').css('visibility', 'hidden'); 4312 $('.next-btn-left-in').css('visibility', 'visible'); 4313 } else if (scrollPosition > 0 & scrollPosition < maxPostion) { 4314 $('.next-btn-right-in').css('visibility', 'visible'); 4315 $('.next-btn-left-in').css('visibility', 'visible'); 4316 4317 }; 4318}); 4319 4320 4321 4322/** Appear 4323 https://github.com/bas2k/jquery.appear/ 4324 **************************************************************** **/ 4325(function(a){a.fn.appear=function(d,b){var c=a.extend({data:undefined,one:true,accX:0,accY:0},b);return this.each(function(){var g=a(this);g.appeared=false;if(!d){g.trigger("appear",c.data);return}var f=a(window);var e=function(){if(!g.is(":visible")){g.appeared=false;return}var r=f.scrollLeft();var q=f.scrollTop();var l=g.offset();var s=l.left;var p=l.top;var i=c.accX;var t=c.accY;var k=g.height();var j=f.height();var n=g.width();var m=f.width();if(p+k+t>=q&&p<=q+j+t&&s+n+i>=r&&s<=r+m+i){if(!g.appeared){g.trigger("appear",c.data)}}else{g.appeared=false}};var h=function(){g.appeared=true;if(c.one){f.unbind("scroll",e);var j=a.inArray(e,a.fn.appear.checks);if(j>=0){a.fn.appear.checks.splice(j,1)}}d.apply(this,arguments)};if(c.one){g.one("appear",c.data,h)}else{g.bind("appear",c.data,h)}f.scroll(e);a.fn.appear.checks.push(e);(e)()})};a.extend(a.fn.appear,{checks:[],timeout:null,checkAll:function(){var b=a.fn.appear.checks.length;if(b>0){while(b--){(a.fn.appear.checks[b])()}}},run:function(){if(a.fn.appear.timeout){clearTimeout(a.fn.appear.timeout)}a.fn.appear.timeout=setTimeout(a.fn.appear.checkAll,20)}});a.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(c,d){var b=a.fn[d];if(b){a.fn[d]=function(){var e=b.apply(this,arguments);a.fn.appear.run();return e}}})})(jQuery); 4326 4327 4328/** Parallax 4329 http://www.ianlunn.co.uk/plugins/jquery-parallax/ 4330 **************************************************************** **/ 4331!function(n){n.fn.parallax=function(n,t,e){function o(){var o=jQuery(window).scrollTop();r=e?function(n){return n.outerHeight(!0)}:function(n){return n.height()},i.each(function(){var e=jQuery(this),i=e.offset().top,h=r(e);if(!(o>i+h||i>o+window.height)){var l=Math.round((u-o)*t);e.css("backgroundPosition",n+" "+l+"px")}})}var r,u,i=jQuery(this);(arguments.length<1||null===n)&&(n="50%"),(arguments.length<2||null===t)&&(t=.1),(arguments.length<3||null===e)&&(e=!0),i.each(function(){u=i.offset().top,u<window.height&&(u=0)}),jQuery(window).bind("scroll",o).resize(o),o()}}(jQuery); 4332 4333 4334/** jQuery Easing v1.3 4335 http://gsgd.co.uk/sandbox/jquery/easing/ 4336 **************************************************************** **/ 4337jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}}); 4338 4339 4340/** WOW - v1.0.3 - 2015-01-14 4341 http://mynameismatthieu.com/WOW/ 4342 **************************************************************** **/ 4343(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]}
vendor: 4,547 bytes, line 4343
4343,a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationNameCache=new c}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addedNodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.doSync(c));return f}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=""+a.className+" "+this.config.animateClass,null!=this.config.callback?this.config.callback(a):void 0},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a}
4343,e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charAt(0).toUpperCase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getPropertyCSSValue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getPropertyCSSValue("-"+f+"-"+b);return c},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this); 4344 4345 4346/** Modernizr 3.3.1 4347 http://modernizr.com/download/#-csstransforms3d-csstransitions-video-touch-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 4348 **************************************************************** **/ 4349!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,a,s;for(var l in b)if(b.hasOwnProperty(l)){if(e=[],t=b[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)a=e[i],s=a.split("."),1===s.length?Modernizr[s[0]]=o:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=o),C.push((o?"":"no-")+s.join("-"))}}function i(e){var t=w.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),S?w.className.baseVal=t:w.className=t)}function a(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):S?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function s(e,t){if("object"==typeof e)for(var n in e)N(e,n)&&s(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2==r.length&&(o=o[r[1]]),"undefined"!=typeof o)return Modernizr;t="function"==typeof t?t():t,1==r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),i([(t&&0!=t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function c(e,t){return!!~(""+e).indexOf(t)}function u(){var e=t.body;return e||(e=a(S?"svg":"body"),e.fake=!0),e}function f(e,n,r,o){var i,s,l,c,f="modernizr",d=a("div"),p=u();if(parseInt(r,10))for(;r--;)l=a("div"),l.id=o?o[r]:f+(r+1),d.appendChild(l);return i=a("style"),i.type="text/css",i.id="s"+f,(p.fake?p:d).appendChild(i),p.appendChild(d),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),d.id=f,p.fake&&(p.style.background="",p.style.overflow="hidden",c=w.style.overflow,w.style.overflow="hidden",
4349w.appendChild(p)),s=n(d,e),p.fake?(p.parentNode.removeChild(p),w.style.overflow=c,w.offsetHeight):d.parentNode.removeChild(d),!!s}function d(e,t){return function(){return e.apply(t,arguments)}}function p(e,t,n){var o;for(var i in e)if(e[i]in t)return n===!1?e[i]:(o=t[e[i]],r(o,"function")?d(o,n||t):o);return!1}function m(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function h(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(m(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+m(t[o])+":"+r+")");return i=i.join(" or "),f("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function v(e,t,o,i){function s(){f&&(delete A.style,delete A.modElem)}if(i=r(i,"undefined")?!1:i,!r(o,"undefined")){var u=h(e,o);if(!r(u,"undefined"))return u}for(var f,d,p,m,v,g=["modernizr","tspan","samp"];!A.style&&g.length;)f=!0,A.modElem=a(g.shift()),A.style=A.modElem.style;for(p=e.length,d=0;p>d;d++)if(m=e[d],v=A.style[m],c(m,"-")&&(m=l(m)),A.style[m]!==n){if(i||r(o,"undefined"))return s(),"pfx"==t?m:!0;try{A.style[m]=o}catch(y){}if(A.style[m]!=v)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t,n,o,i){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+z.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?v(s,t,o,i):(s=(e+" "+T.join(a+" ")+a).split(" "),p(s,t,n))}function y(e,t,r){return g(e,n,n,t,r)}var C=[],b=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=E,Modernizr=new Modernizr;var _=E._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];E._prefixes=_;var w=t.documentElement,S="svg"===w.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,c(t)}function i(e){var t=y[e[v]];return t||(t={},g++,e[v]=g,y[g]=t),t}function a(e,n,r){if(n||(n=t),f)return n.createElement(e);r||(r=i(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():h.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||m.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function s(e,n){if(e||(e=t),f)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)o.createElement(s[a]);return o}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function c(e){e||(e=t);var r=i(e);return!C.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),f||l(e,r),e}var u,f,d="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,h=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",g=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",u="hidden"in e,f=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,f=!0}}();
4349var C={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:d,shivCSS:p.shivCSS!==!1,supportsUnknownElements:f,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:c,createElement:a,createDocumentFragment:s,addElements:o};e.html5=C,c(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var x="Moz O ms Webkit",T=E._config.usePrefixes?x.toLowerCase().split(" "):[];E._domPrefixes=T;var P=function(){function e(e,t){var o;return e?(t&&"string"!=typeof t||(t=a(t||"div")),e="on"+e,o=e in t,!o&&r&&(t.setAttribute||(t=a("div")),t.setAttribute(e,""),o="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),o):!1}var r=!("onblur"in t.documentElement);return e}();E.hasEvent=P,Modernizr.addTest("video",function(){var e=a("video"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t});var N;!function(){var e={}.hasOwnProperty;N=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e<n.length;e++)(r=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){E.addTest=s});var j="CSS"in e&&"supports"in e.CSS,k="supportsCSS"in e;Modernizr.addTest("supports",j||k);var z=E._config.usePrefixes?x.split(" "):[];E._cssomPrefixes=z;var F=function(t){var r,o=_.length,i=e.CSSRule;if("undefined"==typeof i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in i)return"@"+t;for(var a=0;o>a;a++){var s=_[a],l=s.toUpperCase()+"_"+r;if(l in i)return"@-"+s.toLowerCase()+"-"+t}return!1};E.atRule=F;var L=E.testStyles=f,$={elem:a("modernizr")};Modernizr._q.push(function(){delete $.elem});var A={style:$.elem.style};Modernizr._q.unshift(function(){delete A.style});E.testProp=function(e,t,r){return v([e],n,t,r)};E.testAllProps=g;E.prefixed=function(e,t,n){return 0===e.indexOf("@")?F(e):(-1!=e.indexOf("-")&&(e=l(e)),t?g(e,t,n):g(e,"pfx"))};E.testAllProps=y,Modernizr.addTest("csstransitions",y("transition","all",!0)),Modernizr.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in w.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",L(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),o(),i(C),delete E.addTest,delete E.addAsyncTest;for(var M=0;M<Modernizr._q.length;M++)Modernizr._q[M]();e.Modernizr=Modernizr}(window,document); 4350 4351 4352/** POPPER - used by bootstrap 4353 https://popper.js.org/ 4354 **************************************************************** **/ 4355function _loadPopperBS4() {
vendor: 19,187 bytes, lines 4356-4360
4356/* 4357 Copyright (C) Federico Zivolo 2017 4358 Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4359 */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:e?e.ownerDocument.documentElement:document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n))return p(l)?l:r(l);var f=s(e);return f.host?d(f.host,t):d(e,s(t).host)}function a(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){var n=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||n;return r[o]}return e[o]}function l(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=a(t,'top'),n=a(t,'left'),r=o?-1:1;return e.top+=i*r,e.bottom+=i*r,e.left+=n*r,e.right+=n*r,e}function f(e,t){var o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+i+'Width'],10)}function m(e,t,o,i){return J(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],ie()?o['offset'+e]+i['margin'+('Height'===e?'Top':'Left')]+i['margin'+('Height'===e?'Bottom':'Right')]:0)}function h(){var e=document.body,t=document.documentElement,o=ie()&&getComputedStyle(t);return{height:m('Height',e,t,o),width:m('Width',e,t,o)}}function c(e){return se({},e,{right:e.left+e.width,bottom:e.top+e.height})}function g(e){var o={};if(ie())try{o=e.getBoundingClientRect();var i=a(e,'top'),n=a(e,'left');o.top+=i,o.left+=n,o.bottom+=i,o.right+=n}catch(e){}else o=e.getBoundingClientRect();var r={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},p='HTML'===e.nodeName?h():{},s=p.width||e.clientWidth||r.right-r.left,d=p.height||e.clientHeight||r.bottom-r.top,l=e.offsetWidth-s,m=e.offsetHeight-d;if(l||m){var g=t(e);l-=f(g,'x'),m-=f(g,'y'),r.width-=l,r.height-=m}return c(r)}function u(e,o){var i=ie(),r='HTML'===o.nodeName,p=g(e),s=g(o),d=n(e),a=t(o),f=parseFloat(a.borderTopWidth,10),m=parseFloat(a.borderLeftWidth,10),h=c({top:p.top-s.top-f,left:p.left-s.left-m,width:p.width,height:p.height});if(h.marginTop=0,h.marginLeft=0,!i&&r){var u=parseFloat(a.marginTop,10),b=parseFloat(a.marginLeft,10);h.top-=f-u,h.bottom-=f-u,h.left-=m-b,h.right-=m-b,h.marginTop=u,h.marginLeft=b}return(i?o.contains(d):o===d&&'BODY'!==d.nodeName)&&(h=l(h,o)),h}function b(e){var t=e.ownerDocument.documentElement,o=u(e,t),i=J(t.clientWidth,window.innerWidth||0),n=J(t.clientHeight,window.innerHeight||0),r=a(t),p=a(t,'left'),s={top:r-o.top+o.marginTop,left:p-o.left+o.marginLeft,width:i,height:n};return c(s)}function w(e){var i=e.nodeName;return'BODY'===i||'HTML'===i?!1:'fixed'===t(e,'position')||w(o(e))}function y(e,t,i,r){var p={top:0,left:0},s=d(e,t);if('viewport'===r)p=b(s);else{var a;'scrollParent'===r?(a=n(o(t)),'BODY'===a.nodeName&&(a=e.ownerDocument.documentElement)):'window'===r?a=e.ownerDocument.documentElement:a=r;var l=u(a,s);if('HTML'===a.nodeName&&!w(s)){var f=h(),m=f.height,c=f.width;p.top+=l.top-l.marginTop,p.bottom=m+l.top,p.left+=l.left-l.marginLeft,p.right=c+l.left}else p=l}return p.left+=i,p.top+=i,p.right-=i,p.bottom-=i,p}function E(e){var t=e.width,o=e.height;return t*o}function v(e,t,o,i,n){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=y(o,i,r,n),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return se({key:e},s[e],{area:E(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function O(e,t,o){var i=d(t,o);return u(o,i)}function L(e){var t=getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function x(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function S(e,t,o){o=o.split('-')[0];var i=L(e),n={width:i.width,height:i.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return n[p]=t[p]+t[d]/2-i[d]/2,n[s]=o===s?t[s]-i[a]:t[x(s)],n}function T(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function D(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var i=T(e,function(e){return e[t]===o});return e.indexOf(i)}function C(t,o,i){var n=void 0===i?t:t.slice(0,D(t,'name',i));return n.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var i=t['function']||t.fn;t.enabled&&e(i)&&(o.offsets.popper=c(o.offsets.popper),o.offsets.reference=c(o.offsets.reference),o=i(o,t))}),o}function N(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=O(this.state,this.popper,this.reference),e.placement=v(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=S(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=C(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function k(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function W(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function P(){return this.state.isDestroyed=!0,k(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[W('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function B(e){var t=e.ownerDocument;return t?t.defaultView:window}function H(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||H(n(p.parentNode),t,o,i),i.push(p)}function A(e,t,o,i){o.updateBound=i,B(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return H(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=A(this.reference,this.options,this.state,this.scheduleUpdate))}function M(e,t){return B(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function R(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=M(this.reference,this.state))}function U(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function Y(e,t){Object.keys(t).forEach(function(o){var i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&U(t[o])&&(i='px'),e.style[o]=t[o]+i})}function j(e,t){Object.keys(t).forEach(function(o){var i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function F(e,t,o){var i=T(e,function(e){var o=e.name;return o===t}),n=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!n){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return n}function K(e){return'end'===e?'start':'start'===e?'end':e}function q(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=ae.indexOf(e),i=ae.slice(o+1).concat(ae.slice(0,o));return t?i.reverse():i}function V(e,t,o,i){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],p=n[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=i;}var d=c(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?J(document.documentElement.clientHeight,window.innerHeight||0):J(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function z(e,t,o,i){var n=[0,0],r=-1!==['right','left'].indexOf(i),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(T(p,function(e){return-1!==e.search(/,|\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\s*,\s*|\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,i){var n=(1===i?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return V(e,n,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,i){U(o)&&(n[t]+=o*('-'===e[i-1]?-1:1))})}),n}function G(e,t){var o,i=t.offset,n=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=n.split('-')[0];return o=U(+i)?[+i,0]:z(i,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}for(var _=Math.min,X=Math.floor,J=Math.max,Q='undefined'!=typeof window&&'undefined'!=typeof document,Z=['Edge','Trident','Firefox'],$=0,ee=0;ee<Z.length;ee+=1)if(Q&&0<=navigator.userAgent.indexOf(Z[ee])){$=1;break}var i,te=Q&&window.Promise,oe=te?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},$))}},ie=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},ne=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},re=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),pe=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},se=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],ae=de.slice(3),le={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},fe=function(){function t(o,i){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};ne(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=oe(this.update.bind(this)),this.options=se({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=i&&i.jquery?i[0]:i,this.options.modifiers={},Object.keys(se({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){n.options.modifiers[e]=se({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return se({name:e},n.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(n.reference,n.popper,n.options,t,n.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return re(t,[{key:'update',value:function(){return N.call(this)}},{key:'destroy',value:function(){return P.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return R.call(this)}}]),t}();return fe.Utils=('undefined'==typeof window?global:window).PopperUtils,fe.placements=de,fe.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){var n=e.offsets,r=n.reference,p=n.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:pe({},d,r[d]),end:pe({},d,r[d]+r[a]-p[a])};e.offsets.popper=se({},p,l[i])}return e}},offset:{order:200,enabled:!0,fn:G,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||r(e.instance.popper);e.instance.reference===o&&(o=r(o));var i=y(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var n=t.priority,p=e.offsets.popper,s={primary:function(e){var o=p[e];return p[e]<i[e]&&!t.escapeWithReference&&(o=J(p[e],i[e])),pe({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=p[o];return p[e]>i[e]&&!t.escapeWithReference&&(n=_(p[o],i[e]-('right'===e?p.width:p.height))),pe({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=se({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=X,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(i[d])&&(e.offsets.popper[d]=r(i[d])-o[a]),o[d]>r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var i;if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var n=o.element;if('string'==typeof n){if(n=e.instance.popper.querySelector(n),!n)return e;}else if(!e.instance.popper.contains(n))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',g=a?'bottom':'right',u=L(n)[l];d[g]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[g]-u)),d[m]+u>s[g]&&(e.offsets.popper[m]+=d[m]+u-s[g]),e.offsets.popper=c(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=J(_(s[l]-u,v),0),e.arrowElement=n,e.offsets.arrow=(i={},pe(i,m,Math.round(v)),pe(i,h,''),i),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(k(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=y(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=x(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case le.FLIP:p=[i,n];break;case le.CLOCKWISE:p=q(i);break;case le.COUNTERCLOCKWISE:p=q(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=x(i);var a=e.offsets.popper,l=e.offsets.reference,f=X,m='left'===i&&f(a.right)>f(l.left)||'right'===i&&f(a.left)<f(l.right)||'top'===i&&f(a.bottom)>f(l.top)||'bottom'===i&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===i&&h||'right'===i&&c||'top'===i&&g||'bottom'===i&&u,w=-1!==['top','bottom'].indexOf(i),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u);(m||b||y)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),y&&(r=K(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=se({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=C(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[o]-(s?n[p?'width':'height']:0),e.placement=x(t),e.offsets.popper=c(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,n=e.offsets.popper,p=T(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==p&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===p?t.gpuAcceleration:p,l=r(e.instance.popper),f=g(l),m={position:n.position},h={left:X(n.left),top:X(n.top),bottom:X(n.bottom),right:X(n.right)},c='bottom'===o?'top':'bottom',u='right'===i?'left':'right',b=W('transform');if(d='bottom'==c?-f.height+h.bottom:h.top,s='right'==u?-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[u]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==u?-1:1;m[c]=d*w,m[u]=s*y,m.willChange=c+', '+u}var E={"x-placement":e.placement};return e.attributes=se({},E,e.attributes),e.styles=se({},m,e.styles),e.arrowStyles=se({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return Y(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&Y(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,i,n){var r=O(n,t,e),p=v(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),Y(t,{position:'absolute'}),o},gpuAcceleration:void 0}}},fe}); 4360//# sourceMappingURL=popper.min.js.map
4360 4361}
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.