1/* 2Name: Theme Base 3Written by: Okler Themes - (http://www.okler.net) 4Theme Version: 4.0.0 5*/ 6 7// Theme 8window.theme = {}; 9 10// Animate 11(function(theme, $) { 12 13 theme = theme || {}; 14 15 var instanceName = '__animate'; 16 17 var PluginAnimate = function($el, opts) { 18 return this.initialize($el, opts); 19 }; 20 21 PluginAnimate.defaults = { 22 accX: 0, 23 accY: -150, 24 delay: 1 25 }; 26 27 PluginAnimate.prototype = { 28 initialize: function($el, opts) { 29 if ($el.data(instanceName)) { 30 return this; 31 } 32 33 this.$el = $el; 34 35 this 36 .setData() 37 .setOptions(opts) 38 .build(); 39 40 return this; 41 }, 42 43 setData: function() { 44 this.$el.data(instanceName, this); 45 46 return this; 47 }, 48 49 setOptions: function(opts) { 50 this.options = $.extend(true, {}, PluginAnimate.defaults, opts, { 51 wrapper: this.$el 52 }); 53 54 return this; 55 }, 56 57 build: function() { 58 var self = this, 59 $el = this.options.wrapper, 60 delay = 0; 61 62 $el.addClass('appear-animation'); 63 64 if (!$('html').hasClass('no-csstransitions') && $(window).width() > 767) { 65 66 $el.appear(function() { 67 68 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 69 70 if (delay > 1) { 71 $el.css('animation-delay', delay + 'ms'); 72 } 73 74 $el.addClass($el.attr('data-appear-animation')); 75 76 setTimeout(function() { 77 $el.addClass('appear-animation-visible'); 78 }, delay); 79 80 }, { 81 accX: self.options.accX, 82 accY: self.options.accY 83 }); 84 85 } else { 86 87 $el.addClass('appear-animation-visible'); 88 89 } 90 91 return this; 92 } 93 }; 94 95 // expose to scope 96 $.extend(theme, { 97 PluginAnimate: PluginAnimate 98 }); 99 100 // jquery plugin 101 $.fn.themePluginAnimate = function(opts) { 102 return this.map(function() { 103 var $this = $(this); 104 105 if ($this.data(instanceName)) { 106 return $this.data(instanceName); 107 } else { 108 return new PluginAnimate($this, opts); 109 } 110 111 }); 112 }; 113 114}).apply(this, [window.theme, jQuery]); 115 116// Carousel 117(function(theme, $) { 118 119 theme = theme || {}; 120 121 var instanceName = '__carousel'; 122 123 var PluginCarousel = function($el, opts) { 124 return this.initialize($el, opts); 125 }; 126 127 PluginCarousel.defaults = { 128 loop: true, 129 responsive: { 130 0: { 131 items: 1 132 }, 133 479: { 134 items: 1 135 }, 136 768: { 137 items: 2 138 }, 139 979: { 140 items: 3 141 }, 142 1199: { 143 items: 4 144 } 145 }, 146 navText: [] 147 }; 148 149 PluginCarousel.prototype = { 150 initialize: function($el, opts) { 151 if ($el.data(instanceName)) { 152 return this; 153 } 154 155 this.$el = $el; 156 157 this 158 .setData() 159 .setOptions(opts) 160 .build(); 161 162 return this; 163 }, 164 165 setData: function() { 166 this.$el.data(instanceName, this); 167 168 return this; 169 }, 170 171 setOptions: function(opts) { 172 this.options = $.extend(true, {}, PluginCarousel.defaults, opts, { 173 wrapper: this.$el 174 }); 175 176 return this; 177 }, 178 179 build: function() { 180 if (!($.isFunction($.fn.owlCarousel))) { 181 return this; 182 } 183 184 var self = this, 185 $el = this.options.wrapper; 186 187 // Force RTL according to HTML dir attribute 188 if ($('html').attr('dir') == 'rtl') { 189 this.options = $.extend(true, {}, this.options, { 190 rtl: true 191 }); 192 } 193 194 if (this.options.items == 1) { 195 this.options.responsive = {} 196 } 197 198 if (this.options.items > 4) { 199 this.options = $.extend(true, {}, this.options, { 200 responsive: { 201 1199: { 202 items: this.options.items 203 } 204 } 205 }); 206 } 207 208 // Auto Height Fixes 209 if (this.options.autoHeight) { 210 $(window).afterResize(function() { 211 $el.find('.owl-stage-outer').height( $el.find('.owl-item.active').height() ); 212 }); 213 214 $(window).load(function() { 215 $el.find('.owl-stage-outer').height( $el.find('.owl-item.active').height() ); 216 }); 217 } 218 219 // Initialize OwlCarousel 220 $el.owlCarousel(this.options).addClass("owl-carousel-init"); 221 222 return this; 223 } 224 }; 225 226 // expose to scope 227 $.extend(theme, { 228 PluginCarousel: PluginCarousel 229 }); 230 231 // jquery plugin 232 $.fn.themePluginCarousel = function(opts) { 233 return this.map(function() { 234 var $this = $(this); 235 236 if ($this.data(instanceName)) { 237 return $this.data(instanceName); 238 } else { 239 return new PluginCarousel($this, opts); 240 } 241 242 }); 243 } 244 245}).apply(this, [window.theme, jQuery]); 246 247// Chart Circular 248(function(theme, $) { 249 250 theme = theme || {}; 251 252 var instanceName = '__chartCircular'; 253 254 var PluginChartCircular = function($el, opts) { 255 return this.initialize($el, opts); 256 }; 257 258 PluginChartCircular.defaults = { 259 accX: 0, 260 accY: -150, 261 delay: 1, 262 barColor: '#0088CC', 263 trackColor: '#f2f2f2', 264 scaleColor: false, 265 scaleLength: 5, 266 lineCap: 'round', 267 lineWidth: 13, 268 size: 175, 269 rotate: 0, 270 animate: ({ 271 duration: 2500, 272 enabled: true 273 }) 274 }; 275 276 PluginChartCircular.prototype = { 277 initialize: function($el, opts) { 278 if ($el.data(instanceName)) { 279 return this; 280 } 281 282 this.$el = $el; 283 284 this 285 .setData() 286 .setOptions(opts) 287 .build(); 288 289 return this; 290 }, 291 292 setData: function() { 293 this.$el.data(instanceName, this); 294 295 return this; 296 }, 297 298 setOptions: function(opts) { 299 this.options = $.extend(true, {}, PluginChartCircular.defaults, opts, { 300 wrapper: this.$el 301 }); 302 303 return this; 304 }, 305 306 build: function() { 307 if (!($.isFunction($.fn.appear)) || !($.isFunction($.fn.easyPieChart))) { 308 return this; 309 } 310 311 var self = this, 312 $el = this.options.wrapper, 313 value = ($el.attr('data-percent') ? $el.attr('data-percent') : 0), 314 percentEl = $el.find('.percent'); 315 316 $.extend(true, self.options, { 317 onStep: function(from, to, currentValue) { 318 percentEl.html(parseInt(currentValue)); 319 } 320 }); 321 322 $el.attr('data-percent', 0); 323
324 $el.appear(function() { 325 326 $el.easyPieChart(self.options); 327 328 setTimeout(function() { 329 330 $el.data('easyPieChart').update(value); 331 $el.attr('data-percent', value); 332 333 }, self.options.delay); 334 335 }, { 336 accX: self.options.accX, 337 accY: self.options.accY 338 }); 339 340 return this; 341 } 342 }; 343 344 // expose to scope 345 $.extend(theme, { 346 PluginChartCircular: PluginChartCircular 347 }); 348 349 // jquery plugin 350 $.fn.themePluginChartCircular = function(opts) { 351 return this.map(function() { 352 var $this = $(this); 353 354 if ($this.data(instanceName)) { 355 return $this.data(instanceName); 356 } else { 357 return new PluginChartCircular($this, opts); 358 } 359 360 }); 361 } 362 363}).apply(this, [window.theme, jQuery]); 364 365// Counter 366(function(theme, $) { 367 368 theme = theme || {}; 369 370 var instanceName = '__counter'; 371 372 var PluginCounter = function($el, opts) { 373 return this.initialize($el, opts); 374 }; 375 376 PluginCounter.defaults = { 377 accX: 0, 378 accY: 0, 379 speed: 3000, 380 refreshInterval: 100, 381 decimals: 0, 382 onUpdate: null, 383 onComplete: null 384 }; 385 386 PluginCounter.prototype = { 387 initialize: function($el, opts) { 388 if ($el.data(instanceName)) { 389 return this; 390 } 391 392 this.$el = $el; 393 394 this 395 .setData() 396 .setOptions(opts) 397 .build(); 398 399 return this; 400 }, 401 402 setData: function() { 403 this.$el.data(instanceName, this); 404 405 return this; 406 }, 407 408 setOptions: function(opts) { 409 this.options = $.extend(true, {}, PluginCounter.defaults, opts, { 410 wrapper: this.$el 411 }); 412 413 return this; 414 }, 415 416 build: function() { 417 if (!($.isFunction($.fn.countTo))) { 418 return this; 419 } 420 421 var self = this, 422 $el = this.options.wrapper; 423 424 $.extend(self.options, { 425 onComplete: function() { 426 if ($el.data('append')) { 427 $el.html($el.html() + $el.data('append')); 428 } 429 430 if ($el.data('prepend')) { 431 $el.html($el.data('prepend') + $el.html()); 432 } 433 } 434 }); 435 436 $el.appear(function() { 437 438 $el.countTo(self.options); 439 440 }, { 441 accX: self.options.accX, 442 accY: self.options.accY 443 }); 444 445 return this; 446 } 447 }; 448 449 // expose to scope 450 $.extend(theme, { 451 PluginCounter: PluginCounter 452 }); 453 454 // jquery plugin 455 $.fn.themePluginCounter = function(opts) { 456 return this.map(function() { 457 var $this = $(this); 458 459 if ($this.data(instanceName)) { 460 return $this.data(instanceName); 461 } else { 462 return new PluginCounter($this, opts); 463 } 464 465 }); 466 } 467 468}).apply(this, [window.theme, jQuery]); 469 470// Flickr 471(function(theme, $) { 472 473 theme = theme || {}; 474 475 var instanceName = '__flickr'; 476 477 var PluginFlickr = function($el, opts) { 478 return this.initialize($el, opts); 479 }; 480 481 PluginFlickr.defaults = { 482 flickrbase: 'http://api.flickr.com/services/feeds/', 483 feedapi: 'photos_public.gne', 484 limit: 6, 485 qstrings: { 486 lang: 'en-us', 487 format: 'json', 488 jsoncallback: '?' 489 }, 490 cleanDescription: true, 491 useTemplate: true, 492 itemTemplate: '<li><a href="{{image_b}}" title="{{title}}"><span class="thumbnail"><img src="{{image_s}}" /></span></a></li>', 493 itemCallback: function() {} 494 }; 495 496 PluginFlickr.prototype = { 497 initialize: function($el, opts) { 498 if ($el.data(instanceName)) { 499 return this; 500 } 501 502 this.$el = $el; 503 504 this 505 .setData() 506 .setOptions(opts) 507 .build(); 508 509 return this; 510 }, 511 512 setData: function() { 513 this.$el.data(instanceName, this); 514 515 return this; 516 }, 517 518 setOptions: function(opts) { 519 this.options = $.extend(true, {}, PluginFlickr.defaults, opts, { 520 wrapper: this.$el 521 }); 522 523 return this; 524 }, 525 526 build: function() { 527 if (!($.isFunction($.fn.jflickrfeed)) || !($.isFunction($.fn.magnificPopup))) { 528 return this; 529 } 530 531 var self = this; 532 533 self.options.wrapper.jflickrfeed(this.options, function(data) { 534 535 self.options.wrapper.magnificPopup({ 536 delegate: 'a', 537 type: 'image', 538 gallery: { 539 enabled: true, 540 navigateByImgClick: true, 541 preload: [0, 1] 542 }, 543 zoom: { 544 enabled: true, 545 duration: 300, 546 opener: function(element) { 547 return element.find('img'); 548 } 549 } 550 }); 551 552 }); 553 554 return this; 555 } 556 }; 557 558 // expose to scope 559 $.extend(theme, { 560 PluginFlickr: PluginFlickr 561 }); 562 563 // jquery plugin 564 $.fn.themePluginFlickr = function(opts) { 565 return this.map(function() { 566 var $this = $(this); 567 568 if ($this.data(instanceName)) { 569 return $this.data(instanceName); 570 } else { 571 return new PluginFlickr($this, opts); 572 } 573 574 }); 575 } 576 577}).apply(this, [window.theme, jQuery]); 578 579// Lazy Load 580(function(theme, $) { 581 582 theme = theme || {}; 583 584 var instanceName = '__lazyload'; 585 586 var PluginLazyLoad = function($el, opts) { 587 return this.initialize($el, opts); 588 }; 589 590 PluginLazyLoad.defaults = { 591 effect : 'fadeIn' 592 }; 593 594 PluginLazyLoad.prototype = { 595 initialize: function($el, opts) { 596 if ($el.data(instanceName)) { 597 return this; 598 } 599 600 this.$el = $el; 601 602 this 603 .setData() 604 .setOptions(opts) 605 .build(); 606 607 return this; 608 }, 609 610 setData: function() { 611 this.$el.data(instanceName, this); 612 613 return this; 614 }, 615 616 setOptions: function(opts) { 617 this.options = $.extend(true, {}, PluginLazyLoad.defaults, opts, { 618 wrapper: this.$el 619 }); 620 621 return this; 622 }, 623 624 build: function() { 625 if (!($.isFunction($.fn.lazyload))) { 626 return this; 627 } 628 629 var self = this; 630 631 self.options.wrapper.lazyload(this.options); 632 633 return this; 634 } 635 }; 636 637 // expose to scope 638 $.extend(theme, { 639 PluginLazyLoad: PluginLazyLoad 640 }); 641 642 // jquery plugin 643 $.fn.themePluginLazyLoad = function(opts) { 644 return this.map(function() { 645 var $this = $(this); 646 647 if ($this.data(instanceName)) { 648 return $this.data(instanceName); 649 } else { 650 return new PluginLazyLoad($this, opts); 651 } 652 653 }); 654 } 655 656}).apply(this, [window.theme, jQuery]); 657 658// Lightbox 659(function(theme, $) { 660 661 theme = theme || {}; 662 663 var instanceName = '__lightbox'; 664 665 var PluginLightbox = function($el, opts) { 666 return this.initialize($el, opts); 667 }; 668 669 PluginLightbox.defaults = { 670 tClose: 'Close (Esc)', // Alt text on close button 671 tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys 672 gallery: { 673 tPrev: 'Previous (Left arrow key)', // Alt text on left arrow 674 tNext: 'Next (Right arrow key)', // Alt text on right arrow 675 tCounter: '%curr% of %total%' // Markup for "1 of 7" counter 676 }, 677 image: { 678 tError: '<a href="%url%">The image</a> could not be loaded.' // Error message when image could not be loaded 679 }, 680 ajax: { 681 tError: '<a href="%url%">The content</a> could not be loaded.' // Error message when ajax request failed 682 }, 683 callbacks: { 684 open: function() { 685 $('body').addClass('lightbox-opened'); 686 }, 687 close: function() { 688 $('body').removeClass('lightbox-opened'); 689 } 690 } 691 }; 692 693 PluginLightbox.prototype = { 694 initialize: function($el, opts) { 695 if ($el.data(instanceName)) { 696 return this; 697 } 698 699 this.$el = $el; 700 701 this 702 .setData() 703 .setOptions(opts) 704 .build(); 705 706 return this; 707 }, 708 709 setData: function() { 710 this.$el.data(instanceName, this); 711 712 return this; 713 }, 714 715 setOptions: function(opts) { 716 this.options = $.extend(true, {}, PluginLightbox.defaults, opts, { 717 wrapper: this.$el 718 }); 719 720 return this; 721 }, 722 723 build: function() { 724 if (!($.isFunction($.fn.magnificPopup))) { 725 return this; 726 } 727 728 this.options.wrapper.magnificPopup(this.options); 729 730 return this; 731 } 732 }; 733 734 // expose to scope 735 $.extend(theme, { 736 PluginLightbox: PluginLightbox 737 }); 738 739 // jquery plugin 740 $.fn.themePluginLightbox = function(opts) { 741 return this.map(function() { 742 var $this = $(this); 743 744 if ($this.data(instanceName)) { 745 return $this.data(instanceName); 746 } else { 747 return new PluginLightbox($this, opts); 748 } 749 750 }); 751 } 752 753}).apply(this, [window.theme, jQuery]); 754 755// Masonry 756(function(theme, $) { 757 758 theme = theme || {}; 759 760 var instanceName = '__masonry'; 761 762 var PluginMasonry = function($el, opts) { 763 return this.initialize($el, opts); 764 }; 765 766 PluginMasonry.defaults = { 767 itemSelector: 'li' 768 }; 769 770 PluginMasonry.prototype = { 771 initialize: function($el, opts) { 772 if ($el.data(instanceName)) { 773 return this; 774 } 775 776 this.$el = $el; 777 778 this 779 .setData() 780 .setOptions(opts) 781 .build(); 782 783 return this; 784 }, 785 786 setData: function() { 787 this.$el.data(instanceName, this); 788 789 return this; 790 }, 791 792 setOptions: function(opts) { 793 this.options = $.extend(true, {}, PluginMasonry.defaults, opts, { 794 wrapper: this.$el 795 }); 796 797 return this; 798 }, 799 800 build: function() { 801 if (!($.isFunction($.fn.isotope))) { 802 return this; 803 } 804 805 this.options.wrapper.isotope(this.options); 806 807 return this; 808 } 809 }; 810 811 // expose to scope 812 $.extend(theme, { 813 PluginMasonry: PluginMasonry 814 }); 815 816 // jquery plugin 817 $.fn.themePluginMasonry = function(opts) { 818 return this.map(function() { 819 var $this = $(this); 820 821 $this.waitForImages(function() { 822 if ($this.data(instanceName)) { 823 return $this.data(instanceName); 824 } else { 825 return new PluginMasonry($this, opts); 826 } 827 }); 828 829 }); 830 } 831 832}).apply(this, [window.theme, jQuery]); 833 834// Parallax 835(function(theme, $) { 836 837 theme = theme || {}; 838 839 $.extend(theme, { 840 841 PluginParallax: { 842 843 defaults: { 844 itemsSelector: '.parallax', 845 horizontalScrolling: false 846 }, 847 848 initialize: function(opts) { 849 850 this 851 .setOptions(opts) 852 .build(); 853 854 return this; 855 }, 856 857 setOptions: function(opts) { 858 this.options = $.extend(true, {}, this.defaults, opts); 859 860 return this; 861 }, 862 863 build: function() { 864 if (!($.isFunction($.fn.stellar)) || typeof(Modernizr.touch) == 'undefined') { 865 return this; 866 } 867 868 var self = this; 869 870 $(window).load(function() { 871 872 if (!Modernizr.touch) { 873 $.stellar(self.options).addClass('parallax-ready'); 874 875 // Fix for Position 876 setTimeout(function() { 877 $.stellar('refresh'); 878 }, 1000); 879 } else { 880 $(self.options.itemsSelector).addClass('parallax-disabled'); 881 } 882 883 }); 884 885 return this; 886 } 887 888 } 889 890 }); 891 892}).apply(this, [window.theme, jQuery]); 893 894// Progress Bar 895(function(theme, $) { 896 897 theme = theme || {}; 898 899 var instanceName = '__progressBar'; 900 901 var PluginProgressBar = function($el, opts) { 902 return this.initialize($el, opts); 903 }; 904 905 PluginProgressBar.defaults = { 906 accX: 0, 907 accY: -50, 908 delay: 1 909 }; 910 911 PluginProgressBar.prototype = { 912 initialize: function($el, opts) { 913 if ($el.data(instanceName)) { 914 return this; 915 } 916 917 this.$el = $el; 918 919 this 920 .setData() 921 .setOptions(opts) 922 .build(); 923 924 return this; 925 }, 926 927 setData: function() { 928 this.$el.data(instanceName, this); 929 930 return this; 931 }, 932 933 setOptions: function(opts) { 934 this.options = $.extend(true, {}, PluginProgressBar.defaults, opts, { 935 wrapper: this.$el 936 }); 937 938 return this; 939 }, 940 941 build: function() { 942 if (!($.isFunction($.fn.appear))) { 943 return this; 944 } 945 946 var self = this, 947 $el = this.options.wrapper,
948 delay = 1; 949 950 $el.appear(function() { 951 952 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 953 954 $el.addClass($el.attr('data-appear-animation')); 955 956 setTimeout(function() { 957 958 $el.animate({ 959 width: $el.attr('data-appear-progress-animation') 960 }, 1500, 'easeOutQuad', function() { 961 $el.find('.progress-bar-tooltip').animate({ 962 opacity: 1 963 }, 500, 'easeOutQuad'); 964 }); 965 966 }, delay); 967 968 }, { 969 accX: self.options.accX, 970 accY: self.options.accY 971 }); 972 973 return this; 974 } 975 }; 976 977 // expose to scope 978 $.extend(theme, { 979 PluginProgressBar: PluginProgressBar 980 }); 981 982 // jquery plugin 983 $.fn.themePluginProgressBar = function(opts) { 984 return this.map(function() { 985 var $this = $(this); 986 987 if ($this.data(instanceName)) { 988 return $this.data(instanceName); 989 } else { 990 return new PluginProgressBar($this, opts); 991 } 992 993 }); 994 } 995 996}).apply(this, [window.theme, jQuery]); 997 998// Revolution Slider 999(function(theme, $) { 1000 1001 theme = theme || {}; 1002 1003 var instanceName = '__revolution'; 1004 1005 var PluginRevolutionSlider = function($el, opts) { 1006 return this.initialize($el, opts); 1007 }; 1008 1009 PluginRevolutionSlider.defaults = { 1010 dottedOverlay: 'none', 1011 delay: 9000, 1012 startwidth: 1170, 1013 startheight: 500, 1014 hideThumbs: 200, 1015 1016 thumbWidth: 100, 1017 thumbHeight: 50, 1018 thumbAmount: 3, 1019 1020 navigationType: 'none', 1021 navigationArrows: 'solo', 1022 navigationStyle: 'round', 1023 1024 touchenabled: 'on', 1025 onHoverStop: 'on', 1026 1027 swipe_velocity: 0.7, 1028 swipe_min_touches: 1, 1029 swipe_max_touches: 1, 1030 drag_block_vertical: false, 1031 1032 keyboardNavigation: 'on', 1033 1034 navigationHAlign: 'center', 1035 navigationVAlign: 'bottom', 1036 navigationHOffset: 0, 1037 navigationVOffset: 20, 1038 1039 soloArrowLeftHalign: 'left', 1040 soloArrowLeftValign: 'center', 1041 soloArrowLeftHOffset: 20, 1042 soloArrowLeftVOffset: 0, 1043 1044 soloArrowRightHalign: 'right', 1045 soloArrowRightValign: 'center', 1046 soloArrowRightHOffset: 20, 1047 soloArrowRightVOffset: 0, 1048 1049 shadow: 0, 1050 fullWidth: 'on', 1051 fullScreen: 'off', 1052 1053 spinner: 'spinner0', 1054 1055 stopLoop: 'off', 1056 stopAfterLoops: -1, 1057 stopAtSlide: -1, 1058 1059 shuffle: 'off', 1060 1061 autoHeight: 'off', 1062 forceFullWidth: 'off', 1063 1064 hideThumbsOnMobile: 'off', 1065 hideNavDelayOnMobile: 1500, 1066 hideBulletsOnMobile: 'off', 1067 hideArrowsOnMobile: 'off', 1068 hideThumbsUnderResolution: 0, 1069 1070 hideSliderAtLimit: 0, 1071 hideCaptionAtLimit: 0, 1072 hideAllCaptionAtLilmit: 0, 1073 startWithSlide: 0 1074 }; 1075 1076 PluginRevolutionSlider.prototype = { 1077 initialize: function($el, opts) { 1078 if ($el.data(instanceName)) { 1079 return this; 1080 } 1081 1082 this.$el = $el; 1083 1084 this 1085 .setData() 1086 .setOptions(opts) 1087 .build(); 1088 1089 return this; 1090 }, 1091 1092 setData: function() { 1093 this.$el.data(instanceName, this); 1094 1095 return this; 1096 }, 1097 1098 setOptions: function(opts) { 1099 this.options = $.extend(true, {}, PluginRevolutionSlider.defaults, opts, { 1100 wrapper: this.$el 1101 }); 1102 1103 return this; 1104 }, 1105 1106 build: function() { 1107 if (!($.isFunction($.fn.revolution))) { 1108 return this; 1109 } 1110 1111 this.options.wrapper.revolution(this.options); 1112 1113 return this; 1114 } 1115 }; 1116 1117 // expose to scope 1118 $.extend(theme, { 1119 PluginRevolutionSlider: PluginRevolutionSlider 1120 }); 1121 1122 // jquery plugin 1123 $.fn.themePluginRevolutionSlider = function(opts) { 1124 return this.map(function() { 1125 var $this = $(this); 1126 1127 if ($this.data(instanceName)) { 1128 return $this.data(instanceName); 1129 } else { 1130 return new PluginRevolutionSlider($this, opts); 1131 } 1132 1133 }); 1134 } 1135 1136}).apply(this, [window.theme, jQuery]); 1137 1138// Scroll to Top 1139(function(theme, $) { 1140 1141 theme = theme || {}; 1142 1143 $.extend(theme, { 1144 1145 PluginScrollToTop: { 1146 1147 defaults: { 1148 wrapper: $('body'), 1149 offset: 150, 1150 buttonClass: 'scroll-to-top', 1151 iconClass: 'fa fa-chevron-up', 1152 delay: 500, 1153 visibleMobile: false, 1154 label: false 1155 }, 1156 1157 initialize: function(opts) { 1158 initialized = true; 1159 1160 this 1161 .setOptions(opts) 1162 .build() 1163 .events(); 1164 1165 return this; 1166 }, 1167 1168 setOptions: function(opts) { 1169 this.options = $.extend(true, {}, this.defaults, opts); 1170 1171 return this; 1172 }, 1173 1174 build: function() { 1175 var self = this, 1176 $el; 1177 1178 // Base HTML Markup 1179 $el = $('<a />') 1180 .addClass(self.options.buttonClass) 1181 .attr({ 1182 'href': '#', 1183 }) 1184 .append( 1185 $('<i />') 1186 .addClass(self.options.iconClass) 1187 ); 1188 1189 // Visible Mobile 1190 if (!self.options.visibleMobile) { 1191 $el.addClass('hidden-mobile'); 1192 } 1193 1194 // Label 1195 if (self.options.label) { 1196 $el.append( 1197 $('<span />').html(self.options.label) 1198 ); 1199 } 1200 1201 this.options.wrapper.append($el); 1202 1203 this.$el = $el; 1204 1205 return this; 1206 }, 1207 1208 events: function() { 1209 var self = this, 1210 _isScrolling = false;
1211 1212 // Click Element Action 1213 self.$el.on('click', function(e) { 1214 e.preventDefault(); 1215 $('body, html').animate({ 1216 scrollTop: 0 1217 }, self.options.delay); 1218 return false; 1219 }); 1220 1221 // Show/Hide Button on Window Scroll event. 1222 $(window).scroll(function() { 1223 1224 if (!_isScrolling) { 1225 1226 _isScrolling = true; 1227 1228 if ($(window).scrollTop() > self.options.offset) { 1229 1230 self.$el.stop(true, true).addClass('visible'); 1231 _isScrolling = false; 1232 1233 } else { 1234 1235 self.$el.stop(true, true).removeClass('visible'); 1236 _isScrolling = false; 1237 1238 } 1239 1240 } 1241 1242 }); 1243 1244 return this; 1245 } 1246 1247 } 1248 1249 }); 1250 1251}).apply(this, [window.theme, jQuery]); 1252 1253// Sort 1254(function(theme, $) { 1255 1256 theme = theme || {}; 1257 1258 var instanceName = '__sort'; 1259 1260 var PluginSort = function($el, opts) { 1261 return this.initialize($el, opts); 1262 }; 1263 1264 PluginSort.defaults = { 1265 useHash: true, 1266 itemSelector: 'li', 1267 layoutMode: 'masonry', 1268 filter: '*', 1269 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 1270 }; 1271 1272 PluginSort.prototype = { 1273 initialize: function($el, opts) { 1274 if ($el.data(instanceName)) { 1275 return this; 1276 } 1277 1278 this.$el = $el; 1279 1280 this 1281 .setData() 1282 .setOptions(opts) 1283 .build(); 1284 1285 return this; 1286 }, 1287 1288 setData: function() { 1289 this.$el.data(instanceName, this); 1290 1291 return this; 1292 }, 1293 1294 setOptions: function(opts) { 1295 this.options = $.extend(true, {}, PluginSort.defaults, opts, { 1296 wrapper: this.$el 1297 }); 1298 1299 return this; 1300 }, 1301 1302 build: function() { 1303 if (!($.isFunction($.fn.isotope))) { 1304 return this; 1305 } 1306 1307 var self = this, 1308 $source = this.options.wrapper, 1309 $destination = $('.sort-destination[data-sort-id="' + $source.attr('data-sort-id') + '"]'); 1310 1311 if ($destination.get(0)) { 1312 1313 self.$source = $source; 1314 self.$destination = $destination; 1315 1316 self.setParagraphHeight($destination); 1317 1318 $(window).load(function() { 1319 1320 $destination.isotope(self.options).isotope('layout'); 1321 1322 self.$destination.isotope('on', 'layoutComplete', function(event, laidOutItems) { 1323 if (self.options.useHash) { 1324 if (window.location.hash != '' || self.options.filter.replace('.', '') != '*') { 1325 window.location.hash = self.options.filter.replace('.', ''); 1326 } 1327 } 1328 }); 1329 1330 self.events(); 1331 1332 }); 1333 1334 } 1335 1336 return this; 1337 }, 1338 1339 events: function() { 1340 var self = this, 1341 filter = null; 1342 1343 self.$source.find('a').click(function(e) { 1344 e.preventDefault(); 1345 1346 filter = $(this).parent().data('option-value'); 1347 1348 self.setFilter(filter); 1349 1350 return this; 1351 }); 1352 1353 if (self.options.useHash) { 1354 self.hashEvents(); 1355 } 1356 1357 return this; 1358 }, 1359 1360 setFilter: function(filter) { 1361 var self = this; 1362 1363 self.$source.find('li.active').removeClass('active'); 1364 self.$source.find('li[data-option-value="' + filter + '"]').addClass('active'); 1365 1366 self.options.filter = filter; 1367 1368 self.$destination.isotope({ 1369 filter: filter 1370 }); 1371 1372 return this; 1373 }, 1374 1375 hashEvents: function() { 1376 var self = this, 1377 hash = null, 1378 hashFilter = null, 1379 initHashFilter = '.' + location.hash.replace('#', ''); 1380 1381 if (initHashFilter != '.' && initHashFilter != '.*') { 1382 self.setFilter(initHashFilter); 1383 } 1384 1385 $(window).bind('hashchange', function(e) { 1386 1387 hashFilter = '.' + location.hash.replace('#', ''); 1388 hash = (hashFilter == '.' || hashFilter == '.*' ? '*' : hashFilter); 1389 1390 self.setFilter(hash); 1391 1392 }); 1393 1394 return this; 1395 }, 1396 1397 setParagraphHeight: function() { 1398 var self = this, 1399 minParagraphHeight = 0, 1400 paragraphs = $('span.thumb-info-caption p', self.$destination); 1401 1402 paragraphs.each(function() { 1403 if ($(this).height() > minParagraphHeight) { 1404 minParagraphHeight = ($(this).height() + 10); 1405 } 1406 }); 1407 1408 paragraphs.height(minParagraphHeight); 1409 1410 return this; 1411 } 1412 1413 }; 1414 1415 // expose to scope 1416 $.extend(theme, { 1417 PluginSort: PluginSort 1418 }); 1419 1420 // jquery plugin 1421 $.fn.themePluginSort = function(opts) { 1422 return this.map(function() { 1423 var $this = $(this); 1424 1425 if ($this.data(instanceName)) { 1426 return $this.data(instanceName); 1427 } else { 1428 return new PluginSort($this, opts); 1429 } 1430 1431 }); 1432 } 1433 1434}).apply(this, [window.theme, jQuery]); 1435 1436// Match Height 1437(function(theme, $) { 1438 1439 theme = theme || {}; 1440 1441 var instanceName = '__matchHeight'; 1442 1443 var PluginMatchHeight = function($el, opts) { 1444 return this.initialize($el, opts); 1445 }; 1446 1447 PluginMatchHeight.defaults = { 1448 byRow: true, 1449 property: 'height', 1450 target: null, 1451 remove: false 1452 }; 1453 1454 PluginMatchHeight.prototype = { 1455 initialize: function($el, opts) { 1456 if ($el.data(instanceName)) { 1457 return this; 1458 } 1459 1460 this.$el = $el; 1461 1462 this 1463 .setData() 1464 .setOptions(opts) 1465 .build(); 1466 1467 return this; 1468 }, 1469 1470 setData: function() { 1471 this.$el.data(instanceName, this); 1472 1473 return this; 1474 }, 1475 1476 setOptions: function(opts) { 1477 this.options = $.extend(true, {}, PluginMatchHeight.defaults, opts, { 1478 wrapper: this.$el 1479 }); 1480 1481 return this; 1482 }, 1483 1484 build: function() { 1485 if (!($.isFunction($.fn.matchHeight))) { 1486 return this; 1487 } 1488 1489 var self = this; 1490 1491 self.options.wrapper.matchHeight(self.options); 1492 1493 return this; 1494 } 1495 1496 }; 1497 1498 // expose to scope 1499 $.extend(theme, { 1500 PluginMatchHeight: PluginMatchHeight 1501 }); 1502 1503 // jquery plugin 1504 $.fn.themePluginMatchHeight = function(opts) { 1505 return this.map(function() { 1506 var $this = $(this); 1507 1508 if ($this.data(instanceName)) { 1509 return $this.data(instanceName); 1510 } else { 1511 return new PluginMatchHeight($this, opts); 1512 } 1513 1514 }); 1515 } 1516 1517}).apply(this, [window.theme, jQuery]); 1518 1519// Toggle 1520(function(theme, $) { 1521 1522 theme = theme || {}; 1523 1524 var instanceName = '__toggle'; 1525 1526 var PluginToggle = function($el, opts) { 1527 return this.initialize($el, opts); 1528 }; 1529 1530 PluginToggle.defaults = { 1531 duration: 350, 1532 isAccordion: false 1533 }; 1534 1535 PluginToggle.prototype = { 1536 initialize: function($el, opts) { 1537 if ($el.data(instanceName)) { 1538 return this; 1539 } 1540 1541 this.$el = $el; 1542 1543 this 1544 .setData() 1545 .setOptions(opts) 1546 .build(); 1547 1548 return this; 1549 }, 1550 1551 setData: function() { 1552 this.$el.data(instanceName, this); 1553 1554 return this; 1555 }, 1556 1557 setOptions: function(opts) { 1558 this.options = $.extend(true, {}, PluginToggle.defaults, opts, { 1559 wrapper: this.$el 1560 }); 1561 1562 return this; 1563 }, 1564 1565 build: function() { 1566 var self = this, 1567 $wrapper = this.options.wrapper, 1568 $items = $wrapper.find('.toggle'), 1569 $el = null; 1570 1571 $items.each(function() { 1572 $el = $(this); 1573 1574 if ($el.hasClass('active')) { 1575 $el.find('> p').addClass('preview-active'); 1576 $el.find('> .toggle-content').slideDown(self.options.duration); 1577 } 1578 1579 self.events($el); 1580 }); 1581 1582 if (self.options.isAccordion) { 1583 self.options.duration = self.options.duration / 2; 1584 } 1585 1586 return this; 1587 }, 1588 1589 events: function($el) { 1590 var self = this, 1591 previewParCurrentHeight = 0, 1592 previewParAnimateHeight = 0, 1593 toggleContent = null; 1594 1595 $el.find('> label').click(function(e) { 1596 1597 var $this = $(this), 1598 parentSection = $this.parent(), 1599 parentWrapper = $this.parents('.toggle'), 1600 previewPar = null, 1601 closeElement = null; 1602 1603 if (self.options.isAccordion && typeof(e.originalEvent) != 'undefined') { 1604 closeElement = parentWrapper.find('.toggle.active > label'); 1605 1606 if (closeElement[0] == $this[0]) { 1607 return; 1608 } 1609 } 1610 1611 parentSection.toggleClass('active'); 1612 1613 // Preview Paragraph 1614 if (parentSection.find('> p').get(0)) { 1615 1616 previewPar = parentSection.find('> p'); 1617 previewParCurrentHeight = previewPar.css('height'); 1618 previewPar.css('height', 'auto'); 1619 previewParAnimateHeight = previewPar.css('height'); 1620 previewPar.css('height', previewParCurrentHeight); 1621 1622 } 1623 1624 // Content 1625 toggleContent = parentSection.find('> .toggle-content'); 1626 1627 if (parentSection.hasClass('active')) { 1628 1629 $(previewPar).animate({ 1630 height: previewParAnimateHeight 1631 }, self.options.duration, function() { 1632 $(this).addClass('preview-active'); 1633 }); 1634 1635 toggleContent.slideDown(self.options.duration, function() { 1636 if (closeElement) { 1637 closeElement.trigger('click'); 1638 } 1639 }); 1640 1641 } else { 1642 1643 $(previewPar).animate({ 1644 height: 0 1645 }, self.options.duration, function() { 1646 $(this).removeClass('preview-active'); 1647 }); 1648 1649 toggleContent.slideUp(self.options.duration); 1650 1651 } 1652 1653 }); 1654 } 1655 }; 1656 1657 // expose to scope 1658 $.extend(theme, { 1659 PluginToggle: PluginToggle 1660 }); 1661 1662 // jquery plugin 1663 $.fn.themePluginToggle = function(opts) { 1664 return this.map(function() { 1665 var $this = $(this); 1666 1667 if ($this.data(instanceName)) { 1668 return $this.data(instanceName); 1669 } else { 1670 return new PluginToggle($this, opts); 1671 } 1672 1673 }); 1674 } 1675 1676}).apply(this, [window.theme, jQuery]); 1677 1678// Tweets 1679(function(theme, $) { 1680 1681 theme = theme || {}; 1682 1683 var instanceName = '__tweets'; 1684 1685 var PluginTweets = function($el, opts) { 1686 return this.initialize($el, opts); 1687 }; 1688 1689 PluginTweets.defaults = { 1690 username: null, 1691 count: 2, 1692 URL: 'php/twitter-feed.php' 1693 }; 1694 1695 PluginTweets.prototype = { 1696 initialize: function($el, opts) { 1697 if ($el.data(instanceName)) { 1698 return this; 1699 } 1700 1701 this.$el = $el; 1702 1703 this 1704 .setData() 1705 .setOptions(opts) 1706 .build(); 1707 1708 return this; 1709 }, 1710 1711 setData: function() { 1712 this.$el.data(instanceName, this); 1713 1714 return this; 1715 }, 1716 1717 setOptions: function(opts) { 1718 this.options = $.extend(true, {}, PluginTweets.defaults, opts, { 1719 wrapper: this.$el 1720 }); 1721 1722 return this; 1723 }, 1724 1725 build: function() { 1726 if (this.options.username == null || this.options.username == '') { 1727 return this; 1728 } 1729 1730 var self = this, 1731 $wrapper = this.options.wrapper; 1732 1733 $.ajax({ 1734 type: 'GET', 1735 data: { 1736 twitter_screen_name: self.options.username, 1737 tweets_to_display: self.options.count 1738 }, 1739 url: self.options.URL, 1740 }).done(function(html) { 1741 $wrapper.html(html); 1742 }); 1743 1744 return this; 1745 } 1746 }; 1747 1748 // expose to scope 1749 $.extend(theme, { 1750 PluginTweets: PluginTweets 1751 }); 1752 1753 // jquery plugin 1754 $.fn.themePluginTweets = function(opts) { 1755 return this.map(function() { 1756 var $this = $(this); 1757 1758 if ($this.data(instanceName)) { 1759 return $this.data(instanceName); 1760 } else { 1761 return new PluginTweets($this, opts); 1762 } 1763 1764 }); 1765 } 1766 1767}).apply(this, [window.theme, jQuery]); 1768 1769// Validation 1770(function(theme, $) { 1771 1772 theme = theme || {}; 1773 1774 $.extend(theme, { 1775 1776 PluginValidation: { 1777 1778 defaults: { 1779 validator: { 1780 highlight: function(element) { 1781 $(element) 1782 .parent() 1783 .removeClass('has-success') 1784 .addClass('has-error'); 1785 }, 1786 success: function(element) { 1787 $(element) 1788 .parent() 1789 .removeClass('has-error') 1790 .addClass('has-success') 1791 .find('label.error') 1792 .remove(); 1793 }, 1794 errorPlacement: function(error, element) { 1795 if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') { 1796 error.appendTo(element.parent().parent()); 1797 } else { 1798 error.insertAfter(element); 1799 } 1800 } 1801 }, 1802 validateCaptchaURL: 'php/contact-form-verify-captcha.php', 1803 refreshCaptchaURL: 'php/contact-form-refresh-captcha.php' 1804 }, 1805 1806 initialize: function(opts) { 1807 initialized = true; 1808 1809 this 1810 .setOptions(opts) 1811 .build(); 1812 1813 return this; 1814 }, 1815 1816 setOptions: function(opts) { 1817 this.options = $.extend(true, {}, this.defaults, opts); 1818 1819 return this; 1820 }, 1821 1822 build: function() { 1823 var self = this; 1824 1825 if (!($.isFunction($.validator))) { 1826 return this; 1827 } 1828 1829 self.addMethods(); 1830 self.setMessageGroups(); 1831 1832 $.validator.setDefaults(self.options.validator); 1833 1834 return this; 1835 }, 1836 1837 addMethods: function() { 1838 var self = this; 1839 1840 $.validator.addMethod('captcha', function(value, element, params) { 1841 var captchaValid = false;
1842 1843 $.ajax({ 1844 url: self.options.validateCaptchaURL, 1845 type: 'POST', 1846 async: false, 1847 dataType: 'json', 1848 data: { 1849 captcha: $.trim(value) 1850 }, 1851 success: function(data) { 1852 if (data.response == 'success') { 1853 captchaValid = true; 1854 } 1855 } 1856 }); 1857 1858 if (captchaValid) { 1859 return true; 1860 } 1861 1862 }, ''); 1863 1864 // Refresh Captcha 1865 $('#refreshCaptcha').on('click', function(e) { 1866 e.preventDefault(); 1867 $.get(self.options.refreshCaptchaURL, function(url) { 1868 $('#captcha-image').attr('src', url); 1869 }); 1870 }); 1871 1872 }, 1873 1874 setMessageGroups: function() { 1875 1876 $('.checkbox-group[data-msg-required], .radio-group[data-msg-required]').each(function() { 1877 var message = $(this).data('msg-required'); 1878 $(this).find('input').attr('data-msg-required', message); 1879 }); 1880 1881 } 1882 1883 } 1884 1885 }); 1886 1887}).apply(this, [window.theme, jQuery]); 1888 1889// Video Background 1890(function(theme, $) { 1891 1892 theme = theme || {}; 1893 1894 var instanceName = '__videobackground'; 1895 1896 var PluginVideoBackground = function($el, opts) { 1897 return this.initialize($el, opts); 1898 }; 1899 1900 PluginVideoBackground.defaults = { 1901 overlay: true, 1902 volume: 1, 1903 playbackRate: 1, 1904 muted: true, 1905 loop: true, 1906 autoplay: true, 1907 position: '50% 50%', 1908 posterType: 'detect' 1909 }; 1910 1911 PluginVideoBackground.prototype = { 1912 initialize: function($el, opts) { 1913 this.$el = $el; 1914 1915 this 1916 .setData() 1917 .setOptions(opts) 1918 .build(); 1919 1920 return this; 1921 }, 1922 1923 setData: function() { 1924 this.$el.data(instanceName, this); 1925 1926 return this; 1927 }, 1928 1929 setOptions: function(opts) { 1930 this.options = $.extend(true, {}, PluginVideoBackground.defaults, opts, { 1931 path: this.$el.data('video-path'), 1932 wrapper: this.$el 1933 }); 1934 1935 return this; 1936 }, 1937 1938 build: function() { 1939 1940 if (!($.isFunction($.fn.vide)) || (!this.options.path)) { 1941 return this; 1942 } 1943 1944 if (this.options.overlay) { 1945 this.options.wrapper.prepend( 1946 $('<div />').addClass('video-overlay') 1947 ); 1948 } 1949 1950 this.options.wrapper.vide(this.options.path, this.options); 1951 1952 return this; 1953 } 1954 }; 1955 1956 // expose to scope 1957 $.extend(theme, { 1958 PluginVideoBackground: PluginVideoBackground 1959 }); 1960 1961 // jquery plugin 1962 $.fn.themePluginVideoBackground = function(opts) { 1963 return this.map(function() { 1964 var $this = $(this); 1965 1966 if ($this.data(instanceName)) { 1967 return $this.data(instanceName); 1968 } else { 1969 return new PluginVideoBackground($this, opts); 1970 } 1971 1972 }); 1973 } 1974 1975}).apply(this, [window.theme, jQuery]); 1976 1977// Sticky 1978(function(theme, $) { 1979 1980 theme = theme || {}; 1981 1982 var instanceName = '__sticky'; 1983 1984 var PluginSticky = function($el, opts) { 1985 return this.initialize($el, opts); 1986 }; 1987 1988 PluginSticky.defaults = { 1989 minWidth: 991, 1990 activeClass: 'sticky-active' 1991 }; 1992 1993 PluginSticky.prototype = { 1994 initialize: function($el, opts) { 1995 if ( $el.data( instanceName ) ) { 1996 return this; 1997 } 1998 1999 this.$el = $el; 2000 2001 this 2002 .setData() 2003 .setOptions(opts) 2004 .build(); 2005 2006 return this; 2007 }, 2008 2009 setData: function() { 2010 this.$el.data(instanceName, this); 2011 2012 return this; 2013 }, 2014 2015 setOptions: function(opts) { 2016 this.options = $.extend(true, {}, PluginSticky.defaults, opts, { 2017 wrapper: this.$el 2018 }); 2019 2020 return this; 2021 }, 2022 2023 build: function() { 2024 if (!($.isFunction($.fn.pin))) { 2025 return this; 2026 } 2027 2028 this.options.wrapper.pin(this.options); 2029 2030 return this; 2031 } 2032 }; 2033 2034 // expose to scope 2035 $.extend(theme, { 2036 PluginSticky: PluginSticky 2037 }); 2038 2039 // jquery plugin 2040 $.fn.themePluginSticky = function(opts) { 2041 return this.map(function() { 2042 var $this = $(this); 2043 2044 if ($this.data(instanceName)) { 2045 return $this.data(instanceName); 2046 } else { 2047 return new PluginSticky($this, opts); 2048 } 2049 2050 }); 2051 } 2052 2053}).apply(this, [ window.theme, jQuery ]); 2054 2055// Word Rotate 2056(function(theme, $) { 2057 2058 theme = theme || {}; 2059 2060 var instanceName = '__wordRotate'; 2061 2062 var PluginWordRotate = function($el, opts) { 2063 return this.initialize($el, opts); 2064 }; 2065 2066 PluginWordRotate.defaults = { 2067 delay: 2000, 2068 animDelay: 300 2069 }; 2070 2071 PluginWordRotate.prototype = { 2072 initialize: function($el, opts) { 2073 if ( $el.data( instanceName ) ) { 2074 return this; 2075 } 2076 2077 this.$el = $el; 2078 2079 this 2080 .setData() 2081 .setOptions(opts) 2082 .build(); 2083 2084 return this; 2085 }, 2086 2087 setData: function() { 2088 this.$el.data(instanceName, this); 2089 2090 return this; 2091 }, 2092 2093 setOptions: function(opts) { 2094 this.options = $.extend(true, {}, PluginWordRotate.defaults, opts, { 2095 wrapper: this.$el 2096 }); 2097 2098 return this; 2099 }, 2100 2101 build: function() { 2102 var self = this, 2103 $el = this.options.wrapper, 2104 itemsWrapper = $el.find(".word-rotate-items"), 2105 items = itemsWrapper.find("> span"), 2106 firstItem = items.eq(0), 2107 firstItemClone = firstItem.clone(), 2108 currentItem = 1, 2109 currentTop = 0, 2110 itemWidth = 0; 2111 2112 itemsWrapper 2113 .width(firstItem.width() + "px") 2114 .append(firstItemClone); 2115 2116 $el 2117 .addClass("active"); 2118 2119 setInterval(function() { 2120 2121 currentTop = (currentItem * $el.height()); 2122 currentItem++; 2123 2124 if(currentItem <= items.length) { 2125 itemWidth = items.eq(currentItem-1).width(); 2126 } else { 2127 itemWidth = items.eq(0).width(); 2128 } 2129 2130 itemsWrapper.animate({ 2131 top: -(currentTop) + "px", 2132 width: itemWidth + "px" 2133 }, self.options.animDelay, "easeOutQuad", function() { 2134 2135 if(currentItem > items.length) { 2136 2137 itemsWrapper.css("top", 0); 2138 currentItem = 1; 2139 2140 } 2141 2142 }); 2143 2144 }, self.options.delay); 2145 2146 return this; 2147 } 2148 }; 2149 2150 // expose to scope 2151 $.extend(theme, { 2152 PluginWordRotate: PluginWordRotate 2153 }); 2154 2155 // jquery plugin 2156 $.fn.themePluginWordRotate = function(opts) { 2157 return this.map(function() { 2158 var $this = $(this); 2159 2160 if ($this.data(instanceName)) { 2161 return $this.data(instanceName); 2162 } else { 2163 return new PluginWordRotate($this, opts); 2164 } 2165 2166 }); 2167 } 2168 2169}).apply(this, [ window.theme, jQuery ]); 2170 2171// Loading Overlay 2172(function(theme, $) { 2173 2174 'use strict'; 2175 2176 theme = theme || {}; 2177 2178 var loadingOverlayTemplate = [ 2179 '<div class="loading-overlay">', 2180 '<div class="loader"></div>', 2181 '</div>' 2182 ].join(''); 2183 2184 var LoadingOverlay = function( $wrapper, options ) { 2185 return this.initialize( $wrapper, options ); 2186 }; 2187 2188 LoadingOverlay.prototype = { 2189 2190 options: { 2191 css: {} 2192 }, 2193 2194 initialize: function( $wrapper, options ) { 2195 this.$wrapper = $wrapper; 2196 2197 this 2198 .setVars() 2199 .setOptions( options ) 2200 .build() 2201 .events(); 2202 2203 this.$wrapper.data( 'loadingOverlay', this ); 2204 }, 2205 2206 setVars: function() {
2207 this.$overlay = this.$wrapper.find('.loading-overlay'); 2208 2209 return this; 2210 }, 2211 2212 setOptions: function( options ) { 2213 if ( !this.$overlay.get(0) ) { 2214 this.matchProperties(); 2215 } 2216 this.options = $.extend( true, {}, this.options, options ); 2217 this.loaderClass = this.getLoaderClass( this.options.css.backgroundColor ); 2218 2219 return this; 2220 }, 2221 2222 build: function() { 2223 if ( !this.$overlay.closest(document.documentElement).get(0) ) { 2224 if ( !this.$cachedOverlay ) { 2225 this.$overlay = $( loadingOverlayTemplate ).clone(); 2226 2227 if ( this.options.css ) { 2228 this.$overlay.css( this.options.css ); 2229 this.$overlay.find( '.loader' ).addClass( this.loaderClass ); 2230 } 2231 } else { 2232 this.$overlay = this.$cachedOverlay.clone(); 2233 } 2234 2235 this.$wrapper.append( this.$overlay ); 2236 } 2237 2238 if ( !this.$cachedOverlay ) { 2239 this.$cachedOverlay = this.$overlay.clone(); 2240 } 2241 2242 return this; 2243 }, 2244 2245 events: function() { 2246 var _self = this; 2247 2248 if ( this.options.startShowing ) { 2249 _self.show(); 2250 } 2251 2252 if ( this.$wrapper.is('body') || this.options.hideOnWindowLoad ) { 2253 $( window ).on( 'load error', function() { 2254 _self.hide(); 2255 }); 2256 } 2257 2258 if ( this.options.listenOn ) { 2259 $( this.options.listenOn ) 2260 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 2261 e.stopPropagation(); 2262 _self.show(); 2263 }) 2264 .on( 'loading-overlay:hide complete.ic', function( e ) { 2265 e.stopPropagation(); 2266 _self.hide(); 2267 }); 2268 } 2269 2270 this.$wrapper 2271 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 2272 e.stopPropagation(); 2273 _self.show(); 2274 }) 2275 .on( 'loading-overlay:hide complete.ic', function( e ) { 2276 e.stopPropagation(); 2277 _self.hide(); 2278 }); 2279 2280 return this; 2281 }, 2282 2283 show: function() { 2284 this.build(); 2285 2286 this.position = this.$wrapper.css( 'position' ).toLowerCase(); 2287 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 2288 this.$wrapper.css({ 2289 position: 'relative' 2290 }); 2291 } 2292 this.$wrapper.addClass( 'loading-overlay-showing' ); 2293 }, 2294 2295 hide: function() { 2296 var _self = this; 2297 2298 this.$wrapper.removeClass( 'loading-overlay-showing' ); 2299 setTimeout(function() { 2300 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 2301 _self.$wrapper.css({ position: '' }); 2302 } 2303 }, 500); 2304 }, 2305 2306 matchProperties: function() { 2307 var i, 2308 l, 2309 properties; 2310 2311 properties = [ 2312 'backgroundColor', 2313 'borderRadius' 2314 ]; 2315 2316 l = properties.length; 2317 2318 for( i = 0; i < l; i++ ) { 2319 var obj = {}; 2320 obj[ properties[ i ] ] = this.$wrapper.css( properties[ i ] ); 2321 2322 $.extend( this.options.css, obj ); 2323 } 2324 }, 2325 2326 getLoaderClass: function( backgroundColor ) { 2327 if ( !backgroundColor || backgroundColor === 'transparent' || backgroundColor === 'inherit' ) { 2328 return 'black'; 2329 } 2330 2331 var hexColor, 2332 r, 2333 g, 2334 b, 2335 yiq; 2336 2337 var colorToHex = function( color ){ 2338 var hex, 2339 rgb; 2340 2341 if( color.indexOf('#') >- 1 ){ 2342 hex = color.replace('#', ''); 2343 } else { 2344 rgb = color.match(/\d+/g); 2345 hex = ('0' + parseInt(rgb[0], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2); 2346 } 2347 2348 if ( hex.length === 3 ) { 2349 hex = hex + hex; 2350 } 2351 2352 return hex; 2353 }; 2354 2355 hexColor = colorToHex( backgroundColor ); 2356 2357 r = parseInt( hexColor.substr( 0, 2), 16 ); 2358 g = parseInt( hexColor.substr( 2, 2), 16 ); 2359 b = parseInt( hexColor.substr( 4, 2), 16 ); 2360 yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 2361 2362 return ( yiq >= 128 ) ? 'black' : 'white'; 2363 } 2364 2365 }; 2366 2367 // expose to scope 2368 $.extend(theme, { 2369 LoadingOverlay: LoadingOverlay 2370 }); 2371 2372 // expose as a jquery plugin 2373 $.fn.loadingOverlay = function( opts ) { 2374 return this.each(function() { 2375 var $this = $( this ); 2376 2377 var loadingOverlay = $this.data( 'loadingOverlay' ); 2378 if ( loadingOverlay ) { 2379 return loadingOverlay; 2380 } else { 2381 var options = opts || $this.data( 'loading-overlay-options' ) || {}; 2382 return new LoadingOverlay( $this, options ); 2383 } 2384 }); 2385 } 2386 2387 // auto init 2388 $(function() { 2389 $('[data-loading-overlay]').loadingOverlay(); 2390 }); 2391 2392}).apply(this, [window.theme, jQuery]); 2393 2394// Account 2395(function(theme, $) { 2396 2397 theme = theme || {}; 2398 2399 var initialized = false;
2400 2401 $.extend(theme, { 2402 2403 Account: { 2404 2405 defaults: { 2406 wrapper: $('#headerAccount') 2407 }, 2408 2409 initialize: function($wrapper, opts) { 2410 if (initialized) { 2411 return this; 2412 } 2413 2414 initialized = true; 2415 this.$wrapper = ($wrapper || this.defaults.wrapper); 2416 2417 this 2418 .setOptions(opts) 2419 .events(); 2420 2421 return this; 2422 }, 2423 2424 setOptions: function(opts) { 2425 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2426 2427 return this; 2428 }, 2429 2430 events: function() { 2431 var self = this; 2432 2433 self.$wrapper.find('input').on('focus', function() { 2434 self.$wrapper.addClass('open'); 2435 2436 $(document).mouseup(function(e) { 2437 if (!self.$wrapper.is(e.target) && self.$wrapper.has(e.target).length === 0) { 2438 self.$wrapper.removeClass('open'); 2439 } 2440 }); 2441 }); 2442 2443 $('#headerSignUp').on('click', function(e) { 2444 e.preventDefault(); 2445 self.$wrapper.addClass('signup').removeClass('signin').removeClass('recover'); 2446 self.$wrapper.find('.signup-form input:first').focus(); 2447 }); 2448 2449 $('#headerSignIn').on('click', function(e) { 2450 e.preventDefault(); 2451 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 2452 self.$wrapper.find('.signin-form input:first').focus(); 2453 }); 2454 2455 $('#headerRecover').on('click', function(e) { 2456 e.preventDefault(); 2457 self.$wrapper.addClass('recover').removeClass('signup').removeClass('signin'); 2458 self.$wrapper.find('.recover-form input:first').focus(); 2459 }); 2460 2461 $('#headerRecoverCancel').on('click', function(e) { 2462 e.preventDefault(); 2463 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 2464 self.$wrapper.find('.signin-form input:first').focus(); 2465 }); 2466 } 2467 2468 } 2469 2470 }); 2471 2472}).apply(this, [window.theme, jQuery]); 2473 2474// Nav 2475(function(theme, $) { 2476 2477 theme = theme || {}; 2478 2479 var initialized = false; 2480 2481 $.extend(theme, { 2482 2483 Nav: { 2484 2485 defaults: { 2486 wrapper: $('#mainNav'), 2487 scrollDelay: 600, 2488 scrollAnimation: 'easeOutQuad' 2489 }, 2490 2491 initialize: function($wrapper, opts) { 2492 if (initialized) { 2493 return this; 2494 } 2495 2496 initialized = true; 2497 this.$wrapper = ($wrapper || this.defaults.wrapper); 2498 2499 this 2500 .setOptions(opts) 2501 .build() 2502 .events(); 2503 2504 return this; 2505 }, 2506 2507 setOptions: function(opts) { 2508 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2509 2510 return this; 2511 }, 2512 2513 build: function() { 2514 2515 return this; 2516 }, 2517 2518 events: function() { 2519 var self = this, 2520 $header = $('#header'), 2521 $window = $(window); 2522 2523 $header.find('[href=#]').on('click', function(e) { 2524 e.preventDefault(); 2525 }); 2526 2527 // Add Arrows 2528 $header.find('.dropdown-toggle, .dropdown-submenu > a').append($('<i />').addClass('fa fa-caret-down')); 2529 2530 // Mobile Arrows 2531 $header.find('.dropdown-toggle[href=#], .dropdown-submenu [href=#], .dropdown-toggle[href!=#] .fa-caret-down, .dropdown-submenu a[href!=#] .fa-caret-down').on('click', function(e) { 2532 e.preventDefault(); 2533 if ($window.width() < 992) { 2534 $(this).closest('li').toggleClass('opened'); 2535 } 2536 }); 2537 2538 // Touch Devices with normal resolutions 2539 if(('ontouchstart' in window || 'onmsgesturechange' in window)) { 2540 $header.find('.dropdown-toggle:not([href=#]), .dropdown-submenu > a:not([href=#])') 2541 .on('touchstart click', function(e) { 2542 if($window.width() > 991) { 2543 2544 e.stopPropagation(); 2545 e.preventDefault(); 2546 2547 if(e.handled !== true) { 2548 2549 var li = $(this).closest('li'); 2550 2551 if(li.hasClass('tapped')) { 2552 location.href = $(this).attr('href'); 2553 } 2554 2555 li.addClass('tapped'); 2556 2557 e.handled = true; 2558 } else { 2559 return false; 2560 } 2561 2562 return false; 2563 2564 } 2565 }) 2566 .on('blur', function(e) { 2567 $(this).closest('li').removeClass('tapped'); 2568 }); 2569 2570 } 2571 2572 // Anchors Position 2573 $('[data-hash]').on('click', function(e) { 2574 e.preventDefault(); 2575 2576 var target = $(this).attr('href'), 2577 offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0); 2578 2579 self.scrollToTarget(target, offset); 2580 2581 return; 2582 }); 2583 2584 // Mobile Redirect - (Ignores the Dropdown from Bootstrap) 2585 $('.mobile-redirect').on('click', function() { 2586 if ($window.width() < 992) { 2587 self.location = $(this).attr('href'); 2588 } 2589 }); 2590 2591 return this; 2592 }, 2593 2594 scrollToTarget: function(target, offset) { 2595 var self = this; 2596 2597 $('body').addClass('scrolling'); 2598 2599 $('html, body').animate({ 2600 scrollTop: $(target).offset().top - offset 2601 }, self.options.scrollDelay, self.options.scrollAnimation, function() { 2602 $('body').removeClass('scrolling'); 2603 }); 2604 2605 return this; 2606 2607 } 2608 2609 } 2610 2611 }); 2612 2613}).apply(this, [window.theme, jQuery]); 2614 2615// Newsletter 2616(function(theme, $) { 2617 2618 theme = theme || {}; 2619 2620 var initialized = false;
2621 2622 $.extend(theme, { 2623 2624 Newsletter: { 2625 2626 defaults: { 2627 wrapper: $('#newsletterForm') 2628 }, 2629 2630 initialize: function($wrapper, opts) { 2631 if (initialized) { 2632 return this; 2633 } 2634 2635 initialized = true; 2636 this.$wrapper = ($wrapper || this.defaults.wrapper); 2637 2638 this 2639 .setOptions(opts) 2640 .build(); 2641 2642 return this; 2643 }, 2644 2645 setOptions: function(opts) { 2646 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2647 2648 return this; 2649 }, 2650 2651 build: function() { 2652 if (!($.isFunction($.fn.validate))) { 2653 return this; 2654 } 2655 2656 var self = this, 2657 $email = self.$wrapper.find('#newsletterEmail'), 2658 $success = $('#newsletterSuccess'), 2659 $error = $('#newsletterError'); 2660 2661 self.$wrapper.validate({ 2662 submitHandler: function(form) { 2663 2664 $.ajax({ 2665 type: 'POST', 2666 url: self.$wrapper.attr('action'), 2667 data: { 2668 'email': $email.val() 2669 }, 2670 dataType: 'json', 2671 success: function(data) { 2672 if (data.response == 'success') { 2673 2674 $success.removeClass('hidden'); 2675 $error.addClass('hidden'); 2676 2677 $email 2678 .val('') 2679 .blur() 2680 .closest('.control-group') 2681 .removeClass('success') 2682 .removeClass('error'); 2683 2684 } else { 2685 2686 $error.html(data.message); 2687 $error.removeClass('hidden'); 2688 $success.addClass('hidden'); 2689 2690 $email 2691 .blur() 2692 .closest('.control-group') 2693 .removeClass('success') 2694 .addClass('error'); 2695 2696 } 2697 } 2698 }); 2699 2700 }, 2701 rules: { 2702 newsletterEmail: { 2703 required: true, 2704 email: true 2705 } 2706 }, 2707 errorPlacement: function(error, element) { 2708 2709 } 2710 }); 2711 2712 return this; 2713 } 2714 2715 } 2716 2717 }); 2718 2719}).apply(this, [window.theme, jQuery]); 2720 2721// Search 2722(function(theme, $) { 2723 2724 theme = theme || {}; 2725 2726 var initialized = false; 2727 2728 $.extend(theme, { 2729 2730 Search: { 2731 2732 defaults: { 2733 wrapper: $('#searchForm') 2734 }, 2735 2736 initialize: function($wrapper, opts) { 2737 if (initialized) { 2738 return this; 2739 } 2740 2741 initialized = true; 2742 this.$wrapper = ($wrapper || this.defaults.wrapper); 2743 2744 this 2745 .setOptions(opts) 2746 .build(); 2747 2748 return this; 2749 }, 2750 2751 setOptions: function(opts) { 2752 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2753 2754 return this; 2755 }, 2756 2757 build: function() { 2758 if (!($.isFunction($.fn.validate))) { 2759 return this; 2760 } 2761 2762 this.$wrapper.validate({ 2763 errorPlacement: function(error, element) {} 2764 }); 2765 2766 return this; 2767 } 2768 2769 } 2770 2771 }); 2772 2773}).apply(this, [window.theme, jQuery]); 2774 2775// Sticky Header 2776(function(theme, $) { 2777 2778 theme = theme || {}; 2779 2780 var initialized = false; 2781 2782 $.extend(theme, { 2783 2784 StickyHeader: { 2785 2786 defaults: { 2787 wrapper: $('#header'), 2788 headerBody: $('#header .header-body'), 2789 stickyEnabled: true, 2790 stickyEnableOnBoxed: true, 2791 stickyEnableOnMobile: true, 2792 stickyStartAt: 0, 2793 stickyStartAtElement: false, 2794 stickySetTop: 0, 2795 stickyChangeLogo: false 2796 }, 2797 2798 initialize: function($wrapper, opts) { 2799 if (initialized) { 2800 return this; 2801 } 2802 2803 initialized = true; 2804 this.$wrapper = ($wrapper || this.defaults.wrapper); 2805 2806 this 2807 .setOptions(opts) 2808 .build() 2809 .events(); 2810 2811 return this; 2812 }, 2813 2814 setOptions: function(opts) { 2815 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2816 2817 return this; 2818 }, 2819 2820 build: function() { 2821 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || !this.options.stickyEnabled) { 2822 return this; 2823 } 2824 2825 var self = this, 2826 $html = $('html'), 2827 $window = $(window); 2828 2829 // HTML Classes 2830 $html.addClass('sticky-header-enabled'); 2831 2832 // Set Start At 2833 if(self.options.stickyStartAtElement) { 2834 2835 var $stickyStartAtElement = $(self.options.stickyStartAtElement); 2836 2837 $(window).on('scroll resize', function() { 2838 self.options.stickyStartAt = $stickyStartAtElement.offset().top; 2839 }); 2840 2841 $(window).trigger('resize'); 2842 } 2843 2844 // Boxed 2845 if($html.hasClass('boxed') && (parseInt(self.options.stickyStartAt) == 0) && $window.width() > 991) { 2846 self.options.stickyStartAt = 30; 2847 } 2848 2849 // Set Wrapper Min-Height 2850 self.options.wrapper.css('min-height', self.options.wrapper.height()); 2851 2852 // Check Sticky Header 2853 self.checkStickyHeader = function() { 2854 if ($window.scrollTop() >= parseInt(self.options.stickyStartAt)) { 2855 self.activateStickyHeader(); 2856 } else { 2857 self.deactivateStickyHeader(); 2858 } 2859 }; 2860 2861 // Activate Sticky Header 2862 self.activateStickyHeader = function() { 2863 $html.addClass('sticky-header-active'); 2864 self.options.headerBody.css('top', self.options.stickySetTop); 2865 2866 if (self.options.stickyChangeLogo) { 2867 self.changeLogo(true); 2868 } 2869 2870 $.event.trigger({ 2871 type: 'stickyHeader.activate' 2872 }); 2873 }; 2874 2875 // Deactivate Sticky Header 2876 self.deactivateStickyHeader = function() { 2877 $html.removeClass('sticky-header-active'); 2878 self.options.headerBody.css('top', 0); 2879 2880 if (self.options.stickyChangeLogo) { 2881 self.changeLogo(false); 2882 } 2883 2884 // Force Browser Repaint 2885 self.browserRepaint(); 2886 2887 setTimeout(function() { 2888 self.browserRepaint(); 2889 }, 100); 2890 2891 $.event.trigger({ 2892 type: 'stickyHeader.deactivate' 2893 }); 2894 }; 2895 2896 // Always Sticky 2897 if (parseInt(self.options.stickyStartAt) <= 0) { 2898 self.activateStickyHeader(); 2899 } 2900 2901 // Set Logo 2902 if (self.options.stickyChangeLogo) { 2903 2904 var $logoWrapper = self.options.wrapper.find('.header-logo'), 2905 $logo = $logoWrapper.find('img'), 2906 logoWidth = $logo.attr('width'), 2907 logoHeight = $logo.attr('height'), 2908 logoSmallTop = parseInt($logo.attr('data-sticky-top') ? $logo.attr('data-sticky-top') : 0), 2909 logoSmallWidth = parseInt($logo.attr('data-sticky-width') ? $logo.attr('data-sticky-width') : 'auto'),
2910 logoSmallHeight = parseInt($logo.attr('data-sticky-height') ? $logo.attr('data-sticky-height') : 'auto'); 2911 2912 $logoWrapper.css({ 2913 'width': $logo.outerWidth(true), 2914 'height': $logo.outerHeight(true) 2915 }); 2916 2917 self.changeLogo = function(activate) { 2918 if(activate) { 2919 $logo.css({ 2920 'top': logoSmallTop, 2921 'width': logoSmallWidth, 2922 'height': logoSmallHeight 2923 }); 2924 } else { 2925 $logo.css({ 2926 'top': 0, 2927 'width': logoWidth, 2928 'height': logoHeight 2929 }); 2930 } 2931 } 2932 2933 } 2934 2935 // Browser Repaint 2936 self.browserRepaint = function() { 2937 self.options.wrapper.hide(); 2938 self.options.wrapper.get(0).offsetHeight; 2939 self.options.wrapper.show(); 2940 } 2941 2942 return this; 2943 }, 2944 2945 events: function() { 2946 var self = this; 2947 2948 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || !this.options.stickyEnabled) { 2949 return this; 2950 } 2951 2952 if (!self.options.alwaysStickyEnabled) { 2953 $(window).on('scroll resize', function() { 2954 self.checkStickyHeader(); 2955 }); 2956 } else { 2957 self.activateStickyHeader(); 2958 } 2959 2960 return this; 2961 } 2962 2963 } 2964 2965 }); 2966 2967}).apply(this, [window.theme, jQuery]); 2968;/*})'"*/ 2969;/*})'"*/ 2970// Commom Plugins 2971(function($) { 2972 2973 'use strict'; 2974 2975 // Scroll to Top Button. 2976 if (typeof theme.PluginScrollToTop !== 'undefined') { 2977 theme.PluginScrollToTop.initialize(); 2978 } 2979 2980 // Tooltips 2981 if ($.isFunction($.fn['tooltip'])) { 2982 $('[data-tooltip]:not(.manual), [data-plugin-tooltip]:not(.manual)').tooltip(); 2983 } 2984 2985 // Popover 2986 if ($.isFunction($.fn['popover'])) { 2987 $(function() { 2988 $('[data-plugin-popover]:not(.manual)').each(function() { 2989 var $this = $(this), 2990 opts; 2991 2992 var pluginOptions = $this.data('plugin-options'); 2993 if (pluginOptions) 2994 opts = pluginOptions; 2995 2996 $this.popover(opts); 2997 }); 2998 }); 2999 } 3000 3001 // Validations 3002 if (typeof theme.PluginValidation !== 'undefined') { 3003 theme.PluginValidation.initialize(); 3004 } 3005 3006 // Parallax 3007 if (typeof theme.PluginParallax !== 'undefined') { 3008 theme.PluginParallax.initialize(); 3009 } 3010 3011 // Match Height 3012 if ($.isFunction($.fn['matchHeight'])) { 3013 3014 $('.match-height').matchHeight(); 3015 3016 // Featured Boxes 3017 $('.featured-boxes .featured-box').matchHeight(); 3018 3019 // Featured Box Full 3020 $('.featured-box-full').matchHeight(); 3021 3022 } 3023 3024}).apply(this, [jQuery]); 3025 3026// Animate 3027(function($) { 3028 3029 'use strict'; 3030 3031 if ($.isFunction($.fn['themePluginAnimate'])) { 3032 3033 $(function() { 3034 $('[data-plugin-animate], [data-appear-animation]').each(function() { 3035 var $this = $(this), 3036 opts; 3037 3038 var pluginOptions = $this.data('plugin-options'); 3039 if (pluginOptions) 3040 opts = pluginOptions; 3041 3042 $this.themePluginAnimate(opts); 3043 }); 3044 }); 3045 3046 } 3047 3048}).apply(this, [jQuery]); 3049 3050// Carousel 3051(function($) { 3052 3053 'use strict'; 3054 3055 if ($.isFunction($.fn['themePluginCarousel'])) { 3056 3057 $(function() { 3058 $('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function() { 3059 var $this = $(this), 3060 opts; 3061 3062 var pluginOptions = $this.data('plugin-options'); 3063 if (pluginOptions) 3064 opts = pluginOptions; 3065 3066 $this.themePluginCarousel(opts); 3067 }); 3068 }); 3069 3070 } 3071 3072}).apply(this, [jQuery]); 3073 3074// Chart.Circular 3075(function($) { 3076 3077 'use strict'; 3078 3079 if ($.isFunction($.fn['themePluginChartCircular'])) { 3080 3081 $(function() { 3082 $('[data-plugin-chart-circular]:not(.manual), .circular-bar-chart:not(.manual)').each(function() { 3083 var $this = $(this), 3084 opts; 3085 3086 var pluginOptions = $this.data('plugin-options'); 3087 if (pluginOptions) 3088 opts = pluginOptions; 3089 3090 $this.themePluginChartCircular(opts); 3091 }); 3092 }); 3093 3094 } 3095 3096}).apply(this, [jQuery]); 3097 3098// Counter 3099(function($) { 3100 3101 'use strict'; 3102 3103 if ($.isFunction($.fn['themePluginCounter'])) { 3104 3105 $(function() { 3106 $('[data-plugin-counter]:not(.manual), .counters [data-to]').each(function() { 3107 var $this = $(this), 3108 opts; 3109 3110 var pluginOptions = $this.data('plugin-options'); 3111 if (pluginOptions) 3112 opts = pluginOptions; 3113 3114 $this.themePluginCounter(opts); 3115 }); 3116 }); 3117 3118 } 3119 3120}).apply(this, [jQuery]); 3121 3122// Flickr 3123(function($) { 3124 3125 'use strict'; 3126 3127 if ($.isFunction($.fn['themePluginFlickr'])) { 3128 3129 $(function() { 3130 $('[data-plugin-flickr]:not(.manual)').each(function() { 3131 var $this = $(this), 3132 opts; 3133 3134 var pluginOptions = $this.data('plugin-options'); 3135 if (pluginOptions) 3136 opts = pluginOptions; 3137 3138 $this.themePluginFlickr(opts); 3139 }); 3140 }); 3141 3142 } 3143 3144}).apply(this, [jQuery]); 3145 3146// Lazy Load 3147(function($) { 3148 3149 'use strict'; 3150 3151 if ($.isFunction($.fn['themePluginLazyLoad'])) { 3152 3153 $(function() { 3154 $('[data-plugin-lazyload]:not(.manual)').each(function() { 3155 var $this = $(this), 3156 opts; 3157 3158 var pluginOptions = $this.data('plugin-options'); 3159 if (pluginOptions) 3160 opts = pluginOptions; 3161 3162 $this.themePluginLazyLoad(opts); 3163 }); 3164 }); 3165 3166 } 3167 3168}).apply(this, [jQuery]); 3169 3170// Lightbox 3171(function($) { 3172 3173 'use strict'; 3174 3175 if ($.isFunction($.fn['themePluginLightbox'])) { 3176 3177 $(function() { 3178 $('[data-plugin-lightbox]:not(.manual), .lightbox:not(.manual)').each(function() { 3179 var $this = $(this), 3180 opts; 3181 3182 var pluginOptions = $this.data('plugin-options'); 3183 if (pluginOptions) 3184 opts = pluginOptions; 3185 3186 $this.themePluginLightbox(opts); 3187 }); 3188 }); 3189 3190 } 3191 3192}).apply(this, [jQuery]); 3193 3194// Masonry 3195(function($) { 3196 3197 'use strict'; 3198 3199 if ($.isFunction($.fn['themePluginMasonry'])) { 3200 3201 $(function() { 3202 $('[data-plugin-masonry]:not(.manual)').each(function() { 3203 var $this = $(this), 3204 opts; 3205 3206 var pluginOptions = $this.data('plugin-options'); 3207 if (pluginOptions) 3208 opts = pluginOptions; 3209 3210 $this.themePluginMasonry(opts); 3211 }); 3212 }); 3213 3214 } 3215 3216}).apply(this, [jQuery]); 3217 3218// Progress Bar 3219(function($) { 3220 3221 'use strict'; 3222 3223 if ($.isFunction($.fn['themePluginProgressBar'])) { 3224 3225 $(function() { 3226 $('[data-plugin-progress-bar]:not(.manual), [data-appear-progress-animation]').each(function() { 3227 var $this = $(this), 3228 opts; 3229 3230 var pluginOptions = $this.data('plugin-options'); 3231 if (pluginOptions) 3232 opts = pluginOptions; 3233 3234 $this.themePluginProgressBar(opts); 3235 }); 3236 }); 3237 3238 } 3239 3240}).apply(this, [jQuery]); 3241 3242// Revolution Slider 3243(function($) { 3244 3245 'use strict'; 3246 3247 if ($.isFunction($.fn['themePluginRevolutionSlider'])) { 3248 3249 $(function() { 3250 $('[data-plugin-revolution-slider]:not(.manual), .slider-container .slider:not(.manual)').each(function() { 3251 var $this = $(this), 3252 opts; 3253 3254 var pluginOptions = $this.data('plugin-options'); 3255 if (pluginOptions) 3256 opts = pluginOptions; 3257 3258 $this.themePluginRevolutionSlider(opts); 3259 }); 3260 }); 3261 3262 } 3263 3264}).apply(this, [jQuery]); 3265 3266// Sort 3267(function($) { 3268 3269 'use strict'; 3270 3271 if ($.isFunction($.fn['themePluginSort'])) { 3272 3273 $(function() { 3274 $('[data-plugin-sort]:not(.manual), .sort-source:not(.manual)').each(function() { 3275 var $this = $(this), 3276 opts; 3277 3278 var pluginOptions = $this.data('plugin-options'); 3279 if (pluginOptions) 3280 opts = pluginOptions; 3281 3282 $this.themePluginSort(opts); 3283 }); 3284 }); 3285 3286 } 3287 3288}).apply(this, [jQuery]); 3289 3290// Match Height 3291(function($) { 3292 3293 'use strict'; 3294 3295 if ($.isFunction($.fn['themePluginMatchHeight'])) { 3296 3297 $(function() { 3298 $('[data-plugin-match-height]:not(.manual)').each(function() { 3299 var $this = $(this), 3300 opts; 3301 3302 var pluginOptions = $this.data('plugin-options'); 3303 if (pluginOptions) 3304 opts = pluginOptions; 3305 3306 $this.themePluginMatchHeight(opts); 3307 }); 3308 }); 3309 3310 } 3311 3312}).apply(this, [jQuery]); 3313 3314// Toggle 3315(function($) { 3316 3317 'use strict'; 3318 3319 if ($.isFunction($.fn['themePluginToggle'])) { 3320 3321 $(function() { 3322 $('[data-plugin-toggle]:not(.manual)').each(function() { 3323 var $this = $(this), 3324 opts; 3325 3326 var pluginOptions = $this.data('plugin-options'); 3327 if (pluginOptions) 3328 opts = pluginOptions; 3329 3330 $this.themePluginToggle(opts); 3331 }); 3332 }); 3333 3334 } 3335 3336}).apply(this, [jQuery]); 3337 3338// Tweets 3339(function($) { 3340 3341 'use strict'; 3342 3343 if ($.isFunction($.fn['themePluginTweets'])) { 3344 3345 $(function() { 3346 $('[data-plugin-tweets]:not(.manual)').each(function() { 3347 var $this = $(this), 3348 opts; 3349 3350 var pluginOptions = $this.data('plugin-options'); 3351 if (pluginOptions) 3352 opts = pluginOptions; 3353 3354 $this.themePluginTweets(opts); 3355 }); 3356 }); 3357 3358 } 3359 3360}).apply(this, [jQuery]); 3361
3362// Video Background 3363(function($) { 3364 3365 'use strict'; 3366 3367 if ($.isFunction($.fn['themePluginVideoBackground'])) { 3368 3369 $(function() { 3370 $('[data-plugin-video-background]:not(.manual)').each(function() { 3371 var $this = $(this), 3372 opts; 3373 3374 var pluginOptions = $this.data('plugin-options'); 3375 if (pluginOptions) 3376 opts = pluginOptions; 3377 3378 $this.themePluginVideoBackground(opts); 3379 }); 3380 }); 3381 3382 } 3383 3384}).apply(this, [jQuery]); 3385 3386// Sticky 3387(function($) { 3388 3389 'use strict'; 3390 3391 if ($.isFunction($.fn['themePluginSticky'])) { 3392 3393 $(function() { 3394 $('[data-plugin-sticky]:not(.manual)').each(function() { 3395 var $this = $(this), 3396 opts; 3397 3398 var pluginOptions = $this.data('plugin-options'); 3399 if (pluginOptions) 3400 opts = pluginOptions; 3401 3402 $this.themePluginSticky(opts); 3403 }); 3404 }); 3405 3406 } 3407 3408}).apply(this, [jQuery]); 3409 3410// Word Rotate 3411(function($) { 3412 3413 'use strict'; 3414 3415 if ($.isFunction($.fn['themePluginWordRotate'])) { 3416 3417 $(function() { 3418 $('[data-plugin-word-rotate]:not(.manual), .word-rotate:not(.manual)').each(function() { 3419 var $this = $(this), 3420 opts; 3421 3422 var pluginOptions = $this.data('plugin-options'); 3423 if (pluginOptions) 3424 opts = pluginOptions; 3425 3426 $this.themePluginWordRotate(opts); 3427 }); 3428 }); 3429 3430 } 3431 3432}).apply(this, [jQuery]); 3433 3434// Commom Partials 3435(function($) { 3436 3437 'use strict'; 3438 3439 // Sticky Header 3440 if (typeof theme.StickyHeader !== 'undefined') { 3441 theme.StickyHeader.initialize(); 3442 } 3443 3444 // Nav Menu 3445 if (typeof theme.Nav !== 'undefined') { 3446 theme.Nav.initialize(); 3447 } 3448 3449 // Search 3450 if (typeof theme.Search !== 'undefined') { 3451 theme.Search.initialize(); 3452 } 3453 3454 // Newsletter 3455 if (typeof theme.Newsletter !== 'undefined') { 3456 theme.Newsletter.initialize(); 3457 } 3458 3459 // Account 3460 if (typeof theme.Account !== 'undefined') { 3461 theme.Account.initialize(); 3462 } 3463 3464}).apply(this, [jQuery]); 3465;/*})'"*/ 3466;/*})'"*/ 3467/* 3468Name: View - Home 3469Written by: Okler Themes - (http://www.okler.net) 3470Version: 4.0.0 3471*/ 3472 3473(function($) { 3474 3475 'use strict'; 3476 3477 /* 3478 Circle Slider 3479 */ 3480 if ($.isFunction($.fn.flipshow)) { 3481 var circleContainer = $('#fcSlideshow'); 3482 3483 if (circleContainer.get(0)) { 3484 circleContainer.flipshow(); 3485 3486 setTimeout(function circleFlip() { 3487 circleContainer.data().flipshow._navigate(circleContainer.find('div.fc-right span:first'), 'right'); 3488 setTimeout(circleFlip, 3000); 3489 }, 3000); 3490 } 3491 } 3492 3493 /* 3494 Move Cloud 3495 */ 3496 if ($('.cloud').get(0)) { 3497 var moveCloud = function() { 3498 $('.cloud').animate({ 3499 'top': '+=20px' 3500 }, 3000, 'linear', function() { 3501 $('.cloud').animate({ 3502 'top': '-=20px' 3503 }, 3000, 'linear', function() { 3504 moveCloud(); 3505 }); 3506 }); 3507 }; 3508 3509 moveCloud(); 3510 } 3511 3512 /* 3513 Nivo Slider 3514 */ 3515 if ($.isFunction($.fn.nivoSlider)) { 3516 $('#nivoSlider').nivoSlider({ 3517 effect: 'random', 3518 slices: 15, 3519 boxCols: 8, 3520 boxRows: 4, 3521 animSpeed: 500, 3522 pauseTime: 3000, 3523 startSlide: 0, 3524 directionNav: true, 3525 controlNav: true, 3526 controlNavThumbs: false, 3527 pauseOnHover: true, 3528 manualAdvance: false, 3529 prevText: 'Prev', 3530 nextText: 'Next', 3531 randomStart: false 3532 }); 3533 } 3534 3535}).apply(this, [jQuery]); 3536;/*})'"*/ 3537;/*})'"*/
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.