1"use strict"; 2 3; 4(function ($) { 5 'use strict'; 6 7 var $window = $(window); 8 $.fn.getHappySettings = function () { 9 return this.data('happy-settings'); 10 }; 11 function debounce(func, wait, immediate) { 12 var timeout; 13 return function () { 14 var context = this, 15 args = arguments; 16 var later = function later() { 17 timeout = null; 18 if (!immediate) func.apply(context, args); 19 }; 20 var callNow = immediate && !timeout; 21 clearTimeout(timeout); 22 timeout = setTimeout(later, wait); 23 if (callNow) func.apply(context, args); 24 }; 25 } 26 function initFilterNav($scope, filterFn) { 27 var $filterNav = $scope.find('.hajs-filter'), 28 defaultFilter = $filterNav.data('default-filter'); 29 if ($filterNav.length) { 30 $filterNav.on('click.onFilterNav', 'button', function (event) { 31 event.stopPropagation(); 32 var $current = $(this); 33 $current.addClass('ha-filter__item--active').siblings().removeClass('ha-filter__item--active'); 34 filterFn($current.data('filter')); 35 }); 36 $filterNav.find('[data-filter="' + defaultFilter + '"]').click(); 37 } 38 } 39 40 /** 41 * Initialize magnific lighbox gallery 42 * 43 * @param {$element, selector, isEnabled, key} settings 44 */ 45 function initPopupGallery(settings) { 46 settings.$element.on('click', settings.selector, function (event) { 47 event.preventDefault(); 48 }); 49 if (!$.fn.magnificPopup) { 50 return; 51 } 52 if (!settings.isEnabled) { 53 $.magnificPopup.close(); 54 return; 55 } 56 var windowWidth = $(window).width(), 57 mobileWidth = elementorFrontendConfig.breakpoints.md, 58 tabletWidth = elementorFrontendConfig.breakpoints.lg; 59 settings.$element.find(settings.selector).magnificPopup({ 60 key: settings.key, 61 type: 'image', 62 image: { 63 titleSrc: function titleSrc(item) { 64 return item.el.attr('title') ? item.el.attr('title') : item.el.find('img').attr('alt'); 65 } 66 }, 67 gallery: { 68 enabled: true, 69 preload: [1, 2] 70 }, 71 zoom: { 72 enabled: true, 73 duration: 300, 74 easing: 'ease-in-out', 75 opener: function opener(openerElement) { 76 return openerElement.is('img') ? openerElement : openerElement.find('img'); 77 } 78 }, 79 disableOn: function disableOn() { 80 if (settings.disableOnMobile && windowWidth < mobileWidth) { 81 return false; 82 } 83 if (settings.disableOnTablet && windowWidth >= mobileWidth && windowWidth < tabletWidth) { 84 return false; 85 } 86 return true; 87 } 88 }); 89 } 90 var HandleImageCompare = function HandleImageCompare($scope) { 91 var $item = $scope.find('.hajs-image-comparison'), 92 settings = $item.getHappySettings(), 93 fieldMap = { 94 on_hover: 'move_slider_on_hover', 95 on_swipe: 'move_with_handle_only', 96 on_click: 'click_to_move' 97 }; 98 settings[fieldMap[settings.move_handle || 'on_swipe']] = true; 99 delete settings.move_handle; 100 $item.imagesLoaded().done(function () { 101 $item.twentytwenty(settings); 102 var t = setTimeout(function () { 103 $window.trigger('resize.twentytwenty'); 104 clearTimeout(t); 105 }, 400); 106 }); 107 }; 108 $window.on('elementor/frontend/init', function () { 109 var ModuleHandler = elementorModules.frontend.handlers.Base; 110 var SliderBase = ModuleHandler.extend({ 111 bindEvents: function bindEvents() { 112 this.removeArrows(); 113 this.run(); 114 }, 115 removeArrows: function removeArrows() { 116 var _this = this; 117 this.elements.$container.on('init', function () { 118 _this.elements.$container.siblings().hide(); 119 }); 120 }, 121 getDefaultSettings: function getDefaultSettings() { 122 return { 123 autoplay: true, 124 arrows: false, 125 checkVisible: false, 126 container: '.hajs-slick', 127 dots: false, 128 infinite: true, 129 rows: 0, 130 slidesToShow: 1, 131 prevArrow: $('<div />').append(this.findElement('.slick-prev').clone().show()).html(), 132 nextArrow: $('<div />').append(this.findElement('.slick-next').clone().show()).html() 133 }; 134 }, 135 getDefaultElements: function getDefaultElements() { 136 return { 137 $container: this.findElement(this.getSettings('container')) 138 }; 139 }, 140 onElementChange: debounce(function () { 141 this.elements.$container.slick('unslick'); 142 this.run(); 143 }, 200), 144 getSlickSettings: function getSlickSettings() { 145 var settings = { 146 infinite: !!this.getElementSettings('loop'), 147 autoplay: !!this.getElementSettings('autoplay'), 148 autoplaySpeed: this.getElementSettings('autoplay_speed'), 149 speed: this.getElementSettings('animation_speed'), 150 centerMode: !!this.getElementSettings('center'), 151 vertical: !!this.getElementSettings('vertical'), 152 slidesToScroll: 1 153 }; 154 switch (this.getElementSettings('navigation')) { 155 case 'arrow': 156 settings.arrows = true; 157 break; 158 case 'dots': 159 settings.dots = true; 160 break; 161 case 'both': 162 settings.arrows = true; 163 settings.dots = true; 164 break; 165 } 166 settings.slidesToShow = parseInt(this.getElementSettings('slides_to_show')) || 1; 167 settings.responsive = [{ 168 breakpoint: elementorFrontend.config.breakpoints.lg, 169 settings: { 170 slidesToShow: parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow 171 } 172 }, { 173 breakpoint: elementorFrontend.config.breakpoints.md, 174 settings: { 175 slidesToShow: parseInt(this.getElementSettings('slides_to_show_mobile')) || parseInt(this.getElementSettings('slides_to_show_tablet')) || settings.slidesToShow 176 } 177 }]; 178 return $.extend({}
178, this.getSettings(), settings); 179 }, 180 run: function run() { 181 this.elements.$container.slick(this.getSlickSettings()); 182 } 183 }); 184 var NumberHandler = function NumberHandler($scope) { 185 elementorFrontend.waypoint($scope, function () { 186 var $number = $scope.find('.ha-number-text'); 187 $number.numerator($number.data('animation')); 188 }); 189 }; 190 var SkillHandler = function SkillHandler($scope) { 191 elementorFrontend.waypoint($scope, function () { 192 $scope.find('.ha-skill-level').each(function () { 193 var $current = $(this), 194 $lt = $current.find('.ha-skill-level-text'), 195 lv = $current.data('level'); 196 $current.animate({ 197 width: lv + '%' 198 }, 500); 199 $lt.numerator({ 200 toValue: lv + '%', 201 duration: 1300, 202 onStep: function onStep() { 203 $lt.append('%'); 204 } 205 }); 206 }); 207 }); 208 }; 209 var ImageGrid = ModuleHandler.extend({ 210 onInit: function onInit() { 211 ModuleHandler.prototype.onInit.apply(this, arguments); 212 this.run(); 213 this.runFilter(); 214 $window.on('resize', debounce(this.run.bind(this), 100)); 215 }, 216 getLayoutMode: function getLayoutMode() { 217 var layout = this.getElementSettings('layout'); 218 return layout === 'even' ? 'masonry' : layout; 219 }, 220 getDefaultSettings: function getDefaultSettings() { 221 return { 222 itemSelector: '.ha-image-grid__item', 223 percentPosition: true, 224 layoutMode: this.getLayoutMode() 225 }; 226 }, 227 getDefaultElements: function getDefaultElements() { 228 return { 229 $container: this.findElement('.hajs-isotope') 230 }; 231 }, 232 getLightBoxSettings: function getLightBoxSettings() { 233 return { 234 key: 'imagegrid', 235 $element: this.$element, 236 selector: '.ha-js-lightbox', 237 isEnabled: !!this.getElementSettings('enable_popup'), 238 disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'), 239 disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile') 240 }; 241 }, 242 runFilter: function runFilter() { 243 var self = this, 244 lbSettings = this.getLightBoxSettings(); 245 initFilterNav(this.$element, function (filter) { 246 self.elements.$container.isotope({ 247 filter: filter 248 }); 249 if (filter !== '*') { 250 lbSettings.selector = filter; 251 } 252 initPopupGallery(lbSettings); 253 }); 254 }, 255 onElementChange: function onElementChange(changedProp) { 256 if (['layout', 'image_height', 'columns', 'image_margin', 'enable_popup'].indexOf(changedProp) !== -1) { 257 this.run(); 258 } 259 }, 260 run: function run() { 261 var self = this; 262 self.elements.$container.isotope(self.getDefaultSettings()).imagesLoaded().progress(function () { 263 self.elements.$container.isotope('layout'); 264 }); 265 initPopupGallery(self.getLightBoxSettings()); 266 } 267 }); 268 var JustifiedGrid = ModuleHandler.extend({ 269 onInit: function onInit() { 270 ModuleHandler.prototype.onInit.apply(this, arguments); 271 this.run(); 272 this.runFilter(); 273 $window.on('resize', debounce(this.run.bind(this), 100)); 274 }, 275 getDefaultSettings: function getDefaultSettings() { 276 var $defaultSettings = { 277 rowHeight: +this.getElementSettings('row_height.size') || 150, 278 lastRow: this.getElementSettings('last_row'), 279 margins: +this.getElementSettings('margins.size'), 280 captions: !!this.getElementSettings('show_caption') 281 }; 282 var $maxRowHeight = {}; 283 if ('yes' == this.getElementSettings('max_row_height')) { 284 $maxRowHeight = { 285 maxRowHeight: +this.getElementSettings('row_height.size') || 150 286 }; 287 } 288 return $.extend($defaultSettings, $maxRowHeight); 289 }, 290 getDefaultElements: function getDefaultElements() { 291 return { 292 $container: this.findElement('.hajs-justified-grid') 293 }; 294 }, 295 getLightBoxSettings: function getLightBoxSettings() { 296 return { 297 key: 'justifiedgallery', 298 $element: this.$element, 299 selector: '.ha-js-lightbox', 300 isEnabled: !!this.getElementSettings('enable_popup'), 301 disableOnTablet: !!this.getElementSettings('disable_lightbox_on_tablet'), 302 disableOnMobile: !!this.getElementSettings('disable_lightbox_on_mobile') 303 }; 304 }, 305 runFilter: function runFilter() { 306 var self = this, 307 lbSettings = this.getLightBoxSettings(), 308 settings = { 309 lastRow: this.getElementSettings('last_row') 310 }; 311 initFilterNav(self.$element, function (filter) { 312 if (filter !== '*') { 313 settings.lastRow = 'nojustify'; 314 lbSettings.selector = filter; 315 }
316 settings.filter = filter; 317 self.elements.$container.justifiedGallery(settings); 318 initPopupGallery(lbSettings); 319 }); 320 }, 321 onElementChange: function onElementChange(changedProp) { 322 if (['row_height', 'max_row_height', 'last_row', 'margins', 'show_caption', 'enable_popup'].indexOf(changedProp) !== -1) { 323 this.run(); 324 } 325 }, 326 run: function run() { 327 this.elements.$container.justifiedGallery(this.getDefaultSettings()); 328 initPopupGallery(this.getLightBoxSettings()); 329 } 330 }); 331 332 // NewsTicker 333 var NewsTicker = ModuleHandler.extend({ 334 onInit: function onInit() { 335 ModuleHandler.prototype.onInit.apply(this, arguments); 336 this.wrapper = this.$element.find('.ha-news-ticker-wrapper'); 337 this.run(); 338 }, 339 onElementChange: function onElementChange(changed_prop) { 340 if (changed_prop === 'item_space' || changed_prop === 'title_typography_font_size') { 341 this.run(); 342 } 343 }, 344 run: function run() { 345 if (0 == this.wrapper.length) { 346 return; 347 } 348 var wrapper_height = this.wrapper.innerHeight(), 349 wrapper_width = this.wrapper.innerWidth(), 350 container = this.wrapper.find('.ha-news-ticker-container'), 351 single_item = container.find('.ha-news-ticker-item'), 352 scroll_direction = this.wrapper.data('scroll-direction'), 353 scroll = "scroll" + scroll_direction + parseInt(wrapper_height) + parseInt(wrapper_width), 354 duration = this.wrapper.data('duration'), 355 direction = 'normal', 356 all_title_width = 10; 357 var start = { 358 'transform': 'translateX(0' + wrapper_width + 'px)' 359 }, 360 end = { 361 'transform': 'translateX(-101%)' 362 }; 363 if ('right' === scroll_direction) { 364 direction = 'reverse'; 365 } 366 single_item.each(function () { 367 all_title_width += $(this).outerWidth(true); 368 }); 369 container.css({ 370 'width': all_title_width, 371 'display': 'flex' 372 }); 373 $.keyframe.define([{ 374 name: scroll, 375 '0%': start, 376 '100%': end 377 }]); 378 container.playKeyframe({ 379 name: scroll, 380 duration: duration.toString() + "ms", 381 timingFunction: 'linear', 382 delay: '0s', 383 iterationCount: 'infinite', 384 direction: direction, 385 fillMode: 'none', 386 complete: function complete() {} 387 }); 388 } 389 }); 390 391 // Fun factor 392 var FunFactor = function FunFactor($scope) { 393 elementorFrontend.waypoint($scope, function () { 394 var $fun_factor = $scope.find('.ha-fun-factor__content-number'); 395 $fun_factor.numerator($fun_factor.data('animation')); 396 }); 397 }; 398 var BarChart = function BarChart($scope) { 399 elementorFrontend.waypoint($scope, function () { 400 var $chart = $(this), 401 $container = $chart.find('.ha-bar-chart-container'), 402 $chart_canvas = $chart.find('#ha-bar-chart'), 403 settings = $container.data('settings'); 404 if ($container.length) { 405 new Chart($chart_canvas, settings); 406 } 407 }); 408 }; 409 410 //twitter Feed 411 var TwitterFeed = function TwitterFeed($scope) { 412 var button = $scope.find('.ha-twitter-load-more'); 413 var twitter_wrap = $scope.find('.ha-tweet-items'); 414 button.on("click", function (e) { 415 e.preventDefault(); 416 var $self = $(this), 417 query_settings = $self.data("settings"), 418 total = $self.data("total"), 419 items = $scope.find('.ha-tweet-item').length; 420 $.ajax({ 421 url: HappyLocalize.ajax_url, 422 type: 'POST', 423 data: { 424 action: "ha_twitter_feed_action", 425 security: HappyLocalize.nonce, 426 query_settings: query_settings, 427 loaded_item: items 428 }, 429 success: function success(response) { 430 if (total > items) { 431 $(response).appendTo(twitter_wrap); 432 } else { 433 $self.text('All Loaded').addClass('loaded'); 434 setTimeout(function () { 435 $self.css({ 436 "display": "none" 437 }); 438 }, 800); 439 } 440 }, 441 error: function error(_error) {} 442 }); 443 }); 444 }; 445 446 //PostTab 447 var PostTab = ModuleHandler.extend({ 448 onInit: function onInit() { 449 ModuleHandler.prototype.onInit.apply(this, arguments); 450 this.wrapper = this.$element.find('.ha-post-tab'); 451 this.run(); 452 }, 453 run: function run() { 454 var filter_wrap = this.wrapper.find('.ha-post-tab-filter'),
455 filter = filter_wrap.find('li'), 456 event = this.wrapper.data('event'), 457 args = this.wrapper.data('query-args'); 458 filter.on(event, debounce(function (e) { 459 e.preventDefault(); 460 var $self = $(this), 461 term_id = $self.data("term"), 462 $wrapper = $self.closest(".ha-post-tab"), 463 content = $wrapper.find('.ha-post-tab-content'), 464 loading = content.find('.ha-post-tab-loading'), 465 tab_item = content.find('.ha-post-tab-item-wrapper'), 466 $content_exist = false; 467 if (0 === loading.length) { 468 filter.removeClass('active'); 469 tab_item.removeClass('active'); 470 $self.addClass('active'); 471 tab_item.each(function () { 472 var $self = $(this), 473 $content_id = $self.data("term"); 474 if (term_id === $content_id) { 475 $self.addClass('active'); 476 $content_exist = true; 477 } 478 }); 479 if (false === $content_exist) { 480 $.ajax({ 481 url: HappyLocalize.ajax_url, 482 type: 'POST', 483 data: { 484 action: "ha_post_tab_action", 485 security: HappyLocalize.nonce, 486 post_tab_query: args, 487 term_id: term_id 488 }, 489 beforeSend: function beforeSend() { 490 content.append('<span class="ha-post-tab-loading"><i class="eicon-spinner eicon-animation-spin"></i></span>'); 491 }, 492 success: function success(response) { 493 content.find('.ha-post-tab-loading').remove(); 494 content.append(response); 495 }, 496 error: function error(_error2) {} 497 }); 498 } 499 } 500 }, 200)); 501 } 502 }); 503 var DataTable = function DataTable($scope) { 504 var columnTH = $scope.find('.ha-table__head-column-cell'); 505 var rowTR = $scope.find('.ha-table__body-row'); 506 rowTR.each(function (i, tr) { 507 var th = $(tr).find('.ha-table__body-row-cell'); 508 th.each(function (index, th) { 509 $(th).prepend('<div class="ha-table__head-column-cell">' + columnTH.eq(index).html() + '</div>'); 510 }); 511 }); 512 }; 513 514 //Threesixty Rotation 515 var Threesixty_Rotation = function Threesixty_Rotation($scope) { 516 var ha_circlr = $scope.find('.ha-threesixty-rotation-inner'); 517 var cls = ha_circlr.data('selector'); 518 var autoplay = ha_circlr.data('autoplay'); 519 var glass_on = $scope.find('.ha-threesixty-rotation-magnify'); 520 var t360 = $scope.find('.ha-threesixty-rotation-360img'); 521 var zoom = glass_on.data('zoom'); 522 var playb = $scope.find('.ha-threesixty-rotation-play'); 523 var crl = circlr(cls, { 524 play: true 525 }); 526 if ('on' === autoplay) { 527 var autoplay_btn = $scope.find('.ha-threesixty-rotation-autoplay'); 528 autoplay_btn.on('click', function (el) { 529 el.preventDefault(); 530 crl.play(); 531 t360.remove(); 532 }); 533 setTimeout(function () { 534 autoplay_btn.trigger('click'); 535 autoplay_btn.remove(); 536 }, 1000); 537 } else { 538 playb.on('click', function (el) { 539 el.preventDefault(); 540 var $self = $(this); 541 var $i = $self.find('i'); 542 if ($i.hasClass('hm-play-button')) { 543 $i.removeClass('hm-play-button'); 544 $i.addClass('hm-stop'); 545 crl.play(); 546 } else { 547 $i.removeClass('hm-stop'); 548 $i.addClass('hm-play-button'); 549 crl.stop(); 550 } 551 t360.remove(); 552 }); 553 } 554 glass_on.on('click', function (el) { 555 var img_block = $scope.find('img'); 556 img_block.each(function () { 557 var style = $(this).attr('style'); 558 if (-1 !== style.indexOf("block")) { 559 HappySimplaMagnify($(this)[0], zoom); 560 glass_on.css('display', 'none'); 561 t360.remove(); 562 } 563 }); 564 }); 565 $(document).on('click', function (e) { 566 var t = $(e.target); 567 var magnifier = $scope.find('.ha-img-magnifier-glass'); 568 var i = glass_on.find('i'); 569 if (magnifier.length && t[0] !== i[0]) { 570 magnifier.remove(); 571 glass_on.removeAttr('style'); 572 } 573 if (t[0] === ha_circlr[0]) { 574 t360.remove(); 575 } 576 }); 577 ha_circlr.on('mouseup mousedown touchstart touchend', function (e) { 578 t360.remove(); 579 }); 580 }; 581 582 //Event Calendar 583 var Event_Calendar = function Event_Calendar($scope) { 584 var calendarEl = $scope.find('.ha-ec'); 585 var popup = $scope.find('.ha-ec-popup-wrapper'); 586 var popupClose = $scope.find(".ha-ec-popup-close"); 587 var events = calendarEl.data('events'); 588 var initialview = calendarEl.data('initialview'); 589 var firstday = calendarEl.data('firstday'); 590 var locale = calendarEl.data('locale'); 591 var showPopup = calendarEl.data('show-popup'); 592 var allday_text = calendarEl.data('allday-text'); 593 if ('undefined' == typeof events) { 594 return; 595 } 596 var option = { 597 stickyHeaderDates: false, 598 locale: locale, 599 headerToolbar: { 600 left: "prev,next today", 601 center: "title", 602 right: "dayGridMonth,timeGridWeek,timeGridDay,listMonth" 603 }, 604 initialView: initialview, 605 firstDay: firstday, 606 eventTimeFormat: { 607 // like '7pm' 608 hour: 'numeric', 609 minute: '2-digit', 610 meridiem: 'short' 611 }, 612 events: events, 613 height: 'auto', 614 eventClick: function eventClick(info) { 615 if ('yes' == showPopup) { 616 // don't let the browser navigate 617 var getTheDate = function getTheDate(timeString) { 618 return new Date(timeString); 619 }; 620 var timeFormat = function timeFormat(date) { 621 var hours = date.getHours(); 622 var minutes = date.getMinutes(); 623 var ampm = hours >= 12 ? 'pm' : 'am'; 624 hours = hours % 12; 625 hours = hours ? hours : 12; // the hour '0' should be '12' 626 minutes = minutes < 10 ? '0' + minutes : minutes; 627 var strTime = hours + ':' + minutes + '' + ampm; 628 return strTime; 629 }; 630 info.jsEvent.preventDefault(); 631 var todayDateString = info.view.calendar.currentData.currentDate.toString(), 632 allDay = info.event.allDay, 633 title = info.event.title, 634 startDate = info.event.startStr, 635 endDate = info.event.endStr, 636 guest = info.event.extendedProps.guest, 637 location = info.event.extendedProps.location, 638 description = info.event.extendedProps.description, 639 detailsUrl = info.event.url, 640 imageUrl = info.event.extendedProps.image; 641 var titleWrap = popup.find('.ha-ec-event-title'), 642 timeWrap = popup.find('.ha-ec-event-time-wrap'), 643 guestWrap = popup.find('.ha-ec-event-guest-wrap'), 644 locationWrap = popup.find('.ha-ec-event-location-wrap'), 645 descWrap = popup.find('.ha-ec-popup-desc'), 646 detailsWrap = popup.find('.ha-ec-popup-readmore-link'), 647 imageWrap = popup.find('.ha-ec-popup-image'); 648 649 // display none 650 imageWrap.css('display', 'none'); 651 titleWrap.css('display', 'none'); 652 timeWrap.css('display', 'none'); 653 guestWrap.css('display', 'none'); 654 locationWrap.css('display', 'none'); 655 descWrap.css('display', 'none'); 656 detailsWrap.css('display', 'none'); 657 popup.addClass("ha-ec-popup-ready"); 658 659 // image markup 660 if (imageUrl) { 661 imageWrap.removeAttr("style"); 662 imageWrap.find('img').attr("src", imageUrl); 663 imageWrap.find('img').attr("alt", title); 664 } 665 666 // title markup 667 if (title) { 668 titleWrap.removeAttr("style"); 669 titleWrap.text(title); 670 } 671 672 // guest markup 673 if (guest) { 674 guestWrap.removeAttr("style"); 675 guestWrap.find('span.ha-ec-event-guest').text(guest); 676 } 677 678 // location markup 679 if (location) { 680 locationWrap.removeAttr("style"); 681 locationWrap.find('span.ha-ec-event-location').text(location); 682 } 683 684 // description markup 685 if (description) { 686 descWrap.removeAttr("style"); 687 descWrap.html(description); 688 } 689 690 // time markup 691 if (allDay !== true) { 692 timeWrap.removeAttr("style"); 693 startDate = Date.parse(getTheDate(startDate)); 694 endDate = Date.parse(getTheDate(endDate)); 695 var startTimeText = timeFormat(getTheDate(startDate)); 696 var endTimeText = 'Invalid Data'; 697 if (startDate < endDate) { 698 endTimeText = timeFormat(getTheDate(endDate)); 699 } 700 timeWrap.find('span.ha-ec-event-time').text(startTimeText + ' - ' + endTimeText); 701 } else { 702 timeWrap.removeAttr("style"); 703 timeWrap.find('span.ha-ec-event-time').text(allday_text); 704 } 705 706 // read more markup 707 if (detailsUrl) { 708 detailsWrap.removeAttr("style"); 709 detailsWrap.attr("href", detailsUrl); 710 if ("on" === info.event.extendedProps.external) { 711 detailsWrap.attr("target", "_blank"); 712 } 713 if ("on" === info.event.extendedProps.nofollow) { 714 detailsWrap.attr("rel", "nofollow"); 715 } 716 } 717 } else { 718 if (info.event.url && info.event.extendedProps.external) { 719 info.jsEvent.preventDefault(); 720 var id = $scope.data('id'), 721 anchor = document.createElement('a'), 722 anchorReal, 723 timeout; 724 anchor.id = 'happy-even-calender-link-' + id; 725 anchor.href = info.event.url; 726 anchor.target = info.event.extendedProps.external ? '_blank' : '_self'; 727 anchor.rel = info.event.extendedProps.nofollow ? 'nofollow noreferer' : ''; 728 anchor.style.display = 'none'; 729 document.body.appendChild(anchor); 730 anchorReal = document.getElementById(anchor.id); 731 anchorReal.click(); 732 timeout = setTimeout(function () { 733 document.body.removeChild(anchorReal); 734 clearTimeout(timeout); 735 }); 736 return false;
737 } 738 } 739 }, 740 dateClick: function dateClick(arg) { 741 itemDate = arg.date.toUTCString(); 742 } 743 }; 744 var calendar = new FullCalendar.Calendar(calendarEl[0], option); 745 calendar.render(); 746 $scope.find(".ha-ec-popup-wrapper").on("click", function (e) { 747 e.stopPropagation(); 748 if (e.target === e.currentTarget || e.target == popupClose[0] || e.target == popupClose.find(".eicon-editor-close")[0]) { 749 popup.addClass("ha-ec-popup-removing").removeClass("ha-ec-popup-ready"); 750 } 751 }); 752 }; 753 var MailChimp = function MailChimp($scope) { 754 var elForm = $scope.find('.ha-mailchimp-form'), 755 elMessage = $scope.find('.ha-mc-response-message'), 756 successMessage = elForm.data('success-message'); 757 elForm.on('submit', function (e) { 758 e.preventDefault(); 759 var data = { 760 action: 'ha_mailchimp_ajax', 761 security: HappyLocalize.nonce, 762 subscriber_info: elForm.serialize(), 763 list_id: elForm.data('list-id'), 764 post_id: elForm.parent().data('post-id'), 765 widget_id: elForm.parent().data('widget-id') 766 }; 767 $.ajax({ 768 type: 'post', 769 url: HappyLocalize.ajax_url, 770 data: data, 771 success: function success(response) { 772 elForm.trigger('reset'); 773 if (response.status) { 774 elMessage.removeClass('error'); 775 elMessage.addClass('success'); 776 elMessage.text(successMessage); 777 } else { 778 elMessage.addClass('error'); 779 elMessage.removeClass('success'); 780 elMessage.text(response.msg); 781 } 782 var hideMsg = setTimeout(function () { 783 elMessage.removeClass('error'); 784 elMessage.removeClass('success'); 785 clearTimeout(hideMsg); 786 }, 5000); 787 }, 788 error: function error(_error3) { 789 // console.log(error); 790 } 791 }); 792 }); 793 }; 794 795 //Image Accordion 796 var Image_Accordion = function Image_Accordion($scope) { 797 if ($scope.hasClass('ha-image-accordion-click')) { 798 var items = $scope.find('.ha-ia-item'); 799 items.each(function (inx, btn) { 800 $(this).on('click', function (e) { 801 // e.preventDefault(); 802 if ($(this).hasClass('active')) { 803 return; 804 } else { 805 items.removeClass('active'); 806 $(this).addClass('active'); 807 } 808 }); 809 }); 810 } 811 }; 812 813 //Content Switcher 814 var Content_Switcher = function Content_Switcher($scope) { 815 var parent = $scope.find('.ha-content-switcher-wrapper'), 816 designType = parent.data('design-type'); 817 if (designType == 'button') { 818 var buttons = parent.find('.ha-cs-button'), 819 contents = parent.find('.ha-cs-content-section'); 820 buttons.each(function (inx, btn) { 821 $(this).on('click', function (e) { 822 e.preventDefault(); 823 if ($(this).hasClass('active')) { 824 return; 825 } else { 826 buttons.removeClass('active'); 827 $(this).addClass('active'); 828 contents.removeClass('active'); 829 var contentId = $(this).data('content-id'); 830 parent.find('#' + contentId).addClass('active'); 831 } 832 }); 833 }); 834 } else { 835 var toggleSwitch = parent.find('.ha-cs-switch.ha-input-label'), 836 input = parent.find('input.ha-cs-toggle-switch'), 837 primarySwitcher = parent.find('.ha-cs-switch.primary'), 838 secondarySwitcher = parent.find('.ha-cs-switch.secondary'), 839 primaryContent = parent.find('.ha-cs-content-section.primary'), 840 secondaryContent = parent.find('.ha-cs-content-section.secondary'); 841 toggleSwitch.on('click', function (e) { 842 if (input.is(':checked')) { 843 primarySwitcher.removeClass('active'); 844 primaryContent.removeClass('active'); 845 secondarySwitcher.addClass('active'); 846 secondaryContent.addClass('active'); 847 } else { 848 secondarySwitcher.removeClass('active'); 849 secondaryContent.removeClass('active'); 850 primarySwitcher.addClass('active'); 851 primaryContent.addClass('active'); 852 } 853 }); 854 } 855 }; 856 857 //Team Member 858 var Team_Member = function Team_Member($scope) { 859 var btn = $scope.find('.ha-btn'); 860 var lightBox = $scope.find('.ha-member-lightbox'); 861 if (lightBox.length > 0) { 862 var close = lightBox.find('.ha-member-lightbox-close'); 863 btn.on('click', function () { 864 lightBox.addClass('ha-member-lightbox-show'); 865 }); 866 lightBox.on('click', function (e) { 867 if (lightBox.hasClass('ha-member-lightbox-show')) { 868 if (e.target == lightBox[0]) { 869 lightBox.removeClass('ha-member-lightbox-show'); 870 } else if (e.target == close[0]) { 871 lightBox.removeClass('ha-member-lightbox-show'); 872 } else if (e.target == close.find('i.eicon-editor-close')[0]) { 873 lightBox.removeClass('ha-member-lightbox-show'); 874 } 875 } 876 }); 877 } 878 }; 879 880 //Creative Button 881 var Creative_Button = function Creative_Button($scope) { 882 var btn_wrap = $scope.find('.ha-creative-btn-wrap'); 883 var magnetic = btn_wrap.data('magnetic'); 884 var btn = btn_wrap.find('a.ha-creative-btn'); 885 if ('yes' == magnetic) { 886 btn_wrap.on('mousemove', function (e) { 887 var x = e.pageX - (btn_wrap.offset().left + btn_wrap.outerWidth() / 2); 888 var y = e.pageY - (btn_wrap.offset().top + btn_wrap.outerHeight() / 2); 889 btn.css("transform", "translate(" + x * 0.3 + "px, " + y * 0.5 + "px)"); 890 }); 891 btn_wrap.on('mouseout', function (e) { 892 btn.css("transform", "translate(0px, 0px)"); 893 }); 894 } 895 //For expandable button style only 896 var expandable = $scope.find('.ha-eft--expandable'); 897 var text = expandable.find('.text'); 898 if (expandable.length > 0 && text.length > 0) { 899 text[0].addEventListener("transitionend", function () { 900 if (text[0].style.width) { 901 text[0].style.width = "auto"; 902 } 903 }); 904 expandable[0].addEventListener("mouseenter", function (e) { 905 e.currentTarget.classList.add('hover'); 906 text[0].style.width = "auto"; 907 var predicted_answer = text[0].offsetWidth; 908 text[0].style.width = "0"; 909 window.getComputedStyle(text[0]).transform; 910 text[0].style.width = "".concat(predicted_answer, "px"); 911 }); 912 expandable[0].addEventListener("mouseleave", function (e) { 913 e.currentTarget.classList.remove('hover'); 914 text[0].style.width = "".concat(text[0].offsetWidth, "px"); 915 window.getComputedStyle(text[0]).transform; 916 text[0].style.width = ""; 917 }); 918 } 919 }; 920 var PDF_View = function PDF_View($scope) { 921 var $id = $scope.data('id'); 922 var $settings = $scope.find(".viewer-" + $id).data('pdf-settings'); 923 var options = { 924 width: $settings.width, 925 height: $settings.height, 926 page: $settings.page_number 927 }; 928 PDFObject.embed($settings.pdf_url, "#" + $settings.unique_id, options); 929 }; 930 var Comparison_Table = function Comparison_Table($scope) { 931 var $table = $scope.find('.ha-comparison-table-wrapper'); 932 var $table_head = $scope.find('.ha-comparison-table__head'); 933 var $sticky_header = $table_head.data('sticky-header'); 934 var $section_height = $scope.height();
935 var $table_height = $table.innerHeight(); 936 var $tableOffsetTop = $table.offset().top; 937 if ($sticky_header === 'yes') { 938 $window.scroll(function () { 939 var offset = $(this).scrollTop(); 940 if (offset >= $tableOffsetTop) { 941 $table_head.addClass('table-sticky'); 942 } else if (offset > $table_height) { 943 $table_head.removeClass('table-sticky'); 944 } 945 }); 946 } 947 }; 948 949 // Slider 950 elementorFrontend.hooks.addAction('frontend/element_ready/ha-slider.default', function ($scope) { 951 elementorFrontend.elementsHandler.addHandler(SliderBase, { 952 $element: $scope 953 }); 954 }); 955 956 // Carousel 957 elementorFrontend.hooks.addAction('frontend/element_ready/ha-carousel.default', function ($scope) { 958 elementorFrontend.elementsHandler.addHandler(SliderBase, { 959 $element: $scope 960 }); 961 }); 962 963 //Horizontal Timeline 964 elementorFrontend.hooks.addAction('frontend/element_ready/ha-horizontal-timeline.default', function ($scope) { 965 elementorFrontend.elementsHandler.addHandler(SliderBase, { 966 $element: $scope, 967 autoplay: false, 968 container: '.ha-horizontal-timeline-wrapper', 969 navigation: 'arrow', 970 arrows: true 971 }); 972 var img_wrap = $scope.find(".ha-horizontal-timeline-image"); 973 var magnific_popup = img_wrap.data("mfp-src"); 974 if (undefined !== magnific_popup) { 975 img_wrap.magnificPopup({ 976 type: "image", 977 gallery: { 978 enabled: true 979 } 980 }); 981 } 982 }); 983 984 // elementorFrontend.hooks.addAction( 985 // 'frontend/element_ready/ha-mailchimp.default', 986 // function ($scope) { 987 // elementorFrontend.elementsHandler.addHandler(MailChimp, { 988 // $element: $scope, 989 // }); 990 // } 991 // ); 992 993 $('body').on('click.onWrapperLink', '[data-ha-element-link]', function () { 994 var $wrapper = $(this), 995 data = $wrapper.data('ha-element-link'), 996 id = $wrapper.data('id'), 997 anchor = document.createElement('a'), 998 anchorReal, 999 timeout; 1000 anchor.id = 'happy-addons-wrapper-link-' + id; 1001 anchor.href = data.url; 1002 anchor.target = data.is_external ? '_blank' : '_self'; 1003 anchor.rel = data.nofollow ? 'nofollow noreferer' : ''; 1004 anchor.style.display = 'none'; 1005 document.body.appendChild(anchor); 1006 anchorReal = document.getElementById(anchor.id); 1007 anchorReal.click(); 1008 timeout = setTimeout(function () { 1009 document.body.removeChild(anchorReal); 1010 clearTimeout(timeout); 1011 }); 1012 }); 1013 1014 // Background overlay extension
1015 var BackgroundOverlay = function BackgroundOverlay($scope) { 1016 $scope.hasClass('elementor-element-edit-mode') && $scope.addClass('ha-has-bg-overlay'); 1017 }; 1018 var fnHanlders = { 1019 'ha-image-compare.default': HandleImageCompare, 1020 'ha-number.default': NumberHandler, 1021 'ha-skills.default': SkillHandler, 1022 'ha-fun-factor.default': FunFactor, 1023 'ha-bar-chart.default': BarChart, 1024 'ha-twitter-feed.default': TwitterFeed, 1025 'ha-threesixty-rotation.default': Threesixty_Rotation, 1026 'ha-data-table.default': DataTable, 1027 // 'widget' : BackgroundOverlay, 1028 'section': BackgroundOverlay, 1029 'column': BackgroundOverlay, 1030 'ha-event-calendar.default': Event_Calendar, 1031 'ha-mailchimp.default': MailChimp, 1032 'ha-image-accordion.default': Image_Accordion, 1033 'ha-content-switcher.default': Content_Switcher, 1034 'ha-member.default': Team_Member, 1035 'ha-creative-button.default': Creative_Button, 1036 'ha-pdf-view.default': PDF_View, 1037 'ha-comparison-table.default': Comparison_Table 1038 }; 1039 $.each(fnHanlders, function (widgetName, handlerFn) { 1040 elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, handlerFn); 1041 }); 1042 var classHandlers = { 1043 'ha-image-grid.default': ImageGrid, 1044 'ha-justified-gallery.default': JustifiedGrid, 1045 'ha-news-ticker.default': NewsTicker, 1046 'ha-post-tab.default': PostTab 1047 }; 1048 $.each(classHandlers, function (widgetName, handlerClass) { 1049 elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName, function ($scope) { 1050 elementorFrontend.elementsHandler.addHandler(handlerClass, { 1051 $element: $scope 1052 }); 1053 }); 1054 }); 1055 1056 //nav menu 1057 var NavigationMenu = function __init($scope) { 1058 var navMenu = $scope.find('.ha-nav-menu'); 1059 1060 //for tablet only 1061 if (jQuery(window).width() < 1025 && jQuery(window).width() > 767) { 1062 var indicator = navMenu.find('.ha-submenu-indicator-wrap'); 1063 indicator.on('click', function (e) { 1064 e.preventDefault(); 1065 var $parentEl = $(this).parent('li.menu-item-has-children'); 1066 if ($parentEl) { 1067 $parentEl.children('ul.sub-menu').slideToggle(); 1068 } 1069 }); 1070 } 1071 var humBurgerBtn = navMenu.find('.ha-menu-toggler'); 1072 humBurgerBtn.on('click', function (e) { 1073 var humberger = $(this).data('humberger'); 1074 var $pel = navMenu.find('ul.menu'); 1075 if ('open' == humberger) { 1076 $('.ha-menu-open-icon').addClass('hide-icon'); 1077 $('.ha-menu-close-icon').removeClass('hide-icon'); 1078 $('.ha-menu-close-icon').addClass('show-icon'); 1079 $pel.slideDown(); 1080 } else { 1081 $('.ha-menu-close-icon').addClass('hide-icon'); 1082 $('.ha-menu-open-icon').removeClass('hide-icon'); 1083 $('.ha-menu-open-icon').addClass('show-icon'); 1084 $pel.slideUp(); 1085 } 1086 }); 1087 function burgerClsAdd() { 1088 if (jQuery(window).width() < 768) { 1089 navMenu.removeClass('ha-navigation-menu-wrapper'); 1090 navMenu.addClass('ha-navigation-burger-menu'); 1091 var humBurgerSubMenuBtn = navMenu.find('.ha-submenu-indicator-wrap'); 1092 humBurgerSubMenuBtn.on('click', function (e) { 1093 e.preventDefault(); 1094 var $parentEl = $(this).parent('li.menu-item-has-children'); 1095 if ($parentEl) { 1096 $parentEl.children('ul.sub-menu').slideToggle(); 1097 } 1098 }); 1099 } else { 1100 navMenu.addClass('ha-navigation-menu-wrapper'); 1101 navMenu.removeClass('ha-navigation-burger-menu'); 1102 navMenu.find('ul.menu').removeAttr('style'); 1103 navMenu.find('ul.sub-menu').removeAttr('style'); 1104 } 1105 } 1106 burgerClsAdd(); 1107 $window.on('resize', debounce(burgerClsAdd, 100)); 1108 }; 1109 elementorFrontend.hooks.addAction("frontend/element_ready/ha-navigation-menu.default", NavigationMenu); 1110 }); 1111})(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.