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