1/* 2Name: Theme Base 3Written by: Okler Themes - (http://www.okler.net) 4Theme Version: 4.9.1 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 // Add Theme Class 188 $el.addClass('owl-theme'); 189 190 // Force RTL according to HTML dir attribute 191 if ($('html').attr('dir') == 'rtl') { 192 this.options = $.extend(true, {}, this.options, { 193 rtl: true 194 }); 195 } 196 197 if (this.options.items == 1) { 198 this.options.responsive = {} 199 } 200 201 if (this.options.items > 4) { 202 this.options = $.extend(true, {}, this.options, { 203 responsive: { 204 1199: { 205 items: this.options.items 206 } 207 } 208 }); 209 } 210 211 // Auto Height Fixes 212 if (this.options.autoHeight) { 213 $(window).afterResize(function() { 214 $el.find('.owl-stage-outer').height( $el.find('.owl-item.active').height() ); 215 }); 216 217 $(window).on('load', function() { 218 $el.find('.owl-stage-outer').height( $el.find('.owl-item.active').height() ); 219 }); 220 } 221 222 // Initialize OwlCarousel 223 $el.owlCarousel(this.options).addClass('owl-carousel-init'); 224 225 return this; 226 } 227 }; 228 229 // expose to scope 230 $.extend(theme, { 231 PluginCarousel: PluginCarousel 232 }); 233 234 // jquery plugin 235 $.fn.themePluginCarousel = function(opts) { 236 return this.map(function() { 237 var $this = $(this); 238 239 if ($this.data(instanceName)) { 240 return $this.data(instanceName); 241 } else { 242 return new PluginCarousel($this, opts); 243 } 244 245 }); 246 } 247 248}).apply(this, [window.theme, jQuery]); 249 250// Chart Circular 251(function(theme, $) { 252 253 theme = theme || {}; 254 255 var instanceName = '__chartCircular'; 256 257 var PluginChartCircular = function($el, opts) { 258 return this.initialize($el, opts); 259 }; 260 261 PluginChartCircular.defaults = { 262 accX: 0, 263 accY: -150, 264 delay: 1, 265 barColor: '#0088CC', 266 trackColor: '#f2f2f2', 267 scaleColor: false, 268 scaleLength: 5, 269 lineCap: 'round', 270 lineWidth: 13, 271 size: 175, 272 rotate: 0, 273 animate: ({ 274 duration: 2500, 275 enabled: true 276 }) 277 }; 278 279 PluginChartCircular.prototype = { 280 initialize: function($el, opts) { 281 if ($el.data(instanceName)) { 282 return this; 283 } 284 285 this.$el = $el; 286 287 this 288 .setData() 289 .setOptions(opts) 290 .build(); 291 292 return this; 293 }, 294 295 setData: function() { 296 this.$el.data(instanceName, this); 297 298 return this; 299 }, 300 301 setOptions: function(opts) { 302 this.options = $.extend(true, {}, PluginChartCircular.defaults, opts, { 303 wrapper: this.$el 304 }); 305 306 return this; 307 }, 308 309 build: function() { 310 if (!($.isFunction($.fn.appear)) || !($.isFunction($.fn.easyPieChart))) { 311 return this; 312 } 313 314 var self = this, 315 $el = this.options.wrapper, 316 value = ($el.attr('data-percent') ? $el.attr('data-percent') : 0), 317 percentEl = $el.find('.percent'); 318 319 $.extend(true, self.options, { 320 onStep: function(from, to, currentValue) { 321 percentEl.html(parseInt(currentValue)); 322 } 323 }); 324 325 $el.attr('data-percent', 0); 326
327 $el.appear(function() { 328 329 $el.easyPieChart(self.options); 330 331 setTimeout(function() { 332 333 $el.data('easyPieChart').update(value); 334 $el.attr('data-percent', value); 335 336 }, self.options.delay); 337 338 }, { 339 accX: self.options.accX, 340 accY: self.options.accY 341 }); 342 343 return this; 344 } 345 }; 346 347 // expose to scope 348 $.extend(theme, { 349 PluginChartCircular: PluginChartCircular 350 }); 351 352 // jquery plugin 353 $.fn.themePluginChartCircular = function(opts) { 354 return this.map(function() { 355 var $this = $(this); 356 357 if ($this.data(instanceName)) { 358 return $this.data(instanceName); 359 } else { 360 return new PluginChartCircular($this, opts); 361 } 362 363 }); 364 } 365 366}).apply(this, [window.theme, jQuery]); 367 368// Counter 369(function(theme, $) { 370 371 theme = theme || {}; 372 373 var instanceName = '__counter'; 374 375 var PluginCounter = function($el, opts) { 376 return this.initialize($el, opts); 377 }; 378 379 PluginCounter.defaults = { 380 accX: 0, 381 accY: 0, 382 speed: 3000, 383 refreshInterval: 100, 384 decimals: 0, 385 onUpdate: null, 386 onComplete: null 387 }; 388 389 PluginCounter.prototype = { 390 initialize: function($el, opts) { 391 if ($el.data(instanceName)) { 392 return this; 393 } 394 395 this.$el = $el; 396 397 this 398 .setData() 399 .setOptions(opts) 400 .build(); 401 402 return this; 403 }, 404 405 setData: function() { 406 this.$el.data(instanceName, this); 407 408 return this; 409 }, 410 411 setOptions: function(opts) { 412 this.options = $.extend(true, {}, PluginCounter.defaults, opts, { 413 wrapper: this.$el 414 }); 415 416 return this; 417 }, 418 419 build: function() { 420 if (!($.isFunction($.fn.countTo))) { 421 return this; 422 } 423 424 var self = this, 425 $el = this.options.wrapper; 426 427 $.extend(self.options, { 428 onComplete: function() { 429 if ($el.data('append')) { 430 $el.html($el.html() + $el.data('append')); 431 } 432 433 if ($el.data('prepend')) { 434 $el.html($el.data('prepend') + $el.html()); 435 } 436 } 437 }); 438 439 $el.appear(function() { 440 441 $el.countTo(self.options); 442 443 }, { 444 accX: self.options.accX, 445 accY: self.options.accY 446 }); 447 448 return this; 449 } 450 }; 451 452 // expose to scope 453 $.extend(theme, { 454 PluginCounter: PluginCounter 455 }); 456 457 // jquery plugin 458 $.fn.themePluginCounter = function(opts) { 459 return this.map(function() { 460 var $this = $(this); 461 462 if ($this.data(instanceName)) { 463 return $this.data(instanceName); 464 } else { 465 return new PluginCounter($this, opts); 466 } 467 468 }); 469 } 470 471}).apply(this, [window.theme, jQuery]); 472 473// Lazy Load 474(function(theme, $) { 475 476 theme = theme || {}; 477 478 var instanceName = '__lazyload'; 479 480 var PluginLazyLoad = function($el, opts) { 481 return this.initialize($el, opts); 482 }; 483 484 PluginLazyLoad.defaults = { 485 effect : 'fadeIn' 486 }; 487 488 PluginLazyLoad.prototype = { 489 initialize: function($el, opts) { 490 if ($el.data(instanceName)) { 491 return this; 492 } 493 494 this.$el = $el; 495 496 this 497 .setData() 498 .setOptions(opts) 499 .build(); 500 501 return this; 502 }, 503 504 setData: function() { 505 this.$el.data(instanceName, this); 506 507 return this; 508 }, 509 510 setOptions: function(opts) { 511 this.options = $.extend(true, {}, PluginLazyLoad.defaults, opts, { 512 wrapper: this.$el 513 }); 514 515 return this; 516 }, 517 518 build: function() { 519 if (!($.isFunction($.fn.lazyload))) { 520 return this; 521 } 522 523 var self = this; 524 525 self.options.wrapper.lazyload(this.options); 526 527 return this; 528 } 529 }; 530 531 // expose to scope 532 $.extend(theme, { 533 PluginLazyLoad: PluginLazyLoad 534 }); 535 536 // jquery plugin 537 $.fn.themePluginLazyLoad = function(opts) { 538 return this.map(function() { 539 var $this = $(this); 540 541 if ($this.data(instanceName)) { 542 return $this.data(instanceName); 543 } else { 544 return new PluginLazyLoad($this, opts); 545 } 546 547 }); 548 } 549 550}).apply(this, [window.theme, jQuery]); 551 552// Lightbox 553(function(theme, $) { 554 555 theme = theme || {}; 556 557 var instanceName = '__lightbox'; 558 559 var PluginLightbox = function($el, opts) { 560 return this.initialize($el, opts); 561 }; 562 563 PluginLightbox.defaults = { 564 tClose: 'Close (Esc)', // Alt text on close button 565 tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys 566 gallery: { 567 tPrev: 'Previous (Left arrow key)', // Alt text on left arrow 568 tNext: 'Next (Right arrow key)', // Alt text on right arrow 569 tCounter: '%curr% of %total%' // Markup for "1 of 7" counter 570 }, 571 image: { 572 tError: '<a href="%url%">The image</a> could not be loaded.' // Error message when image could not be loaded 573 }, 574 ajax: { 575 tError: '<a href="%url%">The content</a> could not be loaded.' // Error message when ajax request failed 576 }, 577 callbacks: { 578 open: function() { 579 $('html').addClass('lightbox-opened'); 580 }, 581 close: function() { 582 $('html').removeClass('lightbox-opened'); 583 } 584 } 585 }; 586 587 PluginLightbox.prototype = { 588 initialize: function($el, opts) { 589 if ($el.data(instanceName)) { 590 return this; 591 } 592 593 this.$el = $el; 594 595 this 596 .setData() 597 .setOptions(opts) 598 .build(); 599 600 return this; 601 }, 602 603 setData: function() { 604 this.$el.data(instanceName, this); 605 606 return this; 607 }, 608 609 setOptions: function(opts) { 610 this.options = $.extend(true, {}, PluginLightbox.defaults, opts, { 611 wrapper: this.$el 612 }); 613 614 return this; 615 }, 616 617 build: function() { 618 if (!($.isFunction($.fn.magnificPopup))) { 619 return this; 620 } 621 622 this.options.wrapper.magnificPopup(this.options); 623 624 return this; 625 } 626 }; 627 628 // expose to scope 629 $.extend(theme, { 630 PluginLightbox: PluginLightbox 631 }); 632 633 // jquery plugin 634 $.fn.themePluginLightbox = function(opts) { 635 return this.map(function() { 636 var $this = $(this); 637 638 if ($this.data(instanceName)) { 639 return $this.data(instanceName); 640 } else { 641 return new PluginLightbox($this, opts); 642 } 643 644 }); 645 } 646 647}).apply(this, [window.theme, jQuery]); 648 649// Loading Overlay 650(function(theme, $) { 651 652 'use strict'; 653 654 theme = theme || {}; 655 656 var loadingOverlayTemplate = [ 657 '<div class="loading-overlay">', 658 '<div class="loader"></div>', 659 '</div>' 660 ].join(''); 661 662 var LoadingOverlay = function( $wrapper, options ) { 663 return this.initialize( $wrapper, options ); 664 }; 665 666 LoadingOverlay.prototype = { 667 668 options: { 669 css: {} 670 }, 671 672 initialize: function( $wrapper, options ) { 673 this.$wrapper = $wrapper; 674 675 this 676 .setVars() 677 .setOptions( options ) 678 .build() 679 .events(); 680 681 this.$wrapper.data( 'loadingOverlay', this ); 682 }, 683 684 setVars: function() {
685 this.$overlay = this.$wrapper.find('.loading-overlay'); 686 687 return this; 688 }, 689 690 setOptions: function( options ) { 691 if ( !this.$overlay.get(0) ) { 692 this.matchProperties(); 693 } 694 this.options = $.extend( true, {}, this.options, options ); 695 this.loaderClass = this.getLoaderClass( this.options.css.backgroundColor ); 696 697 return this; 698 }, 699 700 build: function() { 701 if ( !this.$overlay.closest(document.documentElement).get(0) ) { 702 if ( !this.$cachedOverlay ) { 703 this.$overlay = $( loadingOverlayTemplate ).clone(); 704 705 if ( this.options.css ) { 706 this.$overlay.css( this.options.css ); 707 this.$overlay.find( '.loader' ).addClass( this.loaderClass ); 708 } 709 } else { 710 this.$overlay = this.$cachedOverlay.clone(); 711 } 712 713 this.$wrapper.append( this.$overlay ); 714 } 715 716 if ( !this.$cachedOverlay ) { 717 this.$cachedOverlay = this.$overlay.clone(); 718 } 719 720 return this; 721 }, 722 723 events: function() { 724 var _self = this; 725 726 if ( this.options.startShowing ) { 727 _self.show(); 728 } 729 730 if ( this.$wrapper.is('body') || this.options.hideOnWindowLoad ) { 731 $( window ).on( 'load error', function() { 732 _self.hide(); 733 }); 734 } 735 736 if ( this.options.listenOn ) { 737 $( this.options.listenOn ) 738 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 739 e.stopPropagation(); 740 _self.show(); 741 }) 742 .on( 'loading-overlay:hide complete.ic', function( e ) { 743 e.stopPropagation(); 744 _self.hide(); 745 }); 746 } 747 748 this.$wrapper 749 .on( 'loading-overlay:show beforeSend.ic', function( e ) { 750 e.stopPropagation(); 751 _self.show(); 752 }) 753 .on( 'loading-overlay:hide complete.ic', function( e ) { 754 e.stopPropagation(); 755 _self.hide(); 756 }); 757 758 return this; 759 }, 760 761 show: function() { 762 this.build(); 763 764 this.position = this.$wrapper.css( 'position' ).toLowerCase(); 765 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 766 this.$wrapper.css({ 767 position: 'relative' 768 }); 769 } 770 this.$wrapper.addClass( 'loading-overlay-showing' ); 771 }, 772 773 hide: function() { 774 var _self = this; 775 776 this.$wrapper.removeClass( 'loading-overlay-showing' ); 777 setTimeout(function() { 778 if ( this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed' ) { 779 _self.$wrapper.css({ position: '' }); 780 } 781 }, 500); 782 }, 783 784 matchProperties: function() { 785 var i, 786 l, 787 properties; 788 789 properties = [ 790 'backgroundColor', 791 'borderRadius' 792 ]; 793 794 l = properties.length; 795 796 for( i = 0; i < l; i++ ) { 797 var obj = {}; 798 obj[ properties[ i ] ] = this.$wrapper.css( properties[ i ] ); 799 800 $.extend( this.options.css, obj ); 801 } 802 }, 803 804 getLoaderClass: function( backgroundColor ) { 805 if ( !backgroundColor || backgroundColor === 'transparent' || backgroundColor === 'inherit' ) { 806 return 'black'; 807 } 808 809 var hexColor, 810 r, 811 g, 812 b, 813 yiq; 814 815 var colorToHex = function( color ){ 816 var hex, 817 rgb; 818 819 if( color.indexOf('#') >- 1 ){ 820 hex = color.replace('#', ''); 821 } else { 822 rgb = color.match(/\d+/g); 823 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); 824 } 825 826 if ( hex.length === 3 ) { 827 hex = hex + hex; 828 } 829 830 return hex; 831 }; 832 833 hexColor = colorToHex( backgroundColor ); 834 835 r = parseInt( hexColor.substr( 0, 2), 16 ); 836 g = parseInt( hexColor.substr( 2, 2), 16 ); 837 b = parseInt( hexColor.substr( 4, 2), 16 ); 838 yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 839 840 return ( yiq >= 128 ) ? 'black' : 'white'; 841 } 842 843 }; 844 845 // expose to scope 846 $.extend(theme, { 847 LoadingOverlay: LoadingOverlay 848 }); 849 850 // expose as a jquery plugin 851 $.fn.loadingOverlay = function( opts ) { 852 return this.each(function() { 853 var $this = $( this ); 854 855 var loadingOverlay = $this.data( 'loadingOverlay' ); 856 if ( loadingOverlay ) { 857 return loadingOverlay; 858 } else { 859 var options = opts || $this.data( 'loading-overlay-options' ) || {}; 860 return new LoadingOverlay( $this, options ); 861 } 862 }); 863 } 864 865 // auto init 866 $(function() { 867 $('[data-loading-overlay]').loadingOverlay(); 868 }); 869 870}).apply(this, [window.theme, jQuery]); 871 872// Masonry 873(function(theme, $) { 874 875 theme = theme || {}; 876 877 var instanceName = '__masonry'; 878 879 var PluginMasonry = function($el, opts) { 880 return this.initialize($el, opts); 881 }; 882 883 PluginMasonry.defaults = { 884 itemSelector: 'li' 885 }; 886 887 PluginMasonry.prototype = { 888 initialize: function($el, opts) { 889 if ($el.data(instanceName)) { 890 return this; 891 } 892 893 this.$el = $el; 894 895 this 896 .setData() 897 .setOptions(opts) 898 .build(); 899 900 return this; 901 }, 902 903 setData: function() { 904 this.$el.data(instanceName, this); 905 906 return this; 907 }, 908 909 setOptions: function(opts) { 910 this.options = $.extend(true, {}, PluginMasonry.defaults, opts, { 911 wrapper: this.$el 912 }); 913 914 return this; 915 }, 916 917 build: function() { 918 if (!($.isFunction($.fn.isotope))) { 919 return this; 920 } 921 922 this.options.wrapper.isotope(this.options); 923 924 return this; 925 } 926 }; 927 928 // expose to scope 929 $.extend(theme, { 930 PluginMasonry: PluginMasonry 931 }); 932 933 // jquery plugin 934 $.fn.themePluginMasonry = function(opts) { 935 return this.map(function() { 936 var $this = $(this); 937 938 $this.waitForImages(function() { 939 if ($this.data(instanceName)) { 940 return $this.data(instanceName); 941 } else { 942 return new PluginMasonry($this, opts); 943 } 944 }); 945 946 }); 947 } 948 949}).apply(this, [window.theme, jQuery]); 950 951// Match Height 952(function(theme, $) { 953 954 theme = theme || {}; 955 956 var instanceName = '__matchHeight'; 957 958 var PluginMatchHeight = function($el, opts) { 959 return this.initialize($el, opts); 960 }; 961 962 PluginMatchHeight.defaults = { 963 byRow: true, 964 property: 'height', 965 target: null, 966 remove: false 967 }; 968 969 PluginMatchHeight.prototype = { 970 initialize: function($el, opts) { 971 if ($el.data(instanceName)) { 972 return this; 973 } 974 975 this.$el = $el; 976 977 this 978 .setData() 979 .setOptions(opts) 980 .build(); 981 982 return this; 983 }, 984 985 setData: function() { 986 this.$el.data(instanceName, this); 987 988 return this; 989 }, 990 991 setOptions: function(opts) { 992 this.options = $.extend(true, {}, PluginMatchHeight.defaults, opts, { 993 wrapper: this.$el 994 }); 995 996 return this; 997 }, 998 999 build: function() { 1000 if (!($.isFunction($.fn.matchHeight))) { 1001 return this; 1002 } 1003 1004 var self = this; 1005 1006 self.options.wrapper.matchHeight(self.options); 1007 1008 return this; 1009 } 1010 1011 }; 1012 1013 // expose to scope 1014 $.extend(theme, { 1015 PluginMatchHeight: PluginMatchHeight 1016 }); 1017 1018 // jquery plugin 1019 $.fn.themePluginMatchHeight = function(opts) { 1020 return this.map(function() { 1021 var $this = $(this); 1022 1023 if ($this.data(instanceName)) { 1024 return $this.data(instanceName); 1025 } else { 1026 return new PluginMatchHeight($this, opts); 1027 } 1028 1029 }); 1030 } 1031 1032}).apply(this, [window.theme, jQuery]); 1033 1034// Parallax 1035(function(theme, $) { 1036 1037 theme = theme || {}; 1038 1039 var instanceName = '__parallax'; 1040 1041 var PluginParallax = function($el, opts) { 1042 return this.initialize($el, opts); 1043 }; 1044 1045 PluginParallax.defaults = { 1046 speed: 1.5, 1047 horizontalPosition: '50%', 1048 offset: 0 1049 }; 1050 1051 PluginParallax.prototype = { 1052 initialize: function($el, opts) { 1053 if ($el.data(instanceName)) { 1054 return this; 1055 } 1056 1057 this.$el = $el; 1058 1059 this 1060 .setData() 1061 .setOptions(opts) 1062 .build(); 1063 1064 return this; 1065 }, 1066 1067 setData: function() { 1068 this.$el.data(instanceName, this); 1069 1070 return this; 1071 }, 1072 1073 setOptions: function(opts) { 1074 this.options = $.extend(true, {}, PluginParallax.defaults, opts, { 1075 wrapper: this.$el 1076 }); 1077 1078 return this; 1079 }, 1080 1081 build: function() { 1082 var self = this, 1083 $window = $(window), 1084 offset, 1085 yPos, 1086 bgpos; 1087 1088 self.options.wrapper.css('background-image', 'url(' + self.options.wrapper.data('image-src') + ')'); 1089 1090 if (!$.browser.mobile) { 1091 1092 $window.on('scroll resize', function() { 1093 offset = self.options.wrapper.offset(); 1094 yPos = -($window.scrollTop() - offset.top) / self.options.speed + (self.options.offset); 1095 bgpos = self.options.horizontalPosition + ' ' + yPos + 'px'; 1096 self.options.wrapper.css('background-position', bgpos); 1097 }); 1098 1099 $window.trigger('scroll'); 1100 1101 } else { 1102 self.options.wrapper.addClass('parallax-disabled'); 1103 } 1104 1105 return this; 1106 } 1107 }; 1108 1109 // expose to scope 1110 $.extend(theme, { 1111 PluginParallax: PluginParallax 1112 }); 1113 1114 // jquery plugin 1115 $.fn.themePluginParallax = function(opts) { 1116 return this.map(function() { 1117 var $this = $(this); 1118 1119 if ($this.data(instanceName)) { 1120 return $this.data(instanceName); 1121 } else { 1122 return new PluginParallax($this, opts); 1123 } 1124 1125 }); 1126 } 1127 1128}).apply(this, [window.theme, jQuery]); 1129 1130// Progress Bar 1131(function(theme, $) { 1132 1133 theme = theme || {}; 1134 1135 var instanceName = '__progressBar'; 1136 1137 var PluginProgressBar = function($el, opts) { 1138 return this.initialize($el, opts); 1139 }; 1140 1141 PluginProgressBar.defaults = { 1142 accX: 0, 1143 accY: -50, 1144 delay: 1 1145 }; 1146 1147 PluginProgressBar.prototype = { 1148 initialize: function($el, opts) { 1149 if ($el.data(instanceName)) { 1150 return this; 1151 } 1152 1153 this.$el = $el; 1154 1155 this 1156 .setData() 1157 .setOptions(opts) 1158 .build(); 1159 1160 return this; 1161 }, 1162 1163 setData: function() { 1164 this.$el.data(instanceName, this); 1165 1166 return this; 1167 }, 1168 1169 setOptions: function(opts) { 1170 this.options = $.extend(true, {}, PluginProgressBar.defaults, opts, { 1171 wrapper: this.$el 1172 }); 1173 1174 return this; 1175 }, 1176 1177 build: function() { 1178 if (!($.isFunction($.fn.appear))) { 1179 return this; 1180 } 1181 1182 var self = this, 1183 $el = this.options.wrapper,
1184 delay = 1; 1185 1186 $el.appear(function() { 1187 1188 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 1189 1190 $el.addClass($el.attr('data-appear-animation')); 1191 1192 setTimeout(function() { 1193 1194 $el.animate({ 1195 width: $el.attr('data-appear-progress-animation') 1196 }, 1500, 'easeOutQuad', function() { 1197 $el.find('.progress-bar-tooltip').animate({ 1198 opacity: 1 1199 }, 500, 'easeOutQuad'); 1200 }); 1201 1202 }, delay); 1203 1204 }, { 1205 accX: self.options.accX, 1206 accY: self.options.accY 1207 }); 1208 1209 return this; 1210 } 1211 }; 1212 1213 // expose to scope 1214 $.extend(theme, { 1215 PluginProgressBar: PluginProgressBar 1216 }); 1217 1218 // jquery plugin 1219 $.fn.themePluginProgressBar = function(opts) { 1220 return this.map(function() { 1221 var $this = $(this); 1222 1223 if ($this.data(instanceName)) { 1224 return $this.data(instanceName); 1225 } else { 1226 return new PluginProgressBar($this, opts); 1227 } 1228 1229 }); 1230 } 1231 1232}).apply(this, [window.theme, jQuery]); 1233 1234// Revolution Slider 1235(function(theme, $) { 1236 1237 theme = theme || {}; 1238 1239 var instanceName = '__revolution'; 1240 1241 var PluginRevolutionSlider = function($el, opts) { 1242 return this.initialize($el, opts); 1243 }; 1244 1245 PluginRevolutionSlider.defaults = { 1246 sliderType: 'standard', 1247 sliderLayout: 'fullwidth', 1248 delay: 9000, 1249 gridwidth: 1170, 1250 gridheight: 500, 1251 spinner: 'spinner3', 1252 parallax: { 1253 type: 'off', 1254 bgparallax: 'off' 1255 }, 1256 navigation: { 1257 keyboardNavigation: 'off', 1258 keyboard_direction: 'horizontal', 1259 mouseScrollNavigation: 'off', 1260 onHoverStop: 'off', 1261 touch: { 1262 touchenabled: 'on', 1263 swipe_threshold: 75, 1264 swipe_min_touches: 1, 1265 swipe_direction: 'horizontal', 1266 drag_block_vertical: false 1267 }, 1268 arrows: { 1269 enable: true, 1270 hide_onmobile: false, 1271 hide_under: 0, 1272 hide_onleave: true, 1273 hide_delay: 200, 1274 hide_delay_mobile: 1200, 1275 left: { 1276 h_align: 'left', 1277 v_align: 'center', 1278 h_offset: 30, 1279 v_offset: 0 1280 }, 1281 right: { 1282 h_align: 'right', 1283 v_align: 'center', 1284 h_offset: 30, 1285 v_offset: 0 1286 } 1287 } 1288 } 1289 }; 1290 1291 PluginRevolutionSlider.prototype = { 1292 initialize: function($el, opts) { 1293 if ($el.data(instanceName)) { 1294 return this; 1295 } 1296 1297 this.$el = $el; 1298 1299 this 1300 .setData() 1301 .setOptions(opts) 1302 .build() 1303 .events(); 1304 1305 return this; 1306 }, 1307 1308 setData: function() { 1309 this.$el.data(instanceName, this); 1310 1311 return this; 1312 }, 1313 1314 setOptions: function(opts) { 1315 this.options = $.extend(true, {}, PluginRevolutionSlider.defaults, opts, { 1316 wrapper: this.$el 1317 }); 1318 1319 return this; 1320 }, 1321 1322 build: function() { 1323 if (!($.isFunction($.fn.revolution))) { 1324 return this; 1325 } 1326 1327 // Single Slider Class 1328 if(this.options.wrapper.find('> ul > li').length == 1) { 1329 this.options.wrapper.addClass('slider-single-slide'); 1330 } 1331 1332 this.options.wrapper.revolution(this.options); 1333 1334 return this; 1335 }, 1336 1337 events: function() { 1338 1339 return this; 1340 } 1341 }; 1342 1343 // expose to scope 1344 $.extend(theme, { 1345 PluginRevolutionSlider: PluginRevolutionSlider 1346 }); 1347 1348 // jquery plugin 1349 $.fn.themePluginRevolutionSlider = function(opts) { 1350 return this.map(function() { 1351 var $this = $(this); 1352 1353 if ($this.data(instanceName)) { 1354 return $this.data(instanceName); 1355 } else { 1356 return new PluginRevolutionSlider($this, opts); 1357 } 1358 1359 }); 1360 } 1361 1362}).apply(this, [window.theme, jQuery]); 1363 1364// Scroll to Top 1365(function(theme, $) { 1366 1367 theme = theme || {}; 1368 1369 $.extend(theme, { 1370 1371 PluginScrollToTop: { 1372 1373 defaults: { 1374 wrapper: $('body'), 1375 offset: 150, 1376 buttonClass: 'scroll-to-top', 1377 iconClass: 'fa fa-chevron-up', 1378 delay: 1000, 1379 visibleMobile: false, 1380 label: false, 1381 easing: 'easeOutBack' 1382 }, 1383 1384 initialize: function(opts) { 1385 initialized = true; 1386 1387 this 1388 .setOptions(opts) 1389 .build() 1390 .events(); 1391 1392 return this; 1393 }, 1394 1395 setOptions: function(opts) { 1396 this.options = $.extend(true, {}, this.defaults, opts); 1397 1398 return this; 1399 }, 1400 1401 build: function() { 1402 var self = this, 1403 $el; 1404 1405 // Base HTML Markup 1406 $el = $('<a />') 1407 .addClass(self.options.buttonClass) 1408 .attr({ 1409 'href': '#', 1410 }) 1411 .append( 1412 $('<i />') 1413 .addClass(self.options.iconClass) 1414 ); 1415 1416 // Visible Mobile 1417 if (!self.options.visibleMobile) { 1418 $el.addClass('hidden-mobile'); 1419 } 1420 1421 // Label 1422 if (self.options.label) { 1423 $el.append( 1424 $('<span />').html(self.options.label) 1425 ); 1426 } 1427 1428 this.options.wrapper.append($el); 1429 1430 this.$el = $el; 1431 1432 return this; 1433 }, 1434 1435 events: function() { 1436 var self = this, 1437 _isScrolling = false; 1438 1439 // Click Element Action 1440 self.$el.on('click', function(e) { 1441 e.preventDefault(); 1442 $('body, html').animate({ 1443 scrollTop: 0 1444 }, self.options.delay, self.options.easing); 1445 return false; 1446 }); 1447 1448 // Show/Hide Button on Window Scroll event. 1449 $(window).scroll(function() { 1450 1451 if (!_isScrolling) { 1452 1453 _isScrolling = true; 1454 1455 if ($(window).scrollTop() > self.options.offset) { 1456 1457 self.$el.stop(true, true).addClass('visible'); 1458 _isScrolling = false; 1459 1460 } else { 1461 1462 self.$el.stop(true, true).removeClass('visible'); 1463 _isScrolling = false; 1464 1465 } 1466 1467 } 1468 1469 }); 1470 1471 return this; 1472 } 1473 1474 } 1475 1476 }); 1477 1478}).apply(this, [window.theme, jQuery]); 1479 1480// Sort 1481(function(theme, $) { 1482 1483 theme = theme || {}; 1484 1485 var instanceName = '__sort'; 1486 1487 var PluginSort = function($el, opts) { 1488 return this.initialize($el, opts); 1489 }; 1490 1491 PluginSort.defaults = { 1492 useHash: true, 1493 itemSelector: '.isotope-item', 1494 layoutMode: 'masonry', 1495 filter: '*', 1496 hiddenStyle: { 1497 opacity: 0 1498 }, 1499 visibleStyle: { 1500 opacity: 1 1501 }, 1502 stagger: 30, 1503 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 1504 }; 1505 1506 PluginSort.prototype = { 1507 initialize: function($el, opts) { 1508 if ($el.data(instanceName)) { 1509 return this; 1510 } 1511 1512 this.$el = $el; 1513 1514 this 1515 .setData() 1516 .setOptions(opts) 1517 .build(); 1518 1519 return this; 1520 }, 1521 1522 setData: function() { 1523 this.$el.data(instanceName, this); 1524 1525 return this; 1526 }, 1527 1528 setOptions: function(opts) { 1529 this.options = $.extend(true, {}, PluginSort.defaults, opts, { 1530 wrapper: this.$el 1531 }); 1532 1533 return this; 1534 }, 1535 1536 build: function() { 1537 if (!($.isFunction($.fn.isotope))) { 1538 return this; 1539 } 1540 1541 var self = this, 1542 $source = this.options.wrapper, 1543 $destination = $('.sort-destination[data-sort-id="' + $source.attr('data-sort-id') + '"]'), 1544 $window = $(window); 1545 1546 if ($destination.get(0)) { 1547 1548 self.$source = $source; 1549 self.$destination = $destination; 1550 self.$loader = false; 1551 1552 self.setParagraphHeight($destination); 1553
1554 if (self.$destination.parents('.sort-destination-loader').get(0)) { 1555 self.$loader = self.$destination.parents('.sort-destination-loader'); 1556 self.createLoader(); 1557 } 1558 1559 self.$destination.waitForImages(function() { 1560 1561 $destination.attr('data-filter', '*').isotope(self.options).isotope('layout').trigger('filtered'); 1562 1563 self.$destination.isotope('on', 'layoutComplete', function(event, laidOutItems) { 1564 if (self.options.useHash) { 1565 if (window.location.hash != '' || self.options.filter.replace('.', '') != '*') { 1566 window.location.hash = self.options.filter.replace('.', ''); 1567 } 1568 } 1569 }); 1570 1571 self.events(); 1572 1573 $source.trigger('filtered'); 1574 1575 if (self.$loader) { 1576 self.$loader.removeClass('sort-destination-loader-showing'); 1577 1578 setTimeout(function() { 1579 self.$loader.addClass('sort-destination-loader-loaded'); 1580 }, 500); 1581 } 1582 1583 }); 1584 1585 $window.on('resize', function() { 1586 setTimeout(function() { 1587 self.$destination.isotope('layout'); 1588 }, 300); 1589 }); 1590 1591 setTimeout(function() { 1592 if (self.$loader) { 1593 self.$loader.removeClass('sort-destination-loader-showing'); 1594 1595 setTimeout(function() { 1596 self.$loader.addClass('sort-destination-loader-loaded'); 1597 }, 500); 1598 } 1599 }, 3000); 1600 1601 } 1602 1603 return this; 1604 }, 1605 1606 events: function() { 1607 var self = this, 1608 filter = null; 1609 1610 self.$source.find('a').click(function(e) { 1611 e.preventDefault(); 1612 1613 filter = $(this).parent().data('option-value'); 1614 1615 self.setFilter(filter); 1616 1617 if (e.originalEvent) { 1618 self.$source.trigger('filtered'); 1619 } 1620 1621 return this; 1622 }); 1623 1624 if (self.options.useHash) { 1625 self.hashEvents(); 1626 } 1627 1628 return this; 1629 }, 1630 1631 setFilter: function(filter) { 1632 var self = this, 1633 page = false, 1634 currentFilter = filter; 1635 1636 self.$source.find('li.active').removeClass('active'); 1637 self.$source.find('li[data-option-value="' + filter + '"]').addClass('active'); 1638 1639 self.options.filter = currentFilter; 1640 1641 if (self.$destination.attr('data-current-page')) { 1642 currentFilter = currentFilter + '[data-page-rel=' + self.$destination.attr('data-current-page') + ']'; 1643 } 1644 1645 self.$destination.attr('data-filter', filter).isotope({ 1646 filter: currentFilter 1647 }) 1648 // zpusobovalo vykonostni problemy (dlouhe nacitani) a nemelo by mit vliv na funkcnost - proto zakomentovano 1649// .on('arrangeComplete', function( event, filteredItems ) { 1650// $(window).trigger('scroll'); 1651// }) 1652 .trigger('filtered'); 1653 1654 return this; 1655 }, 1656 1657 hashEvents: function() { 1658 var self = this, 1659 hash = null, 1660 hashFilter = null, 1661 initHashFilter = '.' + location.hash.replace('#', ''); 1662 1663 if (initHashFilter != '.' && initHashFilter != '.*') { 1664 self.setFilter(initHashFilter); 1665 } 1666 1667 $(window).bind('hashchange', function(e) { 1668 1669 hashFilter = '.' + location.hash.replace('#', ''); 1670 hash = (hashFilter == '.' || hashFilter == '.*' ? '*' : hashFilter); 1671 1672 self.setFilter(hash); 1673 1674 }); 1675 1676 return this; 1677 }, 1678 1679 setParagraphHeight: function() { 1680 var self = this, 1681 minParagraphHeight = 0, 1682 paragraphs = $('span.thumb-info-caption p', self.$destination); 1683 1684 paragraphs.each(function() { 1685 if ($(this).height() > minParagraphHeight) { 1686 minParagraphHeight = ($(this).height() + 10);
1687 } 1688 }); 1689 1690 paragraphs.height(minParagraphHeight); 1691 1692 return this; 1693 }, 1694 1695 createLoader: function() { 1696 var self = this; 1697 1698 var loaderTemplate = [ 1699 '<div class="bounce-loader">', 1700 '<div class="bounce1"></div>', 1701 '<div class="bounce2"></div>', 1702 '<div class="bounce3"></div>', 1703 '</div>' 1704 ].join(''); 1705 1706 self.$loader.append(loaderTemplate); 1707 1708 return this; 1709 } 1710 1711 }; 1712 1713 // expose to scope 1714 $.extend(theme, { 1715 PluginSort: PluginSort 1716 }); 1717 1718 // jquery plugin 1719 $.fn.themePluginSort = function(opts) { 1720 return this.map(function() { 1721 var $this = $(this); 1722 1723 if ($this.data(instanceName)) { 1724 return $this.data(instanceName); 1725 } else { 1726 return new PluginSort($this, opts); 1727 } 1728 1729 }); 1730 } 1731 1732}).apply(this, [window.theme, jQuery]); 1733 1734// Sticky 1735(function(theme, $) { 1736 1737 theme = theme || {}; 1738 1739 var instanceName = '__sticky'; 1740 1741 var PluginSticky = function($el, opts) { 1742 return this.initialize($el, opts); 1743 }; 1744 1745 PluginSticky.defaults = { 1746 minWidth: 991, 1747 activeClass: 'sticky-active' 1748 }; 1749 1750 PluginSticky.prototype = { 1751 initialize: function($el, opts) { 1752 if ( $el.data( instanceName ) ) { 1753 return this; 1754 } 1755 1756 this.$el = $el; 1757 1758 this 1759 .setData() 1760 .setOptions(opts) 1761 .build(); 1762 1763 return this; 1764 }, 1765 1766 setData: function() { 1767 this.$el.data(instanceName, this); 1768 1769 return this; 1770 }, 1771 1772 setOptions: function(opts) { 1773 this.options = $.extend(true, {}, PluginSticky.defaults, opts, { 1774 wrapper: this.$el 1775 }); 1776 1777 return this; 1778 }, 1779 1780 build: function() { 1781 if (!($.isFunction($.fn.pin))) { 1782 return this; 1783 } 1784 1785 var self = this, 1786 $window = $(window); 1787 1788 self.options.wrapper.pin(self.options); 1789 1790 $window.afterResize(function() { 1791 self.options.wrapper.removeAttr('style').removeData('pin'); 1792 self.options.wrapper.pin(self.options); 1793 $window.trigger('scroll'); 1794 }); 1795 1796 return this; 1797 } 1798 }; 1799 1800 // expose to scope 1801 $.extend(theme, { 1802 PluginSticky: PluginSticky 1803 }); 1804 1805 // jquery plugin 1806 $.fn.themePluginSticky = function(opts) { 1807 return this.map(function() { 1808 var $this = $(this); 1809 1810 if ($this.data(instanceName)) { 1811 return $this.data(instanceName); 1812 } else { 1813 return new PluginSticky($this, opts); 1814 } 1815 1816 }); 1817 } 1818 1819}).apply(this, [ window.theme, jQuery ]); 1820 1821// Toggle 1822(function(theme, $) { 1823 1824 theme = theme || {}; 1825 1826 var instanceName = '__toggle'; 1827 1828 var PluginToggle = function($el, opts) { 1829 return this.initialize($el, opts); 1830 }; 1831 1832 PluginToggle.defaults = { 1833 duration: 350, 1834 isAccordion: false 1835 }; 1836 1837 PluginToggle.prototype = { 1838 initialize: function($el, opts) { 1839 if ($el.data(instanceName)) { 1840 return this; 1841 } 1842 1843 this.$el = $el; 1844 1845 this 1846 .setData() 1847 .setOptions(opts) 1848 .build(); 1849 1850 return this; 1851 }, 1852 1853 setData: function() { 1854 this.$el.data(instanceName, this); 1855 1856 return this; 1857 }, 1858 1859 setOptions: function(opts) { 1860 this.options = $.extend(true, {}, PluginToggle.defaults, opts, { 1861 wrapper: this.$el 1862 }); 1863 1864 return this; 1865 }, 1866 1867 build: function() { 1868 var self = this, 1869 $wrapper = this.options.wrapper, 1870 $items = $wrapper.find('.toggle'), 1871 $el = null; 1872 1873 $items.each(function() { 1874 $el = $(this); 1875 1876 if ($el.hasClass('active')) { 1877 $el.find('> p').addClass('preview-active'); 1878 $el.find('> .toggle-content').slideDown(self.options.duration); 1879 } 1880 1881 self.events($el); 1882 }); 1883 1884 if (self.options.isAccordion) { 1885 self.options.duration = self.options.duration / 2; 1886 } 1887 1888 return this; 1889 }, 1890 1891 events: function($el) { 1892 var self = this, 1893 previewParCurrentHeight = 0, 1894 previewParAnimateHeight = 0, 1895 toggleContent = null; 1896 1897 $el.find('> label').click(function(e) { 1898 1899 var $this = $(this), 1900 parentSection = $this.parent(), 1901 parentWrapper = $this.parents('.toggle'), 1902 previewPar = null, 1903 closeElement = null; 1904 1905 if (self.options.isAccordion && typeof(e.originalEvent) != 'undefined') { 1906 closeElement = parentWrapper.find('.toggle.active > label'); 1907 1908 if (closeElement[0] == $this[0]) { 1909 return; 1910 } 1911 } 1912 1913 parentSection.toggleClass('active'); 1914 1915 // Preview Paragraph 1916 if (parentSection.find('> p').get(0)) { 1917 1918 previewPar = parentSection.find('> p'); 1919 previewParCurrentHeight = previewPar.css('height'); 1920 previewPar.css('height', 'auto'); 1921 previewParAnimateHeight = previewPar.css('height'); 1922 previewPar.css('height', previewParCurrentHeight); 1923 1924 } 1925 1926 // Content 1927 toggleContent = parentSection.find('> .toggle-content'); 1928 1929 if (parentSection.hasClass('active')) { 1930 1931 $(previewPar).animate({ 1932 height: previewParAnimateHeight 1933 }, self.options.duration, function() { 1934 $(this).addClass('preview-active'); 1935 });
1936 1937 toggleContent.slideDown(self.options.duration, function() { 1938 if (closeElement) { 1939 closeElement.trigger('click'); 1940 } 1941 }); 1942 1943 } else { 1944 1945 $(previewPar).animate({ 1946 height: 0 1947 }, self.options.duration, function() { 1948 $(this).removeClass('preview-active'); 1949 }); 1950 1951 toggleContent.slideUp(self.options.duration); 1952 1953 } 1954 1955 }); 1956 } 1957 }; 1958 1959 // expose to scope 1960 $.extend(theme, { 1961 PluginToggle: PluginToggle 1962 }); 1963 1964 // jquery plugin 1965 $.fn.themePluginToggle = function(opts) { 1966 return this.map(function() { 1967 var $this = $(this); 1968 1969 if ($this.data(instanceName)) { 1970 return $this.data(instanceName); 1971 } else { 1972 return new PluginToggle($this, opts); 1973 } 1974 1975 }); 1976 } 1977 1978}).apply(this, [window.theme, jQuery]); 1979 1980// Tweets 1981(function(theme, $) { 1982 1983 theme = theme || {}; 1984 1985 var instanceName = '__tweets'; 1986 1987 var PluginTweets = function($el, opts) { 1988 return this.initialize($el, opts); 1989 }; 1990 1991 PluginTweets.defaults = { 1992 username: null, 1993 count: 2, 1994 URL: 'php/twitter-feed.php' 1995 }; 1996 1997 PluginTweets.prototype = { 1998 initialize: function($el, opts) { 1999 if ($el.data(instanceName)) { 2000 return this; 2001 } 2002 2003 this.$el = $el; 2004 2005 this 2006 .setData() 2007 .setOptions(opts) 2008 .build(); 2009 2010 return this; 2011 }, 2012 2013 setData: function() { 2014 this.$el.data(instanceName, this); 2015 2016 return this; 2017 }, 2018 2019 setOptions: function(opts) { 2020 this.options = $.extend(true, {}, PluginTweets.defaults, opts, { 2021 wrapper: this.$el 2022 }); 2023 2024 return this; 2025 }, 2026 2027 build: function() { 2028 if (this.options.username == null || this.options.username == '') { 2029 return this; 2030 } 2031 2032 var self = this, 2033 $wrapper = this.options.wrapper; 2034 2035 $.ajax({ 2036 type: 'GET', 2037 data: { 2038 twitter_screen_name: self.options.username, 2039 tweets_to_display: self.options.count 2040 }, 2041 url: self.options.URL, 2042 }).done(function(html) { 2043 $wrapper.html(html).find('a').attr('target','_blank'); 2044 }); 2045 2046 return this; 2047 } 2048 }; 2049 2050 // expose to scope 2051 $.extend(theme, { 2052 PluginTweets: PluginTweets 2053 }); 2054 2055 // jquery plugin 2056 $.fn.themePluginTweets = function(opts) { 2057 return this.map(function() { 2058 var $this = $(this); 2059 2060 if ($this.data(instanceName)) { 2061 return $this.data(instanceName); 2062 } else { 2063 return new PluginTweets($this, opts); 2064 } 2065 2066 }); 2067 } 2068 2069}).apply(this, [window.theme, jQuery]); 2070 2071// Validation 2072(function(theme, $) { 2073 2074 theme = theme || {}; 2075 2076 $.extend(theme, { 2077 2078 PluginValidation: { 2079 2080 defaults: { 2081 validator: { 2082 highlight: function(element) { 2083 $(element) 2084 .parent() 2085 .removeClass('has-success') 2086 .addClass('has-error'); 2087 }, 2088 success: function(element) { 2089 $(element) 2090 .parent() 2091 .removeClass('has-error') 2092 .addClass('has-success') 2093 .find('label.error') 2094 .remove(); 2095 }, 2096 errorPlacement: function(error, element) { 2097 if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') { 2098 error.appendTo(element.parent().parent()); 2099 } else { 2100 error.insertAfter(element); 2101 } 2102 } 2103 }, 2104 validateCaptchaURL: 'php/contact-form-verify-captcha.php', 2105 refreshCaptchaURL: 'php/contact-form-refresh-captcha.php' 2106 }, 2107 2108 initialize: function(opts) { 2109 initialized = true; 2110 2111 this 2112 .setOptions(opts) 2113 .build(); 2114 2115 return this; 2116 }, 2117 2118 setOptions: function(opts) { 2119 this.options = $.extend(true, {}, this.defaults, opts); 2120 2121 return this; 2122 }, 2123 2124 build: function() { 2125 var self = this; 2126 2127 if (!($.isFunction($.validator))) { 2128 return this; 2129 } 2130 2131 self.addMethods(); 2132 self.setMessageGroups(); 2133 2134 $.validator.setDefaults(self.options.validator); 2135 2136 return this; 2137 }, 2138 2139 addMethods: function() { 2140 var self = this; 2141 2142 $.validator.addMethod('captcha', function(value, element, params) { 2143 var captchaValid = false; 2144 2145 $.ajax({
2146 url: self.options.validateCaptchaURL, 2147 type: 'POST', 2148 async: false, 2149 dataType: 'json', 2150 data: { 2151 captcha: $.trim(value) 2152 }, 2153 success: function(data) { 2154 if (data.response == 'success') { 2155 captchaValid = true; 2156 } 2157 } 2158 }); 2159 2160 if (captchaValid) { 2161 return true; 2162 } 2163 2164 }, ''); 2165 2166 // Refresh Captcha 2167 $('#refreshCaptcha').on('click', function(e) { 2168 e.preventDefault(); 2169 $.get(self.options.refreshCaptchaURL, function(url) { 2170 $('#captcha-image').attr('src', url); 2171 }); 2172 }); 2173 2174 }, 2175 2176 setMessageGroups: function() { 2177 2178 $('.checkbox-group[data-msg-required], .radio-group[data-msg-required]').each(function() { 2179 var message = $(this).data('msg-required'); 2180 $(this).find('input').attr('data-msg-required', message); 2181 }); 2182 2183 } 2184 2185 } 2186 2187 }); 2188 2189}).apply(this, [window.theme, jQuery]); 2190 2191// Video Background 2192(function(theme, $) { 2193 2194 theme = theme || {}; 2195 2196 var instanceName = '__videobackground'; 2197 2198 var PluginVideoBackground = function($el, opts) { 2199 return this.initialize($el, opts); 2200 }; 2201 2202 PluginVideoBackground.defaults = { 2203 overlay: true, 2204 volume: 1, 2205 playbackRate: 1, 2206 muted: true, 2207 loop: true, 2208 autoplay: true, 2209 position: '50% 50%', 2210 posterType: 'detect' 2211 }; 2212 2213 PluginVideoBackground.prototype = { 2214 initialize: function($el, opts) { 2215 this.$el = $el; 2216 2217 this 2218 .setData() 2219 .setOptions(opts) 2220 .build(); 2221 2222 return this; 2223 }, 2224 2225 setData: function() { 2226 this.$el.data(instanceName, this); 2227 2228 return this; 2229 }, 2230 2231 setOptions: function(opts) { 2232 this.options = $.extend(true, {}, PluginVideoBackground.defaults, opts, { 2233 path: this.$el.data('video-path'), 2234 wrapper: this.$el 2235 }); 2236 2237 return this; 2238 }, 2239 2240 build: function() { 2241 2242 if (!($.isFunction($.fn.vide)) || (!this.options.path)) { 2243 return this; 2244 } 2245 2246 if (this.options.overlay) { 2247 this.options.wrapper.prepend( 2248 $('<div />').addClass('video-overlay') 2249 ); 2250 } 2251 2252 this.options.wrapper.vide(this.options.path, this.options); 2253 2254 return this; 2255 } 2256 }; 2257 2258 // expose to scope 2259 $.extend(theme, { 2260 PluginVideoBackground: PluginVideoBackground 2261 }); 2262 2263 // jquery plugin 2264 $.fn.themePluginVideoBackground = function(opts) { 2265 return this.map(function() { 2266 var $this = $(this); 2267 2268 if ($this.data(instanceName)) { 2269 return $this.data(instanceName); 2270 } else { 2271 return new PluginVideoBackground($this, opts); 2272 } 2273 2274 }); 2275 } 2276 2277}).apply(this, [window.theme, jQuery]); 2278 2279// Word Rotate 2280(function(theme, $) { 2281 2282 theme = theme || {}; 2283 2284 var instanceName = '__wordRotate'; 2285 2286 var PluginWordRotate = function($el, opts) { 2287 return this.initialize($el, opts); 2288 }; 2289 2290 PluginWordRotate.defaults = { 2291 delay: 2000, 2292 animDelay: 300 2293 }; 2294 2295 PluginWordRotate.prototype = { 2296 initialize: function($el, opts) { 2297 if ( $el.data( instanceName ) ) { 2298 return this; 2299 } 2300 2301 this.$el = $el; 2302 2303 this 2304 .setData() 2305 .setOptions(opts) 2306 .build(); 2307 2308 return this; 2309 }, 2310 2311 setData: function() { 2312 this.$el.data(instanceName, this); 2313 2314 return this; 2315 }, 2316 2317 setOptions: function(opts) { 2318 this.options = $.extend(true, {}, PluginWordRotate.defaults, opts, { 2319 wrapper: this.$el 2320 }); 2321 2322 return this; 2323 }, 2324 2325 build: function() { 2326 var self = this, 2327 $el = this.options.wrapper, 2328 itemsWrapper = $el.find(".word-rotate-items"), 2329 items = itemsWrapper.find("> span"), 2330 firstItem = items.eq(0), 2331 firstItemClone = firstItem.clone(), 2332 currentItem = 1, 2333 currentTop = 0, 2334 itemWidth = 0; 2335 2336 itemsWrapper 2337 .width(firstItem.width() + "px") 2338 .append(firstItemClone); 2339 2340 $el 2341 .addClass("active"); 2342 2343 setInterval(function() { 2344 2345 currentTop = (currentItem * $el.height()); 2346 currentItem++; 2347 2348 if(currentItem <= items.length) { 2349 itemWidth = items.eq(currentItem-1).width(); 2350 } else { 2351 itemWidth = items.eq(0).width(); 2352 } 2353 2354 itemsWrapper.animate({ 2355 top: -(currentTop) + "px", 2356 width: itemWidth + "px" 2357 }, self.options.animDelay, "easeOutQuad", function() { 2358 2359 if(currentItem > items.length) { 2360 2361 itemsWrapper.css("top", 0); 2362 currentItem = 1; 2363 2364 } 2365 2366 }); 2367 2368 }, self.options.delay); 2369 2370 return this; 2371 } 2372 }; 2373 2374 // expose to scope 2375 $.extend(theme, { 2376 PluginWordRotate: PluginWordRotate 2377 }); 2378 2379 // jquery plugin 2380 $.fn.themePluginWordRotate = function(opts) { 2381 return this.map(function() { 2382 var $this = $(this); 2383 2384 if ($this.data(instanceName)) { 2385 return $this.data(instanceName); 2386 } else { 2387 return new PluginWordRotate($this, opts); 2388 } 2389 2390 }); 2391 } 2392 2393}).apply(this, [ window.theme, jQuery ]); 2394 2395// Account 2396(function(theme, $) { 2397 2398 theme = theme || {}; 2399 2400 var initialized = false; 2401 2402 $.extend(theme, { 2403 2404 Account: { 2405 2406 defaults: { 2407 wrapper: $('#headerAccount') 2408 }, 2409 2410 initialize: function($wrapper, opts) { 2411 if (initialized) { 2412 return this; 2413 } 2414 2415 initialized = true; 2416 this.$wrapper = ($wrapper || this.defaults.wrapper); 2417 2418 this 2419 .setOptions(opts) 2420 .events(); 2421 2422 return this; 2423 }, 2424 2425 setOptions: function(opts) { 2426 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2427 2428 return this; 2429 }, 2430 2431 events: function() { 2432 var self = this; 2433 2434 self.$wrapper.find('input').on('focus', function() { 2435 self.$wrapper.addClass('open'); 2436 2437 $(document).mouseup(function(e) { 2438 if (!self.$wrapper.is(e.target) && self.$wrapper.has(e.target).length === 0) { 2439 self.$wrapper.removeClass('open'); 2440 } 2441 });
2442 }); 2443 2444 $('#headerSignUp').on('click', function(e) { 2445 e.preventDefault(); 2446 self.$wrapper.addClass('signup').removeClass('signin').removeClass('recover'); 2447 self.$wrapper.find('.signup-form input:first').focus(); 2448 }); 2449 2450 $('#headerSignIn').on('click', function(e) { 2451 e.preventDefault(); 2452 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 2453 self.$wrapper.find('.signin-form input:first').focus(); 2454 }); 2455 2456 $('#headerRecover').on('click', function(e) { 2457 e.preventDefault(); 2458 self.$wrapper.addClass('recover').removeClass('signup').removeClass('signin'); 2459 self.$wrapper.find('.recover-form input:first').focus(); 2460 }); 2461 2462 $('#headerRecoverCancel').on('click', function(e) { 2463 e.preventDefault(); 2464 self.$wrapper.addClass('signin').removeClass('signup').removeClass('recover'); 2465 self.$wrapper.find('.signin-form input:first').focus(); 2466 }); 2467 } 2468 2469 } 2470 2471 }); 2472 2473}).apply(this, [window.theme, jQuery]); 2474 2475// Nav 2476(function(theme, $) { 2477 2478 theme = theme || {}; 2479 2480 var initialized = false; 2481 2482 $.extend(theme, { 2483 2484 Nav: { 2485 2486 defaults: { 2487 wrapper: $('#mainNav'), 2488 scrollDelay: 600, 2489 scrollAnimation: 'easeOutQuad' 2490 }, 2491 2492 initialize: function($wrapper, opts) { 2493 if (initialized) { 2494 return this; 2495 } 2496 2497 initialized = true; 2498 this.$wrapper = ($wrapper || this.defaults.wrapper); 2499 2500 this 2501 .setOptions(opts) 2502 .build() 2503 .events(); 2504 2505 return this; 2506 }, 2507 2508 setOptions: function(opts) { 2509 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2510 2511 return this; 2512 }, 2513 2514 build: function() { 2515 var self = this, 2516 $html = $('html'), 2517 $header = $('#header'), 2518 thumbInfoPreview; 2519 2520 // Add Arrows 2521 $header.find('.dropdown-toggle, .dropdown-submenu > a').append($('<i />').addClass('fa fa-caret-down')); 2522 2523 // Preview Thumbs 2524 self.$wrapper.find('a[data-thumb-preview]').each(function() { 2525 thumbInfoPreview = $('<span />').addClass('thumb-info thumb-info-preview') 2526 .append($('<span />').addClass('thumb-info-wrapper') 2527 .append($('<span />').addClass('thumb-info-image').css('background-image', 'url(' + $(this).data('thumb-preview') + ')') 2528 ) 2529 ); 2530 2531 $(this).append(thumbInfoPreview); 2532 }); 2533 2534 // Side Header Right (Reverse Dropdown) 2535 if($html.hasClass('side-header-right')) { 2536 $header.find('.dropdown').addClass('dropdown-reverse'); 2537 } 2538 2539 return this; 2540 }, 2541 2542 events: function() { 2543 var self = this, 2544 $header = $('#header'), 2545 $window = $(window); 2546 2547 $header.find('a[href="#"]').on('click', function(e) { 2548 e.preventDefault(); 2549 }); 2550 2551 // Mobile Arrows 2552 $header.find('.dropdown-toggle[href="#"], .dropdown-submenu a[href="#"], .dropdown-toggle[href!="#"] .fa-caret-down, .dropdown-submenu a[href!="#"] .fa-caret-down').on('click', function(e) { 2553 e.preventDefault(); 2554 if ($window.width() < 992) { 2555 $(this).closest('li').toggleClass('opened'); 2556 } 2557 }); 2558 2559 // Touch Devices with normal resolutions 2560 if('ontouchstart' in document.documentElement) { 2561 $header.find('.dropdown-toggle:not([href="#"]), .dropdown-submenu > a:not([href="#"])') 2562 .on('touchstart click', function(e) { 2563 if($window.width() > 991) { 2564 2565 e.stopPropagation(); 2566 e.preventDefault(); 2567 2568 if(e.handled !== true) { 2569 2570 var li = $(this).closest('li'); 2571 2572 if(li.hasClass('tapped')) { 2573 location.href = $(this).attr('href'); 2574 } 2575 2576 li.addClass('tapped'); 2577 2578 e.handled = true; 2579 } else { 2580 return false; 2581 } 2582 2583 return false; 2584 2585 } 2586 }) 2587 .on('blur', function(e) { 2588 $(this).closest('li').removeClass('tapped'); 2589 }); 2590 2591 } 2592 2593 // Anchors Position 2594 $('[data-hash]').each(function() { 2595 2596 var target = $(this).attr('href'), 2597 offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0); 2598 2599 if($(target).get(0)) { 2600 $(this).on('click', function(e) { 2601 e.preventDefault(); 2602 2603 // Close Collapse if Opened 2604 $(this).parents('.collapse.in').removeClass('in'); 2605 2606 self.scrollToTarget(target, offset); 2607 2608 return; 2609 });
2610 } 2611 2612 }); 2613 2614 // Mobile Redirect - (Ignores the Dropdown from Bootstrap) 2615 $('.mobile-redirect').on('click', function() { 2616 if ($window.width() < 992) { 2617 self.location = $(this).attr('href'); 2618 } 2619 }); 2620 2621 return this; 2622 }, 2623 2624 scrollToTarget: function(target, offset) { 2625 var self = this; 2626 2627 $('body').addClass('scrolling'); 2628 2629 $('html, body').animate({ 2630 scrollTop: $(target).offset().top - offset 2631 }, self.options.scrollDelay, self.options.scrollAnimation, function() { 2632 $('body').removeClass('scrolling'); 2633 }); 2634 2635 return this; 2636 2637 } 2638 2639 } 2640 2641 }); 2642 2643}).apply(this, [window.theme, jQuery]); 2644 2645// Newsletter 2646(function(theme, $) { 2647 2648 theme = theme || {}; 2649 2650 var initialized = false; 2651 2652 $.extend(theme, { 2653 2654 Newsletter: { 2655 2656 defaults: { 2657 wrapper: $('#newsletterForm') 2658 }, 2659 2660 initialize: function($wrapper, opts) { 2661 if (initialized) { 2662 return this; 2663 } 2664 2665 initialized = true; 2666 this.$wrapper = ($wrapper || this.defaults.wrapper); 2667 2668 this 2669 .setOptions(opts) 2670 .build(); 2671 2672 return this; 2673 }, 2674 2675 setOptions: function(opts) { 2676 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2677 2678 return this; 2679 }, 2680 2681 build: function() { 2682 if (!($.isFunction($.fn.validate))) { 2683 return this; 2684 } 2685 2686 var self = this, 2687 $email = self.$wrapper.find('#newsletterEmail'), 2688 $success = $('#newsletterSuccess'), 2689 $error = $('#newsletterError'); 2690 2691 self.$wrapper.validate({ 2692 submitHandler: function(form) { 2693 2694 $.ajax({
2695 type: 'POST', 2696 url: self.$wrapper.attr('action'), 2697 data: { 2698 'email': $email.val() 2699 }, 2700 dataType: 'json', 2701 success: function(data) { 2702 if (data.response == 'success') { 2703 2704 $success.removeClass('hidden'); 2705 $error.addClass('hidden'); 2706 2707 $email 2708 .val('') 2709 .blur() 2710 .closest('.control-group') 2711 .removeClass('success') 2712 .removeClass('error'); 2713 2714 } else { 2715 2716 $error.html(data.message); 2717 $error.removeClass('hidden'); 2718 $success.addClass('hidden'); 2719 2720 $email 2721 .blur() 2722 .closest('.control-group') 2723 .removeClass('success') 2724 .addClass('error'); 2725 2726 } 2727 } 2728 }); 2729 2730 }, 2731 rules: { 2732 newsletterEmail: { 2733 required: true, 2734 email: true 2735 } 2736 }, 2737 errorPlacement: function(error, element) { 2738 2739 } 2740 }); 2741 2742 return this; 2743 } 2744 2745 } 2746 2747 }); 2748 2749}).apply(this, [window.theme, jQuery]); 2750 2751// Search 2752(function(theme, $) { 2753 2754 theme = theme || {}; 2755 2756 var initialized = false; 2757 2758 $.extend(theme, { 2759 2760 Search: { 2761 2762 defaults: { 2763 wrapper: $('#searchForm') 2764 }, 2765 2766 initialize: function($wrapper, opts) { 2767 if (initialized) { 2768 return this; 2769 } 2770 2771 initialized = true; 2772 this.$wrapper = ($wrapper || this.defaults.wrapper); 2773 2774 this 2775 .setOptions(opts) 2776 .build(); 2777 2778 return this; 2779 }, 2780 2781 setOptions: function(opts) { 2782 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2783 2784 return this; 2785 }, 2786 2787 build: function() { 2788 if (!($.isFunction($.fn.validate))) { 2789 return this; 2790 } 2791 2792 this.$wrapper.validate({ 2793 errorPlacement: function(error, element) {} 2794 }); 2795 2796 return this; 2797 } 2798 2799 } 2800 2801 }); 2802 2803}).apply(this, [window.theme, jQuery]); 2804 2805// Sticky Header 2806(function(theme, $) { 2807 2808 theme = theme || {}; 2809 2810 var initialized = false; 2811 2812 $.extend(theme, { 2813 2814 StickyHeader: { 2815 2816 defaults: { 2817 wrapper: $('#header'), 2818 headerBody: $('#header .header-body'), 2819 stickyEnabled: true, 2820 stickyEnableOnBoxed: true, 2821 stickyEnableOnMobile: true, 2822 stickyStartAt: 0, 2823 stickyStartAtElement: false, 2824 stickySetTop: 0, 2825 stickyChangeLogo: false, 2826 stickyChangeLogoWrapper: true 2827 }, 2828 2829 initialize: function($wrapper, opts) { 2830 if (initialized) { 2831 return this; 2832 } 2833 2834 initialized = true; 2835 this.$wrapper = ($wrapper || this.defaults.wrapper); 2836 2837 this 2838 .setOptions(opts) 2839 .build() 2840 .events(); 2841 2842 return this; 2843 }, 2844 2845 setOptions: function(opts) { 2846 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2847 2848 return this; 2849 }, 2850 2851 build: function() { 2852 if (!this.options.stickyEnableOnBoxed && $('html').hasClass('boxed') || !this.options.stickyEnabled) { 2853 return this; 2854 } 2855 2856 var self = this, 2857 $html = $('html'), 2858 $window = $(window), 2859 sideHeader = $html.hasClass('side-header'); 2860 2861 // HTML Classes 2862 $html.addClass('sticky-header-enabled'); 2863 2864 if (parseInt(self.options.stickySetTop) < 0) { 2865 $html.addClass('sticky-header-negative'); 2866 } 2867 2868 // Set Start At 2869 if(self.options.stickyStartAtElement) { 2870 2871 var $stickyStartAtElement = $(self.options.stickyStartAtElement); 2872 2873 $(window).on('scroll resize', function() { 2874 self.options.stickyStartAt = $stickyStartAtElement.offset().top; 2875 }); 2876 2877 $(window).trigger('resize'); 2878 } 2879 2880 // Boxed 2881 if($html.hasClass('boxed') && (parseInt(self.options.stickyStartAt) == 0) && $window.width() > 991) { 2882 self.options.stickyStartAt = 30; 2883 } 2884 2885 // Set Wrapper Min-Height 2886 self.options.wrapper.css('min-height', self.options.wrapper.height()); 2887 2888 // Check Sticky Header 2889 self.checkStickyHeader = function() { 2890 if ($window.scrollTop() >= parseInt(self.options.stickyStartAt)) { 2891 self.activateStickyHeader(); 2892 } else { 2893 self.deactivateStickyHeader(); 2894 } 2895 }; 2896 2897 // Activate Sticky Header 2898 self.activateStickyHeader = function() { 2899 2900 if ($window.width() < 992) { 2901 if (!self.options.stickyEnableOnMobile) { 2902 self.deactivateStickyHeader(); 2903 return; 2904 } 2905 } else { 2906 if (sideHeader) { 2907 self.deactivateStickyHeader(); 2908 return; 2909 } 2910 } 2911 2912 $html.addClass('sticky-header-active'); 2913 2914 self.options.headerBody.css('top', self.options.stickySetTop); 2915 2916 if (self.options.stickyChangeLogo) { 2917 self.changeLogo(true); 2918 } 2919 2920 $.event.trigger({ 2921 type: 'stickyHeader.activate' 2922 });
2923 }; 2924 2925 // Deactivate Sticky Header 2926 self.deactivateStickyHeader = function() { 2927 2928 $html.removeClass('sticky-header-active'); 2929 2930 self.options.headerBody.css('top', 0); 2931 2932 if (self.options.stickyChangeLogo) { 2933 self.changeLogo(false); 2934 } 2935 2936 $.event.trigger({ 2937 type: 'stickyHeader.deactivate' 2938 }); 2939 }; 2940 2941 // Always Sticky 2942 if (parseInt(self.options.stickyStartAt) <= 0) { 2943 self.activateStickyHeader(); 2944 } 2945 2946 // Set Logo 2947 if (self.options.stickyChangeLogo) { 2948 2949 var $logoWrapper = self.options.wrapper.find('.header-logo'), 2950 $logo = $logoWrapper.find('img'), 2951 logoWidth = $logo.attr('width'), 2952 logoHeight = $logo.attr('height'), 2953 logoSmallTop = parseInt($logo.attr('data-sticky-top') ? $logo.attr('data-sticky-top') : 0), 2954 logoSmallWidth = parseInt($logo.attr('data-sticky-width') ? $logo.attr('data-sticky-width') : 'auto'), 2955 logoSmallHeight = parseInt($logo.attr('data-sticky-height') ? $logo.attr('data-sticky-height') : 'auto'); 2956 2957 if (self.options.stickyChangeLogoWrapper) { 2958 $logoWrapper.css({ 2959 'width': $logo.outerWidth(true), 2960 'height': $logo.outerHeight(true) 2961 }); 2962 } 2963 2964 self.changeLogo = function(activate) { 2965 if(activate) { 2966 $logo.css({ 2967 'top': logoSmallTop, 2968 'width': logoSmallWidth, 2969 'height': logoSmallHeight 2970 }); 2971 } else { 2972 $logo.css({ 2973 'top': 0, 2974 'width': logoWidth, 2975 'height': logoHeight 2976 }); 2977 } 2978 } 2979 2980 } 2981 2982 return this; 2983 }, 2984 2985 events: function() { 2986 var self = this; 2987 2988 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || !this.options.stickyEnabled) { 2989 return this; 2990 } 2991 2992 if (!self.options.alwaysStickyEnabled) { 2993 $(window).on('scroll resize', function() { 2994 self.checkStickyHeader(); 2995 }); 2996 } else { 2997 self.activateStickyHeader(); 2998 } 2999 3000 return this; 3001 } 3002 3003 } 3004 3005 }); 3006 3007}).apply(this, [window.theme, jQuery]);
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.