1/** ********************************************** ** 2 @Author Dorin Grigoras 3 @Website www.stepofweb.com 4 @Last Update Saturday, March 15, 2014 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 01. Top Nav 14 02. Animate 15 03. Superslides 16 04. OWL Carousel 17 05. Popover 18 06. Lightbox 19 07. ScrollTo 20 08. Parallax 21 09. Masonry Filter 22 10. Toggle 23 11. Background Image 24 12. Global Search 25 13. Quick Cart 26 14. Placeholder 27 15. Summernote HTML Editor 28 16. facebook login 29 17. form stepper 30 18. Zoom -- smartyból 31 GOOGLE MAP 32 AFTER RESIZE 33 COUNT TO 34 FITVIDS 35 WAIT FOR IMAGES [used by masonry] 36*************************************************** **/ 37 38 /* Init */ 39 jQuery(window).ready(function () { 40 Atropos(); 41 }); 42 43 44/** Load Script 45 46 USAGE 47 var pageInit = function() {} 48 loadScript(plugin_path + "script.js", function); 49 50 Load multiple scripts and call a final function 51 loadScript(plugin_path + "script1.js", function(){ 52 loadScript(plugin_path + "script2.js", function(){ 53 loadScript(plugin_path + "script3.js", function(){ 54 loadScript(plugin_path + "script4.js", function); 55 }); 56 }); 57 }); 58 **************************************************************** **/ 59 var _arr = {}; 60 function loadScript(scriptName, callback) { 61 62 if (!_arr[scriptName]) { 63 _arr[scriptName] = true; 64 65 var body = document.getElementsByTagName('body')[0]; 66 var script = document.createElement('script'); 67 script.type = 'text/javascript'; 68 script.src = scriptName; 69 70 // then bind the event to the callback function 71 // there are several events for cross browser compatibility 72 // script.onreadystatechange = callback; 73 script.onload = callback; 74 75 // fire the loading 76 body.appendChild(script); 77 78 } else if (callback) { 79 80 callback(); 81 82 } 83 84 }; 85 86 87 88 89/** Core 90 **************************************************************** **/ 91 function Atropos() { 92 _topNav(); 93 _animate(); 94 _superslide(); 95 _owl_carousel(); 96 _popover(); 97 _lightbox(); 98 _scrollTo(); 99 _parallax(); 100 _masonry(); 101 _toggle(); 102 _bgimage(); 103 _globalSearch(); 104 _quickCart(); 105 _placeholder(); 106 _htmlEditor(); 107 _stepper(); 108 _zoom(); 109 110 111 /** Bootstrap Tooltip **/ 112 jQuery("a[data-toggle=tooltip]").tooltip(); 113 114 /** Fitvids [Youtube|Vimeo] 115 if(jQuery(".fullwidthbanner iframe").length < 1 && jQuery(".fullscreenbanner iframe").length < 1 && jQuery(".fullscreenvideo").length < 1) { // disable fitvids if revolution slider video is present! 116 jQuery("body").fitVids(); 117 } 118**/ 119 /** 120 price slider 121 122 <script type="text/javascript" charset="utf-8"> 123 var slider_config = { from: 10, to: 500, heterogeneity: ['50/100', '75/250'], step: 10, dimension: ' $', skin: 'round_plastic' }; 124 </script> 125 **/ 126 if(jQuery().slider && jQuery(".price-slider").length > 0) { 127 jQuery("#Slider2").slider(slider_config); 128 } 129 130 /** mobile - hide on click! **/ 131 jQuery(document).bind("click", function() { 132 if(jQuery("div.navbar-collapse").hasClass('in')) { 133 jQuery("button.btn-mobile").trigger('click'); 134 } 135 }); 136 137 } 138 139 140/** 01. Top Nav 141 **************************************************************** **/ 142function _topNav() { 143 var addActiveClass = false; 144 145 jQuery("#topMain li.dropdown > a, #topMain li.dropdown-submenu > a").bind("click", function(e) { 146 e.preventDefault(); 147 e.stopPropagation(); 148 149 if($(window).width() > 979) { 150 return; 151 } 152 153 154 addActiveClass = jQuery(this).parent().hasClass("resp-active"); 155 jQuery("#topMain").find(".resp-active").removeClass("resp-active"); 156 157 if(!addActiveClass) { 158 jQuery(this).parents("li").addClass("resp-active"); 159 } 160 161 return; 162 163 }); 164 165 // Drop Downs - do not hide on click 166 jQuery("#topHead .dropdown-menu, #topNav .mega-menu .dropdown-menu").bind("click", function(e) { 167 e.stopPropagation(); 168 }); 169 170 jQuery(window).scroll(function() { 171 172 if(jQuery(window).width() > 1006) { 173 topMain(); // on scroll 174 } 175 176 }); 177 178 if(jQuery(window).width() > 1006) { 179 topMain(); // on load 180 } 181 182 183/* 184 // #topHead Fixes 185 window._headHeight = 81; 186 window._headHeightSmall = 30; 187 188 function _topNavCalibrate() { 189 190 if(jQuery("#topHead").length > 0) { 191 window._headHeight = jQuery("header#topHead").outerHeight() + jQuery("header#topNav").outerHeight() - 10; 192 window._headHeightSmall = 66; 193 194 jQuery('#wrapper').css({"padding-top":window._headHeight + "px"}); 195 jQuery('#topHead').removeClass('fixed').addClass('fixed'); 196 197 if(jQuery('#header_shadow').length > 0) { 198 jQuery('#header_shadow').css({"top":window._headHeight + "px"}); 199 } 200 201 } else { 202 203 if(jQuery(window).width() < 1006) { 204 jQuery('#wrapper').css({"margin-top":"-30px"}); 205 jQuery('#header_shadow').css({"top":"40px"}); 206 } else { 207 jQuery('#wrapper').css({"margin-top":"0px"}); 208 jQuery('#header_shadow').css({"top":"80px"}); 209 } 210 211 } 212 213 } 214*/ 215 window._headHeight = 81; 216 window._headHeightSmall = 11; 217 function _topNavCalibrate() { 218 219 if(jQuery("#topHead").length > 0) { 220 window._headHeight = jQuery("header#topHead").outerHeight() + jQuery("header#topNav").outerHeight() - 10; 221 window._headHeightSmall = 66; 222 223 jQuery('#wrapper').css({"padding-top":window._headHeight + "px"}); 224 225 226 if(jQuery('#header_shadow').length > 0) { 227 /*jQuery('#header_shadow').css({"top":window._headHeight + "px"});*/ 228 } 229 230 } else { 231 232 if(jQuery(window).width() < 1006) { 233 jQuery('#wrapper').css({"margin-top":"30px"}); 234 jQuery('#header_shadow').css({"top":"40px"}); 235 } else { 236 jQuery('#wrapper').css({"margin-top":"0px"}); 237 jQuery('#header_shadow').css({"top":"80px"}); 238 } 239 240 } 241 242 } 243 244 245 // recalibrate menu (mobile = slim mode) on resize 246 jQuery(window).resize(function() { 247 _topNavCalibrate(); 248 }); _topNavCalibrate(); 249 250 251 // scoll is on top! 252 window.topNavSmall = false;
253 254 255 function topMain() { 256 var _scrollTop = jQuery(document).scrollTop(); 257 258 if(window.topNavSmall === false && _scrollTop > 0) { 259 260 jQuery('header#topNav div.nav-main-collapse').addClass('topFix'); 261 jQuery('#topNav').stop().animate({ 'height':'60px'},400); 262 jQuery('header#topNav div.nav-main-collapse').stop().animate({ 'margin-top':'6px'},400); 263 jQuery('header#topNav button').stop().animate({ 'margin-top':'0'},100); 264 jQuery('header#topNav a.logo').stop().animate({ 'margin-top':'-10px'},400); 265 266 if(jQuery('#header_shadow').length > 0) { 267 jQuery('#header_shadow').stop().animate({ 'top':window._headHeightSmall + 'px'},400);/* just a little visible */ 268 } 269 270 window.topNavSmall = true; 271 } 272 273 if(window.topNavSmall === true && _scrollTop < 3) { 274 jQuery('header#topNav div.nav-main-collapse').removeClass('topFix'); 275 jQuery('#topNav').stop().animate({ 'height':'81px'},400); 276 jQuery('header#topNav div.nav-main-collapse').stop().animate({ 'margin-top':'16px'},400); 277 jQuery('header#topNav button').stop().animate({ 'margin-top':'8px'},100); 278 jQuery('header#topNav a.logo').stop().animate({ 'line-height':'50px', 'margin-top':'0'},400); 279 280 if(jQuery('#header_shadow').length > 0) { 281 jQuery('#header_shadow').stop().animate({ 'top':window._headHeight + 'px'},400); 282 } 283 284 window.topNavSmall = false; 285 } 286 287 } 288} 289 290 291/** 02. Animate 292 **************************************************************** **/ 293function _animate() { 294 295 // Animation [appear] 296 jQuery("[data-animation]").each(function() { 297 var _t = jQuery(this); 298 299 if(jQuery(window).width() > 767) { 300 301 _t.appear(function() { 302 303 var delay = (_t.attr("data-animation-delay") ? _t.attr("data-animation-delay") : 1); 304 305 if(delay > 1) _t.css("animation-delay", delay + "ms"); 306 _t.addClass(_t.attr("data-animation")); 307 308 setTimeout(function() { 309 _t.addClass("animation-visible"); 310 }, delay); 311 312 }, {accX: 0, accY: -150}); 313 314 } else { 315 316 _t.addClass("animation-visible"); 317 318 } 319 320 }); 321 322 // Bootstrap Progress Bar 323 jQuery("[data-appear-progress-animation]").each(function() { 324 var $_t = jQuery(this); 325 326 if(jQuery(window).width() > 767) { 327 328 $_t.appear(function() { 329 _delay = 1; 330 331 if($_t.attr("data-appear-progress-animation-delay")) { 332 _delay = $_t.attr("data-appear-progress-animation-delay"); 333 } 334 335 if(_delay > 1) { 336 $_t.css("animation-delay", _delay + "ms"); 337 } 338 339 $_t.addClass($_t.attr("data-appear-progress-animation")); 340 341 setTimeout(function() { 342 343 $_t.addClass("animation-visible"); 344 345 }, _delay); 346 347 }, {accX: 0, accY: -150}); 348 349 } else { 350 351 $_t.addClass("animation-visible"); 352 353 } 354 355 }); 356 357 358 jQuery("[data-appear-progress-animation]").each(function() { 359 var $_t = jQuery(this); 360 361 $_t.appear(function() { 362 363 var _delay = ($_t.attr("data-appear-animation-delay") ? $_t.attr("data-appear-animation-delay"): 1); 364 365 if(_delay > 1) { 366 $_t.css("animation-delay", _delay + "ms"); 367 } 368 369 $_t.addClass($_t.attr("data-appear-animation")); 370 setTimeout(function() { 371 372 $_t.animate({"width": $_t.attr("data-appear-progress-animation")}, 1000, "easeOutQuad", function() { 373 $_t.find(".progress-bar-tooltip").animate({"opacity": 1}, 500, "easeOutQuad"); 374 }); 375 376 }, _delay); 377 378 }, {accX: 0, accY: -50}); 379 380 }); 381 382 383 // Count To 384 jQuery(".countTo [data-to]").each(function() { 385 var $_t = jQuery(this); 386 387 $_t.appear(function() { 388 389 $_t.countTo(); 390 391 }, {accX:0, accY:-150}); 392 393 }); 394 395 396 /* Knob Circular Bar */ 397 if(jQuery().knob) { 398 399 jQuery(".knob").knob(); 400 401 } 402 403 404 /* Animation */ 405 jQuery('.animate_from_top').each(function () { 406 jQuery(this).appear(function() { 407 jQuery(this).delay(150).animate({opacity:1,top:"0px"},1000); 408 }); 409 }); 410 411 jQuery('.animate_from_bottom').each(function () { 412 jQuery(this).appear(function() { 413 jQuery(this).delay(150).animate({opacity:1,bottom:"0px"},1000); 414 }); 415 }); 416 417 418 jQuery('.animate_from_left').each(function () { 419 jQuery(this).appear(function() { 420 jQuery(this).delay(150).animate({opacity:1,left:"0px"},1000); 421 }); 422 }); 423 424 425 jQuery('.animate_from_right').each(function () { 426 jQuery(this).appear(function() { 427 jQuery(this).delay(150).animate({opacity:1,right:"0px"},1000); 428 }); 429 }); 430 431 jQuery('.animate_fade_in').each(function () { 432 jQuery(this).appear(function() { 433 jQuery(this).delay(350).animate({opacity:1,right:"0px"},1000); 434 }); 435 }); 436} 437 438 439 440 441/** 03. Superslides 442 **************************************************************** **/ 443function _superslide() { 444
445 if(jQuery("#slider").length > 0) { 446 447 var data_autoplay = jQuery("#slider").attr('data-autoplay'), 448 data_mouseover_stop = jQuery("#slider").attr('data-mouseover-stop'); 449 450 if(data_autoplay) { 451 if(data_autoplay == '') { 452 var data_autoplay = false; 453 } else { 454 var data_autoplay = parseInt(data_autoplay); 455 } 456 } else { 457 var data_autoplay = false; 458 } 459 460 if(!data_autoplay) { 461 data_mouseover_stop = false; 462 } 463 464 jQuery("#slider").superslides({ 465 animation: "fade", // slide|fade 466 pagination: true, // true|false 467 play: data_autoplay, // false to disable autoplay -OR- miliseconds (eg.: 1000 = 1s) 468 animation_speed: 600, // animation transition 469 470 elements: { 471 preserve: '.preserve', 472 nav: '.slides-navigation', 473 container: '.slides-container', 474 pagination: '.slides-pagination' 475 } 476 }); 477 478 if(data_mouseover_stop == 'true') { 479 480 // Stop on mouse over ! 481 jQuery('#slider').on('mouseenter', function() { 482 jQuery(this).superslides('stop'); 483 // console.log('Stopped') 484 }); 485 jQuery('#slider').on('mouseleave', function() { 486 jQuery(this).superslides('start'); 487 // console.log('_start') 488 }); 489 490 } 491 492 jQuery(window).load(function () { 493 jQuery("#slider").css({"background":"none"}); 494 }); 495 496 } 497} 498 499 500 501 502/** 04. OWL Carousel 503 **************************************************************** **/ 504function _owl_carousel() { 505 506 var total = jQuery("div.owl-carousel").length, 507 count = 0; 508 509 jQuery("div.owl-carousel").each(function() { 510 511 var slider = jQuery(this); 512 var options = slider.attr('data-plugin-options'); 513 514 var defaults = { 515 items: 5, 516 itemsCustom: false, 517 itemsDesktop: [1199,4], 518 itemsDesktopSmall: [980,3], 519 itemsTablet: [768,2], 520 itemsTabletSmall: false, 521 itemsMobile: [479,1], 522 singleItem: true, 523 itemsScaleUp: false, 524 525 slideSpeed: 200, 526 paginationSpeed: 800, 527 rewindSpeed: 1000, 528 529 autoPlay: false, 530 stopOnHover: false, 531 532 navigation: false, 533 navigationText: [ 534 '<i class="fa fa-chevron-left"></i>', 535 '<i class="fa fa-chevron-right"></i>' 536 ], 537 rewindNav: true, 538 scrollPerPage: false, 539 540 pagination: true, 541 paginationNumbers: false, 542 543 responsive: true, 544 responsiveRefreshRate: 200, 545 responsiveBaseWidth: window, 546 547 baseClass: "owl-carousel", 548 theme: "owl-theme", 549 550 lazyLoad: false, 551 lazyFollow: true, 552 lazyEffect: "fade", 553 554 autoHeight: false, 555 556 jsonPath: false, 557 jsonSuccess: false, 558 559 dragBeforeAnimFinish: true, 560 mouseDrag: true, 561 touchDrag: true, 562 563 transitionStyle: false, 564 565 addClassActive: false, 566 567 beforeUpdate: false, 568 afterUpdate: false, 569 beforeInit: false, 570 afterInit: false, 571 beforeMove: false, 572 afterMove: false, 573 afterAction: false, 574 startDragging: false, 575 afterLazyLoad: false 576 } 577 578 var config = jQuery.extend({}, defaults, options, slider.data("plugin-options")); 579 slider.owlCarousel(config).addClass("owl-carousel-init"); 580 }); 581} 582 583 584 585 586/** 05. Popover 587 **************************************************************** **/ 588function _popover() { 589 590 jQuery("a[data-toggle=popover]").bind("click", function(e) { 591 jQuery('.popover-title .close').remove(); 592 e.preventDefault(); 593 }); 594 595 var isVisible = false, 596 clickedAway = false; 597 598 599 jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover({ 600 601 html: true, 602 trigger: 'manual' 603 604 }).click(function(e) { 605 606 jQuery(this).popover('show'); 607 608 clickedAway = false; 609 isVisible = true; 610 e.preventDefault(); 611 612 }); 613 614 jQuery(document).click(function(e) { 615 if(isVisible & clickedAway) { 616 617 jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide'); 618 isVisible = clickedAway = false; 619 620 } else { 621 622 623 clickedAway = true; 624 625 } 626 627 }); 628 629 jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover({ 630 631 html: true, 632 trigger: 'manual' 633 634 }).click(function(e) { 635 636 $(this).popover('show'); 637 $('.popover-title').append('<button type="button" class="close">×</button>'); 638 $('.close').click(function(e){ 639 640 jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide'); 641 642 }); 643 644 e.preventDefault(); 645 }); 646 647 648 // jQuery("a[data-toggle=popover], button[data-toggle=popover]").popover(); 649} 650 651 652 653 654/** 06. LightBox 655 **************************************************************** **/ 656function _lightbox() { 657 658 659 660 if(typeof(jQuery.magnificPopup) == "undefined") { 661 return false;
662 } 663 664 jQuery.extend(true, jQuery.magnificPopup.defaults, { 665 tClose: 'Close', 666 tLoading: 'Loading...', 667 668 gallery: { 669 tPrev: 'Previous', 670 tNext: 'Next', 671 tCounter: '%curr% / %total%' 672 }, 673 674 image: { 675 tError: 'Image not loaded!' 676 }, 677 678 ajax: { 679 tError: 'Content not loaded!' 680 } 681 }); 682 683 jQuery(".lightbox").each(function() { 684 685 var _t = jQuery(this), 686 options = _t.attr('data-plugin-options'), 687 config = {}, 688 defaults = { 689 type: 'image', 690 fixedContentPos: false, 691 fixedBgPos: false, 692 mainClass: 'mfp-no-margins mfp-with-zoom', 693 image: { 694 verticalFit: true 695 }, 696 697 zoom: { 698 enabled: false, 699 duration: 300 700 }, 701 702 gallery: { 703 enabled: false, 704 navigateByImgClick: true, 705 preload: [0,1], 706 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 707 tPrev: 'Previou', 708 tNext: 'Next', 709 tCounter: '<span class="mfp-counter">%curr% / %total%</span>' 710 }, 711 }; 712 713 if(_t.data("plugin-options")) { 714 config = jQuery.extend({}, defaults, options, _t.data("plugin-options")); 715 } 716 717 jQuery(this).magnificPopup(config); 718 719 }); 720} 721 722 723 724 725/** 07. ScrollTo 726 **************************************************************** **/ 727function _scrollTo() { 728 729 jQuery("a.scrollTo").bind("click", function(e) { 730 e.preventDefault(); 731 732 var href = jQuery(this).attr('href'); 733 734 if(href != '#') { 735 jQuery('html,body').animate({scrollTop: jQuery(href).offset().top - 60}, 1000, 'easeInOutExpo'); 736 } 737 }); 738 739 jQuery("a.toTop").bind("click", function(e) { 740 e.preventDefault(); 741 jQuery('html,body').animate({scrollTop: 0}, 1000, 'easeInOutExpo'); 742 }); 743} 744 745 746 747 748/** 08. Parallax 749 **************************************************************** **/ 750function _parallax() { 751
752 if(typeof(jQuery.stellar) == "undefined") { 753 754 jQuery(".parallax").addClass("parallax-init"); 755 return false; 756 757 } 758 759 jQuery(window).load(function () { 760 761 if(jQuery(".parallax").length > 0) { 762 763 if(!Modernizr.touch) { 764 765 jQuery(window).stellar({ 766 767 responsive: true, 768 scrollProperty: 'scroll', 769 parallaxElements: false, 770 horizontalScrolling: false, 771 horizontalOffset: 0, 772 verticalOffset: 0 773 }); 774 775 } else { 776 777 jQuery(".parallax").addClass("disabled"); 778 779 } 780 } 781 782 jQuery(".parallax").addClass("parallax-init"); 783 784 // responsive 785 jQuery(window).afterResize(function() { 786 jQuery.stellar('refresh'); 787 }); 788 789 }); 790} 791 792 793 794 795/** 09. Masonry Filter 796 **************************************************************** **/ 797function _masonry() { 798 799 jQuery(window).load(function() { 800 801 jQuery("span.js_loader").remove(); 802 jQuery("li.masonry-item").addClass('fadeIn'); 803 804 jQuery(".masonry-list").each(function() { 805 806 var _c = jQuery(this); 807 808 _c.waitForImages(function() { // waitForImages Plugin - bottom of this file 809 810 _c.masonry({ 811 itemSelector: '.masonry-item' 812 }); 813 814 }); 815 816 }); 817 818 }); 819 820 jQuery("ul.isotope-filter").each(function() { 821 822 var _el = jQuery(this), 823 destination = jQuery("ul.sort-destination[data-sort-id=" + jQuery(this).attr("data-sort-id") + "]"); 824 825 if(destination.get(0)) { 826 827 jQuery(window).load(function() { 828 829 destination.isotope({ 830 itemSelector: "li", 831 layoutMode: 'sloppyMasonry' 832 }); 833 834 _el.find("a").click(function(e) { 835 836 e.preventDefault(); 837 838 var $_t = jQuery(this), 839 sortId = $_t.parents(".sort-source").attr("data-sort-id"), 840 filter = $_t.parent().attr("data-option-value"); 841 842 _el.find("li.active").removeClass("active"); 843 $_t.parent().addClass("active"); 844 845 destination.isotope({ 846 filter: filter 847 }); 848 849 jQuery(".sort-source-title[data-sort-id=" + sortId + "] strong").html($_t.html()); 850 return false; 851 852 }); 853 854 }); 855 856 } 857 858 }); 859 860 861 jQuery(window).load(function() { 862 863 jQuery("ul.isotope").addClass('fadeIn'); 864 865 }); 866} 867 868 869 870 871 872/** 10. Toggle 873 **************************************************************** **/ 874function _toggle() { 875 876 var $_t = this, 877 previewParClosedHeight = 25; 878 879 jQuery("div.toggle.active > p").addClass("preview-active"); 880 jQuery("div.toggle.active > div.toggle-content").slideDown(400); 881 jQuery("div.toggle > label").click(function(e) { 882 883 var parentSection = jQuery(this).parent(), 884 parentWrapper = jQuery(this).parents("div.toogle"), 885 previewPar = false, 886 isAccordion = parentWrapper.hasClass("toogle-accordion"); 887 888 if(isAccordion && typeof(e.originalEvent) != "undefined") { 889 parentWrapper.find("div.toggle.active > label").trigger("click"); 890 } 891 892 parentSection.toggleClass("active"); 893 894 if(parentSection.find("> p").get(0)) { 895 896 previewPar = parentSection.find("> p"); 897 var previewParCurrentHeight = previewPar.css("height"); 898 var previewParAnimateHeight = previewPar.css("height"); 899 previewPar.css("height", "auto"); 900 previewPar.css("height", previewParCurrentHeight); 901 902 } 903 904 var toggleContent = parentSection.find("> div.toggle-content"); 905 906 if(parentSection.hasClass("active")) { 907 908 jQuery(previewPar).animate({height: previewParAnimateHeight}, 350, function() {jQuery(this).addClass("preview-active");}); 909 toggleContent.slideDown(350); 910 911 } else { 912 913 jQuery(previewPar).animate({height: previewParClosedHeight}, 350, function() {jQuery(this).removeClass("preview-active");}); 914 toggleContent.slideUp(350); 915 916 } 917 918 }); 919} 920 921 922 923
924/** 11. Background Image 925 class="boxed" should be added to body. 926 Add to body - example: data-background="assets/images/boxed_background/1.jpg" 927 **************************************************************** **/ 928 function _bgimage() { 929 if(jQuery('body').hasClass('boxed')) { 930 backgroundImageSwitch(); 931 } 932 function backgroundImageSwitch() { 933 var data_background = jQuery('body').attr('data-background'); 934 if(data_background) { 935 jQuery.backstretch(data_background); 936 jQuery('body').addClass('transparent'); // remove backround color of boxed class 937 } 938 } 939 } 940 941 942 943 944/** 12. Global Search 945 **************************************************************** **/ 946 function _globalSearch() { 947 948 jQuery('li.search, li.search input').bind("click", function(e) { 949 e.stopPropagation(); 950 }); 951 952 jQuery('li.search input').bind("click", function() { 953 return false; 954 }); 955 956 jQuery('li.search').bind("click", function() { 957 958 if(jQuery(this).hasClass('open')) { 959 960 disable_overlay(); 961 enable_scroll(); 962 jQuery(this).removeClass('open'); 963 964 } else { 965 966 enable_overlay(); 967 disable_scroll(); 968 jQuery(this).addClass('open'); 969 jQuery('li.quick-cart').removeClass('open'); // close quick cart 970 971 } 972 973 }); 974 975 // 'esc' key 976 jQuery(document).keydown(function(e) { 977 var code = e.keyCode ? e.keyCode : e.which; 978 if(code == 27) { 979 jQuery('li.search, li.quick-cart').removeClass('open'); 980 disable_overlay(); 981 enable_scroll(); 982 } 983 }); 984 985 jQuery(document).bind("click", function() { 986 if(jQuery('li.search').hasClass('open')) { 987 jQuery('li.search, li.quick-cart').removeClass('open'); 988 disable_overlay(); 989 enable_scroll(); 990 } 991 }); 992 993 } 994 995 996 997/** 13. Quick Cart 998 **************************************************************** **/ 999 function _quickCart() { 1000 1001 jQuery('li.quick-cart').bind("click", function() { 1002 1003 jQuery('li.quick-cart .quick-cart-content').bind("click", function(e) { 1004 e.stopPropagation(); 1005 }); 1006 1007 if(jQuery(this).hasClass('open')) { 1008 1009 disable_overlay(); 1010 enable_scroll(); 1011 jQuery(this).removeClass('open'); 1012 1013 } else { 1014 1015 enable_overlay(); 1016 disable_scroll(); 1017 jQuery(this).addClass('open'); 1018 jQuery('li.search').removeClass('open'); // close search 1019 1020 } 1021 1022 return false; 1023 }); 1024 1025 // 'esc' key 1026 jQuery(document).keydown(function(e) { 1027 var code = e.keyCode ? e.keyCode : e.which; 1028 if(code == 27) { 1029 jQuery('li.search, li.quick-cart').removeClass('open'); 1030 disable_overlay(); 1031 enable_scroll(); 1032 } 1033 }); 1034 1035 jQuery(document).bind("click", function() { 1036 if(jQuery('li.quick-cart').hasClass('open')) { 1037 jQuery('li.search, li.quick-cart').removeClass('open'); 1038 disable_overlay(); 1039 enable_scroll(); 1040 } 1041 }); 1042 1043 } 1044 1045 1046 1047 1048 1049/** 14. Placeholder 1050 **************************************************************** **/ 1051 function _placeholder() { 1052 1053 //check for IE 1054 if(navigator.appVersion.indexOf("MSIE")!=-1) { 1055 1056 jQuery('[placeholder]').focus(function() { 1057 1058 var input = jQuery(this); 1059 if (input.val() == input.attr('placeholder')) { 1060 input.val(''); 1061 input.removeClass('placeholder'); 1062 } 1063 1064 }).blur(function() { 1065 1066 var input = jQuery(this); 1067 if (input.val() == '' || input.val() == input.attr('placeholder')) { 1068 input.addClass('placeholder'); 1069 input.val(input.attr('placeholder')); 1070 } 1071 1072 }).blur(); 1073 1074 } 1075 1076 } 1077 1078 1079 1080/** 15. Summernote HTML Editor 1081 **************************************************************** **/ 1082 function _htmlEditor() { 1083 /** 1084 SUMMERNOTE - textarea html editor 1085 1086 <script type="text/javascript" src="assets/plugins/html_summernote/summernote.min.js"></script> 1087 **/ 1088 if(jQuery('textarea.summernote').length > 0 && jQuery().summernote) { 1089 jQuery('textarea.summernote').each(function() { 1090 jQuery(this).summernote({ 1091 height: jQuery(this).attr('data-height') || 200, 1092 toolbar: [ 1093 /* [groupname, [button list]] */ 1094 ['fontsize', ['fontsize']], 1095 ['style', ['bold', 'italic', 'underline','strikethrough', 'clear']], 1096 ['para', ['ul', 'ol', 'paragraph']], 1097 ['table', ['table']], 1098 ['media', ['link', 'picture', 'video']], 1099 ['misc', ['codeview']] 1100 ] 1101 }); 1102 }); 1103 } 1104 } 1105 1106 1107/** 16. Image Zoom 1108 **************************************************************** **/ 1109 function _zoom() { 1110 var _container = jQuery('figure.zoom'); 1111
1112 if(_container.length > 0) { 1113 1114 loadScript('/assets/plugins/image.zoom/jquery.zoom.min.js', function() { 1115 1116 if(jQuery().zoom) { 1117 1118 _container.each(function() { 1119 var _t = jQuery(this), 1120 _mode = _t.attr('data-mode'), 1121 _id = _t.attr('id'); 1122 1123 if(_mode == 'grab') { 1124 _t.zoom({ on:'grab' }); 1125 } else 1126 1127 if(_mode == 'click') { 1128 _t.zoom({ on:'click' }); 1129 } else 1130 1131 if(_mode == 'toggle') { 1132 _t.zoom({ on:'toggle' }); 1133 } else { 1134 _t.zoom(); 1135 } 1136 1137 1138 // Thumbnails 1139 if(_id) { 1140 jQuery('.zoom-more[data-for='+_id+'] a').bind("click", function(e) { 1141 e.preventDefault(); 1142 1143 var _href = jQuery(this).attr('href'); 1144 1145 if(_href != "#") { 1146 jQuery('.zoom-more[data-for='+_id+'] a').removeClass('active'); 1147 jQuery(this).addClass('active'); 1148 1149 jQuery('figure#'+_id + '>.lightbox').attr('href', _href); 1150 1151 jQuery('figure#'+_id + '>img').fadeOut(0, function() { 1152 jQuery('figure#'+_id + '>img').attr('src', _href); 1153 }).fadeIn(500); 1154 1155 1156 } 1157 }); 1158 } 1159 1160 }); 1161 1162 } 1163 1164 }); 1165 1166 } 1167 1168 } 1169 1170 1171 1172/** Toastr 1173 1174 TYPE: 1175 primary 1176 info 1177 error 1178 sucess 1179 warning 1180 1181 POSITION 1182 top-right 1183 top-left 1184 top-center 1185 top-full-width 1186 bottom-right 1187 bottom-left 1188 bottom-center 1189 bottom-full-width 1190 1191 USAGE: 1192 _toastr("My Message here","top-right","error",false); 1193 1194 NOTE: 1195 _onclick = url to redirect (example: http://www.stepofweb.com) 1196 **************************************************************** **/ 1197 function _toastr(_message,_position,_notifyType,_onclick) { 1198 var _btn = jQuery(".toastr-notify"); 1199 1200 if(_btn.length > 0 || _message != false) { 1201 1202 loadScript('/assets/plugins/toastr/toastr.js', function() { 1203 // toastr.clear(); 1204 1205 /** BUTTON CLICK 1206 ********************* **/ 1207 _btn.bind("click", function(e) { 1208 e.preventDefault(); 1209 1210 1211 var _message = jQuery(this).attr('data-message'), 1212 _notifyType = jQuery(this).attr('data-notifyType') || "default", 1213 _position = jQuery(this).attr('data-position') || "top-right", 1214 _progressBar = jQuery(this).attr('data-progressBar') == "true" ? true : false, 1215 _closeButton = jQuery(this).attr('data-closeButton') == "true" ? true : false, 1216 _debug = jQuery(this).attr('data-debug') == "true" ? true : false, 1217 _newestOnTop = jQuery(this).attr('data-newestOnTop') == "true" ? true : false, 1218 _preventDuplicates = jQuery(this).attr('data-preventDuplicates') == "true" ? true : false, 1219 _showDuration = jQuery(this).attr('data-showDuration') || "300", 1220 _hideDuration = jQuery(this).attr('data-hideDuration') || "1000", 1221 _timeOut = jQuery(this).attr('data-timeOut') || "5000", 1222 _extendedTimeOut = jQuery(this).attr('data-extendedTimeOut') || "1000", 1223 _showEasing = jQuery(this).attr('data-showEasing') || "swing", 1224 _hideEasing = jQuery(this).attr('data-hideEasing') || "linear", 1225 _showMethod = jQuery(this).attr('data-showMethod') || "fadeIn", 1226 _hideMethod = jQuery(this).attr('data-hideMethod') || "fadeOut"; 1227 1228 toastr.options = { 1229 "closeButton": _closeButton, 1230 "debug": _debug, 1231 "newestOnTop": _newestOnTop, 1232 "progressBar": _progressBar, 1233 "positionClass": "toast-" + _position, 1234 "preventDuplicates": _preventDuplicates, 1235 "onclick": null, 1236 "showDuration": _showDuration, 1237 "hideDuration": _hideDuration, 1238 "timeOut": _timeOut, 1239 "extendedTimeOut": _extendedTimeOut, 1240 "showEasing": _showEasing, 1241 "hideEasing": _hideEasing, 1242 "showMethod": _showMethod, 1243 "hideMethod": _hideMethod 1244 } 1245 1246 toastr[_notifyType](_message); 1247 }); 1248 1249 1250 /** JAVSCRIPT / ON LOAD 1251 ************************* **/ 1252 if(_message != false) { 1253 1254 if(_onclick != false) { 1255 onclick = function() { 1256 window.location = _onclick; 1257 } 1258 } else { 1259 onclick = null 1260 } 1261 1262 toastr.options = { 1263 "closeButton": true, 1264 "debug": false, 1265 "newestOnTop": false, 1266 "progressBar": true, 1267 "positionClass": "toast-" + _position, 1268 "preventDuplicates": false, 1269 "onclick": onclick, 1270 "showDuration": "300", 1271 "hideDuration": "1000", 1272 "timeOut": "5000", 1273 "extendedTimeOut": "1000", 1274 "showEasing": "swing", 1275 "hideEasing": "linear", 1276 "showMethod": "fadeIn", 1277 "hideMethod": "fadeOut" 1278 } 1279 1280 setTimeout(function(){ 1281 toastr[_notifyType](_message); 1282 }, 1500); // delay 1.5s 1283 } 1284 }); 1285 1286 } 1287 1288 } 1289 1290 1291/** **************************************************************************************************************** **/ 1292/** **************************************************************************************************************** **/ 1293/** **************************************************************************************************************** **/ 1294/** **************************************************************************************************************** **/ 1295 1296 1297 1298 // scroll 1299 function wheel(e) { 1300 e.preventDefault(); 1301 } 1302 1303 function disable_scroll() { 1304 if (window.addEventListener) { 1305 window.addEventListener('DOMMouseScroll', wheel, false); 1306 } 1307 window.onmousewheel = document.onmousewheel = wheel; 1308 } 1309 1310 function enable_scroll() { 1311 if (window.removeEventListener) { 1312 window.removeEventListener('DOMMouseScroll', wheel, false); 1313 } 1314 window.onmousewheel = document.onmousewheel = document.onkeydown = null; 1315 } 1316 1317 // overlay 1318 function enable_overlay() { 1319 jQuery("span.global-overlay").remove(); // remove first! 1320 jQuery('body').append('<span class="global-overlay"></span>'); 1321 } 1322 function disable_overlay() { 1323 jQuery("span.global-overlay").remove(); 1324 } 1325 1326 1327 1328/** MEDIA ELEMENTS 1329*************************************************** **/ 1330 if(jQuery().mediaelementplayer && jQuery('video').length > 0 && jQuery(".fullscreenbanner video").length < 1 && jQuery(".fullwidthbanner video").length < 1) { // exclude revolution slider videos 1331 jQuery('video').mediaelementplayer({ 1332 // if the <video width> is not specified, this is the default 1333 defaultVideoWidth: 480, 1334 // if the <video height> is not specified, this is the default 1335 defaultVideoHeight: 270, 1336 // if set, overrides <video width> 1337 videoWidth: '100%', // -1 1338 // if set, overrides <video height> 1339 videoHeight: '100%', // -1 1340 // width of audio player 1341 audioWidth: 400,
1342 // height of audio player 1343 audioHeight: 30, 1344 // initial volume when the player starts 1345 startVolume: 0.8, 1346 // useful for <audio> player loops 1347 loop: true, 1348 // enables Flash and Silverlight to resize to content size 1349 enableAutosize: true, 1350 // the order of controls you want on the control bar (and other plugins below) 1351 features: ['playpause','progress','current','duration','tracks','volume','fullscreen'], 1352 // Hide controls when playing and mouse is not over the video 1353 alwaysShowControls: false, 1354 // force iPad's native controls 1355 iPadUseNativeControls: false, 1356 // force iPhone's native controls 1357 iPhoneUseNativeControls: false, 1358 // force Android's native controls 1359 AndroidUseNativeControls: false, 1360 // forces the hour marker (##:00:00) 1361 alwaysShowHours: false, 1362 // show framecount in timecode (##:00:00:00) 1363 showTimecodeFrameCount: false, 1364 // used when showTimecodeFrameCount is set to true 1365 framesPerSecond: 25, 1366 // turns keyboard support on and off for this instance 1367 enableKeyboard: true, 1368 // when this player starts, it will pause other players 1369 pauseOtherPlayers: true, 1370 // array of keyboard commands 1371 keyActions: [] 1372 1373 }); 1374 1375 setTimeout('eventClickTrigger()', 1000); 1376 function eventClickTrigger() { 1377 jQuery('video').trigger('click'); 1378 // resizeToCover(); 1379 } 1380 1381 // VOVER STYLE 1382 var min_w = 300; // minimum video width allowed 1383 var vid_w_orig; // original video dimensions 1384 var vid_h_orig; 1385 1386 jQuery(function() { // runs after DOM has loaded 1387 vid_w_orig = parseInt(jQuery('video, source').attr('width')); 1388 vid_h_orig = parseInt(jQuery('video, source').attr('height')); 1389 jQuery(window).resize(function () { resizeToCover(); }); 1390 }); 1391 1392 function resizeToCover() { 1393 1394 // set the video viewport to the window size 1395 jQuery('.video-wrap').width(jQuery(window).width()); 1396 jQuery('.video-wrap').height(jQuery(window).height()); 1397 1398 // use largest scale factor of horizontal/vertical 1399 var scale_h = jQuery(window).width() / vid_w_orig; 1400 var scale_v = jQuery(window).height() / vid_h_orig; 1401 var scale = scale_h > scale_v ? scale_h: scale_v; 1402 1403 // don't allow scaled width < minimum video width 1404 if (scale * vid_w_orig < min_w) {scale = min_w / vid_w_orig;}; 1405 1406 // now scale the video 1407 jQuery('video, source').width(scale * vid_w_orig); 1408 jQuery('video, source').height(scale * vid_h_orig); 1409 1410 // and center it by scrolling the video viewport 1411 jQuery('.video-wrap').scrollLeft((jQuery('video').width() - jQuery(window).width()) / 2); 1412 jQuery('.video-wrap').scrollTop((jQuery('video').height() - jQuery(window).height()) / 2); 1413 } 1414 1415 } 1416 1417 1418 1419/** GOOGLE MAP 1420*************************************************** **/ 1421 function contactMap() { 1422 1423 var latLang = new google.maps.LatLng($googlemap_latitude,$googlemap_longitude); 1424 1425 var mapOptions = { 1426 zoom:$googlemap_zoom, 1427 center: latLang, 1428 disableDefaultUI: false, 1429 navigationControl: false, 1430 mapTypeControl: false, 1431 scrollwheel: false, 1432 // styles: styles, 1433 mapTypeId: google.maps.MapTypeId.ROADMAP 1434 }; 1435 1436 var map = new google.maps.Map(document.getElementById('gmap'), mapOptions); 1437 google.maps.event.trigger(map, 'resize'); 1438 map.setZoom( map.getZoom() ); 1439 1440 var marker = new google.maps.Marker({ 1441 icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAArCAYAAAD7YZFOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABR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U6/6tVqtX9u3rz5uSg0FNhPE/JwV1K4CeQBWz43gnCJkJR83I9qtm2vAuOB+jojBjssyj2UFOZlEe61goXCWZY1p5S6EQdsZ2en6DhOXWprRKDSUnuaKFQA/gY2JK1uK1jkSbher1+KsU256+vrm7IK0/LX97AG4AA5eU223i6VHeGUUmppaSnruu7VXuC2t7e3q9VqMuD4Q6JWRdS6Bfwhqaz4ZhvnDtGwbftDpVS1G7CDg4OHhUJhR6BOymHSBe7KNfMX4LbYRrUTWCc4VSqVnN3d3SvdwBUKhXuBlalJkeeBG3Kg/QvYlo3f6+v2pZTygNrKyspsrVbLR01SKpX2y+WyJ75ZE4u4BfwE/CyQ5bDCj6McUqxl27ZnPM87bDfg8PCwadv2gTz4jqTwR+B74FcB3dd1vdELWEc4Ua/qOM5vjuN83W7M2tranuu6O8CavIBcAK6JVdwFDnVd9+LYUqqbUzZwL5/Pf5nJZN7IZDIv+x2bm5uVcrmcl3q
14416LarZUm9uXKhu0+qrdwDYq6url+r1elVWZ21jY+Ma8B1wVdTKATtAvV+wbpXzr2+71Wr190Kh8MX4+Ph7uVxuAfhBfGtLjuCuruuKAcV/AwDnrxMM7gFGVQAAAABJRU5ErkJggg==', 1442 position: latLang, 1443 map: map, 1444 title: "" 1445 }); 1446 1447 marker.setMap(map); 1448 google.maps.event.addListener(marker, "click", function() { 1449 // Add optionally an action for when the marker is clicked 1450 }); 1451 1452 // kepp googlemap responsive - center on resize 1453 google.maps.event.addDomListener(window, 'resize', function() { 1454 map.setCenter(latLang); 1455 }); 1456 1457 } 1458 1459 1460 function showMap(initWhat) { 1461 var script = document.createElement('script'); 1462 script.type = 'text/javascript'; 1463 script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&callback='+initWhat; 1464 document.body.appendChild(script); 1465 } 1466 1467 1468 // INIT CONTACT, NLY IF #contactMap EXISRS 1469 if(jQuery("#gmap").length > 0) { 1470 showMap('contactMap'); 1471 } 1472 1473 1474 1475/** @Facebook 1476*************************************************** **/ 1477 /* 1478 https://developers.facebook.com/docs/plugins/like-button/ 1479 1480 ADD TO YOUR CODE (just change data-href, that's all): 1481 1482 <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div> 1483 */ 1484 if(jQuery("div.fb-like").length > 0) { 1485 1486 jQuery('body').append('<div id="fb-root"></div>'); 1487 1488 (function(d, s, id) { 1489 var js, fjs = d.getElementsByTagName(s)[0]; 1490 if (d.getElementById(id)) return; 1491 js = d.createElement(s); js.id = id; 1492 js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; 1493 fjs.parentNode.insertBefore(js, fjs); 1494 }(document, 'script', 'facebook-jssdk')); 1495 1496 } 1497 1498/** @Google Plus 1499*************************************************** **/ 1500 /* 1501 https://developers.google.com/+/web/+1button/ 1502 1503 <!-- Place this tag where you want the +1 button to render. --> 1504 <div class="g-plusone" data-size="medium" data-annotation="inline" data-width="300"></div> 1505 */ 1506 if(jQuery("div.g-plusone").length > 0) { 1507 1508 (function() { 1509 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 1510 po.src = 'https://apis.google.com/js/platform.js'; 1511 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 1512 })(); 1513 1514 } 1515 1516/** @Twitter 1517*************************************************** **/ 1518 /* 1519 https://dev.twitter.com/docs/tweet-button 1520 1521 <!-- Place this tag where you want the twitter button to render. --> 1522 <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a> 1523 */ 1524 if(jQuery("a.twitter-share-button").length > 0) { 1525 1526 !function(d,s,id){ 1527 var js,fjs=d.getElementsByTagName(s)[0]; 1528 if(!d.getElementById(id)){js=d.createElement(s); 1529 js.id=id;js.src="https://platform.twitter.com/widgets.js"; 1530 fjs.parentNode.insertBefore(js,fjs);} 1531 }(document,"script","twitter-wjs"); 1532 1533 } 1534 1535 1536 1537 1538 1539/** AFTER RESIZE 1540 http://www.mcshaman.com/afterresize-js-jquery-plugin/ 1541 **************************************************************** **/ 1542 1543( function( $ ) { 1544 "use strict"; 1545 1546 // Define default settings 1547 var defaults = { 1548 action: function() {}, 1549 runOnLoad: false, 1550 duration: 500 1551 }; 1552 1553 // Define global variables 1554 var settings = defaults, 1555 running = false, 1556 start; 1557 1558 var methods = {}; 1559 1560 // Initial plugin configuration 1561 methods.init = function() { 1562 1563 // Allocate passed arguments to settings based on type 1564 for( var i = 0; i <= arguments.length; i++ ) { 1565 var arg = arguments[i]; 1566 switch ( typeof arg ) { 1567 case "function": 1568 settings.action = arg; 1569 break; 1570 case "boolean": 1571 settings.runOnLoad = arg; 1572 break; 1573 case "number": 1574 settings.duration = arg; 1575 break; 1576 } 1577 } 1578 1579 // Process each matching jQuery object 1580 return this.each(function() { 1581 1582 if( settings.runOnLoad ) { settings.action(); } 1583 1584 jQuery(this).resize( function() { 1585 1586 methods.timedAction.call( this ); 1587 1588 } ); 1589 1590 } ); 1591 }; 1592 1593 methods.timedAction = function( code, millisec ) { 1594 1595 var doAction = function() { 1596 var remaining = settings.duration; 1597 1598 if( running ) { 1599 var elapse = new Date() - start; 1600 remaining = settings.duration - elapse; 1601 if( remaining <= 0 ) { 1602 // Clear timeout and reset running variable 1603 clearTimeout(running); 1604 running = false;
1605 // Perform user defined function 1606 settings.action(); 1607 1608 return; 1609 } 1610 } 1611 wait( remaining ); 1612 }; 1613 1614 var wait = function( time ) { 1615 running = setTimeout( doAction, time ); 1616 }; 1617 1618 // Define new action starting time 1619 start = new Date(); 1620 1621 // Define runtime settings if function is run directly 1622 if( typeof millisec === 'number' ) { settings.duration = millisec; } 1623 if( typeof code === 'function' ) { settings.action = code; } 1624 1625 // Only run timed loop if not already running 1626 if( !running ) { doAction(); } 1627 1628 }; 1629 1630 1631 $.fn.afterResize = function( method ) { 1632 1633 if( methods[method] ) { 1634 return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) ); 1635 } else { 1636 return methods.init.apply( this, arguments ); 1637 } 1638 1639 }; 1640 1641})(jQuery); 1642 1643 1644 1645 1646/** COUNT TO 1647 https://github.com/mhuggins/jquery-countTo 1648 **************************************************************** **/ 1649 (function ($) { 1650 $.fn.countTo = function (options) { 1651 options = options || {}; 1652 1653 return jQuery(this).each(function () { 1654 // set options for current element 1655 var settings = jQuery.extend({}, $.fn.countTo.defaults, { 1656 from: jQuery(this).data('from'), 1657 to: jQuery(this).data('to'), 1658 speed: jQuery(this).data('speed'), 1659 refreshInterval: jQuery(this).data('refresh-interval'), 1660 decimals: jQuery(this).data('decimals') 1661 }, options); 1662 1663 // how many times to update the value, and how much to increment the value on each update 1664 var loops = Math.ceil(settings.speed / settings.refreshInterval), 1665 increment = (settings.to - settings.from) / loops; 1666 1667 // references & variables that will change with each update 1668 var self = this, 1669 $self = jQuery(this), 1670 loopCount = 0, 1671 value = settings.from, 1672 data = $self.data('countTo') || {}; 1673 1674 $self.data('countTo', data); 1675 1676 // if an existing interval can be found, clear it first 1677 if (data.interval) { 1678 clearInterval(data.interval); 1679 } 1680 data.interval = setInterval(updateTimer, settings.refreshInterval); 1681 1682 // __construct the element with the starting value 1683 render(value); 1684 1685 function updateTimer() { 1686 value += increment; 1687 loopCount++; 1688 1689 render(value); 1690
1691 if (typeof(settings.onUpdate) == 'function') { 1692 settings.onUpdate.call(self, value); 1693 } 1694 1695 if (loopCount >= loops) { 1696 // remove the interval 1697 $self.removeData('countTo'); 1698 clearInterval(data.interval); 1699 value = settings.to; 1700 1701 if (typeof(settings.onComplete) == 'function') { 1702 settings.onComplete.call(self, value); 1703 } 1704 } 1705 } 1706 1707 function render(value) { 1708 var formattedValue = settings.formatter.call(self, value, settings); 1709 $self.html(formattedValue); 1710 } 1711 }); 1712 }; 1713 1714 $.fn.countTo.defaults = { 1715 from: 0, // the number the element should start at 1716 to: 0, // the number the element should end at 1717 speed: 1000, // how long it should take to count between the target numbers 1718 refreshInterval: 100, // how often the element should be updated 1719 decimals: 0, // the number of decimal places to show 1720 formatter: formatter, // handler for formatting the value before rendering 1721 onUpdate: null, // callback method for every time the element is updated 1722 onComplete: null // callback method for when the element finishes updating 1723 }; 1724 1725 function formatter(value, settings) { 1726 return value.toFixed(settings.decimals); 1727 } 1728}(jQuery)); 1729 1730 1731 1732 1733 1734/** WAIT FOR IMAGES [used by masonry] 1735 https://github.com/alexanderdickson/waitForImages 1736 **************************************************************** **/ 1737;(function ($) { 1738 // Namespace all events. 1739 var eventNamespace = 'waitForImages'; 1740 1741 // CSS properties which contain references to images. 1742 $.waitForImages = { 1743 hasImageProperties: ['backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage', 'cursor'] 1744 }; 1745 1746 // Custom selector to find `img` elements that have a valid `src` attribute and have not already loaded. 1747 $.expr[':'].uncached = function (obj) { 1748 // Ensure we are dealing with an `img` element with a valid `src` attribute. 1749 if (!$(obj).is('img[src!=""]')) { 1750 return false; 1751 } 1752 1753 // Firefox's `complete` property will always be `true` even if the image has not been downloaded. 1754 // Doing it this way works in Firefox. 1755 var img = new Image(); 1756 img.src = obj.src; 1757 return !img.complete; 1758 }; 1759 1760 $.fn.waitForImages = function (finishedCallback, eachCallback, waitForAll) { 1761 1762 var allImgsLength = 0; 1763 var allImgsLoaded = 0; 1764 1765 // Handle options object. 1766 if ($.isPlainObject(arguments[0])) { 1767 waitForAll = arguments[0].waitForAll; 1768 eachCallback = arguments[0].each; 1769 // This must be last as arguments[0] 1770 // is aliased with finishedCallback. 1771 finishedCallback = arguments[0].finished; 1772 } 1773 1774 // Handle missing callbacks. 1775 finishedCallback = finishedCallback || $.noop; 1776 eachCallback = eachCallback || $.noop; 1777 1778 // Convert waitForAll to Boolean 1779 waitForAll = !! waitForAll; 1780 1781 // Ensure callbacks are functions. 1782 if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) { 1783 throw new TypeError('An invalid callback was supplied.'); 1784 } 1785 1786 return this.each(function () { 1787 // Build a list of all imgs, dependent on what images will be considered. 1788 var obj = $(this); 1789 var allImgs = []; 1790 // CSS properties which may contain an image. 1791 var hasImgProperties = $.waitForImages.hasImageProperties || []; 1792 // To match `url()` references. 1793 // Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri 1794 var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g; 1795 1796 if (waitForAll) { 1797 1798 // Get all elements (including the original), as any one of them could have a background image. 1799 obj.find('*').addBack().each(function () { 1800 var element = $(this); 1801 1802 // If an `img` element, add it. But keep iterating in case it has a background image too. 1803 if (element.is('img:uncached')) { 1804 allImgs.push({ 1805 src: element.attr('src'), 1806 element: element[0] 1807 }); 1808 } 1809 1810 $.each(hasImgProperties, function (i, property) { 1811 var propertyValue = element.css(property); 1812 var match; 1813 1814 // If it doesn't contain this property, skip. 1815 if (!propertyValue) { 1816 return true; 1817 } 1818 1819 // Get all url() of this element. 1820 while (match = matchUrl.exec(propertyValue)) { 1821 allImgs.push({ 1822 src: match[2], 1823 element: element[0] 1824 }); 1825 } 1826 }); 1827 }); 1828 } else { 1829 // For images only, the task is simpler. 1830 obj.find('img:uncached') 1831 .each(function () { 1832 allImgs.push({ 1833 src: this.src, 1834 element: this 1835 }); 1836 }); 1837 } 1838 1839 allImgsLength = allImgs.length; 1840 allImgsLoaded = 0; 1841 1842 // If no images found, don't bother. 1843 if (allImgsLength === 0) { 1844 finishedCallback.call(obj[0]); 1845 } 1846 1847 $.each(allImgs, function (i, img) { 1848 1849 var image = new Image(); 1850 1851 // Handle the image loading and error with the same callback. 1852 $(image).on('load.' + eventNamespace + ' error.' + eventNamespace, function (event) { 1853 allImgsLoaded++; 1854 1855 // If an error occurred with loading the image, set the third argument accordingly. 1856 eachCallback.call(img.element, allImgsLoaded, allImgsLength, event.type == 'load'); 1857 1858 if (allImgsLoaded == allImgsLength) { 1859 finishedCallback.call(obj[0]); 1860 return false;
1861 } 1862 1863 }); 1864 1865 image.src = img.src; 1866 }); 1867 }); 1868 }; 1869}(jQuery)); 1870 1871 1872/** 1873 * facebook login 1874 */ 1875 1876 // Load the SDK asynchronously 1877 (function(d, s, id) { 1878 var js, fjs = d.getElementsByTagName(s)[0]; 1879 if (d.getElementById(id)) return; 1880 js = d.createElement(s); js.id = id; 1881 js.src = "https://connect.facebook.net/en_US/sdk.js"; 1882 fjs.parentNode.insertBefore(js, fjs); 1883 }(document, 'script', 'facebook-jssdk')); 1884 1885 1886 function statusChangeCallback(response) { 1887 console.log('statusChangeCallback'); 1888 console.log(response); 1889 // The response object is returned with a status field that lets the 1890 // app know the current login status of the person. 1891 // Full docs on the response object can be found in the documentation 1892 // for FB.getLoginStatus(). 1893 if (response.status === 'connected') { 1894 // Logged into your app and Facebook. 1895 fLogin(); 1896 } else { 1897 // The person is not logged into your app or we are unable to tell. 1898 document.getElementById('status').innerHTML = 'Please log ' + 1899 'into this app.'; 1900 } 1901 } 1902 1903 // This function is called when someone finishes with the Login 1904 // Button. See the onlogin handler attached to it in the sample 1905 // code below. 1906 function checkLoginState() { 1907 FB.getLoginStatus(function(response) { 1908 statusChangeCallback(response); 1909 }); 1910 } 1911 1912 1913 window.fbAsyncInit = function() { 1914 FB.init({ 1915 appId : '464165980348598', 1916 cookie : true, // enable cookies to allow the server to access 1917 // the session 1918 xfbml : true, // parse social plugins on this page 1919 version : 'v2.8' // use graph api version 2.8 1920 }); 1921 1922 // Now that we've initialized the JavaScript SDK, we call 1923 // FB.getLoginStatus(). This function gets the state of the 1924 // person visiting this page and can return one of three states to 1925 // the callback you provide. They can be: 1926 // 1927 // 1. Logged into your app ('connected') 1928 // 2. Logged into Facebook, but not your app ('not_authorized') 1929 // 3. Not logged into Facebook and can't tell if they are logged into 1930 // your app or not. 1931 // 1932 // These three cases are handled in the callback function. 1933 1934 /* FB.getLoginStatus(function(response) { 1935 statusChangeCallback(response); 1936 }); 1937*/ 1938 }; 1939 1940 1941 1942 1943 function fLogin() 1944 { 1945 1946 FB.login(function(response) { 1947 if (response.authResponse) 1948 { 1949 getUserInfo(); 1950 } else 1951 { 1952 console.log('User cancelled login or did not fully authorize.'); 1953 } 1954 },{scope: 'email'}); 1955 1956 1957 } 1958 1959 function getUserInfo() { 1960 1961 FB.api('/me',{fields: 'first_name, last_name, email'}, function(response) { 1962 window.location= "http://www.jogaklikk.hu/user-login.php?login="+ response.email+"&last_name="+response.last_name+"&first_name="+ response.first_name+"&fb_id="+response.id; 1963 1964 }); 1965 } 1966 1967 function Logout() 1968 { 1969 FB.logout(function(){document.location.reload();}); 1970 } 1971 1972 1973 1974 /** Form Stepper 1975 **************************************************************** **/ 1976 function _stepper() { 1977 var _container = jQuery('input.stepper'); 1978 1979 if(_container.length > 0) { 1980 1981 loadScript('/assets/plugins/form.stepper/jquery.stepper.min.js', function() { 1982 1983 if(jQuery().stepper) { 1984 1985 jQuery(_container).each(function() { 1986 var _t = jQuery(this), 1987 _min = _t.attr('min') || null, 1988 _max = _t.attr('max') || null; 1989 1990 _t.stepper({ 1991 limit: [_min,_max], 1992 floatPrecission: _t.attr('data-floatPrecission') || 2, 1993 wheel_step: _t.attr('data-wheelstep') || 0.1, 1994 arrow_step: _t.attr('data-arrowstep') || 0.2, 1995 allowWheel: _t.attr('data-mousescrool') == "false" ? false : true, 1996 UI: _t.attr('data-UI') == "false" ? false : true, 1997 // -- 1998 type: _t.attr('data-type') || "float", 1999 preventWheelAcceleration: _t.attr('data-preventWheelAcceleration') == "false" ? false : true, 2000 incrementButton: _t.attr('data-incrementButton') || "▴", 2001 decrementButton: _t.attr('data-decrementButton') || "▾", 2002 onStep: null, 2003 onWheel: null, 2004 onArrow: null, 2005 onButton: null, 2006 onKeyUp: null 2007 }); 2008 2009 }); 2010 2011 } 2012 2013 }); 2014 2015 } 2016 2017 }
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.