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