1(function ($) { 2 3 'use strict'; 4 5 document.querySelectorAll('[data-placement]').forEach(element => { 6 if (element.getAttribute('data-placement').indexOf('ms-') < 0 && !element.classList.contains('cookieconsent')) { 7 element.setAttribute('data-bs-placement', element.getAttribute('data-placement')); 8 element.removeAttribute('data-placement'); 9 } 10 }); 11 12 document.querySelectorAll('[data-parent]').forEach(element => { 13 if (element.getAttribute('data-parent').indexOf('ms-') < 0) { 14 element.setAttribute('data-bs-parent', element.getAttribute('data-parent')); 15 element.removeAttribute('data-parent'); 16 } 17 }); 18 19 document.querySelectorAll('[data-toggle]').forEach(element => { 20 if (element.getAttribute('data-toggle').indexOf('ms-') < 0) { 21 element.setAttribute('data-bs-toggle', element.getAttribute('data-toggle')); 22 element.removeAttribute('data-toggle'); 23 } 24 }); 25 26 document.querySelectorAll('[data-target]').forEach(element => { 27 if (element.getAttribute('data-target').indexOf('ms-') < 0) { 28 element.setAttribute('data-bs-target', element.getAttribute('data-target')); 29 element.removeAttribute('data-target'); 30 } 31 }); 32 33 document.querySelectorAll('[data-dismiss]').forEach(element => { 34 if (element.getAttribute('data-dismiss').indexOf('ms-') < 0) { 35 element.setAttribute('data-bs-dismiss', element.getAttribute('data-dismiss')); 36 element.removeAttribute('data-dismiss'); 37 } 38 }); 39 40 document.querySelectorAll('[data-content]').forEach(element => { 41 if (element.getAttribute('data-content').indexOf('ms-') < 0) { 42 element.setAttribute('data-bs-content', element.getAttribute('data-content')); 43 element.removeAttribute('data-content'); 44 } 45 }); 46 47 document.querySelectorAll('[data-trigger]').forEach(element => { 48 if (element.getAttribute('data-trigger').indexOf('ms-') < 0) { 49 element.setAttribute('data-bs-trigger', element.getAttribute('data-trigger')); 50 element.removeAttribute('data-trigger'); 51 } 52 }); 53 54 document.querySelectorAll('[data-dismiss]').forEach(element => { 55 if (element.getAttribute('data-dismiss').indexOf('ms-') < 0) { 56 element.setAttribute('data-bs-dismiss', element.getAttribute('data-dismiss')); 57 element.removeAttribute('data-dismiss'); 58 } 59 }); 60 61}).apply(this, [jQuery]);// Lightbox 62(function (theme, $) { 63 64 theme = theme || {}; 65 66 var instanceName = '__lightbox'; 67 68 var PluginLightbox = function ($el, opts) { 69 return this.initialize($el, opts); 70 }; 71 72 PluginLightbox.defaults = { 73 tClose: 'Close (Esc)', // Alt text on close button 74 tLoading: 'Loading...', // Text that is displayed during loading. Can contain %curr% and %total% keys 75 gallery: { 76 tPrev: 'Previous (Left arrow key)', // Alt text on left arrow 77 tNext: 'Next (Right arrow key)', // Alt text on right arrow 78 tCounter: '%curr% of %total%' // Markup for "1 of 7" counter 79 }, 80 image: { 81 tError: '<a href="%url%">The image</a> could not be loaded.' // Error message when image could not be loaded 82 }, 83 ajax: { 84 tError: '<a href="%url%">The content</a> could not be loaded.' // Error message when ajax request failed 85 }, 86 callbacks: { 87 open: function () { 88 $('body').addClass('lightbox-opened'); 89 }, 90 close: function () { 91 $('body').removeClass('lightbox-opened'); 92 } 93 } 94 }; 95 96 PluginLightbox.prototype = { 97 initialize: function ($el, opts) { 98 if ($el.data(instanceName)) { 99 return this; 100 } 101 102 this.$el = $el; 103 104 this 105 .setData() 106 .setOptions(opts) 107 .build(); 108 109 return this; 110 }, 111 112 setData: function () { 113 this.$el.data(instanceName, this); 114 115 return this; 116 }, 117 118 setOptions: function (opts) { 119 this.options = $.extend(true, {}, PluginLightbox.defaults, opts, { 120 wrapper: this.$el 121 }); 122 123 return this; 124 }, 125 126 build: function () { 127 if (!($.isFunction($.fn.magnificPopup))) { 128 return this; 129 } 130 131 this.options.wrapper.magnificPopup(this.options); 132 133 return this; 134 } 135 }; 136 137 // expose to scope 138 $.extend(theme, { 139 PluginLightbox: PluginLightbox 140 });
141 142 // jquery plugin 143 $.fn.themePluginLightbox = function (opts) { 144 return this.map(function () { 145 var $this = $(this); 146 147 if ($this.data(instanceName)) { 148 return $this.data(instanceName); 149 } else { 150 return new PluginLightbox($this, opts); 151 } 152 153 }); 154 } 155 156}).apply(this, [window.theme, jQuery]); 157 158// Lightbox 159(function ($) { 160 161 'use strict'; 162 163 if ($.isFunction($.fn['themePluginLightbox'])) { 164 165 $(function () { 166 $('[data-plugin-lightbox]:not(.manual), .lightbox:not(.manual)').each(function () { 167 var $this = $(this), 168 opts; 169 170 var pluginOptions = $this.data('plugin-options'); 171 if (pluginOptions) 172 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 173 174 $this.themePluginLightbox(opts); 175 }); 176 }); 177 178 } 179 180}).apply(this, [jQuery]);/* 181Name: Shortcodes - Lightboxes - Examples 182Written by: Okler Themes - (http://www.okler.net) 183Theme Version: 3.8.0 184*/ 185 186(function( $ ) { 187 188 'use strict'; 189 190 /* 191 Popup with video or map 192 */ 193 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 194 disableOn: 700, 195 type: 'iframe', 196 mainClass: 'mfp-fade', 197 removalDelay: 160, 198 preloader: false, 199 200 fixedContentPos: false 201 }); 202 203 /* 204 Dialog with CSS animation 205 */ 206 $('.popup-with-zoom-anim').magnificPopup({ 207 type: 'inline', 208 209 fixedContentPos: false, 210 fixedBgPos: true, 211 212 overflowY: 'auto', 213 214 closeBtnInside: true, 215 preloader: false, 216 217 midClick: true, 218 removalDelay: 300, 219 mainClass: 'my-mfp-zoom-in' 220 }); 221 222 $('.popup-with-move-anim').magnificPopup({ 223 type: 'inline', 224 225 fixedContentPos: false, 226 fixedBgPos: true, 227 228 overflowY: 'auto', 229 230 closeBtnInside: true, 231 preloader: false, 232 233 midClick: true, 234 removalDelay: 300, 235 mainClass: 'my-mfp-slide-bottom' 236 }); 237 238 /* 239 Form 240 */ 241 $('.popup-with-form').magnificPopup({ 242 type: 'inline', 243 preloader: false, 244 focus: '#name', 245 246 // When elemened is focused, some mobile browsers in some cases zoom in 247 // It looks not nice, so we disable it: 248 callbacks: { 249 open: function() { 250 $('body').addClass('lightbox-opened'); 251 }, 252 close: function() { 253 $('body').removeClass('lightbox-opened'); 254 }, 255 beforeOpen: function() { 256 if($(window).width() < 700) { 257 this.st.focus = false; 258 } else { 259 this.st.focus = '#name'; 260 } 261 } 262 } 263 }); 264 265 /* 266 Ajax 267 */ 268 $('.simple-ajax-popup').magnificPopup({ 269 type: 'ajax', 270 callbacks: { 271 open: function() { 272 $('body').addClass('lightbox-opened'); 273 }, 274 close: function() { 275 $('body').removeClass('lightbox-opened'); 276 } 277 } 278 }); 279 280}).apply( this, [ jQuery ]);// Progress Bar 281(function (theme, $) { 282 283 theme = theme || {}; 284 285 var instanceName = '__progressBar'; 286 287 var PluginProgressBar = function ($el, opts) { 288 return this.initialize($el, opts); 289 }; 290 291 PluginProgressBar.defaults = { 292 accX: 0, 293 accY: -50, 294 delay: 1 295 }; 296 297 PluginProgressBar.prototype = { 298 initialize: function ($el, opts) { 299 if ($el.data(instanceName)) { 300 return this; 301 } 302 303 this.$el = $el; 304 305 this 306 .setData() 307 .setOptions(opts) 308 .build(); 309 310 return this; 311 }, 312 313 setData: function () { 314 this.$el.data(instanceName, this); 315 316 return this; 317 }, 318 319 setOptions: function (opts) { 320 this.options = $.extend(true, {}, PluginProgressBar.defaults, opts, { 321 wrapper: this.$el 322 }); 323 324 return this; 325 }, 326 327 build: function () { 328 if (!($.isFunction($.fn.appear))) { 329 return this; 330 } 331 332 var self = this, 333 $el = this.options.wrapper, 334 delay = 1; 335 336 $el.appear(function () { 337 338 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 339 340 $el.addClass($el.attr('data-appear-animation')); 341 342 setTimeout(function () { 343 344 $el.animate({ 345 width: $el.attr('data-appear-progress-animation') 346 }, 1500, 'easeOutQuad', function () { 347 $el.find('.progress-bar-tooltip').animate({ 348 opacity: 1 349 }, 500, 'easeOutQuad'); 350 }); 351 352 }, delay); 353 354 }, { 355 accX: self.options.accX, 356 accY: self.options.accY
357 }); 358 359 return this; 360 } 361 }; 362 363 // expose to scope 364 $.extend(theme, { 365 PluginProgressBar: PluginProgressBar 366 }); 367 368 // jquery plugin 369 $.fn.themePluginProgressBar = function (opts) { 370 return this.map(function () { 371 var $this = $(this); 372 373 if ($this.data(instanceName)) { 374 return $this.data(instanceName); 375 } else { 376 return new PluginProgressBar($this, opts); 377 } 378 379 }); 380 } 381 382}).apply(this, [window.theme, jQuery]); 383 384// Progress Bar 385(function ($) { 386 387 'use strict'; 388 389 if ($.isFunction($.fn['themePluginProgressBar'])) { 390 391 $(function () { 392 $('[data-plugin-progress-bar]:not(.manual), [data-appear-progress-animation]').each(function () { 393 var $this = $(this), 394 opts; 395 396 var pluginOptions = $this.data('plugin-options'); 397 if (pluginOptions) 398 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 399 400 $this.themePluginProgressBar(opts); 401 }); 402 }); 403 404 } 405 406}).apply(this, [jQuery]); 407 408// Animate 409(function (theme, $) { 410 411 theme = theme || {}; 412 413 var instanceName = '__animate'; 414 415 var PluginAnimate = function ($el, opts) { 416 return this.initialize($el, opts); 417 }; 418 419 PluginAnimate.defaults = { 420 accX: 0, 421 accY: -150, 422 delay: 1 423 }; 424 425 PluginAnimate.prototype = { 426 initialize: function ($el, opts) { 427 if ($el.data(instanceName)) { 428 return this; 429 } 430 431 this.$el = $el; 432 433 this 434 .setData() 435 .setOptions(opts) 436 .build(); 437 438 return this; 439 }, 440 441 setData: function () { 442 this.$el.data(instanceName, this); 443 444 return this; 445 }, 446 447 setOptions: function (opts) { 448 this.options = $.extend(true, {}, PluginAnimate.defaults, opts, { 449 wrapper: this.$el 450 }); 451 452 return this; 453 }, 454 455 build: function () { 456 var self = this, 457 $el = this.options.wrapper, 458 delay = 0; 459 460 $el.addClass('appear-animation'); 461 462 if (!$('html').hasClass('no-csstransitions') && $(window).width() > 767) { 463 464 $el.appear(function () { 465 466 delay = ($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay') : self.options.delay); 467 468 if (delay > 1) { 469 $el.css('animation-delay', delay + 'ms'); 470 } 471 472 $el.addClass($el.attr('data-appear-animation')); 473 474 setTimeout(function () { 475 $el.addClass('appear-animation-visible'); 476 }, delay); 477 478 }, { 479 accX: self.options.accX, 480 accY: self.options.accY 481 }); 482 483 } else { 484 485 $el.addClass('appear-animation-visible'); 486 487 } 488 489 return this; 490 } 491 }; 492 493 // expose to scope 494 $.extend(theme, { 495 PluginAnimate: PluginAnimate 496 }); 497 498 // jquery plugin 499 $.fn.themePluginAnimate = function (opts) { 500 return this.map(function () { 501 var $this = $(this); 502 503 if ($this.data(instanceName)) { 504 return $this.data(instanceName); 505 } else { 506 return new PluginAnimate($this, opts); 507 } 508 509 }); 510 }; 511 512}).apply(this, [window.theme, jQuery]); 513 514 515// Animate 516(function ($) { 517 518 'use strict'; 519 520 if ($.isFunction($.fn['themePluginAnimate'])) { 521 522 $(function () { 523 $('[data-plugin-animate], [data-appear-animation]').each(function () { 524 var $this = $(this), 525 opts; 526 527 var pluginOptions = $this.data('plugin-options'); 528 if (pluginOptions) 529 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 530 531 $this.themePluginAnimate(opts); 532 }); 533 }); 534 535 } 536 537}).apply(this, [jQuery]);window.theme = {}; 538 539window.theme.fn = { 540 541 getOptions: function (opts) { 542 543 if (typeof (opts) == 'object') { 544 545 return opts; 546 547 } else if (typeof (opts) == 'string') { 548 549 try { 550 return JSON.parse(opts.replace(/'/g, '"').replace(';', '')); 551 } catch (e) { 552 return {}; 553 } 554 555 } else { 556 557 return {}; 558 559 } 560 561 }, 562 563 execPluginFunction: function (functionName, context) { 564 var args = Array.prototype.slice.call(arguments, 2); 565 var namespaces = functionName.split("."); 566 var func = namespaces.pop(); 567 568 for (var i = 0; i < namespaces.length; i++) { 569 context = context[namespaces[i]]; 570 } 571
572 return context[func].apply(context, args); 573 }, 574 575 intObs: function (selector, functionName, intObsOptions, alwaysObserve) { 576 var $el = document.querySelectorAll(selector); 577 var intersectionObserverOptions = { 578 rootMargin: '0px 0px 200px 0px' 579 } 580 581 if (intObsOptions.length) { 582 $.extend(intersectionObserverOptions, intObsOptions); 583 } 584 585 var observer = new IntersectionObserver(function (entries) { 586 for (var i = 0; i < entries.length; i++) { 587 var entry = entries[i]; 588 589 if (entry.intersectionRatio > 0) { 590 if (typeof functionName === 'string') { 591 var func = Function('return ' + functionName)(); 592 } else { 593 var callback = functionName; 594 595 callback.call($(entry.target)); 596 } 597 598 // Unobserve 599 if (!alwaysObserve) { 600 observer.unobserve(entry.target); 601 } 602 603 } 604 } 605 }, intersectionObserverOptions); 606 607 $($el).each(function () { 608 observer.observe($(this)[0]); 609 }); 610 }, 611 612 intObsInit: function (selector, functionName) { 613 var $el = document.querySelectorAll(selector); 614 var intersectionObserverOptions = { 615 rootMargin: '200px' 616 } 617 618 var observer = new IntersectionObserver(function (entries) { 619 for (var i = 0; i < entries.length; i++) { 620 var entry = entries[i]; 621 if (entry.intersectionRatio > 0) { 622 623 var $this = $(entry.target), 624 opts; 625 626 var pluginOptions = theme.fn.getOptions($this.data('plugin-options')); 627 if (pluginOptions) 628 opts = pluginOptions; 629 630 theme.fn.execPluginFunction(functionName, $this, opts); 631 632 // Unobserve 633 observer.unobserve(entry.target); 634 } 635 } 636 }, intersectionObserverOptions); 637 638 $($el).each(function () { 639 observer.observe($(this)[0]); 640 }); 641 } 642}; 643 644// Before / After 645(function (theme, $) { 646 647 theme = theme || {}; 648 649 var instanceName = '__beforeafter'; 650 651 var PluginBeforeAfter = function ($el, opts) { 652 return this.initialize($el, opts); 653 }; 654 655 PluginBeforeAfter.defaults = { 656 657 }; 658 659 PluginBeforeAfter.prototype = { 660 initialize: function ($el, opts) { 661 this.$el = $el; 662 663 this 664 .setData() 665 .setOptions(opts) 666 .build(); 667 668 return this; 669 }, 670 671 setData: function () { 672 this.$el.data(instanceName, this); 673 674 return this; 675 }, 676 677 setOptions: function (opts) { 678 this.options = $.extend(true, {}, PluginBeforeAfter.defaults, opts, { 679 wrapper: this.$el 680 }); 681 682 return this; 683 }, 684 685 build: function () { 686 687 if (!($.isFunction($.fn.twentytwenty))) { 688 return this; 689 } 690 691 var self = this; 692 693 self.options.wrapper 694 .twentytwenty(self.options); 695 696 return this; 697 698 } 699 }; 700 701 // expose to scope 702 $.extend(theme, { 703 PluginBeforeAfter: PluginBeforeAfter 704 }); 705 706 // jquery plugin 707 $.fn.themePluginBeforeAfter = function (opts) { 708 return this.map(function () { 709 var $this = $(this); 710 711 if ($this.data(instanceName)) { 712 return $this.data(instanceName); 713 } else { 714 return new PluginBeforeAfter($this, opts); 715 } 716 717 }); 718 } 719 720}).apply(this, [window.theme, jQuery]); 721 722// Countdown 723(function (theme, $) { 724 725 theme = theme || {}; 726 727 var instanceName = '__countdown'; 728 729 var PluginCountdown = function ($el, opts) { 730 return this.initialize($el, opts); 731 }; 732 733 PluginCountdown.defaults = { 734 date: '2030/06/10 12:00:00', 735 textDay: 'DAY', 736 textHour: 'HRS', 737 textMin: 'MIN', 738 textSec: 'SEC', 739 uppercase: true, 740 numberClass: '', 741 wrapperClass: '', 742 insertHTMLbefore: '', 743 insertHTMLafter: '' 744 }; 745 746 PluginCountdown.prototype = { 747 initialize: function ($el, opts) { 748 if ($el.data(instanceName)) { 749 return this; 750 } 751 752 this.$el = $el; 753 754 this 755 .setData() 756 .setOptions(opts) 757 .build(); 758 759 return this; 760 }, 761 762 setData: function () { 763 this.$el.data(instanceName, this); 764 765 return this; 766 }, 767 768 setOptions: function (opts) { 769 this.options = $.extend(true, {}, PluginCountdown.defaults, opts, { 770 wrapper: this.$el 771 }); 772 773 return this; 774 }, 775 776 build: function () { 777 if (!($.isFunction($.fn.countTo))) { 778 return this; 779 } 780 781 var self = this, 782 $el = this.options.wrapper, 783 numberClass = (self.options.numberClass) ? ' ' + self.options.numberClass : '', 784 wrapperClass = (self.options.wrapperClass) ? ' ' + self.options.wrapperClass : ''; 785 786 if (self.options.uppercase) { 787 $el.countdown(self.options.date).on('update.countdown', function (event) { 788 var $this = $(this).html(event.strftime(self.options.insertHTMLbefore 789 + '<span class="days' + wrapperClass + '"><span class="' + numberClass + '">%D</span> ' + self.options.textDay + '<div class="d-inline text-uppercase">%!d</div></span> ' 790 + '<span class="hours' + wrapperClass + '"><span class="' + numberClass + '">%H</span> ' + self.options.textHour + '</span> ' 791 + '<span class="minutes' + wrapperClass + '"><span class="' + numberClass + '">%M</span> ' + self.options.textMin + '</span> ' 792 + '<span class="seconds' + wrapperClass + '"><span class="' + numberClass + '">%S</span> ' + self.options.textSec + '</span> ' 793 + self.options.insertHTMLafter 794 )); 795 }); 796 } else { 797 $el.countdown(self.options.date).on('update.countdown', function (event) { 798 var $this = $(this).html(event.strftime(self.options.insertHTMLbefore 799 + '<span class="days' + wrapperClass + '"><span class="' + numberClass + '">%D</span> ' + self.options.textDay + '%!d</span> ' 800 + '<span class="hours' + wrapperClass + '"><span class="' + numberClass + '">%H</span> ' + self.options.textHour + '</span> ' 801 + '<span class="minutes' + wrapperClass + '"><span class="' + numberClass + '">%M</span> ' + self.options.textMin + '</span> ' 802 + '<span class="seconds' + wrapperClass + '"><span class="' + numberClass + '">%S</span> ' + self.options.textSec + '</span> ' 803 + self.options.insertHTMLafter 804 )); 805 }); 806 } 807 808 return this; 809 } 810 }; 811 812 // expose to scope 813 $.extend(theme, { 814 PluginCountdown: PluginCountdown 815 }); 816 817 // jquery plugin 818 $.fn.themePluginCountdown = function (opts) { 819 return this.map(function () { 820 var $this = $(this); 821 822 if ($this.data(instanceName)) { 823 return $this.data(instanceName); 824 } else { 825 return new PluginCountdown($this, opts); 826 } 827 828 }); 829 } 830 831}).apply(this, [window.theme, jQuery]); 832 833// Counter 834(function (theme, $) { 835 836 theme = theme || {}; 837 838 var instanceName = '__counter'; 839 840 var PluginCounter = function ($el, opts) { 841 return this.initialize($el, opts); 842 }; 843 844 PluginCounter.defaults = { 845 accX: 0, 846 accY: 0, 847 speed: 3000, 848 refreshInterval: 100, 849 decimals: 0, 850 onUpdate: null, 851 onComplete: null 852 }; 853 854 PluginCounter.prototype = { 855 initialize: function ($el, opts) { 856 if ($el.data(instanceName)) { 857 return this; 858 } 859 860 this.$el = $el; 861 862 this 863 .setData() 864 .setOptions(opts) 865 .build(); 866 867 return this; 868 }, 869 870 setData: function () { 871 this.$el.data(instanceName, this); 872 873 return this; 874 }, 875 876 setOptions: function (opts) { 877 this.options = $.extend(true, {}, PluginCounter.defaults, opts, { 878 wrapper: this.$el 879 }); 880 881 return this; 882 }, 883 884 build: function () { 885 if (!($.isFunction($.fn.countTo))) { 886 return this; 887 } 888 889 var self = this, 890 $el = this.options.wrapper; 891 892 $.extend(self.options, { 893 onComplete: function () { 894 if ($el.data('append')) { 895 $el.html($el.html() + $el.data('append')); 896 } 897 898 if ($el.data('prepend')) { 899 $el.html($el.data('prepend') + $el.html()); 900 } 901 } 902 }); 903
904 $el.appear(function () { 905 906 $el.countTo(self.options); 907 908 }, { 909 accX: self.options.accX, 910 accY: self.options.accY 911 }); 912 913 return this; 914 } 915 }; 916 917 // expose to scope 918 $.extend(theme, { 919 PluginCounter: PluginCounter 920 }); 921 922 // jquery plugin 923 $.fn.themePluginCounter = function (opts) { 924 return this.map(function () { 925 var $this = $(this); 926 927 if ($this.data(instanceName)) { 928 return $this.data(instanceName); 929 } else { 930 return new PluginCounter($this, opts); 931 } 932 933 }); 934 } 935 936}).apply(this, [window.theme, jQuery]); 937 938// Match Height 939(function (theme, $) { 940 941 theme = theme || {}; 942 943 var instanceName = '__matchHeight'; 944 945 var PluginMatchHeight = function ($el, opts) { 946 return this.initialize($el, opts); 947 }; 948 949 PluginMatchHeight.defaults = { 950 byRow: true, 951 property: 'height', 952 target: null, 953 remove: false 954 }; 955 956 PluginMatchHeight.prototype = { 957 initialize: function ($el, opts) { 958 if ($el.data(instanceName)) { 959 return this; 960 } 961 962 this.$el = $el; 963 964 this 965 .setData() 966 .setOptions(opts) 967 .build(); 968 969 return this; 970 }, 971 972 setData: function () { 973 this.$el.data(instanceName, this); 974 975 return this; 976 }, 977 978 setOptions: function (opts) { 979 this.options = $.extend(true, {}, PluginMatchHeight.defaults, opts, { 980 wrapper: this.$el 981 }); 982 983 return this; 984 }, 985 986 build: function () { 987 if (!($.isFunction($.fn.matchHeight))) { 988 return this; 989 } 990 991 var self = this; 992 993 self.options.wrapper.matchHeight(self.options); 994 995 return this; 996 } 997 998 }; 999 1000 // expose to scope 1001 $.extend(theme, { 1002 PluginMatchHeight: PluginMatchHeight 1003 }); 1004 1005 // jquery plugin 1006 $.fn.themePluginMatchHeight = function (opts) { 1007 return this.map(function () { 1008 var $this = $(this); 1009 1010 if ($this.data(instanceName)) { 1011 return $this.data(instanceName); 1012 } else { 1013 return new PluginMatchHeight($this, opts); 1014 } 1015 1016 }); 1017 } 1018 1019}).apply(this, [window.theme, jQuery]); 1020 1021// Sticky 1022(function (theme, $) { 1023 1024 theme = theme || {}; 1025 1026 var instanceName = '__sticky'; 1027 1028 var PluginSticky = function ($el, opts) { 1029 return this.initialize($el, opts); 1030 }; 1031 1032 PluginSticky.defaults = { 1033 minWidth: 991, 1034 activeClass: 'sticky-active' 1035 }; 1036 1037 PluginSticky.prototype = { 1038 initialize: function ($el, opts) { 1039 if ($el.data(instanceName)) { 1040 return this; 1041 } 1042 1043 this.$el = $el; 1044 1045 this 1046 .setData() 1047 .setOptions(opts) 1048 .build(); 1049 1050 return this; 1051 }, 1052 1053 setData: function () { 1054 this.$el.data(instanceName, this); 1055 1056 return this; 1057 }, 1058 1059 setOptions: function (opts) { 1060 this.options = $.extend(true, {}, PluginSticky.defaults, opts, { 1061 wrapper: this.$el 1062 }); 1063 1064 return this; 1065 }, 1066 1067 build: function () { 1068 if (!($.isFunction($.fn.pin))) { 1069 return this; 1070 } 1071 1072 this.options.wrapper.pin(this.options); 1073 1074 return this; 1075 } 1076 }; 1077 1078 // expose to scope 1079 $.extend(theme, { 1080 PluginSticky: PluginSticky 1081 }); 1082 1083 // jquery plugin 1084 $.fn.themePluginSticky = function (opts) { 1085 return this.map(function () { 1086 var $this = $(this); 1087 1088 if ($this.data(instanceName)) { 1089 return $this.data(instanceName); 1090 } else { 1091 return new PluginSticky($this, opts); 1092 } 1093 1094 }); 1095 } 1096 1097}).apply(this, [window.theme, jQuery]); 1098 1099// Toggle 1100(function (theme, $) { 1101 1102 theme = theme || {}; 1103 1104 var instanceName = '__toggle'; 1105 1106 var PluginToggle = function ($el, opts) { 1107 return this.initialize($el, opts); 1108 }; 1109 1110 PluginToggle.defaults = { 1111 duration: 350, 1112 isAccordion: false 1113 }; 1114 1115 PluginToggle.prototype = { 1116 initialize: function ($el, opts) { 1117 if ($el.data(instanceName)) { 1118 return this; 1119 } 1120 1121 this.$el = $el; 1122 1123 this 1124 .setData() 1125 .setOptions(opts) 1126 .build(); 1127 1128 return this; 1129 }, 1130 1131 setData: function () { 1132 this.$el.data(instanceName, this); 1133 1134 return this; 1135 }, 1136 1137 setOptions: function (opts) { 1138 this.options = $.extend(true, {}, PluginToggle.defaults, opts, { 1139 wrapper: this.$el 1140 }); 1141 1142 return this; 1143 }, 1144 1145 build: function () { 1146 var self = this, 1147 $wrapper = this.options.wrapper, 1148 $items = $wrapper.find('.toggle'), 1149 $el = null; 1150 1151 $items.each(function () { 1152 $el = $(this); 1153 1154 if ($el.hasClass('active')) { 1155 $el.find('> p').addClass('preview-active'); 1156 $el.find('> .toggle-content').slideDown(self.options.duration); 1157 } 1158 1159 self.events($el); 1160 }); 1161 1162 if (self.options.isAccordion) { 1163 self.options.duration = self.options.duration / 2; 1164 } 1165 1166 return this; 1167 }, 1168 1169 events: function ($el) { 1170 var self = this, 1171 previewParCurrentHeight = 0, 1172 previewParAnimateHeight = 0, 1173 toggleContent = null; 1174 1175 $el.find('> label, > button').click(function (e) { 1176 1177 var $this = $(this), 1178 parentSection = $this.parent(), 1179 parentWrapper = $this.parents('.toggle'), 1180 previewPar = null, 1181 closeElement = null; 1182 1183 if (self.options.isAccordion && typeof (e.originalEvent) != 'undefined') { 1184 closeElement = parentWrapper.find('.toggle.active > label,.toggle.active > button'); 1185 1186 if (closeElement[0] == $this[0]) { 1187 return; 1188 } 1189 } 1190 1191 parentSection.toggleClass('active'); 1192 1193 // Preview Paragraph 1194 if (parentSection.find('> p').get(0)) { 1195 1196 previewPar = parentSection.find('> p'); 1197 previewParCurrentHeight = previewPar.css('height'); 1198 previewPar.css('height', 'auto'); 1199 previewParAnimateHeight = previewPar.css('height'); 1200 previewPar.css('height', previewParCurrentHeight); 1201 1202 } 1203 1204 // Content 1205 toggleContent = parentSection.find('> .toggle-content'); 1206 1207 if (parentSection.hasClass('active')) { 1208 1209 $(previewPar).animate({ 1210 height: previewParAnimateHeight 1211 }, self.options.duration, function () { 1212 $(this).addClass('preview-active'); 1213 });
1214 1215 toggleContent.slideDown(self.options.duration, function () { 1216 if (closeElement) { 1217 closeElement.trigger('click'); 1218 } 1219 }); 1220 1221 } else { 1222 1223 $(previewPar).animate({ 1224 height: 0 1225 }, self.options.duration, function () { 1226 $(this).removeClass('preview-active'); 1227 }); 1228 1229 toggleContent.slideUp(self.options.duration); 1230 1231 } 1232 1233 }); 1234 } 1235 }; 1236 1237 // expose to scope 1238 $.extend(theme, { 1239 PluginToggle: PluginToggle 1240 }); 1241 1242 // jquery plugin 1243 $.fn.themePluginToggle = function (opts) { 1244 return this.map(function () { 1245 var $this = $(this); 1246 1247 if ($this.data(instanceName)) { 1248 return $this.data(instanceName); 1249 } else { 1250 return new PluginToggle($this, opts); 1251 } 1252 1253 }); 1254 } 1255 1256}).apply(this, [window.theme, jQuery]); 1257 1258// Word Rotate 1259(function (theme, $) { 1260 1261 theme = theme || {}; 1262 1263 var instanceName = '__wordRotate'; 1264 1265 var PluginwordRotate = function ($el, opts) { 1266 return this.initialize($el, opts); 1267 }; 1268 1269 PluginwordRotate.defaults = { 1270 delay: 2000, 1271 animDelay: 300 1272 }; 1273 1274 PluginwordRotate.prototype = { 1275 initialize: function ($el, opts) { 1276 if ($el.data(instanceName)) { 1277 return this; 1278 } 1279 1280 this.$el = $el; 1281 1282 this 1283 .setData() 1284 .setOptions(opts) 1285 .build(); 1286 1287 return this; 1288 }, 1289 1290 setData: function () { 1291 this.$el.data(instanceName, this); 1292 1293 return this; 1294 }, 1295 1296 setOptions: function (opts) { 1297 this.options = $.extend(true, {}, PluginwordRotate.defaults, opts, { 1298 wrapper: this.$el 1299 }); 1300 1301 return this; 1302 }, 1303 1304 build: function () { 1305 var self = this, 1306 $el = this.options.wrapper, 1307 itemsWrapper = $el.find(".word-rotate-items"), 1308 items = itemsWrapper.find("> span"), 1309 firstItem = items.eq(0), 1310 firstItemClone = firstItem.clone(), 1311 currentItem = 1, 1312 currentTop = 0, 1313 itemWidth = 0; 1314 1315 itemsWrapper 1316 .width(firstItem.width() + "px") 1317 .append(firstItemClone); 1318 1319 $el 1320 .addClass("active"); 1321 1322 setInterval(function () { 1323 1324 currentTop = (currentItem * $el.height()); 1325 currentItem++; 1326 1327 if (currentItem <= items.length) { 1328 itemWidth = items.eq(currentItem - 1).width(); 1329 } else { 1330 itemWidth = items.eq(0).width(); 1331 } 1332 1333 itemsWrapper.animate({ 1334 top: -(currentTop) + "px", 1335 width: itemWidth + "px" 1336 }, self.options.animDelay, "easeOutQuad", function () { 1337 1338 if (currentItem > items.length) { 1339 1340 itemsWrapper.css("top", 0); 1341 currentItem = 1; 1342 1343 } 1344 1345 }); 1346 1347 }, self.options.delay); 1348 1349 return this; 1350 } 1351 }; 1352 1353 // expose to scope 1354 $.extend(theme, { 1355 PluginwordRotate: PluginwordRotate 1356 }); 1357 1358 // jquery plugin 1359 $.fn.themePluginwordRotate = function (opts) { 1360 return this.map(function () { 1361 var $this = $(this); 1362 1363 if ($this.data(instanceName)) { 1364 return $this.data(instanceName); 1365 } else { 1366 return new PluginwordRotate($this, opts); 1367 } 1368 1369 }); 1370 } 1371 1372}).apply(this, [window.theme, jQuery]); 1373 1374// Loading Overlay 1375(function (theme, $) { 1376 1377 'use strict'; 1378 1379 theme = theme || {}; 1380 1381 // Default 1382 var loadingOverlayDefaultTemplate = [ 1383 '<div class="loading-overlay">', 1384 '<div class="bounce-loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>', 1385 '</div>' 1386 ].join(''); 1387 1388 // Percentage 1389 var loadingOverlayPercentageTemplate = [ 1390 '<div class="loading-overlay loading-overlay-percentage">', 1391 '<div class="page-loader-progress-wrapper"><span class="page-loader-progress">0</span><span class="page-loader-progress-symbol">%</span></div>', 1392 '</div>' 1393 ].join(''); 1394 1395 // Cubes 1396 var loadingOverlayCubesTemplate = [ 1397 '<div class="loading-overlay">', 1398 '<div class="bounce-loader"><div class="cssload-thecube"><div class="cssload-cube cssload-c1"></div><div class="cssload-cube cssload-c2"></div><div class="cssload-cube cssload-c4"></div><div class="cssload-cube cssload-c3"></div></div></div>', 1399 '</div>' 1400 ].join(''); 1401 1402 // Cube Progress 1403 var loadingOverlayCubeProgressTemplate = [ 1404 '<div class="loading-overlay">', 1405 '<div class="bounce-loader"><span class="cssload-cube-progress"><span class="cssload-cube-progress-inner"></span></span></div>', 1406 '</div>' 1407 ].join(''); 1408 1409 // Float Rings 1410 var loadingOverlayFloatRingsTemplate = [ 1411 '<div class="loading-overlay">', 1412 '<div class="bounce-loader"><div class="cssload-float-rings-loader"><div class="cssload-float-rings-inner cssload-one"></div><div class="cssload-float-rings-inner cssload-two"></div><div class="cssload-float-rings-inner cssload-three"></div></div></div>', 1413 '</div>' 1414 ].join(''); 1415 1416 // Floating Bars 1417 var loadingOverlayFloatBarsTemplate = [ 1418 '<div class="loading-overlay">', 1419 '<div class="bounce-loader"><div class="cssload-float-bars-container"><ul class="cssload-float-bars-flex-container"><li><span class="cssload-float-bars-loading"></span></li></div></div></div>', 1420 '</div>' 1421 ].join(''); 1422 1423 // Speeding Wheel 1424 var loadingOverlaySpeedingWheelTemplate = [ 1425 '<div class="loading-overlay">', 1426 '<div class="bounce-loader"><div class="cssload-speeding-wheel-container"><div class="cssload-speeding-wheel"></div></div></div>', 1427 '</div>' 1428 ].join(''); 1429 1430 // Zenith 1431 var loadingOverlayZenithTemplate = [ 1432 '<div class="loading-overlay">', 1433 '<div class="bounce-loader"><div class="cssload-zenith-container"><div class="cssload-zenith"></div></div></div>', 1434 '</div>' 1435 ].join(''); 1436 1437 // Spinning Square 1438 var loadingOverlaySpinningSquareTemplate = [ 1439 '<div class="loading-overlay">', 1440 '<div class="bounce-loader"><div class="cssload-spinning-square-loading"></div></div>', 1441 '</div>' 1442 ].join(''); 1443 1444 // Pulse
1445 var loadingOverlayPulseTemplate = [ 1446 '<div class="loading-overlay">', 1447 '<div class="bounce-loader"><div class="wrapper-pulse"><div class="cssload-pulse-loader"></div></div></div>', 1448 '</div>' 1449 ].join(''); 1450 1451 var LoadingOverlay = function ($wrapper, options, noInheritOptions) { 1452 return this.initialize($wrapper, options, noInheritOptions); 1453 }; 1454 1455 LoadingOverlay.prototype = { 1456 1457 options: { 1458 css: {}, 1459 hideDelay: 500, 1460 progressMinTimeout: 0, 1461 effect: 'default' 1462 }, 1463 1464 initialize: function ($wrapper, options, noInheritOptions) { 1465 this.$wrapper = $wrapper; 1466 1467 this 1468 .setVars() 1469 .setOptions(options, noInheritOptions) 1470 .build() 1471 .events() 1472 .dynamicShowHideEvents(); 1473 1474 this.$wrapper.data('loadingOverlay', this); 1475 }, 1476 1477 setVars: function () { 1478 this.$overlay = this.$wrapper.find('.loading-overlay'); 1479 this.pageStatus = null; 1480 this.progress = null; 1481 this.animationInterval = 33; 1482 1483 return this; 1484 }, 1485 1486 setOptions: function (options, noInheritOptions) { 1487 if (!this.$overlay.get(0)) { 1488 this.matchProperties(); 1489 } 1490 1491 if (noInheritOptions) { 1492 this.options = $.extend(true, {}, this.options, options); 1493 } else { 1494 this.options = $.extend(true, {}, this.options, options, theme.fn.getOptions(this.$wrapper.data('plugin-options'))); 1495 } 1496 1497 this.loaderClass = this.getLoaderClass(this.options.css.backgroundColor); 1498 1499 return this; 1500 }, 1501 1502 build: function () { 1503 var _self = this; 1504 1505 if (!this.$overlay.closest(document.documentElement).get(0)) { 1506 if (!this.$cachedOverlay) { 1507 1508 switch (_self.options.effect) { 1509 case 'percentageProgress1': 1510 this.$overlay = $(loadingOverlayPercentageTemplate).clone(); 1511 break; 1512 1513 case 'percentageProgress2': 1514 this.$overlay = $(loadingOverlayPercentageTemplate).clone(); 1515 this.$overlay 1516 .addClass('loading-overlay-percentage-effect-2') 1517 .prepend('<div class="loading-overlay-background-layer"></div>'); 1518 break; 1519 1520 case 'cubes': 1521 this.$overlay = $(loadingOverlayCubesTemplate).clone(); 1522 break; 1523 1524 case 'cubeProgress': 1525 this.$overlay = $(loadingOverlayCubeProgressTemplate).clone(); 1526 break; 1527 1528 case 'floatRings': 1529 this.$overlay = $(loadingOverlayFloatRingsTemplate).clone(); 1530 break; 1531 1532 case 'floatBars': 1533 this.$overlay = $(loadingOverlayFloatBarsTemplate).clone(); 1534 break; 1535 1536 case 'speedingWheel': 1537 this.$overlay = $(loadingOverlaySpeedingWheelTemplate).clone(); 1538 break; 1539 1540 case 'zenith': 1541 this.$overlay = $(loadingOverlayZenithTemplate).clone(); 1542 break; 1543 1544 case 'spinningSquare': 1545 this.$overlay = $(loadingOverlaySpinningSquareTemplate).clone(); 1546 break; 1547 1548 case 'pulse': 1549 this.$overlay = $(loadingOverlayPulseTemplate).clone(); 1550 break; 1551 1552 case 'default': 1553 default: 1554 this.$overlay = $(loadingOverlayDefaultTemplate).clone(); 1555 break; 1556 } 1557 1558 if (this.options.css) { 1559 this.$overlay.css(this.options.css); 1560 this.$overlay.find('.loader').addClass(this.loaderClass); 1561 } 1562 } else { 1563 this.$overlay = this.$cachedOverlay.clone(); 1564 } 1565 1566 this.$wrapper.prepend(this.$overlay); 1567 } 1568 1569 if (!this.$cachedOverlay) { 1570 this.$cachedOverlay = this.$overlay.clone(); 1571 } 1572 1573 if (['percentageProgress1', 'percentageProgress2'].includes(_self.options.effect)) { 1574 _self.updateProgress(); 1575 1576 if (_self.options.isDynamicHideShow) { 1577 setTimeout(function () { 1578 _self.progress = 'complete'; 1579 1580 $('.page-loader-progress').text(100); 1581 1582 if (['percentageProgress2'].includes(_self.options.effect)) { 1583 $('.loading-overlay-background-layer').css({ 1584 width: '100%' 1585 }); 1586 } 1587 }, 2800); 1588 } 1589 } 1590 1591 return this; 1592 }, 1593 1594 events: function () { 1595 var _self = this; 1596 1597 if (this.options.startShowing) { 1598 _self.show(); 1599 } 1600 1601 if (this.$wrapper.is('body') || this.options.hideOnWindowLoad) { 1602 $(window).on('load error', function () { 1603 setTimeout(function () { 1604 _self.hide(); 1605 }, _self.options.progressMinTimeout); 1606 }); 1607 } 1608 1609 if (this.options.listenOn) { 1610 $(this.options.listenOn) 1611 .on('loading-overlay:show beforeSend.ic', function (e) { 1612 e.stopPropagation(); 1613 _self.show(); 1614 }) 1615 .on('loading-overlay:hide complete.ic', function (e) { 1616 e.stopPropagation(); 1617 _self.hide(); 1618 });
1619 } 1620 1621 this.$wrapper 1622 .on('loading-overlay:show beforeSend.ic', function (e) { 1623 if (e.target === _self.$wrapper.get(0)) { 1624 e.stopPropagation(); 1625 _self.show(); 1626 return true; 1627 } 1628 return false; 1629 }) 1630 .on('loading-overlay:hide complete.ic', function (e) { 1631 if (e.target === _self.$wrapper.get(0)) { 1632 e.stopPropagation(); 1633 _self.hide(); 1634 return true; 1635 } 1636 return false; 1637 }); 1638 1639 if (['percentageProgress1', 'percentageProgress2'].includes(_self.options.effect)) { 1640 $(window).on('load', function () { 1641 setTimeout(function () { 1642 _self.pageStatus = "complete"; 1643 1644 $('.page-loader-progress').text(100); 1645 1646 if (['percentageProgress2'].includes(_self.options.effect)) { 1647 $('.loading-overlay-background-layer').css({ 1648 width: '100%' 1649 }); 1650 } 1651 }, _self.options.progressMinTimeout); 1652 }); 1653 } 1654 1655 return this; 1656 }, 1657 1658 show: function () { 1659 this.build(); 1660 1661 this.position = this.$wrapper.css('position').toLowerCase(); 1662 if (this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed') { 1663 this.$wrapper.css({ 1664 position: 'relative' 1665 }); 1666 } 1667 this.$wrapper.addClass('loading-overlay-showing'); 1668 }, 1669 1670 hide: function () { 1671 var _self = this; 1672 1673 setTimeout(function () { 1674 _self.$wrapper.removeClass('loading-overlay-showing'); 1675 1676 if (this.position != 'relative' || this.position != 'absolute' || this.position != 'fixed') { 1677 _self.$wrapper.css({ position: '' }); 1678 } 1679 1680 $(window).trigger('loading.overlay.ready'); 1681 }, _self.options.hideDelay); 1682 }, 1683 1684 updateProgress: function () { 1685 var _self = this; 1686 1687 var render = function () { 1688 if (_self.pageStatus == "complete") { 1689 $('.page-loader-progress').text(100); 1690 setTimeout(function () { 1691 $('.page-loader-progress').addClass('d-none'); 1692 }, 700); 1693 } 1694 else { 1695 if (_self.progress == null) { 1696 _self.progress = 1; 1697 } 1698 1699 _self.progress = _self.progress + 1; 1700 if (_self.progress >= 0 && _self.progress <= 30) { 1701 _self.animationInterval += 1; 1702 $('.page-loader-progress').text(_self.progress); 1703 } 1704 else if (_self.progress > 30 && _self.progress <= 60) { 1705 _self.animationInterval += 2; 1706 $('.page-loader-progress').text(_self.progress); 1707 } 1708 else if (_self.progress > 60 && _self.progress <= 80) { 1709 _self.animationInterval += 40; 1710 $('.page-loader-progress').text(_self.progress); 1711 } 1712 else if (_self.progress > 80 && _self.progress <= 90) { 1713 _self.animationInterval += 80; 1714 $('.page-loader-progress').text(_self.progress); 1715 } 1716 else if (_self.progress > 90 && _self.progress <= 95) { 1717 _self.animationInterval += 150; 1718 $('.page-loader-progress').text(_self.progress); 1719 } 1720 else if (_self.progress > 95 && _self.progress <= 99) { 1721 _self.animationInterval += 400; 1722 $('.page-loader-progress').text(_self.progress); 1723 } 1724 else if (_self.progress >= 100) { 1725 $('.page-loader-progress').text(99); 1726 } 1727 1728 if (['percentageProgress2'].includes(_self.options.effect)) { 1729 $('.loading-overlay-background-layer').css({ 1730 width: _self.progress + '%' 1731 }); 1732 } 1733 1734 self.loopInside = setTimeout(render, _self.animationInterval); 1735 } 1736 1737 } 1738 render(); 1739 1740 return this; 1741 }, 1742 1743 matchProperties: function () { 1744 var i, 1745 l, 1746 properties; 1747 1748 properties = [ 1749 'backgroundColor', 1750 'borderRadius' 1751 ]; 1752 1753 l = properties.length; 1754 1755 for (i = 0; i < l; i++) { 1756 var obj = {}; 1757 obj[properties[i]] = this.$wrapper.css(properties[i]); 1758 1759 $.extend(this.options.css, obj); 1760 } 1761 }, 1762 1763 getLoaderClass: function (backgroundColor) { 1764 if (!backgroundColor || backgroundColor === 'transparent' || backgroundColor === 'inherit') { 1765 return 'black'; 1766 } 1767 1768 var hexColor, 1769 r, 1770 g, 1771 b, 1772 yiq; 1773 1774 var colorToHex = function (color) { 1775 var hex, 1776 rgb; 1777 1778 if (color.indexOf('#') > - 1) { 1779 hex = color.replace('#', ''); 1780 } else { 1781 rgb = color.match(/\d+/g); 1782 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); 1783 } 1784 1785 if (hex.length === 3) { 1786 hex = hex + hex; 1787 } 1788 1789 return hex; 1790 }; 1791 1792 hexColor = colorToHex(backgroundColor); 1793 1794 r = parseInt(hexColor.substr(0, 2), 16); 1795 g = parseInt(hexColor.substr(2, 2), 16); 1796 b = parseInt(hexColor.substr(4, 2), 16); 1797 yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1798 1799 return (yiq >= 128) ? 'black' : 'white'; 1800 }, 1801 1802 dynamicShowHide: function (effect) { 1803 var _self = this; 1804 1805 // Remove Loading Overlay Data 1806 $('body').removeData('loadingOverlay'); 1807 1808 // Remove Html Of Loading Overlay 1809 $('.loading-overlay').remove(); 1810 1811 if (effect == '') { 1812 return this; 1813 } 1814 1815 // Initialize New Loading Overlay (second parameter is to NO inherit data-plugin-options) 1816 $('body').loadingOverlay({ 1817 effect: effect ? effect : 'pulse', 1818 isDynamicHideShow: true 1819 }, true); 1820
1821 // Show Loading Overlay Loader 1822 $('body').data('loadingOverlay').show(); 1823 1824 // Hide Loading Overlay Loader 1825 setTimeout(function () { 1826 $('body').data('loadingOverlay').hide(); 1827 }, 3000); 1828 1829 return this; 1830 }, 1831 1832 dynamicShowHideEvents: function () { 1833 var _self = this; 1834 1835 // Button 1836 $(document).off('click.loading-overlay-button').on('click.loading-overlay-button', '.loading-overlay-button', function (e) { 1837 e.preventDefault(); 1838 1839 _self.dynamicShowHide($(this).data('effect')); 1840 }); 1841 1842 return this; 1843 } 1844 1845 }; 1846 1847 // expose to scope 1848 $.extend(theme, { 1849 LoadingOverlay: LoadingOverlay 1850 }); 1851 1852 // expose as a jquery plugin 1853 $.fn.loadingOverlay = function (opts, noInheritOptions) { 1854 return this.each(function () { 1855 var $this = $(this); 1856 1857 var loadingOverlay = $this.data('loadingOverlay'); 1858 if (loadingOverlay) { 1859 return loadingOverlay; 1860 } else { 1861 var options = opts || $this.data('loading-overlay-options') || {}; 1862 return new LoadingOverlay($this, options, noInheritOptions); 1863 } 1864 }); 1865 } 1866 1867 // auto init 1868 $('[data-loading-overlay]').loadingOverlay(); 1869 1870}).apply(this, [window.theme, jQuery]); 1871 1872//Lazy Load Background Images (with lazySizes plugin) 1873document.addEventListener('lazybeforeunveil', function (e) { 1874 var bg = e.target.getAttribute('data-bg-src'); 1875 if (bg) { 1876 e.target.style.backgroundImage = 'url(' + bg + ')'; 1877 } 1878}); 1879 1880//Shape Divider - SVG Aspect Ratio 1881function aspectRatioSVG() { 1882 if ($(window).width() < 1950) { 1883 $('.shape-divider svg[preserveAspectRatio]').each(function () { 1884 if (!$(this).parent().hasClass('shape-divider-horizontal-animation')) { 1885 $(this).attr('preserveAspectRatio', 'xMinYMin'); 1886 } else { 1887 $(this).attr('preserveAspectRatio', 'none'); 1888 } 1889 }); 1890 } else { 1891 $('.shape-divider svg[preserveAspectRatio]').each(function () { 1892 $(this).attr('preserveAspectRatio', 'none'); 1893 }); 1894 } 1895} 1896 1897if ($('.shape-divider').length) { 1898 aspectRatioSVG(); 1899 $(window).on('resize', function () { 1900 aspectRatioSVG(); 1901 }); 1902} 1903 1904//Shape Divider Animated 1905if ($('.shape-divider-horizontal-animation').length) { 1906 theme.fn.intObs('.shape-divider-horizontal-animation', function () { 1907 for (var i = 0; i <= 1; i++) { 1908 var svgClone = $(this).find('svg:nth-child(1)').clone(); 1909 1910 $(this).append(svgClone) 1911 } 1912 1913 $(this).addClass('start'); 1914 }, {}); 1915} 1916 1917// Nav 1918(function (theme, $) { 1919 1920 theme = theme || {}; 1921 1922 var initialized = false; 1923 1924 $.extend(theme, { 1925 1926 Nav: { 1927 1928 defaults: { 1929 wrapper: $('#mainMenu'), 1930 scrollDelay: 600, 1931 scrollAnimation: 'easeOutQuad' 1932 }, 1933 1934 initialize: function ($wrapper, opts) { 1935 if (initialized) { 1936 return this; 1937 } 1938 1939 initialized = true; 1940 this.$wrapper = ($wrapper || this.defaults.wrapper); 1941 1942 this 1943 .setOptions(opts) 1944 .build() 1945 .events(); 1946 1947 return this; 1948 }, 1949 1950 setOptions: function (opts) { 1951 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 1952 1953 return this; 1954 }, 1955 1956 build: function () { 1957 1958 return this; 1959 }, 1960 1961 events: function () { 1962 var self = this, 1963 target = "",
1964 delay = 1, 1965 $header = $('header'), 1966 headerHeight = $header.outerHeight(), 1967 $nav = $('.nav-main'), 1968 $body = $('body'); 1969 1970 $header.find('[href=#]').on('click', function (e) { 1971 e.preventDefault(); 1972 }); 1973 1974 $('ul.image-gallery').parent('.row').css('display', 'block'); 1975 1976 //DNN 9 1977 1978 if ($('.personalBarContainer').length && $('.full-header').length) 1979 $('header.full-header').css('margin-left', '-80px'); 1980 1981 //LSF Widgets 1982 function changeWidgets() { 1983 if ($("header").hasClass("flat-header")) 1984 $(".mini-widgets").addClass("brd-top"); 1985 1986 else if ($("header").hasClass("clean-top")) 1987 $(".mini-widgets").addClass("bg-color-light brd-top"); 1988 1989 if ($(window).width() > 991) { 1990 1991 if ($("header").hasClass("darken-top-border")) 1992 $(".mini-widgets").addClass("darken-border-top"); 1993 1994 if ($(".mini-widgets").find(".DNNEmptyPane").length != 3) { 1995 if ($("header").hasClass("colored")) 1996 $(".mini-widgets").addClass("bg-color-primary"); 1997 1998 else if ($("header").hasClass("newHeader") && !$("header").hasClass("fixedheader")) { 1999 $(".mini-widgets").addClass("widget-overlap") 2000 $(".newHeader").css("margin-top", $(".mini-widgets").height()); 2001 } 2002 2003 else if ($("header").hasClass("header-bottom")) { 2004 $(".mini-widgets").addClass("widget-overlap") 2005 $(".header-bottom").css("margin-top", $(".mini-widgets").height()); 2006 } 2007 2008 else if ($("header").hasClass("full-header") && !$("header").hasClass("fixedheader")) { 2009 $(".mini-widgets").find(".container").addClass("container-fluid").removeClass("container"); 2010 $(".mini-widgets").addClass("widget-overlap bg-color-dark").css("padding-right", "40px"); 2011 $(".full-header").css("margin-top", $(".mini-widgets").height()); 2012 } 2013 2014 if ($("body").hasClass("dnnEditState")) { 2015 $(".mini-widgets").removeClass("widget-overlap"); 2016 $("header").css("margin-top", "0"); 2017 } 2018 } 2019 } 2020 else { 2021 $("header").removeClass("mt-55 mt-38 mt-32") 2022 $(".mini-widgets").removeClass("widget-overlap bg-color-dark darken-border-top"); 2023 } 2024 } 2025 2026 changeWidgets(); 2027 2028 //Skip To Content 2029 $("#SkipContent a").click(function (e) { 2030 e.preventDefault(); 2031 var target = $(this).attr("href"); 2032 window.scrollTo(0, $("#" + target).offset().top - 100); 2033 }); 2034 2035 $("#SkipContent a").on('keyup', function (e) { 2036 if (e.which == 32 || e.which == 13) { 2037 var target = $(this).attr("href"); 2038 $("#" + target).attr('tabindex', '-1').css('outline', 'none').focus(); 2039 } 2040 }); 2041 2042 //VerticalMenu 2043 2044 $vMenu = $('#verticalMenu'); 2045 2046 if ($vMenu.length > 0) 2047 $vMenu.find('.dropdown-toggle, .dropdown:not(.mega-menu-item) .dropdown-submenu > a').append($('<i />').addClass('fas fa-caret-down')); 2048 2049 $('.nav-main').find('.dropdown-toggle[href="#"], .dropdown-submenu [href="#"], .dropdown-toggle[href!="#"] .fa-caret-down, .dropdown-submenu a[href!="#"] .fa-caret-down').on('click', function (e) { 2050 2051 e.preventDefault(); 2052 2053 if ($(window).width() > 991 && $(this).parents('#verticalMenu').length < 0) 2054 return this; 2055 2056 $(this).parent().parent().toggleClass('resp-active'); 2057 2058 return this; 2059 }); 2060 2061 function changeVerticalMenu() { 2062 2063 if ($(window).width() < 992) { 2064 if ($('body').hasClass('v-hamburger')) 2065 $('.v-menu').addClass('hamburger'); 2066 } else 2067 $('.v-menu').removeClass('hamburger'); 2068 2069 if ($('.v-menu').hasClass('hamburger')) { 2070 $('.btn-vertical-nav').show(); 2071 $('.nav-main-vertical').hide(); 2072 } else { 2073 $('.btn-vertical-nav').hide(); 2074 $('.nav-main-vertical').show(); 2075 } 2076 } 2077 2078 $('.btn-vertical-nav').click(function () { 2079 $('.nav-main-vertical').slideToggle('slow'); 2080 }); 2081 2082 //Vertical Menu Keyboard Focus 2083 $('.v-menu nav ul.nav-main > li > a').keyup(function (e) { 2084 if (e.keyCode == 9) { 2085 if ($('.v-menu .dropdown').hasClass('resp-active')) 2086 $('.v-menu .dropdown').removeClass('resp-active'); 2087 $(this).siblings('.dropdown-menu').parent().addClass('resp-active'); 2088 } 2089 }); 2090 2091 $('.v-menu .dropdown-submenu > a').keyup(function (e) { 2092 if (e.keyCode == 9) { 2093 if ($('.v-menu .dropdown-submenu').hasClass('resp-active')) 2094 $('.v-menu .dropdown-submenu').removeClass('resp-active'); 2095 $(this).siblings('.dropdown-menu').parent().addClass('resp-active'); 2096 } 2097 }); 2098 2099 changeVerticalMenu(); 2100 2101 //Accordion 2102 $('.panel-group .accordion-body.collapse').each(function () { 2103 if ($(this).hasClass('in')) 2104 $(this).removeClass('in').addClass('show') 2105 }); 2106 2107 //Toggle 2108 $('a[data-bs-toggle="tab"]').on("shown.bs.tab", function (a) { 2109 $(this).parents(".nav-tabs").find(".active").removeClass("active"), 2110 $(this).addClass("active").parent().addClass("active") 2111 }); 2112 2113 //Toggle Keyboard Focus 2114 $('.toggle-heading').keyup(function (e) { 2115 if (e.keyCode == 9) { 2116 $(this).trigger('click'); 2117 } 2118 }); 2119 2120 //Search 2121 var $search = $('.search .searchInputContainer'); 2122 var inputid = $search.find('input').attr('id'); 2123 $search.append('<label class="sr-only" for="' + inputid + '">Search</label>'); 2124 $search.parent().find('.icon-search').text('Search').css("text-indent", "-9999px"); 2125 2126 //Mini Search 2127 var $searchBlock = $('.search-block .searchInputContainer'); 2128 var inputid = $searchBlock.find('input').attr('id'); 2129 $searchBlock.append('<label class="sr-only" for="' + inputid + '">Mini Search</label>'); 2130 $searchBlock.parent().find('.icon-search').text('Search').css("text-indent", "-9999px"); 2131 2132 function showSearch() { 2133 if ($(window).width() < 992) { 2134 if ($('header .search-block').children().length > 0) 2135 $('header .mini-search').show(); 2136 else 2137 $('header .mini-search').hide(); 2138 } 2139 } 2140 2141 //Header Height 2142 headerBodyHeight = $('header .header-body').outerHeight(); 2143 2144 //Mini Search Animate in Mobile 2145 function animateSearch() { 2146 2147 if ($(window).width() < 992) { 2148 2149 $('header .search-block').on('show.bs.collapse', function () { 2150 2151 $('.header-body').animate({ 2152 'min-height': ($('.search-block').outerHeight() + $('.header-body').outerHeight()) 2153 }, 500); 2154 2155 $('.header-body').css("overflow", "hidden"); 2156 $("header .navbar-collapse").removeClass("show"); 2157 $("header .btn-responsive-nav").find("em").removeClass("fa-times").addClass("fa-bars"); 2158 });
2159 2160 $('header .search-block').on('hide.bs.collapse', function () { 2161 $('.header-body').animate({ 2162 'min-height': headerBodyHeight 2163 }, 250); 2164 }); 2165 2166 $('header .search-block').on('hidden.bs.collapse', function () { 2167 setTimeout(function () { 2168 $('.header-body').removeAttr("style"); 2169 }, 270); 2170 }); 2171 } 2172 } 2173 2174 showSearch(); 2175 animateSearch(); 2176 2177 //Menu Type 2178 if ($nav.hasClass('ddrmenu')) { 2179 $nav.parents('header').addClass('ddrheader'); 2180 $('header').find(".btn-responsive-nav").removeAttr('style'); 2181 } 2182 else if ($nav.hasClass('overlay')) { 2183 $nav.parents('header').addClass('overlayHeader'); 2184 $('header').find(".btn-responsive-nav").removeAttr('style'); 2185 } 2186 else if ($nav.hasClass('push-down')) { 2187 $nav.parents('header').addClass('inlineHeader'); 2188 $('header').find(".btn-responsive-nav").removeAttr('style'); 2189 } 2190 else if ($nav.hasClass('pushdown')) { 2191 $nav.parents('header').addClass('pushdownHeader'); 2192 $('header').find(".btn-responsive-nav").removeAttr('style'); 2193 } 2194 else if ($('.navbar-collapse').hasClass('slidebar')) { 2195 $('header').addClass('slideHeader'); 2196 $('header').find(".btn-responsive-nav").removeAttr('style'); 2197 } 2198 2199 //Change Button Text 2200 $('header .btn-responsive-nav .btn-text-indent').text('Open Menu'); 2201 2202 //Dropdown Menu Keyboard Focus 2203 $(document).click(function () { 2204 $('.dropdown').removeClass('focused'); 2205 $('.dropdown-submenu').removeClass('focused'); 2206 }); 2207 2208 $('header .nav > li > a').focus(function () { 2209 if ($('.dropdown').hasClass('focused')) 2210 $('.dropdown').removeClass('focused'); 2211 $('.dropdown-submenu').removeClass('focused'); 2212 $(this).siblings('.dropdown-menu').parent().addClass('focused'); 2213 }); 2214 2215 $('header .dropdown-submenu a').focus(function () { 2216 if ($(this).parent().siblings('.dropdown-submenu').hasClass('focused')) 2217 $(this).parent().siblings('.dropdown-submenu').removeClass('focused'); 2218 $(this).siblings('.dropdown-menu').parent().addClass('focused'); 2219 }); 2220 2221 $("header .navbar-collapse ul.nav-pills li").last().focusout(function () { 2222 $(".btn-responsive-nav").trigger('click'); 2223 }); 2224 2225 //Header Animate in Mobile 2226 function animateHeader() { 2227 2228 if ($(window).width() < 992) { 2229 2230 if ($('header').hasClass('ddrheader')) { 2231 2232 $('header .navbar-collapse').on('show.bs.collapse', function () { 2233 2234 $('header .header-body').css('max-height', $('header').outerHeight() + 330); 2235 2236 $('.header-body').animate({ 2237 'min-height': ($('.navbar-collapse').height() + $('.header-body').outerHeight()), 2238 }, 500); 2239 2240 $('.header-body').css("overflow", "hidden"); 2241 $("header .search-block").removeClass("show"); 2242 }); 2243 2244 $('header .navbar-collapse').on('hide.bs.collapse', function () { 2245 $('.header-body').animate({ 2246 'min-height': headerBodyHeight 2247 }, 250); 2248 }); 2249 2250 $('header .navbar-collapse').on('hidden.bs.collapse', function () { 2251 setTimeout(function () { 2252 $('.header-body').removeAttr("style"); 2253 }, 270); 2254 }); 2255 2256 } 2257
2258 else if ($('header').hasClass('pushdownHeader')) { 2259 $('header .navbar-collapse').on('show.bs.collapse', function () { 2260 2261 $('header .header-body').css('max-height', $('header').outerHeight() + 330); 2262 2263 $('.header-body').animate({ 2264 'min-height': ($('.pushdown.nav-main-collapse-push').height() + $('.header-body').outerHeight()) 2265 }, 500); 2266 2267 $('.header-body .nav-main-collapse').animate({ 2268 'height': '100%' 2269 }); 2270 2271 $('.header-body').css("overflow", "hidden"); 2272 $("header .search-block").removeClass("show"); 2273 }); 2274 2275 $('header .navbar-collapse').on('hide.bs.collapse', function () { 2276 $('.header-body').animate({ 2277 'min-height': headerBodyHeight 2278 }, 250); 2279 }); 2280 2281 $('header .navbar-collapse').on('hidden.bs.collapse', function () { 2282 setTimeout(function () { 2283 $('.header-body').removeAttr("style"); 2284 }, 270); 2285 }); 2286 } 2287 } 2288 else { 2289 $('.header-body').css('height', 'auto'); 2290 } 2291 } 2292 2293 animateHeader(); 2294 2295 // Setup Menu 2296 $('.btn-responsive-nav').click(function () { 2297 2298 if ($('header').hasClass('overlayHeader')) { 2299 2300 $body.addClass('overlay-effect'); 2301 2302 if ($('header .close-btn').length == 0) { 2303 var close = $('<button type="button" class="close-btn"><em class="fas fa-times"></em></button>'); 2304 $('header .btn-responsive-nav').before(close); 2305 } 2306 2307 $('.overlay-effect .overlayHeader .close-btn').click(function () { 2308 if ($('body').hasClass('overlay-effect')) 2309 overlayHeader($('.overlayHeader'), false); 2310 }); 2311 } else 2312 $(this).find('.fas').toggleClass('fa-bars fa-times'); 2313 2314 if ($nav.hasClass('push-down')) 2315 inlineHeader(false); 2316 2317 }); 2318 2319 //Overlay Menu 2320 2321 $('.overlayHeader .overlay-dropdown a .fa-caret-right').click(function (e) { 2322 e.preventDefault(); 2323 }); 2324 2325 $('.overlayHeader .overlay-dropdown > a').click(function () { 2326 2327 $('.overlayHeader .overlay').removeClass('animate-menu'); 2328 2329 $('.overlayHeader .overlay .nav').hide("drop", { 2330 direction: "right" 2331 }, 50); 2332 $('.overlayHeader .overlay .nav').show("drop", { 2333 direction: "right" 2334 }).delay(100); 2335 2336 $('.overlayHeader .overlay .nav').addClass('dl-subview'); 2337 $(this).parent().addClass('dl-subviewopen'); 2338 }); 2339 2340 $('.overlayHeader .overlay-dropdown-submenu > a').click(function () { 2341 2342 $('.overlayHeader .overlay').removeClass('animate-menu'); 2343 2344 $(this).parents().removeClass('dl-subviewopen'); 2345 2346 $('.overlayHeader .overlay .nav').hide("drop", { 2347 direction: "right" 2348 }, 50); 2349 $('.overlayHeader .overlay .nav').show("drop", { 2350 direction: "right" 2351 }).delay(100); 2352 2353 $('.overlayHeader .overlay-menu').addClass('dl-menu'); 2354 $(this).parent().addClass('dl-submenu'); 2355 $(this).parent().parent().parent().addClass('dl-menuopen dl-subview'); 2356 }); 2357 2358 $('.overlayHeader .overlay .icon-back').click(function () { 2359 2360 if ($('.overlayHeader .overlay li').hasClass('dl-menuopen')) { 2361 2362 $('.overlayHeader .overlay li.dl-subview').addClass('dl-subviewopen').removeClass('dl-subview dl-menuopen'); 2363 $('.overlayHeader .overlay ul').removeClass('dl-menu'); 2364 $('.overlayHeader .overlay li').removeClass('dl-submenu'); 2365 $('.overlayHeader .overlay').addClass('animate-menu'); 2366 } else if ($('.overlayHeader .overlay li').hasClass('dl-subviewopen')) { 2367 2368 $('.overlayHeader').find(".animate-menu").removeClass('animate-menu'); 2369 2370 setTimeout(function () { 2371 $('.overlayHeader .overlay ul').removeClass('dl-subview'); 2372 $('.overlayHeader .overlay li').removeClass('dl-subviewopen'); 2373 $('.overlayHeader .overlay').addClass('animate-menu'); 2374 }, 50); 2375 } 2376 }); 2377 2378 //Inline Menu 2379 2380 $(".inline-menu.nav-main .nav").hide(); 2381 2382 $('.inlineHeader .push-menu a .fa-caret-right').click(function (e) { 2383 e.preventDefault(); 2384 }); 2385 2386 $('.menu-set > a').click(function () { 2387 2388 $('.push-menu').removeClass('push-animate'); 2389 2390 $('.push-menu .nav').hide("drop", { 2391 direction: "right" 2392 }, 50); 2393 $('.push-menu .nav').show("drop", { 2394 direction: "right" 2395 }).delay(100); 2396 2397 $('.push-menu ul.nav').addClass('dl-subview'); 2398 $(this).parent().addClass('dl-subviewopen'); 2399 }); 2400 2401 $('li.menu-set > ul.pushdown-menu > li.pushdown-sub > a').click(function () { 2402 2403 $('.push-menu .push-down').removeClass('push-animate'); 2404 2405 $('ul.pushdown-menu').addClass('subview'); 2406 $(this).parent().addClass('subviewopen'); 2407 2408 $('.push-menu .nav').hide("drop", { 2409 direction: "right" 2410 }, 50); 2411 $('.push-menu .nav').show("drop", { 2412 direction: "right" 2413 }).delay(100); 2414 }); 2415 2416 $('li.pushdown-sub-menu > a').click(function () { 2417 2418 $('.push-menu .push-down').removeClass('push-animate'); 2419 2420 $(this).parent().parent().addClass('sub-view'); 2421 $(this).parent().addClass('open'); 2422 2423 $('.push-menu .nav').hide("drop", { 2424 direction: "right" 2425 }, 50); 2426 $('.push-menu .nav').show("drop", { 2427 direction: "right" 2428 }).delay(100); 2429 }); 2430 2431 $('.backicon').click(function () { 2432 2433 if ($('li.pushdown-sub').hasClass('subviewopen')) { 2434 2435 $('li.pushdown-sub').removeClass('subviewopen'); 2436 $('ul.pushdown-menu').removeClass('subview'); 2437 $('.push-down').addClass('push-animate'); 2438 } else if ($('li').hasClass('dl-subviewopen')) { 2439 2440 $('.push-menu').find(".push-animate").removeClass('push-animate'); 2441 2442 setTimeout(function () { 2443 $('ul').removeClass('dl-subview'); 2444 $('li').removeClass('dl-subviewopen'); 2445 $('.push-down').addClass('push-animate'); 2446 }, 100); 2447 } 2448 }); 2449 2450 //Pushdown Menu 2451
2452 $(".pushdownHeader .btn-responsive-nav").hide(); 2453 $(".pushdown .scrollbar").hide(); 2454 2455 $(".nav-main.pushdown").addClass("collapse"); 2456 2457 if ($(".pushdownHeader").length > 0) 2458 $(".nav-main-collapse").removeClass("collapse"); 2459 2460 if ($nav.hasClass('pushdown')) { 2461 $(".btn-push-nav").click(function () { 2462 pushdownMenu(); 2463 $(".pushdown .scrollbar").show(); 2464 }); 2465 } 2466 2467 $('nav.pushdown ul.nav-main li a').click(function () { 2468 $(this).parent().toggleClass('resp-active'); 2469 }); 2470 2471 $(window).on('scroll resize', function () { 2472 $(".pushdownHeader .btn-responsive-nav").hide(); 2473 }); 2474 2475 if ($(".pushdownHeader").length > 0) { 2476 2477 if (($header.hasClass('flat-header')) || ($header.hasClass('newHeader'))) { 2478 $('header div.social-icons').css('margin-right', '40px'); 2479 } 2480 } 2481 2482 //Resize 2483 $(window).on('resize', function () { 2484 changeVerticalMenu(); 2485 showSearch(); 2486 animateSearch(); 2487 animateHeader(); 2488 changeWidgets(); 2489 2490 $('header').find(".btn-responsive-nav").removeAttr('style'); 2491 }); 2492 2493 // Add Arrows 2494 if ($(window).width() > 991) 2495 $header.find('.dropdown-toggle, .dropdown:not(.mega-menu-item) .dropdown-submenu > a').append($('<i />').addClass('fas fa-caret-down')); 2496 else 2497 $header.find('.dropdown-toggle, .dropdown .dropdown-submenu > a').append($('<i />').addClass('fas fa-caret-down')); 2498 2499 if ($(window).width() < 992) { 2500 $(".navbar-collapse ul li.mega-menu-item").each(function () { 2501 if (!$(this).find(".dropdown-menu > li").length) 2502 $(this).find(".fa-caret-down").hide(); 2503 }); 2504 } 2505 2506 // Mobile Arrows 2507 $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) { 2508 e.preventDefault(); 2509 2510 if ($(window).width() < 992) { 2511 2512 $(this).closest('li').toggleClass('opened'); 2513 2514 if ($(this).closest('li').hasClass('opened')) { 2515 $('header.ddrheader .header-body').css({ 2516 "height": $(this).closest('li').height() + $('.header-body').height(), 2517 "max-height": parseInt($('header').css('min-height')) + 330 2518 }); 2519 } 2520 else { 2521 setTimeout(function () { 2522 $('header.ddrheader .header-body').css({ 2523 "height": "auto", 2524 "min-height": $('.navbar-collapse').height() + parseInt($('header').css('min-height')), 2525 "max-height": $('.navbar-collapse').height() + parseInt($('header').css('min-height')) 2526 });
2527 }, 100); 2528 } 2529 } 2530 }); 2531 2532 // Anchors Position 2533 $('[data-hash]').each(function () { 2534 2535 var target = $(this).attr('href'), 2536 offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0); 2537 2538 if ($(target).get(0)) { 2539 $(this).on('click', function (e) { 2540 e.preventDefault(); 2541 2542 if (!$(e.target).is('i')) { 2543 2544 // Close Collapse if Opened 2545 $(this).parents('.collapse.show').collapse('hide'); 2546 2547 self.scrollToTarget(target, offset); 2548 } 2549 return; 2550 }); 2551 } 2552 }); 2553 2554 // Mobile Redirect - (Ignores the Dropdown from Bootstrap) 2555 $('.mobile-redirect').on('click', function () { 2556 if ($(window).width() < 992) { 2557 self.location = $(this).attr('href'); 2558 } 2559 }); 2560 2561 // Dropdown Menu Check Visible Space 2562 $("#mainMenu li.dropdown").hover(function () { 2563 2564 if ($(window).width() < 767) return; 2565 2566 var menuItem = $(this); 2567 var subMenu = $(this).find("> ul.dropdown-menu"); 2568 2569 var screenWidth = $(window).width(), 2570 menuItemWidth = menuItem.width(), 2571 subMenuWidth = subMenu.width(), 2572 menuItemPosRight = subMenu.offset().left + subMenu.width(); 2573 2574 if (menuItemPosRight > screenWidth) { 2575 subMenu.css("margin-left", "-" + ((subMenuWidth - menuItemWidth) + 10) + "px"); 2576 subMenu.css('border-radius', '0'); 2577 } else 2578 subMenu.css("margin-left", '2px'); 2579 }); 2580 2581 // Submenu Check Visible Space 2582 $("#mainMenu li.dropdown-submenu").hover(function () { 2583 2584 if ($(window).width() < 767) return; 2585 2586 var subMenu = $(this).find("ul.dropdown-menu"); 2587 2588 if (!subMenu.get(0)) return; 2589 2590 var screenWidth = $(window).width(), 2591 subMenuWidth = subMenu.width(), 2592 subMenuParentWidth = $(this).parent().width(), 2593 subMenuPosRight = subMenu.offset().left + subMenu.width(); 2594 2595 if (subMenuPosRight > screenWidth) 2596 subMenu.css("margin-left", "-" + (subMenuParentWidth + subMenuWidth + 10) + "px"); 2597 else 2598 subMenu.css("margin-left", 0); 2599 }); 2600 2601 return this; 2602 }, 2603 2604 scrollToTarget: function (target, offset) { 2605 var self = this; 2606 2607 $('body').addClass('scrolling'); 2608 2609 $('html, body').animate({ 2610 scrollTop: $(target).offset().top - offset 2611 }, self.options.scrollDelay, self.options.scrollAnimation, function () { 2612 $('body').removeClass('scrolling'); 2613 }); 2614 2615 return this; 2616 2617 } 2618 2619 } 2620 2621 }); 2622 2623}).apply(this, [window.theme, jQuery]); 2624 2625// Sticky Menu 2626(function (theme, $) { 2627 2628 theme = theme || {}; 2629 2630 var initialized = false; 2631 2632 $.extend(theme, { 2633 2634 StickyMenu: { 2635 2636 defaults: { 2637 wrapper: $('header'), 2638 stickyEnabled: true, 2639 stickyEnableOnBoxed: true, 2640 stickyEnableOnMobile: true, 2641 stickyWithGap: true, 2642 stickyChangeLogoSize: true, 2643 stickyBodyPadding: false, 2644 menuAfterHeader: false, 2645 alwaysStickyEnabled: false, 2646 stickyForceHeaderTop: false, 2647 logoPaddingTop: 28, 2648 logoSmallHeight: 40 2649 }, 2650 2651 initialize: function ($wrapper, opts, sw) { 2652 if (!sw && initialized) { 2653 return this; 2654 } 2655 2656 initialized = true; 2657 this.$wrapper = ($wrapper || this.defaults.wrapper); 2658 2659 this 2660 .setOptions(opts) 2661 .build() 2662 .events(); 2663 2664 return this; 2665 }, 2666 2667 setOptions: function (opts) { 2668 this.options = $.extend(true, {}, this.defaults, opts, this.$wrapper.data('plugin-options')); 2669 2670 return this; 2671 }, 2672 2673 build: function () { 2674 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed') || !this.options.stickyEnabled) { 2675 return this; 2676 } 2677 2678 var self = this, 2679 $window = $(window); 2680 $body = $('body'), 2681 $header = self.$wrapper, 2682 $headerContainer = $header.parent(), 2683 $headerNavItems = $header.find('ul.nav-main > li > a'), 2684 $logoWrapper = $header.find('.logo'), 2685 $logo = $logoWrapper.find('img'), 2686 logoHeight = $logo.height(), 2687 logoPaddingTop = parseInt($logo.attr('data-sticky-padding') ? $logo.attr('data-sticky-padding') : self.options.logoPaddingTop), 2688 logoSmallHeight = parseInt($logo.attr('data-sticky-height') ? $logo.attr('data-sticky-height') : self.options.logoSmallHeight), 2689 headerHeight = $header.height(), 2690 stickyGap = 0; 2691 2692 if (logoHeight == 0) { 2693 setTimeout(function () { 2694 logoHeight = $logo.height(); 2695 }, 400); 2696 } else { 2697 2698 if ($('header').outerHeight() > 0) 2699 $('header').css('min-height', $('header').outerHeight()); 2700 } 2701 2702 if (this.options.menuAfterHeader) { 2703 $headerContainer.css('min-height', $header.height()); 2704 } 2705 2706 $window.afterResize(function () { 2707 $headerContainer.css('min-height', $header.height()); 2708 }); 2709 2710 self.checkStickyMenu = function () { 2711 2712 if ((!self.options.stickyEnableOnBoxed && $body.hasClass('boxed')) || ($window.width() < 991 && !self.options.stickyEnableOnMobile)) { 2713 self.stickyMenuDeactivate(); 2714 $header.removeClass('fixed') 2715 return false; 2716 } 2717 2718 if (self.options.stickyWithGap && headerHeight > 0) { 2719 stickyGap = ((headerHeight - 15) - logoSmallHeight); 2720 } else { 2721 stickyGap = 0; 2722 } 2723 2724 // Menu After Header 2725 if (!this.options.menuAfterHeader) { 2726 2727 if ($window.scrollTop() > stickyGap) { 2728 self.stickyMenuActivate(); 2729 } else { 2730 self.stickyMenuDeactivate(); 2731 } 2732 2733 } else { 2734 2735 if ($window.scrollTop() > $headerContainer.offset().top) { 2736 $header.addClass('fixed'); 2737 } else { 2738 $header.removeClass('fixed'); 2739 } 2740 2741 } 2742 2743 } 2744 2745 self.stickyMenuActivate = function () { 2746 2747 if ($body.hasClass('sticky-menu-active')) { 2748 return false; 2749 } 2750 2751 logoHeight = $logo.height(); 2752 2753 $logo.stop(true, true); 2754 2755 $body.addClass('sticky-menu-active').removeClass('sticky-menu-deactive'); 2756 2757 if (self.options.stickyBodyPadding) { 2758 $body.css('padding-top', headerHeight); 2759 } 2760 2761 // Flat Menu Items 2762 if ($header.hasClass('flat-menu')) { 2763 $headerNavItems.addClass('sticky-menu-active'); 2764 } 2765 2766 if (self.options.stickyChangeLogoSize) { 2767 2768 $logoWrapper.addClass('logo-sticky-active'); 2769 2770 $logo.animate({ 2771 height: logoSmallHeight, 2772 top: logoPaddingTop + 'px' 2773 }, 200, function () { 2774 $.event.trigger({ 2775 type: 'stickyMenu.active' 2776 });
2777 }); 2778 2779 } else { 2780 $.event.trigger({ 2781 type: 'stickyMenu.active' 2782 }); 2783 } 2784 2785 if (self.options.stickyForceHeaderTop) { 2786 $header.css('top', self.options.stickyForceHeaderTop); 2787 } 2788 2789 } 2790 2791 self.stickyMenuDeactivate = function () { 2792 2793 if ($body.hasClass('sticky-menu-active')) { 2794 2795 $body.removeClass('sticky-menu-active').addClass('sticky-menu-deactive'); 2796 2797 if (self.options.stickyBodyPadding) { 2798 $body.css('padding-top', 0); 2799 } 2800 2801 // Flat Menu Items 2802 if ($header.hasClass('flat-menu')) { 2803 $headerNavItems.removeClass('sticky-menu-active'); 2804 } 2805 2806 if (self.options.stickyChangeLogoSize) { 2807 2808 $logoWrapper.removeClass('logo-sticky-active'); 2809 2810 $logo.animate({ 2811 height: logoHeight, 2812 top: '0px' 2813 }, 200, function () { 2814 $.event.trigger({ 2815 type: 'stickyMenu.deactive' 2816 }); 2817 $window.trigger('resize'); 2818 }); 2819 2820 } else { 2821 $.event.trigger({ 2822 type: 'stickyMenu.deactive' 2823 }); 2824 } 2825 2826 } 2827 2828 if (self.options.stickyForceHeaderTop) { 2829 $header.css('top', '0'); 2830 } 2831 2832 } 2833 2834 if (!self.options.alwaysStickyEnabled) { 2835 2836 $body.addClass('sticky-menu-deactive'); 2837 2838 self.checkStickyMenu(); 2839 2840 } else { 2841 2842 $body.addClass('sticky-menu-active always-sticky').removeClass('sticky-menu-deactive'); 2843 2844 if (self.options.stickyBodyPadding) { 2845 $body.css('padding-top', $header.height() + ($header.hasClass('narrow') ? 0 : 22)); 2846 } 2847 2848 } 2849 2850 return this; 2851 }, 2852 2853 events: function () { 2854 var self = this; 2855 2856 if (!this.options.stickyEnableOnBoxed && $('body').hasClass('boxed')) { 2857 return this; 2858 } 2859 2860 if (!self.options.alwaysStickyEnabled) { 2861 $(window).on('scroll resize', function () { 2862 if (self.options.stickyEnabled) 2863 self.checkStickyMenu(); 2864 else { 2865 if ($(window).scrollTop() > 0) 2866 $('body').addClass('sticky-disable'); 2867 else 2868 $('body').removeClass('sticky-disable'); 2869 } 2870 }); 2871 } 2872 $('.btn-responsive-nav').on('click', function (e) { 2873 e.preventDefault(); 2874 }); 2875 2876 return this; 2877 } 2878 2879 } 2880 2881 }); 2882 2883}).apply(this, [window.theme, jQuery]); 2884 2885// Scroll to Top 2886(function (theme, $) { 2887 2888 theme = theme || {}; 2889 2890 $.extend(theme, { 2891 2892 PluginScrollToTop: { 2893 2894 defaults: { 2895 wrapper: $('body'), 2896 offset: 150, 2897 buttonClass: 'scroll-to-top', 2898 iconClass: 'fa fa-chevron-up', 2899 delay: 500, 2900 visibleMobile: false, 2901 label: false 2902 }, 2903 2904 initialize: function (opts) { 2905 initialized = true; 2906 2907 this 2908 .setOptions(opts) 2909 .build() 2910 .events(); 2911 2912 return this; 2913 }, 2914 2915 setOptions: function (opts) { 2916 this.options = $.extend(true, {}, this.defaults, opts); 2917 2918 return this; 2919 }, 2920 2921 build: function () { 2922 var self = this, 2923 $el; 2924 2925 // Base HTML Markup 2926 $el = $('<a />') 2927 .addClass(self.options.buttonClass) 2928 .attr({ 2929 'href': '#', 2930 }) 2931 .append( 2932 $('<i />') 2933 .addClass(self.options.iconClass).html('<span class="scroll-indent">scroller</span>') 2934 ); 2935 2936 // Visible Mobile 2937 if (!self.options.visibleMobile) { 2938 $el.addClass('hidden-mobile'); 2939 } 2940 2941 // Label 2942 if (self.options.label) { 2943 $el.append( 2944 $('<span />').html(self.options.label) 2945 ); 2946 } 2947 2948 this.options.wrapper.append($el); 2949 2950 this.$el = $el; 2951 2952 return this; 2953 }, 2954 2955 events: function () { 2956 var self = this, 2957 _isScrolling = false; 2958 2959 // Click Element Action 2960 self.$el.on('click', function (e) { 2961 e.preventDefault(); 2962 $('body, html').animate({ 2963 scrollTop: 0 2964 }, self.options.delay); 2965 return false; 2966 }); 2967 2968 // Show/Hide Button on Window Scroll event. 2969 $(window).scroll(function () { 2970 2971 if (!_isScrolling) { 2972 2973 _isScrolling = true; 2974 2975 if ($(window).scrollTop() > self.options.offset) { 2976 2977 self.$el.stop(true, true).addClass('visible'); 2978 _isScrolling = false; 2979 2980 } else { 2981 2982 self.$el.stop(true, true).removeClass('visible'); 2983 _isScrolling = false; 2984 2985 } 2986 2987 } 2988 2989 }); 2990 2991 return this; 2992 } 2993 2994 } 2995 2996 }); 2997 2998}).apply(this, [window.theme, jQuery]); 2999 3000// Parallax 3001(function (theme, $) { 3002 3003 theme = theme || {}; 3004 3005 $.extend(theme, { 3006 3007 PluginParallax: { 3008 3009 defaults: { 3010 itemsSelector: '.parallax-background', 3011 offset: 0, 3012 horizontalPosition: '50%', 3013 speed: 1.5, 3014 horizontalScrolling: false 3015 }, 3016 3017 initialize: function (opts) { 3018 3019 this 3020 .setOptions(opts) 3021 .build(); 3022 3023 return this; 3024 }, 3025 3026 setOptions: function (opts) { 3027 this.options = $.extend(true, {}, this.defaults, opts); 3028 3029 return this; 3030 }, 3031 3032 build: function () { 3033 if (!($.isFunction($.fn.stellar)) || typeof (Modernizr.touch) == 'undefined') { 3034 return this; 3035 } 3036 3037 var self = this; 3038 3039 $(window).load(function () { 3040 3041 if (!Modernizr.touch) { 3042 $.stellar(self.options).addClass('parallax-ready'); 3043 } else { 3044 $(self.options.itemsSelector).addClass('parallax-touch'); 3045 $(window).on('scroll resize', function () { 3046 yPos = -($(window).scrollTop()) / ((self.options.speed + 2)); 3047 plxPos = (yPos < 0) ? Math.abs(yPos) : -Math.abs(yPos); 3048 bgpos = self.options.horizontalPosition + ' ' + yPos + 'px'; 3049 $(self.options.itemsSelector).css('background-position', bgpos); 3050 });
3051 } 3052 3053 }); 3054 3055 return this; 3056 } 3057 3058 } 3059 3060 }); 3061 3062}).apply(this, [window.theme, jQuery]); 3063 3064// Commom Plugins 3065(function ($) { 3066 3067 'use strict'; 3068 3069 // Scroll to Top Button. 3070 if (typeof theme.PluginScrollToTop !== 'undefined') { 3071 theme.PluginScrollToTop.initialize(); 3072 } 3073 3074 // Parallax 3075 if (typeof theme.PluginParallax !== 'undefined') { 3076 theme.PluginParallax.initialize(); 3077 } 3078 3079 // Tooltips 3080 if ($.isFunction($.fn['tooltip'])) { 3081 3082 var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"], [data-toggle="tooltip"], [data-tooltip]:not(.manual), [data-plugin-tooltip]:not(.manual), a[rel=tooltip]')) 3083 tooltipTriggerList.map(function (tooltipTriggerEl) { 3084 return new bootstrap.Tooltip(tooltipTriggerEl) 3085 }); 3086 } 3087 3088 // Popover 3089 if ($.isFunction($.fn['popover'])) { 3090 $(function () { 3091 $('[data-plugin-popover]:not(.manual)').each(function () { 3092 var $this = $(this), 3093 opts; 3094 3095 var pluginOptions = $this.data('plugin-options'); 3096 if (pluginOptions) 3097 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3098 3099 $this.popover(opts); 3100 }); 3101 }); 3102 } 3103 3104 var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')); 3105 popoverTriggerList.map(function (popoverTriggerEl) { 3106 return new bootstrap.Popover(popoverTriggerEl) 3107 }); 3108 3109 // Match Height 3110 if ($.isFunction($.fn['matchHeight'])) { 3111 3112 $('.match-height').matchHeight(); 3113 3114 // Featured Boxes 3115 $('.featured-boxes .featured-box').matchHeight(); 3116 3117 // Featured Box Full 3118 $('.featured-box-full').matchHeight(); 3119 3120 } 3121 3122}).apply(this, [jQuery]); 3123 3124// Before / After 3125(function ($) { 3126 3127 'use strict'; 3128 3129 if ($.isFunction($.fn['themePluginBeforeAfter']) && $('[data-plugin-before-after]').length) { 3130 theme.fn.intObsInit('[data-plugin-before-after]:not(.manual)', 'themePluginBeforeAfter'); 3131 } 3132 3133}).apply(this, [jQuery]); 3134 3135// Countdown 3136(function ($) { 3137 3138 'use strict'; 3139 3140 if ($.isFunction($.fn['themePluginCountdown'])) { 3141 3142 $(function () { 3143 $('[data-plugin-countdown]').each(function () { 3144 var $this = $(this), 3145 opts; 3146 3147 var pluginOptions = $this.data('plugin-options'); 3148 if (pluginOptions) 3149 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3150 3151 $this.themePluginCountdown(opts); 3152 }); 3153 }); 3154 3155 } 3156 3157}).apply(this, [jQuery]); 3158 3159// Counter 3160(function ($) { 3161 3162 'use strict'; 3163 3164 if ($.isFunction($.fn['themePluginCounter'])) { 3165 3166 $(function () { 3167 $('[data-plugin-counter]:not(.manual), .counters [data-to]').each(function () { 3168 var $this = $(this), 3169 opts; 3170 3171 var pluginOptions = $this.data('plugin-options'); 3172 if (pluginOptions) 3173 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3174 3175 $this.themePluginCounter(opts); 3176 }); 3177 }); 3178 3179 } 3180 3181}).apply(this, [jQuery]); 3182 3183// Match Height 3184(function ($) { 3185 3186 'use strict'; 3187 3188 if ($.isFunction($.fn['themePluginMatchHeight'])) { 3189 3190 $(function () { 3191 $('[data-plugin-match-height]:not(.manual)').each(function () { 3192 var $this = $(this), 3193 opts; 3194 3195 var pluginOptions = $this.data('plugin-options'); 3196 if (pluginOptions) 3197 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3198 3199 $this.themePluginMatchHeight(opts); 3200 }); 3201 }); 3202 3203 } 3204 3205}).apply(this, [jQuery]); 3206 3207// Sticky 3208(function ($) { 3209 3210 'use strict'; 3211 3212 if ($.isFunction($.fn['themePluginSticky'])) { 3213 3214 $(function () { 3215 $('[data-plugin-sticky]:not(.manual)').each(function () { 3216 var $this = $(this), 3217 opts; 3218 3219 var pluginOptions = $this.data('plugin-options'); 3220 if (pluginOptions) 3221 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3222 3223 $this.themePluginSticky(opts); 3224 }); 3225 }); 3226 3227 } 3228 3229}).apply(this, [jQuery]); 3230 3231// Move Cloud 3232(function ($) { 3233 3234 'use strict'; 3235 3236 if ($('.cloud').get(0)) { 3237 var moveCloud = function () { 3238 $('.cloud').animate({ 3239 'top': '+=20px' 3240 }, 3000, 'linear', function () { 3241 $('.cloud').animate({ 3242 'top': '-=20px' 3243 }, 3000, 'linear', function () { 3244 moveCloud(); 3245 }); 3246 }); 3247 }; 3248 3249 moveCloud(); 3250 } 3251 3252}).apply(this, [jQuery]); 3253 3254// Toggle 3255(function ($) { 3256 3257 'use strict'; 3258 3259 if ($.isFunction($.fn['themePluginToggle'])) { 3260 3261 $(function () { 3262 3263 //Added toogle class to support backward compatibility 3264 $('[data-plugin-toggle]:not(.manual), .toogle').each(function () { 3265 var $this = $(this), 3266 opts; 3267 3268 var pluginOptions = $this.data('plugin-options'); 3269 if (pluginOptions) 3270 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3271 3272 $this.themePluginToggle(opts); 3273 }); 3274 3275 //Added toggle class to support backward compatibility 3276 $('section.toggle').parent(':not([class])').each(function () { 3277 var $this = $(this), 3278 opts; 3279 3280 var pluginOptions = $this.data('plugin-options'); 3281 if (pluginOptions) 3282 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3283 3284 $this.themePluginToggle(opts); 3285 }); 3286 }); 3287 3288 } 3289 3290}).apply(this, [jQuery]); 3291 3292// Word Rotate 3293(function ($) { 3294 3295 'use strict'; 3296 3297 if ($.isFunction($.fn['themePluginwordRotate'])) { 3298 3299 $(function () { 3300 $('[data-plugin-word-rotate]:not(.manual), .word-rotate:not(.manual)').each(function () { 3301 var $this = $(this), 3302 opts; 3303 3304 var pluginOptions = $this.data('plugin-options'); 3305 if (pluginOptions) 3306 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3307 3308 $this.themePluginwordRotate(opts); 3309 }); 3310 }); 3311 3312 } 3313 3314}).apply(this, [jQuery]); 3315 3316 3317 3318// Commom Partials 3319(function ($) { 3320 3321 'use strict'; 3322 3323 // Sticky Menu 3324 if (typeof theme.StickyMenu !== 'undefined') { 3325 theme.StickyMenu.initialize(); 3326 } 3327 3328 // Nav Menu 3329 if (typeof theme.Nav !== 'undefined') { 3330 theme.Nav.initialize(); 3331 } 3332 3333 if ($(window).width() < 992) 3334 fixedHeader(); 3335 3336 $(window).on('resize', function () { 3337 fixedHeader(); 3338 }); 3339 3340}).apply(this, [jQuery]); 3341 3342// Fixed Header 3343function fixedHeader() { 3344 3345 var hasFixed = $('header').hasClass('fixedheader'); 3346 var $header = $('header'); 3347 if ($(window).width() < 992) 3348 $header.addClass('fixedheader'); 3349 else { 3350 if (!hasFixed) 3351 $header.removeClass('fixedheader'); 3352 } 3353} 3354 3355// Overlay Menu 3356function overlayHeader($overlayHeader, onePage) { 3357 3358 $('body').removeClass('overlay-effect'); 3359 $overlayHeader.find('button.close-btn').remove(); 3360 $overlayHeader.find('.overlay ul').removeClass('dl-menu, dl-subview'); 3361 $overlayHeader.find('.overlay li').removeClass('dl-submenu, dl-subviewopen'); 3362 3363 if (onePage) { 3364 $overlayHeader.find('.overlay').addClass('one-menu'); 3365 $('.btn-responsive-nav').click(function () { 3366 $overlayHeader.find('.overlay').removeClass('one-menu'); 3367 }); 3368 } 3369 3370 if (!onePage) { 3371 $overlayHeader.find('.overlay').removeClass('animate-menu'); 3372 3373 } 3374} 3375 3376// Pushdown & Inline Menu 3377function inlineHeader(onePage) { 3378 3379 if (!onePage) 3380 $body.toggleClass('show-menu'); 3381 3382 else { 3383 $('body').removeClass('show-menu'); 3384 $body.find('.push-down ul').removeClass('dl-subview'); 3385 $('.btn-responsive-nav').find('.fas').switchClass('fa-close', 'fa-bars'); 3386 } 3387} 3388 3389function pushdownMenu(onePage) { 3390 $(".pushdown.collapse").addClass("nav-main-collapse-push"); 3391 $("header").toggleClass("pushdownshow"); 3392} 3393
3394var pushMenu = $(".pushdownHeader"); 3395if (pushMenu.length > 0) 3396 $(".nav-main-collapse").removeClass("collapse"); 3397$(".nav-main.pushdown").addClass("collapse"); 3398$(".pushdown .scrollbar").hide(); 3399 3400// Added below code to support backward compatibility 3401/* Circular Bars - Knob */ 3402if (typeof ($.fn.knob) != "undefined") { 3403 $(".knob").knob({}); 3404} 3405 3406$(document).on('click.bs.modal.data-api', '[data-bs-toggle="modal"]', function (e) { 3407 e.preventDefault(); 3408}); 3409 3410//Google Map 3411$(window).load(function () { 3412 $('.google-map img:not([alt])').attr('alt', 'Google Map'); 3413}); 3414 3415//Slide Menu 3416$('.nav-main-collapse.slidebar nav ul.nav-main li a').click(function () { 3417 $(this).parent().toggleClass('sub-open'); 3418}); 3419 3420$('.nav-main').find('.dropdown-toggle[href="#"], .dropdown-submenu [href="#"], .dropdown-toggle[href!="#"] .fa-caret-down, .dropdown-submenu a[href!="#"] .fa-caret-down').on('click', function (e) { 3421 3422 e.preventDefault(); 3423 3424 if ($(window).width() > 991 && $(this).parents('.slidebar').length < 0) 3425 return this; 3426 3427 return this; 3428}); 3429 3430(function ($) { 3431 3432 // Create a new instance of Slidebars 3433 var controller = new slidebars(); 3434 3435 // Initialize Slidebars 3436 controller.init(); 3437 3438 // Left Slidebar controls 3439 $('.btn-responsive-nav').on('click', function (event) { 3440 controller.toggle('slidebar'); 3441 }); 3442 3443 $('.close-icon .fa-times-circle').on('click', function (event) { 3444 $SideClose = $(".btn-responsive-nav .fa-times"); 3445 if ($SideClose.length > 0) 3446 $(".btn-responsive-nav .fas").removeClass('fa-times').addClass('fa-bars'); 3447 controller.close('slidebar'); 3448 }); 3449 3450})(jQuery); 3451// Video Background 3452(function (theme, $) { 3453 3454 theme = theme || {}; 3455 3456 var instanceName = '__videobackground'; 3457 3458 var PluginVideoBackground = function ($el, opts) { 3459 return this.initialize($el, opts); 3460 }; 3461 3462 PluginVideoBackground.defaults = { 3463 overlay: true, 3464 volume: 1, 3465 playbackRate: 1, 3466 muted: true, 3467 loop: true, 3468 autoplay: true, 3469 position: '50% 50%', 3470 posterType: 'detect' 3471 }; 3472 3473 PluginVideoBackground.prototype = { 3474 initialize: function ($el, opts) { 3475 this.$el = $el; 3476 3477 this 3478 .setData() 3479 .setOptions(opts) 3480 .build(); 3481 3482 return this; 3483 }, 3484 3485 setData: function () { 3486 this.$el.data(instanceName, this); 3487 3488 return this; 3489 }, 3490 3491 setOptions: function (opts) { 3492 this.options = $.extend(true, {}, PluginVideoBackground.defaults, opts, { 3493 path: this.$el.data('video-path'), 3494 wrapper: this.$el 3495 }); 3496 3497 return this; 3498 }, 3499 3500 build: function () { 3501 3502 if (!($.isFunction($.fn.vide)) || (!this.options.path)) { 3503 return this; 3504 } 3505 3506 if (this.options.overlay) { 3507 this.options.wrapper.prepend( 3508 $('<div />').addClass('video-overlay') 3509 ); 3510 } 3511 3512 this.options.wrapper.vide(this.options.path, this.options); 3513 3514 return this; 3515 } 3516 }; 3517 3518 // expose to scope 3519 $.extend(theme, { 3520 PluginVideoBackground: PluginVideoBackground 3521 }); 3522 3523 // jquery plugin 3524 $.fn.themePluginVideoBackground = function (opts) { 3525 return this.map(function () { 3526 var $this = $(this); 3527 3528 if ($this.data(instanceName)) { 3529 return $this.data(instanceName); 3530 } else { 3531 return new PluginVideoBackground($this, opts); 3532 } 3533 3534 }); 3535 } 3536 3537}).apply(this, [window.theme, jQuery]); 3538 3539// Video Background 3540(function ($) { 3541 3542 'use strict'; 3543 3544 if ($.isFunction($.fn['themePluginVideoBackground'])) { 3545 3546 $(function () { 3547 $('[data-plugin-video-background]:not(.manual)').each(function () { 3548 var $this = $(this), 3549 opts; 3550 3551 var pluginOptions = $this.data('plugin-options'); 3552 if (pluginOptions) 3553 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3554
3555 $this.themePluginVideoBackground(opts); 3556 }); 3557 }); 3558 3559 } 3560 3561}).apply(this, [jQuery]); 3562 3563// Parallax 3564(function (theme, $) { 3565 3566 theme = theme || {}; 3567 3568 var instanceName = '__parallax'; 3569 3570 var PluginParallax = function ($el, opts) { 3571 return this.initialize($el, opts); 3572 }; 3573 3574 PluginParallax.defaults = { 3575 speed: 1.5, 3576 horizontalPosition: '50%', 3577 offset: 0, 3578 parallaxHeight: '100vh' 3579 }; 3580 3581 PluginParallax.prototype = { 3582 initialize: function ($el, opts) { 3583 if ($el.data(instanceName)) { 3584 return this; 3585 } 3586 3587 this.$el = $el; 3588 3589 this 3590 .setData() 3591 .setOptions(opts) 3592 .build(); 3593 3594 return this; 3595 }, 3596 3597 setData: function () { 3598 this.$el.data(instanceName, this); 3599 3600 return this; 3601 }, 3602 3603 setOptions: function (opts) { 3604 this.options = $.extend(true, {}, PluginParallax.defaults, opts, { 3605 wrapper: this.$el 3606 }); 3607 3608 return this; 3609 }, 3610 3611 build: function () { 3612 var self = this, 3613 $window = $(window), 3614 offset, 3615 yPos, 3616 bgpos, 3617 background; 3618 3619 // Create Parallax Element 3620 background = $('<div class="parallax-background"></div>'); 3621 3622 // Set Style for Parallax Element 3623 background.css({ 3624 'background-image': 'url(' + self.options.wrapper.data('image-src') + ')', 3625 'background-size': 'cover', 3626 'position': 'absolute', 3627 'top': '-50px', 3628 'left': 0, 3629 'width': '100%', 3630 'height': self.options.parallaxHeight 3631 }); 3632 3633 // Add Parallax Element on DOM 3634 self.options.wrapper.prepend(background); 3635 3636 // Set Overlfow Hidden and Position Relative to Parallax Wrapper 3637 self.options.wrapper.css({ 3638 'position': 'relative', 3639 'overflow': 'hidden' 3640 }); 3641 3642 // Parallax Effect on Scroll & Resize 3643 var parallaxEffectOnScrolResize = function () { 3644 $window.on('scroll resize', function () { 3645 offset = self.options.wrapper.offset(); 3646 yPos = -($window.scrollTop() - (offset.top - 100)) / ((self.options.speed + 2)); 3647 plxPos = (yPos < 0) ? Math.abs(yPos) : -Math.abs(yPos); 3648 if (self.options.offset > 0) 3649 self.options.offset = 0; 3650 background.css({ 3651 'transform': 'translate3d(0, ' + ((plxPos) + (self.options.offset)) + 'px, 0)', 3652 'background-position-x': self.options.horizontalPosition 3653 }); 3654 }); 3655 3656 $window.trigger('scroll'); 3657 } 3658 3659 if (!$.browser.mobile) { 3660 parallaxEffectOnScrolResize(); 3661 } else { 3662 if (self.options.enableOnMobile == true) { 3663 parallaxEffectOnScrolResize(); 3664 } else { 3665 self.options.wrapper.addClass('parallax-disabled'); 3666 } 3667 } 3668 3669 return this; 3670 } 3671 }; 3672 3673 // expose to scope 3674 $.extend(theme, { 3675 PluginParallax: PluginParallax 3676 }); 3677 3678 // jquery plugin 3679 $.fn.themePluginParallax = function (opts) { 3680 return this.map(function () { 3681 var $this = $(this); 3682 3683 if ($this.data(instanceName)) { 3684 return $this.data(instanceName); 3685 } else { 3686 return new PluginParallax($this, opts); 3687 } 3688 3689 }); 3690 } 3691 3692}).apply(this, [window.theme, jQuery]); 3693 3694// Parallax 3695(function ($) { 3696 3697 'use strict'; 3698 3699 if ($.isFunction($.fn['themePluginParallax'])) { 3700 3701 $(function () { 3702 $('[data-plugin-parallax]:not(.manual)').each(function () { 3703 var $this = $(this), 3704 opts; 3705 3706 var pluginOptions = $this.data('plugin-options'); 3707 3708 if (pluginOptions) 3709 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3710 3711 $this.themePluginParallax(opts); 3712 }); 3713 }); 3714 3715 } 3716 3717}).apply(this, [jQuery]);// Chart Circular 3718(function (theme, $) { 3719 3720 theme = theme || {}; 3721 3722 var instanceName = '__chartCircular'; 3723 3724 var PluginChartCircular = function ($el, opts) { 3725 return this.initialize($el, opts); 3726 }; 3727 3728 PluginChartCircular.defaults = { 3729 accX: 0, 3730 accY: -150, 3731 delay: 1, 3732 barColor: '#0088CC', 3733 trackColor: '#f2f2f2', 3734 scaleColor: false, 3735 scaleLength: 5, 3736 lineCap: 'round', 3737 lineWidth: 13, 3738 size: 175, 3739 rotate: 0, 3740 animate: ({ 3741 duration: 2500, 3742 enabled: true 3743 }) 3744 }; 3745 3746 PluginChartCircular.prototype = { 3747 initialize: function ($el, opts) { 3748 if ($el.data(instanceName)) { 3749 return this; 3750 } 3751 3752 this.$el = $el; 3753 3754 this 3755 .setData() 3756 .setOptions(opts) 3757 .build(); 3758 3759 return this; 3760 }, 3761 3762 setData: function () { 3763 this.$el.data(instanceName, this); 3764 3765 return this; 3766 }, 3767 3768 setOptions: function (opts) { 3769 this.options = $.extend(true, {}, PluginChartCircular.defaults, opts, { 3770 wrapper: this.$el 3771 }); 3772 3773 return this; 3774 }, 3775 3776 build: function () { 3777 if (!($.isFunction($.fn.appear)) || !($.isFunction($.fn.easyPieChart))) { 3778 return this; 3779 } 3780 3781 var self = this, 3782 $el = this.options.wrapper, 3783 value = ($el.attr('data-percent') ? $el.attr('data-percent') : 0), 3784 percentEl = $el.find('.percent'); 3785 3786 $.extend(true, self.options, { 3787 onStep: function (from, to, currentValue) { 3788 percentEl.html(parseInt(currentValue)); 3789 } 3790 }); 3791 3792 $el.attr('data-percent', 0); 3793 3794 $el.appear(function () { 3795 3796 $el.easyPieChart(self.options); 3797 3798 setTimeout(function () { 3799 3800 $el.data('easyPieChart').update(value); 3801 $el.attr('data-percent', value); 3802 3803 }, self.options.delay); 3804 3805 }, { 3806 accX: self.options.accX, 3807 accY: self.options.accY
3808 }); 3809 3810 return this; 3811 } 3812 }; 3813 3814 // expose to scope 3815 $.extend(theme, { 3816 PluginChartCircular: PluginChartCircular 3817 }); 3818 3819 // jquery plugin 3820 $.fn.themePluginChartCircular = function (opts) { 3821 return this.map(function () { 3822 var $this = $(this); 3823 3824 if ($this.data(instanceName)) { 3825 return $this.data(instanceName); 3826 } else { 3827 return new PluginChartCircular($this, opts); 3828 } 3829 3830 }); 3831 } 3832 3833}).apply(this, [window.theme, jQuery]); 3834 3835// Chart.Circular 3836(function ($) { 3837 3838 'use strict'; 3839 3840 if ($.isFunction($.fn['themePluginChartCircular'])) { 3841 3842 $(function () { 3843 $('[data-plugin-chart-circular]:not(.manual), .circular-bar-chart:not(.manual)').each(function () { 3844 var $this = $(this), 3845 opts; 3846 3847 var pluginOptions = $this.data('plugin-options'); 3848 if (pluginOptions) 3849 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 3850 3851 $this.themePluginChartCircular(opts); 3852 }); 3853 }); 3854 3855 } 3856 3857}).apply(this, [jQuery]);// Sort 3858(function (theme, $) { 3859 3860 theme = theme || {}; 3861 3862 var instanceName = '__sort'; 3863 3864 var PluginSort = function ($el, opts) { 3865 return this.initialize($el, opts); 3866 }; 3867 3868 PluginSort.defaults = { 3869 useHash: true, 3870 itemSelector: 'li', 3871 layoutMode: 'masonry', 3872 filter: '*', 3873 isOriginLeft: ($('html').attr('dir') == 'rtl' ? false : true) 3874 }; 3875 3876 PluginSort.prototype = { 3877 initialize: function ($el, opts) { 3878 if ($el.data(instanceName)) { 3879 return this; 3880 } 3881 3882 this.$el = $el; 3883 3884 this 3885 .setData() 3886 .setOptions(opts) 3887 .build(); 3888 3889 return this; 3890 }, 3891 3892 setData: function () { 3893 this.$el.data(instanceName, this); 3894 3895 return this; 3896 }, 3897 3898 setOptions: function (opts) { 3899 this.options = $.extend(true, {}, PluginSort.defaults, opts, { 3900 wrapper: this.$el 3901 }); 3902 3903 return this; 3904 }, 3905 3906 build: function () { 3907 if (!($.isFunction($.fn.isotope))) { 3908 return this; 3909 } 3910 3911 var self = this, 3912 $source = this.options.wrapper, 3913 $destination = $('.sort-destination[data-sort-id="' + $source.attr('data-sort-id') + '"]'); 3914 3915 if ($destination.get(0)) { 3916 3917 self.$source = $source; 3918 self.$destination = $destination; 3919 3920 self.setParagraphHeight($destination); 3921 3922 $(window).load(function () { 3923 3924 $destination.isotope(self.options).isotope('layout'); 3925 3926 self.$destination.isotope('on', 'layoutComplete', function (isoInstance, laidOutItems) { 3927 if (self.options.useHash && typeof isoInstance.options != 'undefined' && typeof isoInstance.options.filter != 'undefined') { 3928 if (window.location.hash != '' || isoInstance.options.filter.replace('.', '') != '*') { 3929 window.location.hash = isoInstance.options.filter.replace('.', ''); 3930 } 3931 } 3932 }); 3933 3934 self.events(); 3935 3936 }); 3937 3938 } 3939 3940 return this; 3941 }, 3942 3943 events: function () { 3944 var self = this, 3945 filter = null; 3946 3947 self.$source.find('a').click(function (e) { 3948 e.preventDefault(); 3949 3950 filter = $(this).parent().attr('data-option-value'); 3951 3952 self.setFilter(filter); 3953 3954 return this; 3955 }); 3956 3957 if (self.options.useHash) { 3958 self.hashEvents(); 3959 } 3960 3961 return this; 3962 }, 3963 3964 setFilter: function (filter) { 3965 var self = this; 3966 3967 //if (self.filter == filter) { 3968 // return this; 3969 //} 3970 3971 self.$source.find('li.active').removeClass('active'); 3972 self.$source.find('li[data-option-value="' + filter + '"]').addClass('active'); 3973 3974 self.$destination.isotope({ 3975 filter: filter 3976 }); 3977
3978 self.filter = filter; 3979 3980 return this; 3981 }, 3982 3983 hashEvents: function () { 3984 var self = this, 3985 hash = null, 3986 hashFilter = null, 3987 initHashFilter = '.' + location.hash.replace('#', ''); 3988 3989 if (initHashFilter != '.' && initHashFilter != '.*') { 3990 self.setFilter(initHashFilter); 3991 } 3992 3993 $(window).bind('hashchange', function (e) { 3994 3995 hashFilter = '.' + location.hash.replace('#', ''); 3996 hash = (hashFilter == '.' || hashFilter == '.*' ? '*' : hashFilter); 3997 3998 self.setFilter(hash); 3999 4000 }); 4001 4002 return this; 4003 }, 4004 4005 setParagraphHeight: function () { 4006 var self = this, 4007 minParagraphHeight = 0, 4008 paragraphs = $('span.thumb-info-caption p', self.$destination); 4009 4010 paragraphs.each(function () { 4011 if ($(this).height() > minParagraphHeight) { 4012 minParagraphHeight = ($(this).height() + 10);
4013 } 4014 }); 4015 4016 paragraphs.height(minParagraphHeight); 4017 4018 return this; 4019 } 4020 4021 }; 4022 4023 // expose to scope 4024 $.extend(theme, { 4025 PluginSort: PluginSort 4026 }); 4027 4028 // jquery plugin 4029 $.fn.themePluginSort = function (opts) { 4030 return this.map(function () { 4031 var $this = $(this); 4032 4033 if ($this.data(instanceName)) { 4034 return $this.data(instanceName); 4035 } else { 4036 return new PluginSort($this, opts); 4037 } 4038 4039 }); 4040 } 4041 4042}).apply(this, [window.theme, jQuery]); 4043 4044// Sort 4045(function ($) { 4046 4047 'use strict'; 4048 4049 if ($.isFunction($.fn['themePluginSort'])) { 4050 4051 $(function () { 4052 $('[data-plugin-sort]:not(.manual), .sort-source:not(.manual)').each(function () { 4053 var $this = $(this), 4054 opts; 4055 4056 var pluginOptions = $this.data('plugin-options'); 4057 if (pluginOptions) 4058 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 4059 4060 $this.themePluginSort(opts); 4061 }); 4062 }); 4063 4064 } 4065 4066}).apply(this, [jQuery]); 4067 4068// Masonry 4069(function (theme, $) { 4070 4071 theme = theme || {}; 4072 4073 var instanceName = '__masonry'; 4074 4075 var PluginMasonry = function ($el, opts) { 4076 return this.initialize($el, opts); 4077 }; 4078 4079 PluginMasonry.defaults = { 4080 itemSelector: 'li' 4081 }; 4082 4083 PluginMasonry.prototype = { 4084 initialize: function ($el, opts) { 4085 if ($el.data(instanceName)) { 4086 return this; 4087 } 4088 4089 this.$el = $el; 4090 4091 this 4092 .setData() 4093 .setOptions(opts) 4094 .build(); 4095 4096 return this; 4097 }, 4098 4099 setData: function () { 4100 this.$el.data(instanceName, this); 4101 4102 return this; 4103 }, 4104 4105 setOptions: function (opts) { 4106 this.options = $.extend(true, {}, PluginMasonry.defaults, opts, { 4107 wrapper: this.$el 4108 }); 4109 4110 return this; 4111 }, 4112 4113 build: function () { 4114 if (!($.isFunction($.fn.isotope))) { 4115 return this; 4116 } 4117 4118 this.options.wrapper.isotope(this.options); 4119 4120 return this; 4121 } 4122 }; 4123 4124 // expose to scope 4125 $.extend(theme, { 4126 PluginMasonry: PluginMasonry 4127 }); 4128 4129 // jquery plugin 4130 $.fn.themePluginMasonry = function (opts) { 4131 return this.map(function () { 4132 var $this = $(this); 4133 4134 $this.waitForImages(function () { 4135 if ($this.data(instanceName)) { 4136 return $this.data(instanceName); 4137 } else { 4138 return new PluginMasonry($this, opts); 4139 } 4140 }); 4141 4142 }); 4143 } 4144 4145}).apply(this, [window.theme, jQuery]); 4146 4147// Masonry 4148(function ($) { 4149 4150 'use strict'; 4151 4152 if ($.isFunction($.fn['themePluginMasonry'])) { 4153 4154 $(function () { 4155 $('[data-plugin-masonry]:not(.manual)').each(function () { 4156 var $this = $(this), 4157 opts; 4158 4159 var pluginOptions = $this.data('plugin-options'); 4160 if (pluginOptions) 4161 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 4162 4163 $this.themePluginMasonry(opts); 4164 }); 4165 }); 4166 4167 } 4168 4169}).apply(this, [jQuery]);// Carousel 4170(function (theme, $) { 4171 4172 theme = theme || {}; 4173 4174 var instanceName = '__carousel'; 4175 4176 var PluginCarousel = function ($el, opts) { 4177 return this.initialize($el, opts); 4178 }; 4179 4180 PluginCarousel.defaults = { 4181 loop: true, 4182 responsive: { 4183 0: { 4184 items: 1 4185 }, 4186 479: { 4187 items: 1 4188 }, 4189 768: { 4190 items: 2 4191 }, 4192 979: { 4193 items: 3 4194 }, 4195 1199: { 4196 items: 4 4197 } 4198 }, 4199 navText: [] 4200 }; 4201 4202 PluginCarousel.prototype = { 4203 initialize: function ($el, opts) { 4204 if ($el.data(instanceName)) { 4205 return this; 4206 } 4207 4208 this.$el = $el; 4209 4210 this 4211 .setData() 4212 .setOptions(opts) 4213 .build(); 4214 4215 return this; 4216 }, 4217 4218 setData: function () { 4219 this.$el.data(instanceName, this); 4220 4221 return this; 4222 }, 4223 4224 setOptions: function (opts) { 4225 this.options = $.extend(true, {}, PluginCarousel.defaults, opts, { 4226 wrapper: this.$el 4227 }); 4228 4229 return this; 4230 }, 4231 4232 build: function () { 4233 if (!($.isFunction($.fn.owlCarousel))) { 4234 return this; 4235 } 4236 4237 var self = this, 4238 $el = this.options.wrapper, 4239 activeItemHeight = 0; 4240 4241 // Force RTL according to HTML dir attribute 4242 if ($('html').attr('dir') == 'rtl') { 4243 this.options = $.extend(true, {}, this.options, { 4244 rtl: true 4245 }); 4246 } 4247 4248 if (this.options.items == 1) { 4249 this.options.responsive = {} 4250 } 4251 4252 if (this.options.items > 4) { 4253 this.options = $.extend(true, {}, this.options, { 4254 responsive: { 4255 1199: { 4256 items: this.options.items 4257 } 4258 } 4259 }); 4260 } 4261 4262 // Auto Height 4263 $(window).afterResize(function () { 4264 activeItemHeight = $el.find('.owl-item.active').height(); 4265 $el.find('.owl-stage-outer').height(activeItemHeight); 4266 }); 4267 4268 this.options.wrapper.owlCarousel(this.options).addClass("owl-carousel-init"); 4269 4270 return this; 4271 } 4272 }; 4273 4274 // expose to scope 4275 $.extend(theme, { 4276 PluginCarousel: PluginCarousel 4277 });
4278 4279 // jquery plugin 4280 $.fn.themePluginCarousel = function (opts) { 4281 return this.map(function () { 4282 var $this = $(this); 4283 4284 if ($this.data(instanceName)) { 4285 return $this.data(instanceName); 4286 } else { 4287 return new PluginCarousel($this, opts); 4288 } 4289 4290 }); 4291 } 4292 4293}).apply(this, [window.theme, jQuery]); 4294 4295// Carousel 4296(function ($) { 4297 4298 'use strict'; 4299 4300 if ($.isFunction($.fn['themePluginCarousel'])) { 4301 4302 $(function () { 4303 $('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function () { 4304 var $this = $(this), 4305 opts; 4306 4307 var pluginOptions = $this.data('plugin-options'); 4308 if (pluginOptions) 4309 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 4310 4311 $this.themePluginCarousel(opts); 4312 }); 4313 }); 4314 4315 } 4316 4317}).apply(this, [jQuery]); 4318 4319// Carousel Videos 4320(function ($) { 4321 4322 'use strict'; 4323 4324 // Videos 4325 $('#videos').owlCarousel({ 4326 items: 1, 4327 merge: true, 4328 loop: true, 4329 margin: 10, 4330 video: true, 4331 lazyLoad: true, 4332 center: true, 4333 responsive: { 4334 480: { 4335 items: 2 4336 }, 4337 600: { 4338 items: 4 4339 } 4340 } 4341 }) 4342 4343}).apply(this, [jQuery]);// Flickr 4344(function (theme, $) { 4345 4346 theme = theme || {}; 4347 4348 var instanceName = '__flickr'; 4349 4350 var PluginFlickr = function ($el, opts) { 4351 return this.initialize($el, opts); 4352 }; 4353 4354 PluginFlickr.defaults = { 4355 flickrbase: '//api.flickr.com/services/feeds/', 4356 feedapi: 'photos_public.gne', 4357 limit: 6, 4358 qstrings: { 4359 lang: 'en-us', 4360 format: 'json', 4361 jsoncallback: '?' 4362 }, 4363 cleanDescription: true, 4364 useTemplate: true, 4365 itemTemplate: '<li><a href="{{image_b}}" title="{{title}}"><span class="thumbnail"><img alt="flickr" src="{{image_s}}" /></span></a></li>', 4366 itemCallback: function () { } 4367 }; 4368 4369 PluginFlickr.prototype = { 4370 initialize: function ($el, opts) { 4371 if ($el.data(instanceName)) { 4372 return this; 4373 } 4374 4375 this.$el = $el; 4376 4377 this 4378 .setData() 4379 .setOptions(opts) 4380 .build(); 4381 4382 return this; 4383 }, 4384 4385 setData: function () { 4386 this.$el.data(instanceName, this); 4387 4388 return this; 4389 }, 4390 4391 setOptions: function (opts) { 4392 this.options = $.extend(true, {}, PluginFlickr.defaults, opts, { 4393 wrapper: this.$el 4394 }); 4395 4396 return this; 4397 }, 4398 4399 build: function () { 4400 if (!($.isFunction($.fn.jflickrfeed)) || !($.isFunction($.fn.magnificPopup))) { 4401 return this; 4402 } 4403 4404 var self = this; 4405 4406 self.options.wrapper.jflickrfeed(this.options, function (data) { 4407 4408 self.options.wrapper.magnificPopup({ 4409 delegate: 'a', 4410 type: 'image', 4411 gallery: { 4412 enabled: true, 4413 navigateByImgClick: true, 4414 preload: [0, 1] 4415 }, 4416 zoom: { 4417 enabled: true, 4418 duration: 300, 4419 opener: function (element) { 4420 return element.find('img'); 4421 } 4422 } 4423 }); 4424 4425 }); 4426 4427 return this; 4428 } 4429 }; 4430 4431 // expose to scope 4432 $.extend(theme, { 4433 PluginFlickr: PluginFlickr 4434 }); 4435 4436 // jquery plugin 4437 $.fn.themePluginFlickr = function (opts) { 4438 return this.map(function () { 4439 var $this = $(this); 4440 4441 if ($this.data(instanceName)) { 4442 return $this.data(instanceName); 4443 } else { 4444 return new PluginFlickr($this, opts); 4445 } 4446 4447 }); 4448 } 4449 4450}).apply(this, [window.theme, jQuery]); 4451 4452// Flickr 4453(function ($) { 4454 4455 'use strict'; 4456 4457 if ($.isFunction($.fn['themePluginFlickr'])) { 4458 4459 $(function () {
4460 //Added ul.flickr-feed selector to support backward compatibility 4461 $('[data-plugin-flickr]:not(.manual), ul.flickr-feed').each(function () { 4462 var $this = $(this), 4463 opts; 4464 4465 var pluginOptions = $this.data('plugin-options'); 4466 if (pluginOptions) 4467 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 4468 4469 $this.themePluginFlickr(opts); 4470 }); 4471 }); 4472 4473 } 4474 4475}).apply(this, [jQuery]);// Type 4476(function (theme, $) { 4477 4478 theme = theme || {}; 4479 4480 var instanceName = '__typeWriter'; 4481 4482 var PlugintypeWriter = function ($el, opts) { 4483 return this.initialize($el, opts); 4484 }; 4485 4486 PlugintypeWriter.defaults = { 4487 typeSpeed: 150, 4488 backSpeed: 0, 4489 backDelay: 500, 4490 startDelay: 0, 4491 loop: false 4492 }; 4493 4494 PlugintypeWriter.prototype = { 4495 initialize: function ($el, opts) { 4496 if ($el.data(instanceName)) { 4497 return this; 4498 } 4499 4500 this.$el = $el; 4501 4502 this 4503 .setData() 4504 .setOptions(opts) 4505 .build(); 4506 4507 return this; 4508 }, 4509 4510 setData: function () { 4511 this.$el.data(instanceName, this); 4512 4513 return this; 4514 }, 4515 4516 setOptions: function (opts) { 4517 this.options = $.extend(true, {}, PlugintypeWriter.defaults, opts, { 4518 wrapper: this.$el 4519 }); 4520 4521 return this; 4522 }, 4523 4524 build: function () { 4525 4526 if (!($.isFunction(Typed))) { 4527 return this; 4528 } 4529 var self = this, 4530 $wrapper = $(self.options.wrapper); 4531 4532 if ($wrapper.find('> span').length > 0) 4533 element = '#' + $wrapper.find('> span').attr('id'); 4534 else if ($wrapper.find('> input').length > 0) 4535 element = '#' + $wrapper.find('> input').attr('id'); 4536 4537 if (element != null) 4538 typed = new Typed(element, self.options); 4539 4540 return this; 4541 } 4542 }; 4543 4544 // expose to scope 4545 $.extend(theme, { 4546 PlugintypeWriter: PlugintypeWriter 4547 }); 4548 4549 // jquery plugin 4550 $.fn.themePlugintypeWriter = function (opts) { 4551 return this.map(function () { 4552 var $this = $(this); 4553 4554 if ($this.data(instanceName)) { 4555 return $this.data(instanceName); 4556 } else { 4557 return new PlugintypeWriter($this, opts); 4558 } 4559 4560 }); 4561 } 4562 4563}).apply(this, [window.theme, jQuery]); 4564 4565// Type 4566(function ($) { 4567 4568 'use strict'; 4569 4570 if ($.isFunction($.fn['themePlugintypeWriter'])) { 4571 4572 $(function () { 4573 $('[data-plugin-type-writer]:not(.manual), .type-writer:not(.manual)').each(function () { 4574 var $this = $(this), 4575 opts; 4576 4577 var pluginOptions = $this.data('plugin-options'); 4578 if (pluginOptions) 4579 opts = jQuery.parseJSON(pluginOptions.replace(/'/g, '\"')); 4580 4581 $this.themePlugintypeWriter(opts); 4582 }); 4583 }); 4584 4585 } 4586 4587}).apply(this, [jQuery]);// Circle Slider 4588(function ($) { 4589 4590 'use strict'; 4591 4592 if ($.isFunction($.fn.flipshow)) { 4593 var circleContainer = $('#fcSlideshow'); 4594 4595 if (circleContainer.get(0)) { 4596 circleContainer.flipshow(); 4597 4598 setTimeout(function circleFlip() { 4599 circleContainer.data().flipshow._navigate(circleContainer.find('div.fc-right span:first'), 'right'); 4600 setTimeout(circleFlip, 3000); 4601 }, 3000); 4602 } 4603 } 4604 4605}).apply(this, [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.