1(function ($) { 2 "use strict"; 3 4 /** 5 * Essential Addons For Elementor 6 * 7 * @use Frontend script file. 8 * @link https://essential-addons.com/elementor/ 9 * -------------------------------------------------------- 10 * ================== Table Of Contents ================== 11 * -------------------------------------------------------- 12 * // 13 * 01. Common Scripts 14 * 02. Toggle Handler 15 * 03. Counter Handler 16 * 04. Flip Carousel 17 * 05. Filterable Gallery 18 * 06. Dynamic Filterable Gallery 19 * 07. Instagram Gallery 20 * 08. Advance Accordion 21 * 09. Advance Google Map 22 * 10. Advance Tab 23 * 12. Post Block 24 * 13. Content Timeline 25 * 14. Post List 26 * 15. Data Table 27 * 16. Team member carousel 28 * 17. Image Hotspot 29 * 18. Logo Carousel Handler 30 * 19. Post Carousel 31 * 20. Facebook Carousel 32 * 21. Facebook Feed 33 * 22. Twitter Feed 34 * 23. Twitter Feed Carousel 35 * 24. Testimonial Slider 36 * 25. Content Ticker 37 * 26. Image Comparison 38 * 27. MailChimp 39 * 28. LightBox 40 * 29. CountDown 41 * 30. Fancy Text 42 * 31. Image Accordion 43 * 32. Interactive Card 44 * 33. Pricing Tooltip 45 * 34. ProgressBar 46 * 35. Pricing Tooltip 47 * 36. Section Particales 48 * 37. Section Parallax 49 * 38. Advanced Menu 50 * 38. Image Scroller 51 */ 52 53 /*=================================*/ 54 /* 01. Common Scripts 55 /*=================================*/ 56 var isEditMode = false; 57 window.eaelHasMapAPI = window.google ? window.google : undefined; 58 59 function maybe_note_undefined($selector, $data_atts) { 60 return ($selector.data($data_atts) !== undefined) ? $selector.data($data_atts) : ''; 61 } 62 63 64 /*=================================*/ 65 /* 02. Toggle Handler 66 /*=================================*/ 67 var ToggleHandler = function ( $scope, $ ) { 68 var toggle_elem = $scope.find('.eael-toggle-container').eq(0); 69 $(toggle_elem).each(function () { 70 var $toggle_target = $(this).data('toggle-target'); 71 var $toggle_switch = $($toggle_target).find('.eael-toggle-switch'); 72 $($toggle_target).find('.eael-primary-toggle-label').addClass("active"); 73 $($toggle_switch).toggle( 74 function() { 75 var $parent_container = $(this).closest('.eael-toggle-container'); 76 $($parent_container).find('.eael-toggle-content-wrap').removeClass("primary"); 77 $($parent_container).children('.eael-toggle-content-wrap').addClass("secondary"); 78 $($parent_container).find('.eael-toggle-switch-container').addClass("eael-toggle-switch-on"); 79 $(this).parent().parent().find('.eael-primary-toggle-label').removeClass("active"); 80 $(this).parent().parent().find('.eael-secondary-toggle-label').addClass("active"); 81 }, 82 function() { 83 var $parent_container = $(this).closest('.eael-toggle-container'); 84 $($parent_container).children('.eael-toggle-content-wrap').addClass("primary"); 85 $($parent_container).children('.eael-toggle-content-wrap').removeClass("secondary"); 86 $($parent_container).find('.eael-toggle-switch-container').removeClass("eael-toggle-switch-on"); 87 $(this).parent().parent().find('.eael-primary-toggle-label').addClass("active"); 88 $(this).parent().parent().find('.eael-secondary-toggle-label').removeClass("active"); 89 } 90 ); 91 }); 92 }; 93 94 /*=================================*/ 95 /* 03. Counter Handler 96 /*=================================*/ 97 var CounterHandler = function ($scope, $) { 98 var counter_elem = $scope.find('.eael-counter').eq(0), 99 $target = counter_elem.data('target'); 100 101 $(counter_elem).waypoint(function () { 102 $($target).each(function () { 103 var v = $(this).data("to"), 104 speed = $(this).data("speed"), 105 od = new Odometer({ 106 el: this, 107 value: 0, 108 duration: speed 109 }); 110 od.render(); 111 setInterval(function () { 112 od.update(v); 113 }); 114 }); 115 }, 116 { 117 offset: "80%", 118 triggerOnce: true 119 }); 120 }; 121 122 /*=================================*/ 123 /* 04. Flip Carousel 124 /*=================================*/ 125 var FlipCarousel = function( $scope, $ ) { 126 var flipCarousel_elem = $scope.find('.eael-flip-carousel').eq(0); 127 $(flipCarousel_elem).each(function() { 128 var style = $(this).data('style'), 129 start = $(this).data('start'), 130 fadeIn = $(this).data('fadein'), 131 loop = $(this).data('loop'), 132 autoplay = $(this).data('autoplay'), 133 pauseOnHover = $(this).data('pauseonhover'), 134 spacing = $(this).data('spacing'), 135 click = $(this).data('click'), 136 scrollwheel = $(this).data('scrollwheel'), 137 touch = $(this).data('touch'), 138 buttons = $(this).data('buttons'),
139 buttonPrev = $(this).data('buttonprev'), 140 buttonNext = $(this).data('buttonnext'); 141 142 $(this).flipster({ 143 style : style, 144 start : start, 145 fadeIn : fadeIn, 146 loop : loop, 147 autoplay : autoplay, 148 pauseOnHover: pauseOnHover, 149 spacing : spacing, 150 click : click, 151 scrollwheel : scrollwheel, 152 tocuh : touch, 153 buttons : buttons, 154 buttonPrev : '<i class="flip-custom-nav ' + buttonPrev + '"></i>', 155 buttonNext : '<i class="flip-custom-nav ' + buttonNext + '"></i>', 156 }); 157 }); 158 } 159 160 /*=================================*/ 161 /* 05. Filterable Gallery 162 /*=================================*/ 163 var filterableGalleryHandler = function($scope, $) { 164 if (!isEditMode) { 165 var $gallery = $('.eael-filter-gallery-container', $scope), 166 $settings = $gallery.data('settings'), 167 $gallery_items = $gallery.data('gallery-items'), 168 $layout_mode = ($settings.grid_style == 'masonry' ? 'masonry' : 'fitRows'), 169 $gallery_enabled = ($settings.gallery_enabled == 'yes' ? true : false); 170 171 // init isotope 172 var $isotope_gallery = $gallery.isotope({ 173 itemSelector: '.eael-filterable-gallery-item-wrap', 174 layoutMode: $layout_mode, 175 percentPosition: true, 176 stagger: 30, 177 transitionDuration: $settings.duration + 'ms', 178 filter: $('.eael-filter-gallery-control .control.active', $scope).data('filter') 179 }); 180 181 // layout gal - not necessary, just in case 182 $isotope_gallery.imagesLoaded().progress(function() { 183 $isotope_gallery.isotope('layout'); 184 }); 185 186 // filter 187 $scope.on('click', '.control', function() { 188 var $this = $(this), 189 $filterValue = $this.data('filter'); 190 191 $this.siblings().removeClass('active'); 192 $this.addClass('active'); 193 $isotope_gallery.isotope({ 194 filter: $filterValue 195 }); 196 }); 197 198 // popup 199 $('.eael-magnific-link', $scope).magnificPopup({ 200 type: 'image', 201 gallery: { 202 enabled: $gallery_enabled 203 }, 204 callbacks: { 205 close: function() { 206 $('#elementor-lightbox').hide(); 207 } 208 } 209 }); 210 211 $($scope).magnificPopup({ 212 delegate: '.eael-magnific-video-link', 213 type: 'iframe', 214 callbacks: { 215 close: function() { 216 $('#elementor-lightbox').hide(); 217 } 218 } 219 }); 220 221 // Load more button 222 $scope.on('click', '.eael-gallery-load-more', function(e) { 223 e.preventDefault(); 224 225 var $this = $(this), 226 $init_show = $('.eael-filter-gallery-container', $scope).children('.eael-filterable-gallery-item-wrap').length, 227 $total_items = $gallery.data('total-gallery-items'), 228 $images_per_page = $gallery.data('images-per-page'), 229 $nomore_text = $gallery.data('nomore-item-text'), 230 $items = []; 231 232 if ($init_show == $total_items) { 233 $this.html('<div class="no-more-items-text">' + $nomore_text + '</div>'); 234 setTimeout(function() { 235 $this.fadeOut('slow'); 236 }, 600); 237 } 238 239 // new items html 240 for (var i = $init_show; i < ($init_show + $images_per_page); i++) { 241 $items.push($($gallery_items[i])[0]); 242 } 243 244 // append items 245 $gallery.append($items) 246 $isotope_gallery.isotope('appended', $items) 247 $isotope_gallery.imagesLoaded().progress(function() { 248 $isotope_gallery.isotope('layout') 249 }) 250 251 // reinit magnificPopup 252 $('.eael-magnific-link', $scope).magnificPopup({ 253 type: 'image', 254 gallery: { 255 enabled: $gallery_enabled 256 }, 257 callbacks: { 258 close: function() { 259 $('#elementor-lightbox').hide(); 260 } 261 } 262 }) 263 }); 264 } 265 266 } 267 268 /*=================================*/ 269 /* 06. Dynamic Filterable Gallery 270 /*=================================*/ 271 var DynamicFilterableGallery = function($scope, $) { 272 var $gallery = $scope.find('.eael-filter-gallery-container').eq(0), 273 $galleryWrap = $scope.find('.eael-filter-gallery-wrapper').eq(0), 274 $settings = $gallery.data('settings'); 275 276 // if( !isEditMode ) { 277 if( true ) { 278 var $layout_mode = 'fitRows'; 279 280 if( 'masonry' == $settings.layout_mode ) { 281 $layout_mode = 'masonry'; 282 } 283 284 var $isotope_args = { 285 itemSelector: '.dynamic-gallery-item', 286 layoutMode : $layout_mode, 287 percentPosition : true, 288 stagger: 30, 289 transitionDuration: $settings.duration + 'ms', 290 } 291 292 var $isotope_gallery = {}; 293 294 $scope.imagesLoaded(function(e) { 295 $isotope_gallery = $gallery.isotope($isotope_args); 296 }); 297 298 $scope.on('click', '.control', function() { 299 var $this = $(this), 300 filterValue = $this.attr('data-filter'); 301 302 $this.siblings().removeClass('active'); 303 $this.addClass('active'); 304 $isotope_gallery.isotope({ filter: filterValue }); 305 }); 306 307 var $gallery_id = $galleryWrap.data('gallery_id'), 308 $gallery_by_id = $('#eael-filter-gallery-wrapper-'+$gallery_id), 309 $post_style = $galleryWrap.data('post_style'), 310 $grid_style = $galleryWrap.data('grid_style'), 311 $grid_hover_style = $galleryWrap.data('grid_hover_style'), 312 $show_popup = $galleryWrap.data('show_popup'), 313 $show_popup_styles = $galleryWrap.data('show_popup_styles'), 314 $zoom_icon = $galleryWrap.data('zoom_icon'),
315 $link_icon = $galleryWrap.data('link_icon'), 316 $post_excerpt = $galleryWrap.data('post_excerpt'), 317 $btn_text = $galleryWrap.data('btn_text'), 318 $total_posts = $galleryWrap.data('total_posts'), 319 $post_type = $galleryWrap.data('post_type'), 320 $posts_per_page = $galleryWrap.data('posts_per_page'), 321 $post_order = $galleryWrap.data('post_order'), 322 $post_orderby = $galleryWrap.data('post_orderby'), 323 $post_offset = $galleryWrap.data('post_offset'), 324 $tax_query = $galleryWrap.data('tax_query'), 325 $exclude_posts = $galleryWrap.data('exclude_posts'), 326 $post__in = $galleryWrap.data('post__in'); 327 328 var options = { 329 totalPosts : $total_posts, 330 postStyle : $post_style, 331 loadMoreBtn : $( '#eael-load-more-btn-' + $gallery_id ), 332 postContainer : $( '.eael-filter-gallery-appender-' + $gallery_id ), 333 gridStyle : $grid_style, 334 hoverStyle : $grid_hover_style, 335 popUp : $show_popup, 336 showPopupStyles: $show_popup_styles, 337 zoomIcon : $zoom_icon, 338 linkIcon : $link_icon 339 } 340 341 var gallerySettings = { 342 postType : $post_type, 343 perPage : $posts_per_page, 344 postOrder : $post_order, 345 orderBy : $post_orderby, 346 offset : $post_offset, 347 tax_query : $tax_query, 348 exclude_posts: $exclude_posts, 349 post__in : $post__in, 350 postExcerpt : $post_excerpt, 351 btnText : $btn_text 352 } 353 354 eaelDynamicGalleryLoadMore( options, gallerySettings, $gallery); 355 } 356 357 } 358 359 /*=================================*/ 360 /* 07. Instagram Gallery 361 /*=================================*/ 362 var InstagramGallery = function( $scope, $ ) { 363 364 var instagramGallery = $scope.find('.eael-instagram-feed').eq(0), 365 caption = (instagramGallery.find('.eael-insta-grid').data('caption') === 'show-caption') ? '<p class="insta-caption">{{caption}}</p>' : '', 366 likes = (instagramGallery.find('.eael-insta-grid').data('likes') === 'yes') ? '<p class="eael-insta-post-likes"> <i class="fa fa-heart-o" aria-hidden="true"></i> {{likes}}</p>' : '', 367 comments = (instagramGallery.find('.eael-insta-grid').data('comments') === 'yes') ? '<p class="eael-insta-post-comments"><i class="fa fa-comment-o" aria-hidden="true"></i> {{comments}}</p>' : '', 368 link_target = (instagramGallery.find('.eael-insta-grid').data('link-target') === 'yes') ? 'target="_blank"' : '', 369 link = (instagramGallery.find('.eael-insta-grid').data('link') === 'yes') ? '<a href=\"{{link}}\" ' +link_target+ '></a>' : ''; 370 371 $(instagramGallery).each(function() { 372 var get = $(this).find('.eael-insta-grid').data('get'), 373 tagName = $(this).find('.eael-insta-grid').data('tag-name'), 374 userId = $(this).find('.eael-insta-grid').data('user-id'), 375 clientId = $(this).find('.eael-insta-grid').data('client-id'), 376 accessToken = $(this).find('.eael-insta-grid').data('access-token'), 377 limit = $(this).find('.eael-insta-grid').data('limit'), 378 resolution = $(this).find('.eael-insta-grid').data('resolution'), 379 sortBy = $(this).find('.eael-insta-grid').data('sort-by'), 380 target = $(this).find('.eael-insta-grid').data('target'); 381 382 var loadButton = $(this).find('.eael-load-more-button'); 383 var feed = new Instafeed({ 384 get : ''+get+'', 385 tagName : ''+tagName+'', 386 userId : userId, 387 clientId : ''+clientId+'', 388 accessToken: ''+accessToken+'', 389 limit : ''+limit+'', 390 resolution : ''+resolution+'', 391 sortBy : ''+sortBy+'', 392 target : ''+target+'', 393 template : '<div class="eael-insta-feed eael-insta-box"><div class="eael-insta-feed-inner"><div class="eael-insta-feed-wrap"><div class="eael-insta-img-wrap"><img src="{{image}}" /></div><div class="eael-insta-info-wrap"><div class="eael-insta-info-wrap-inner"><div class="eael-insta-likes-comments">' + likes + comments + '</div>' + caption + '</div></div>' + link + '</div></div></div>', 394 after: function() { 395 var el = $(this); 396 if (el.classList) 397 el.classList.add('show'); 398 else 399 el.className += ' ' + 'show'; 400 401 // disable button if no more results to load 402 if (!this.hasNext()) { 403 $(loadButton).parent().addClass( 'no-pagination' ); 404 loadButton.attr('disabled', 'disabled'); 405 } 406 }, 407 success: function() { 408 $(this).find('.eael-insta-grid').masonry(); 409 $(loadButton).removeClass( 'button--loading' );
410 $(loadButton).find( 'span' ).html( 'Load More' ); 411 } 412 }); 413 414 // bind the load more button 415 loadButton.on('click', function() { 416 feed.next(); 417 $(loadButton).addClass( 'button--loading' ); 418 $(loadButton).find( 'span' ).html( 'Loading...' ); 419 }); 420 421 feed.run(); 422 423 $(window).load(function() { 424 $(this).find('.eael-insta-grid').masonry({ 425 itemSelector: '.eael-insta-feed', 426 percentPosition: true, 427 columnWidth: '.eael-insta-box' 428 }); 429 }); 430 }); 431 } 432 433 /*=================================*/ 434 /* 08. Advance Accordion 435 /*=================================*/ 436 var AdvAccordionHandler = function($scope, $) { 437 var $advanceAccordion = $scope.find(".eael-adv-accordion"), 438 $accordionHeader = $scope.find(".eael-accordion-header"), 439 $accordionType = $advanceAccordion.data("accordion-type"), 440 $accordionSpeed = $advanceAccordion.data("toogle-speed"); 441 442 // Open default actived tab 443 $accordionHeader.each(function(){ 444 if($(this).hasClass('active-default')){ 445 $(this).addClass('show active'); 446 $(this).next().slideDown($accordionSpeed) 447 } 448 }) 449 450 // Remove multiple click event for nested accordion 451 $accordionHeader.unbind("click"); 452 453 $accordionHeader.click(function(e) { 454 e.preventDefault(); 455 456 var $this = $(this); 457 458 if($accordionType === 'accordion') { 459 if ($this.hasClass("show")) { 460 $this.removeClass("show active"); 461 $this.next().slideUp($accordionSpeed); 462 } else { 463 $this.parent().parent().find(".eael-accordion-header").removeClass("show active"); 464 $this.parent().parent().find(".eael-accordion-content").slideUp($accordionSpeed); 465 $this.toggleClass("show active"); 466 $this.next().slideToggle($accordionSpeed); 467 } 468 } else { 469 // For acccordion type 'toggle' 470 if ($this.hasClass("show")) { 471 $this.removeClass("show active"); 472 $this.next().slideUp($accordionSpeed); 473 } else { 474 $this.addClass("show active"); 475 $this.next().slideDown($accordionSpeed); 476 } 477 } 478 }); 479 }; // End of advance accordion 480 481 482 /*=================================*/ 483 /* 09. Advance Google Map 484 /*=================================*/ 485 var AdvGoogleMap = function($scope, $) { 486 487 if(!window.eaelHasMapAPI ) { 488 var $map_class = $scope.find('.eael-google-map').eq(0), 489 $map_notice = $scope.find('.google-map-notice').eq(0); 490 491 $map_class.css('display', 'none'); 492 493 $map_notice.html('Whoops! It\' seems like you didn\'t set Google Map API key. You can set from <b>Elementor > Essential Addons > Elements > Advanced Google Map (Settings)</b>'); 494 $map_notice.addClass('alert alert-warning'); 495 $map_notice.css({ 496 "background-color": "#f2dede", 497 "color" : "#a94442", 498 "font-size" : "85%", 499 "padding" : "15px", 500 "border-radius" : "3px" 501 }); 502 503 }else { 504 505 var $map = $scope.find('.eael-google-map'), 506 $thisMap = $('#' + $map.attr('id')), 507 $mapID = $thisMap.data('id'), 508 $mapType = $thisMap.data('map_type'), 509 $mapAddressType = $thisMap.data('map_address_type'), 510 $mapLat = $thisMap.data('map_lat'), 511 $mapLng = $thisMap.data('map_lng'), 512 $mapAddr = $thisMap.data('map_addr'), 513 $mapBasicMarkerTitle = $thisMap.data('map_basic_marker_title'), 514 $mapBasicMarkerContent = $thisMap.data('map_basic_marker_content'), 515 $mapBasicMarkerIconEnable = $thisMap.data('map_basic_marker_icon_enable'), 516 $mapBasicMarkerIcon = $thisMap.data('map_basic_marker_icon'), 517 $mapBasicMarkerIconWidth = $thisMap.data('map_basic_marker_icon_width'), 518 $mapBasicMarkerIconHeight = $thisMap.data('map_basic_marker_icon_height'), 519 $mapZoom = $thisMap.data('map_zoom'), 520 $mapMarkerContent = $thisMap.data('map_marker_content'), 521 $mapMarkers = $thisMap.data('map_markers'), 522 $mapStaticWidth = $thisMap.data('map_static_width'), 523 $mapStaticHeight = $thisMap.data('map_static_height'), 524 $mapStaticLat = $thisMap.data('map_static_lat'), 525 $mapStaticLng = $thisMap.data('map_static_lng'), 526 $mapPolylines = $thisMap.data('map_polylines'), 527 $mapStrokeColor = $thisMap.data('map_stroke_color'), 528 $mapStrokeOpacity = $thisMap.data('map_stroke_opacity'), 529 $mapStrokeWeight = $thisMap.data('map_stroke_weight'), 530 $mapStrokeFillColor = $thisMap.data('map_stroke_fill_color'), 531 $mapStrokeFillOpacity = $thisMap.data('map_stroke_fill_opacity'), 532 $mapOverlayContent = $thisMap.data('map_overlay_content'), 533 $mapRoutesOriginLat = $thisMap.data('map_routes_origin_lat'), 534 $mapRoutesOriginLng = $thisMap.data('map_routes_origin_lng'), 535 $mapRoutesDestLat = $thisMap.data('map_routes_dest_lat'), 536 $mapRoutesDestLng = $thisMap.data('map_routes_dest_lng'), 537 $mapRoutesTravelMode = $thisMap.data('map_routes_travel_mode'), 538 $mapPanoramaLat = $thisMap.data('map_panorama_lat'), 539 $mapPanoramaLng = $thisMap.data('map_panorama_lng'), 540 $mapTheme = JSON.parse(decodeURIComponent(($thisMap.data('map_theme') + '').replace(/\+/g, '%20'))), 541 $map_streeview_control = $thisMap.data('map_streeview_control'), 542 $map_type_control = $thisMap.data('map_type_control'), 543 $map_zoom_control = $thisMap.data('map_zoom_control'), 544 $map_fullscreen_control = $thisMap.data('map_fullscreen_control'), 545 $map_scroll_zoom = $thisMap.data('map_scroll_zoom'); 546 547 var eaelMapHeader = new GMaps({ 548 el : "#eael-google-map-" + $mapID, 549 lat : $mapLat, 550 lng : $mapLng,
551 zoom : $mapZoom, 552 streetViewControl: $map_streeview_control, 553 mapTypeControl : $map_type_control, 554 zoomControl : $map_zoom_control, 555 fullscreenControl: $map_fullscreen_control, 556 scrollwheel : $map_scroll_zoom 557 }); 558 559 if($mapTheme != '') { 560 eaelMapHeader.addStyle({ 561 styledMapName: "Styled Map", 562 styles : JSON.parse($mapTheme), 563 mapTypeId : "map_style" 564 }); 565 566 eaelMapHeader.setStyle("map_style"); 567 } 568 569 if( 'basic' == $mapType ) { 570 571 var infoWindowHolder = $mapBasicMarkerContent != '' ? { content: $mapBasicMarkerContent} : ''; 572 573 if($mapBasicMarkerIconEnable == 'yes') { 574 var iconHolder = { 575 url : $mapBasicMarkerIcon, 576 scaledSize: new google.maps.Size($mapBasicMarkerIconWidth, $mapBasicMarkerIconHeight), 577 } 578 } else { var iconHolder = null; } 579 580 if($mapAddressType == 'address') { 581 GMaps.geocode({ 582 address: $mapAddr, 583 callback: function(results, status) { 584 if (status == 'OK') { 585 var latlng = results[0].geometry.location; 586 eaelMapHeader.setCenter(latlng.lat(), latlng.lng()); 587 eaelMapHeader.addMarker({ 588 lat : latlng.lat(), 589 lng : latlng.lng(), 590 title : $mapBasicMarkerTitle, 591 infoWindow: infoWindowHolder, 592 icon : iconHolder 593 }); 594 } 595 } 596 }); 597 }else if($mapAddressType == 'coordinates') { 598 eaelMapHeader.addMarker({ 599 lat : $mapLat, 600 lng : $mapLng, 601 title : $mapBasicMarkerTitle, 602 infoWindow: infoWindowHolder, 603 icon : iconHolder 604 }); 605 } 606 607 } // end of basic map script 608 609 610 if('marker' == $mapType) { 611 612 var $data = JSON.parse(decodeURIComponent(($mapMarkers + '').replace(/\+/g, '%20'))); 613 614 if($data.length > 0) { 615 616 var MarkersMap = new GMaps({ 617 el : "#eael-google-map-" + $mapID, 618 lat : $data[0].eael_google_map_marker_lat, 619 lng : $data[0].eael_google_map_marker_lng, 620 zoom : $mapZoom, 621 streetViewControl: $map_streeview_control, 622 mapTypeControl : $map_type_control, 623 zoomControl : $map_zoom_control, 624 fullscreenControl: $map_fullscreen_control, 625 scrollwheel : $map_scroll_zoom 626 }); 627 628 MarkersMap.setCenter($data[0].eael_google_map_marker_lat, $data[0].eael_google_map_marker_lng); 629 630 if($mapTheme != '') { 631 MarkersMap.addStyle({ 632 styledMapName: "Styled Map", 633 styles : JSON.parse($mapTheme), 634 mapTypeId : "map_style" 635 }); 636 637 MarkersMap.setStyle("map_style"); 638 } 639 640 $data.forEach(function($marker) { 641 642 if($marker.eael_google_map_marker_content != '') { 643 var infoWindowHolder = { 644 content: $marker.eael_google_map_marker_content 645 }; 646 }else { 647 var infoWindowHolder = ''; 648 } 649 650 if($marker.eael_google_map_marker_icon_enable == 'yes') { 651 var iconHolder = { 652 url : $marker.eael_google_map_marker_icon.url, 653 scaledSize: new google.maps.Size($marker.eael_google_map_marker_icon_width, $marker.eael_google_map_marker_icon_height), // scaled size 654 }; 655 }else { 656 var iconHolder = ''; 657 } 658 659 660 MarkersMap.addMarker({ 661 lat : parseFloat($marker.eael_google_map_marker_lat), 662 lng : parseFloat($marker.eael_google_map_marker_lng), 663 title : $marker.eael_google_map_marker_title, 664 infoWindow: infoWindowHolder, 665 icon : iconHolder 666 }); 667 668 }); 669 } 670 }// end of multiple markers map 671 672 673 if('static' == $mapType) { 674 675 var $data = JSON.parse(decodeURIComponent(($mapMarkers + '').replace(/\+/g, '%20'))), 676 markersHolder = []; 677 678 if($data.length > 0) { 679 $data.forEach(function($marker) { 680 markersHolder.push( 681 { 682 lat : parseFloat($marker.eael_google_map_marker_lat), 683 lng : parseFloat($marker.eael_google_map_marker_lng), 684 color: $marker.eael_google_map_marker_icon_color 685 } 686 ); 687 }); 688 } 689 690 var eaelStaticMapUrl = GMaps.staticMapURL({ 691 size : [$mapStaticWidth, $mapStaticHeight], 692 lat : $mapStaticLat, 693 lng : $mapStaticLng, 694 markers: markersHolder 695 }); 696 697 $('<img />').attr('src', eaelStaticMapUrl).appendTo('#eael-google-map-' + $mapID); 698 699 } // End of static map 700 701 702 if('polyline' == $mapType) { 703 704 var $polylines_data = JSON.parse(decodeURIComponent(($mapPolylines + '').replace(/\+/g, '%20'))), 705 $data = JSON.parse(decodeURIComponent(($mapMarkers + '').replace(/\+/g, '%20'))), 706 $eael_polylines = []; 707 708 709 var eaelPolylineMap = new GMaps({ 710 el : '#eael-google-map-' + $mapID, 711 lat : $mapLat, 712 lng : $mapLng,
713 zoom : $mapZoom, 714 center: { 715 lat: -12.07635776902266, 716 lng: -77.02792530422971, 717 } 718 }); 719 720 $polylines_data.forEach(function($polyline) { 721 $eael_polylines.push( 722 [ 723 parseFloat($polyline.eael_google_map_polyline_lat), 724 parseFloat($polyline.eael_google_map_polyline_lng) 725 ] 726 ) 727 }); 728 729 var path = JSON.parse(JSON.stringify($eael_polylines)); 730 731 eaelPolylineMap.drawPolyline({ 732 path : path, 733 strokeColor : $mapStrokeColor.toString(), 734 strokeOpacity: $mapStrokeOpacity, 735 strokeWeight : $mapStrokeWeight 736 }); 737 738 $data.forEach(function($marker) { 739 if($marker.eael_google_map_marker_content != '') { 740 var infoWindowHolder = { 741 content: $marker.eael_google_map_marker_content 742 }; 743 }else { 744 var infoWindowHolder = ''; 745 } 746 747 if($marker.eael_google_map_marker_icon_enable == 'yes') { 748 var iconHolder = { 749 url : $marker.eael_google_map_marker_icon.url, 750 scaledSize: new google.maps.Size($marker.eael_google_map_marker_icon_width, $marker.eael_google_map_marker_icon_height), // scaled size 751 }; 752 }else { 753 var iconHolder = ''; 754 } 755 756 eaelPolylineMap.addMarker({ 757 lat : $marker.eael_google_map_marker_lat, 758 lng : $marker.eael_google_map_marker_lng, 759 title : $marker.eael_google_map_marker_title, 760 infoWindow: infoWindowHolder, 761 icon : iconHolder 762 }); 763 }); 764 765 if($mapTheme != '') { 766 eaelPolylineMap.addStyle({ 767 styledMapName: "Styled Map", 768 styles : JSON.parse($mapTheme), 769 mapTypeId : "polyline_map_style" 770 }); 771 772 eaelPolylineMap.setStyle("polyline_map_style"); 773 } 774 775 } // End of polyline map 776 777 778 if('polygon' == $mapType) { 779 780 var $polylines_data = JSON.parse(decodeURIComponent(($mapPolylines + '').replace(/\+/g, '%20'))), 781 $eael_polylines = []; 782 783 $polylines_data.forEach(function($polyline) { 784 $eael_polylines.push( 785 [ 786 parseFloat($polyline.eael_google_map_polyline_lat), 787 parseFloat($polyline.eael_google_map_polyline_lng) 788 ] 789 ) 790 }); 791 792 var path = JSON.parse(JSON.stringify($eael_polylines)); 793 eaelMapHeader.drawPolygon({ 794 paths : path, 795 strokeColor : $mapStrokeColor.toString(), 796 strokeOpacity: $mapStrokeOpacity, 797 strokeWeight : $mapStrokeWeight, 798 fillColor : $mapStrokeFillColor.toString(), 799 fillOpacity : $mapStrokeFillOpacity 800 }); 801 } // End of polygon map 802 803 804 if('overlay' == $mapType) { 805 806 if( $mapOverlayContent != '') { 807 var contentHolder = '<div class="eael-gmap-overlay">'+$mapOverlayContent+'</div>'; 808 }else { 809 var contentHolder = ''; 810 } 811 812 eaelMapHeader.drawOverlay({ 813 lat : $mapLat, 814 lng : $mapLng, 815 content: contentHolder 816 }); 817 } // End of overlay map 818 819 820 if('routes' == $mapType) { 821 eaelMapHeader.drawRoute({ 822 origin : [$mapRoutesOriginLat, $mapRoutesOriginLng], 823 destination : [$mapRoutesDestLat, $mapRoutesDestLng], 824 travelMode : $mapRoutesTravelMode.toString(), 825 strokeColor : $mapStrokeColor.toString(), 826 strokeOpacity: $mapStrokeOpacity, 827 strokeWeight : $mapStrokeWeight, 828 }); 829 830 var $data = JSON.parse(decodeURIComponent(($mapMarkers + '').replace(/\+/g, '%20'))); 831 832 if($data.length > 0) { 833 $data.forEach(function($marker) { 834 835 if($marker.eael_google_map_marker_content != '') { 836 var infoWindowHolder = { 837 content: $marker.eael_google_map_marker_content 838 }; 839 }else { 840 var infoWindowHolder = ''; 841 } 842 843 if($marker.eael_google_map_marker_icon_enable == 'yes') { 844 var iconHolder = { 845 url : $marker.eael_google_map_marker_icon.url, 846 scaledSize: new google.maps.Size($marker.eael_google_map_marker_icon_width, $marker.eael_google_map_marker_icon_height), // scaled size 847 }; 848 }else { 849 var iconHolder = ''; 850 } 851 852 eaelMapHeader.addMarker({ 853 lat : $marker.eael_google_map_marker_lat, 854 lng : $marker.eael_google_map_marker_lng, 855 title : $marker.eael_google_map_marker_title, 856 infoWindow: infoWindowHolder, 857 icon : iconHolder, 858 }); 859 }); 860 } 861 } // End of map routers 862 863 864 if('panorama' == $mapType) { 865 var eaelPanorama = GMaps.createPanorama({ 866 el : '#eael-google-map-'+$mapID, 867 lat: $mapPanoramaLat, 868 lng: $mapPanoramaLng, 869 }); 870 } // end of map panorama 871 } 872 873 } // Advance google map 874 875 876 /*=================================*/ 877 /* 10. Advance Tab 878 /*=================================*/ 879 var AdvanceTabHandler = function ($scope, $) { 880 881 jQuery(document).ready(function($) { 882 var $currentTab = $scope.find('.eael-advance-tabs'), 883 $currentTabId = '#' + $currentTab.attr('id').toString(); 884 885 $($currentTabId + ' .eael-tabs-nav ul li').each( function(index) { 886 if( $(this).hasClass('active-default') ) { 887 $($currentTabId + ' .eael-tabs-nav > ul li').removeClass('active').addClass('inactive'); 888 $(this).removeClass('inactive'); 889 }else { 890 if( index == 0 ) { 891 $(this).removeClass('inactive').addClass('active'); 892 893 } 894 } 895 } ); 896 897 $($currentTabId + ' .eael-tabs-content div').each( function(index) { 898 if( $(this).hasClass('active-default') ) { 899 $($currentTabId + ' .eael-tabs-content > div').removeClass('active'); 900 }else { 901 if( index == 0 ) { 902 $(this).removeClass('inactive').addClass('active'); 903 } 904 } 905 } ); 906 907 $($currentTabId + ' .eael-tabs-nav ul li').click(function(){ 908 var currentTabIndex = $(this).index(), 909 tabsContainer = $(this).closest('.eael-advance-tabs'), 910 tabsNav = $(tabsContainer).children('.eael-tabs-nav').children('ul').children('li'), 911 tabsContent = $(tabsContainer).children('.eael-tabs-content').children('div'); 912 913 $(this).parent('li').addClass('active'); 914 915 $(tabsNav).removeClass('active active-default').addClass('inactive'); 916 $(this).addClass('active').removeClass('inactive'); 917 918 $(tabsContent).removeClass('active').addClass('inactive'); 919 $(tabsContent).eq(currentTabIndex).addClass('active').removeClass('inactive'); 920 921 $(tabsContent).each( function(index) { 922 $(this).removeClass('active-default'); 923 }); 924 }); 925 926 }); 927 } 928 929 930 /*=================================*/ 931 /* 11. Post Timeline 932 /*=================================*/ 933 var postTimelineHandler = function ($scope, $) { 934 var $_this = $scope.find('.eael-post-timeline'), 935 $currentTimelineId = '#' + $_this.attr('id'), 936 $total_posts = parseInt( $_this.data('total_posts'), 10 ), 937 $timeline_id = $_this.data('timeline_id'), 938 $post_type = $_this.data('post_type'), 939 $posts_per_page = parseInt( $_this.data('posts_per_page'), 10 ), 940 $post_order = $_this.data('post_order'), 941 $post_orderby = $_this.data('post_orderby'), 942 $post_offset = parseInt( $_this.data('post_offset'), 10 ), 943 $show_images = $_this.data('show_images'), 944 $image_size = $_this.data('image_size'), 945 $show_title = $_this.data('show_title'), 946 $show_excerpt = $_this.data('show_excerpt'), 947 $excerpt_length = parseInt( $_this.data('excerpt_length'), 10 ), 948 $btn_text = $_this.data('btn_text'), 949 $tax_query = $_this.data('tax_query'), 950 $exclude_posts = $_this.data('exclude_posts'), 951 $post__in = $_this.data('post__in'); 952 953 var options = { 954 totalPosts : $total_posts, 955 loadMoreBtn : $( '#eael-load-more-btn-' + $timeline_id ), 956 postContainer: $( '.eael-post-appender-' + $timeline_id ), 957 postStyle : 'timeline', 958 } 959 960 var settings = { 961 postType : $post_type, 962 perPage : $posts_per_page, 963 postOrder : $post_order, 964 orderBy : $post_orderby, 965 offset : $post_offset, 966 showImage : $show_images, 967 imageSize : $image_size, 968 showTitle : $show_title, 969 showExcerpt : $show_excerpt, 970 excerptLength: parseInt( $excerpt_length, 10 ), 971 btnText : $btn_text, 972 tax_query : $tax_query, 973 exclude_posts: $exclude_posts, 974 post__in : $post__in, 975 } 976 977 eaelLoadMore( options, settings ); 978 } 979 980 981 /*=================================*/ 982 /* 12. Post Block 983 /*=================================*/ 984 var PostBlockHandler = function($scope, $) { 985 986 var $_this = $scope.find('.eael-post-block').eq(0), 987 $options = $_this.data('post_grid_options'), 988 $settings = $_this.data('post_grid_settings'); 989 990 var options = { 991 totalPosts : parseInt($options.totalPosts), 992 loadMoreBtn : $( $options.loadMoreBtn ), 993 postContainer: $( $options.postContainer ), 994 postStyle : 'block' 995 } 996 997 var exclude_posts = JSON.parse($settings.exclude_posts), 998 tax_query = JSON.parse($settings.tax_query), 999 post__in = JSON.parse($settings.post__in); 1000 1001 var settings = { 1002 postType : $settings.postType, 1003 perPage : parseInt($settings.perPage), 1004 postOrder : $settings.postOrder, 1005 orderBy : $settings.orderBy, 1006 showImage : parseInt($settings.showImage), 1007 imageSize : $settings.imageSize, 1008 showTitle : parseInt($settings.showTitle), 1009 showExcerpt : parseInt($settings.showExcerpt), 1010 showMeta : parseInt($settings.showMeta), 1011 offset : $settings.offset,
1012 metaPosition : $settings.metaPosition, 1013 excerptLength : $settings.excerptLength, 1014 btnText : $settings.btnText, 1015 tax_query : tax_query, 1016 exclude_posts : exclude_posts, 1017 post__in : post__in, 1018 grid_style : $settings.grid_style, 1019 hover_animation: $settings.hover_animation 1020 } 1021 1022 eaelLoadMore( options, settings ); 1023 } 1024 1025 /*=================================*/ 1026 /* 13. Content Timeline 1027 /*=================================*/ 1028 var contentTimelineHandler = function($scope, $) { 1029 var contentBlock = $( '.eael-content-timeline-block' ); 1030 1031 $( window ).on( 'scroll', function() { 1032 1033 contentBlock.each(function() { 1034 if( $(this).find( '.highlight' ) ) { 1035 1036 // Calculate screen middle position, top offset and line height and 1037 // change line height dynamically 1038 1039 let lineEnd = contentBlock.height() * 0.15 + window.innerHeight / 2; 1040 let topOffset = $(this).offset().top; 1041 let lineHeight = window.scrollY + lineEnd * 1.3 - topOffset; 1042 1043 $(this).find( '.eael-content-timeline-inner' ).css( 'height', lineHeight +'px' ); 1044 } 1045 }); 1046 1047 if( this.oldScroll > this.scrollY == false ) { 1048 this.oldScroll = this.scrollY; 1049 // Scroll Down 1050 $( '.eael-content-timeline-block.highlight' ).prev().find('.eael-content-timeline-inner').removeClass( 'eael-muted' ).addClass( 'eael-highlighted' ); 1051 1052 }else if( this.oldScroll > this.scrollY == true ) { 1053 this.oldScroll = this.scrollY; 1054 // Scroll Up 1055 $( '.eael-content-timeline-block.highlight' ).find('.eael-content-timeline-inner').addClass( 'eael-prev-highlighted' ); 1056 $( '.eael-content-timeline-block.highlight' ).next().find('.eael-content-timeline-inner').removeClass( 'eael-highlighted' ).removeClass( 'eael-prev-highlighted' ).addClass( 'eael-muted' ); 1057 1058 } 1059 }); 1060 } // end of content timeline 1061 1062 /*=================================*/ 1063 /* 14. Post List 1064 /*=================================*/ 1065 var postListHandler = function($scope, $) { 1066 var $_this = $scope.find('.eael-post-list-container'); 1067 1068 var eael_post_list_settings = { 1069 appender : $( $_this.data('appender') ), 1070 post_type : $_this.data('post_type'), 1071 posts_per_page : ( $_this.data('posts_per_page') !== '' ) ? parseInt( $_this.data('posts_per_page'), 10 ): 11, 1072 post__in : $_this.data('post__in'), 1073 orderby : $_this.data('orderby'), 1074 order : $_this.data('order'), 1075 total_posts : $_this.data('total_posts'), 1076 offset : ( $_this.data('offset') !== '' ) ? parseInt( $_this.data('offset'), 10 ) : 0, 1077 eael_post_list_post_feature_image : $_this.data('show_image'), 1078 eael_post_list_post_meta : $_this.data('show_meta'), 1079 eael_post_list_post_title : $_this.data('show_title'), 1080 eael_post_list_post_excerpt : $_this.data('show_excerpt'), 1081 eael_post_list_post_excerpt_length : $_this.data('excerpt_length'), 1082 eael_post_list_featured_area : $_this.data('show_featured_area'), 1083 featured_posts : $_this.data('featured_posts'), 1084 eael_post_list_featured_meta : $_this.data('show_featured_meta'), 1085 eael_post_list_featured_title : $_this.data('show_featured_title'), 1086 eael_post_list_featured_excerpt : $_this.data('show_featured_excerpt'), 1087 eael_post_list_featured_excerpt_length: $_this.data('featured_excerpt_length'), 1088 tax_query : $_this.data('tax_query'), 1089 excluded : $_this.data('excluded'), 1090 eael_post_list_pagination : $_this.data('show_nav'), 1091 eael_post_list_pagination_next_icon : $_this.data('next_icon'), 1092 eael_post_list_pagination_prev_icon : $_this.data('prev_icon'), 1093 next_btn : $( $_this.data('next_btn') ), 1094 prev_btn : $( $_this.data('prev_btn') ), 1095 }; 1096 eaelLoadMorePostList( eael_post_list_settings ); 1097 } // end of Post List 1098 1099 1100 /*=================================*/ 1101 /* 15. Data Table 1102 /*=================================*/ 1103 var dataTable = function($scope, $) { 1104 var $_this = $scope.find('.eael-data-table-wrap'), 1105 $enable_table = $_this.data('table_enabled'), 1106 $id = $_this.data('table_id'); 1107 1108 if( true == $enable_table ) $("#eael-data-table-"+$id).tablesorter(); 1109 if( $enable_table != true ) { 1110 $('table#eael-data-table-'+$id+' .sorting').addClass('sorting-none'); 1111 $('table#eael-data-table-'+$id+' .sorting_desc').addClass('sorting-none'); 1112 $('table#eael-data-table-'+$id+' .sorting_asc').addClass('sorting-none'); 1113 } 1114 1115 var responsive = $_this.data('custom_responsive'); 1116 if( true == responsive ) { 1117 var $th = $scope.find('.eael-data-table').find('th'), 1118 $tbody = $scope.find('.eael-data-table').find('tbody'); 1119 1120 $tbody.find('tr').each(function(i, item) { 1121 $(item).find('td .td-content-wrapper').each(function(index, item){ 1122 $(this) 1123 .prepend('<div class="th-mobile-screen">' + $th.eq(index).html() + '</div>'); 1124 }); 1125 }); 1126 } 1127 } // end of Data Table 1128 1129 1130 /*=================================*/ 1131 /* 16. Team member carousel
1132 /*=================================*/ 1133 var TeamMemberCarouselHandler = function ($scope, $) { 1134 var $carousel = $scope.find('.eael-tm-carousel').eq(0), 1135 $pagination = ($carousel.data("pagination") !== undefined) ? $carousel.data("pagination") : '.swiper-pagination', 1136 $arrow_next = ($carousel.data("arrow-next") !== undefined) ? $carousel.data("arrow-next") : '.swiper-button-next', 1137 $arrow_prev = ($carousel.data("arrow-prev") !== undefined) ? $carousel.data("arrow-prev") : '.swiper-button-prev', 1138 $items = ($carousel.data("items") !== undefined) ? $carousel.data("items") : 3, 1139 $items_tablet = ($carousel.data("items-tablet") !== undefined) ? $carousel.data("items-tablet") : 3, 1140 $items_mobile = ($carousel.data("items-mobile") !== undefined) ? $carousel.data("items-mobile") : 3, 1141 $margin = ($carousel.data("margin") !== undefined) ? $carousel.data("margin") : 10, 1142 $margin_tablet = ($carousel.data("margin-tablet") !== undefined) ? $carousel.data("margin-tablet") : 10, 1143 $margin_mobile = ($carousel.data("margin-mobile") !== undefined) ? $carousel.data("margin-mobile") : 10, 1144 $speed = ($carousel.data("speed") !== undefined) ? $carousel.data("speed") : 400, 1145 $autoplay = ($carousel.data("autoplay") !== undefined) ? $carousel.data("autoplay") : 999999, 1146 $loop = ($carousel.data("loop") !== undefined) ? $carousel.data("loop") : 0, 1147 $grab_cursor = ($carousel.data("grab-cursor") !== undefined) ? $carousel.data("grab-cursor") : 0, 1148 $data_id = maybe_note_undefined($carousel, 'id'), 1149 $pause_on_hover = maybe_note_undefined($carousel, 'pause-on-hover'), 1150 $slider_options = { 1151 direction : 'horizontal', 1152 speed : $speed, 1153 slidesPerView: $items, 1154 spaceBetween : $margin, 1155 grabCursor : $grab_cursor, 1156 loop : $loop, 1157 autoplay: { 1158 delay: $autoplay, 1159 }, 1160 pagination: { 1161 el : $pagination, 1162 clickable: true, 1163 }, 1164 navigation: { 1165 nextEl: $arrow_next, 1166 prevEl: $arrow_prev, 1167 }, 1168 breakpoints: { 1169 // when window width is <= 480px 1170 480: { 1171 slidesPerView: $items_mobile, 1172 spaceBetween : $margin_mobile 1173 }, 1174 // when window width is <= 640px 1175 768: { 1176 slidesPerView: $items_tablet, 1177 spaceBetween : $margin_tablet 1178 } 1179 } 1180 }; 1181 1182 var TeamSlider = new Swiper($carousel, $slider_options); 1183 if( 0 == $autoplay ) { TeamSlider.autoplay.stop(); } 1184 1185 if($pause_on_hover && $autoplay !== 0) { 1186 $carousel.on('mouseenter', function() { 1187 TeamSlider.autoplay.stop(); 1188 }); 1189 $carousel.on('mouseleave', function() { 1190 TeamSlider.autoplay.start(); 1191 }); 1192 } 1193 }; 1194 1195 /*=================================*/ 1196 /* 17. Image Hotspot 1197 /*=================================*/ 1198 var ImageHotspotHandler = function ($scope, $) { 1199 $('.eael-hot-spot-tooptip').each(function () { 1200 var $position_local = $(this).data('tooltip-position-local'), 1201 $position_global = $(this).data('tooltip-position-global'), 1202 $width = $(this).data('tooltip-width'), 1203 $size = $(this).data('tooltip-size'), 1204 $animation_in = $(this).data('tooltip-animation-in'), 1205 $animation_out = $(this).data('tooltip-animation-out'), 1206 $background = $(this).data('tooltip-background'), 1207 $text_color = $(this).data('tooltip-text-color'), 1208 $arrow = ($(this).data('eael-tooltip-arrow') === 'yes') ? true : false, 1209 $position = $position_local; 1210 1211 if (typeof $position_local === 'undefined' || $position_local === 'global') { 1212 $position = $position_global; 1213 } 1214 if (typeof $animation_out === 'undefined' || !$animation_out) { 1215 $animation_out = $animation_in; 1216 } 1217 1218 $(this).tipso({ 1219 speed : 200, 1220 delay : 200, 1221 width : $width, 1222 background : $background, 1223 color : $text_color, 1224 size : $size, 1225 position : $position, 1226 animationIn : $animation_in, 1227 animationOut: $animation_out, 1228 showArrow : $arrow 1229 }); 1230 }); 1231 }; 1232 1233 /*=================================*/ 1234 /* 18. Logo Carousel Handler 1235 /*=================================*/ 1236 var LogoCarouselHandler = function ($scope, $) { 1237 var $carousel = $scope.find('.eael-logo-carousel').eq(0), 1238 $items = ($carousel.data("items") !== undefined) ? $carousel.data("items") : 3, 1239 $items_tablet = ($carousel.data("items-tablet") !== undefined) ? $carousel.data("items-tablet") : 3, 1240 $items_mobile = ($carousel.data("items-mobile") !== undefined) ? $carousel.data("items-mobile") : 3, 1241 $margin = ($carousel.data("margin") !== undefined) ? $carousel.data("margin") : 10, 1242 $margin_tablet = ($carousel.data("margin-tablet") !== undefined) ? $carousel.data("margin-tablet") : 10, 1243 $margin_mobile = ($carousel.data("margin-mobile") !== undefined) ? $carousel.data("margin-mobile") : 10, 1244 $effect = ($carousel.data("effect") !== undefined) ? $carousel.data("effect") : 'slide', 1245 $speed = ($carousel.data("speed") !== undefined) ? $carousel.data("speed") : 400, 1246 $autoplay = ($carousel.data("autoplay") !== undefined) ? $carousel.data("autoplay") : 999999, 1247 $loop = ($carousel.data("loop") !== undefined) ? $carousel.data("loop") : 0, 1248 $grab_cursor = ($carousel.data("grab-cursor") !== undefined) ? $carousel.data("grab-cursor") : 0, 1249 $pagination = ($carousel.data("pagination") !== undefined) ? $carousel.data("pagination") : '.swiper-pagination', 1250 $arrow_next = ($carousel.data("arrow-next") !== undefined) ? $carousel.data("arrow-next") : '.swiper-button-next', 1251 $arrow_prev = ($carousel.data("arrow-prev") !== undefined) ? $carousel.data("arrow-prev") : '.swiper-button-prev',
1252 $pause_on_hover = ($carousel.data('pause-on-hover') !== undefined ? $carousel.data('pause-on-hover') : ''), 1253 $carousel_options = { 1254 direction : 'horizontal', 1255 speed : $speed, 1256 effect : $effect, 1257 slidesPerView : $items, 1258 spaceBetween : $margin, 1259 grabCursor : $grab_cursor, 1260 paginationClickable: true, 1261 autoHeight : true, 1262 loop : $loop, 1263 autoplay : { 1264 delay: $autoplay, 1265 }, 1266 pagination: { 1267 el : $pagination, 1268 clickable: true, 1269 }, 1270 navigation: { 1271 nextEl: $arrow_next, 1272 prevEl: $arrow_prev, 1273 }, 1274 breakpoints: { 1275 // when window width is <= 480px 1276 480: { 1277 slidesPerView: $items_mobile, 1278 spaceBetween : $margin_mobile 1279 }, 1280 // when window width is <= 640px 1281 768: { 1282 slidesPerView: $items_tablet, 1283 spaceBetween : $margin_tablet 1284 } 1285 } 1286 }; 1287 1288 var LogoCarousel = new Swiper($carousel, $carousel_options); 1289 if($pause_on_hover) { 1290 $carousel.on('mouseenter', function() { 1291 LogoCarousel.autoplay.stop(); 1292 }); 1293 $carousel.on('mouseleave', function() { 1294 LogoCarousel.autoplay.start(); 1295 }); 1296 } 1297 }; 1298 1299 /*=================================*/ 1300 /* 19. Post Carousel 1301 /*=================================*/ 1302 var PostCarouselHandler = function ($scope, $) { 1303 var $postCarousel = $scope.find('.eael-post-carousel').eq(0), 1304 $autoplay = ($postCarousel.data("autoplay") !== undefined) ? $postCarousel.data("autoplay") : 999999, 1305 $pagination = ($postCarousel.data("pagination") !== undefined) ? $postCarousel.data("pagination") : '.swiper-pagination', 1306 $arrow_next = ($postCarousel.data("arrow-next") !== undefined) ? $postCarousel.data("arrow-next") : '.swiper-button-next', 1307 $arrow_prev = ($postCarousel.data("arrow-prev") !== undefined) ? $postCarousel.data("arrow-prev") : '.swiper-button-prev', 1308 $items = ($postCarousel.data("items") !== undefined) ? $postCarousel.data("items") : 3, 1309 $items_tablet = ($postCarousel.data("items-tablet") !== undefined) ? $postCarousel.data("items-tablet") : 3, 1310 $items_mobile = ($postCarousel.data("items-mobile") !== undefined) ? $postCarousel.data("items-mobile") : 3, 1311 $margin = ($postCarousel.data("margin") !== undefined) ? $postCarousel.data("margin") : 10, 1312 $margin_tablet = ($postCarousel.data("margin-tablet") !== undefined) ? $postCarousel.data("margin-tablet") : 10, 1313 $margin_mobile = ($postCarousel.data("margin-mobile") !== undefined) ? $postCarousel.data("margin-mobile") : 10, 1314 $effect = ($postCarousel.data("effect") !== undefined) ? $postCarousel.data("effect") : 'slide', 1315 $speed = ($postCarousel.data("speed") !== undefined) ? $postCarousel.data("speed") : 400, 1316 $loop = ($postCarousel.data("loop") !== undefined) ? $postCarousel.data("loop") : 0, 1317 $grab_cursor = ($postCarousel.data("grab-cursor") !== undefined) ? $postCarousel.data("grab-cursor") : 0, 1318 $pause_on_hover = ($postCarousel.data("pause-on-hover") !== undefined) ? $postCarousel.data("pause-on-hover") : '', 1319 $centeredSlides = ($effect == 'coverflow')? true : false; 1320 1321 var eaelPostCarousel = new Swiper($postCarousel, { 1322 direction : 'horizontal', 1323 speed : $speed, 1324 effect : $effect, 1325 centeredSlides: $centeredSlides, 1326 slidesPerView : $items, 1327 spaceBetween : $margin, 1328 grabCursor : $grab_cursor, 1329 autoHeight : true, 1330 loop : $loop, 1331 autoplay: { 1332 delay: $autoplay, 1333 }, 1334 pagination: { 1335 el : $pagination, 1336 clickable: true, 1337 }, 1338 navigation: { 1339 nextEl: $arrow_next, 1340 prevEl: $arrow_prev, 1341 }, 1342 breakpoints: { 1343 480: { 1344 slidesPerView: $items_mobile, 1345 spaceBetween : $margin_mobile 1346 }, 1347 768: { 1348 slidesPerView: $items_tablet, 1349 spaceBetween : $margin_tablet 1350 } 1351 } 1352 }); 1353 1354 if($autoplay === 0) {
1355 eaelPostCarousel.autoplay.stop(); 1356 } 1357 1358 if($pause_on_hover && $autoplay !== 0) { 1359 $postCarousel.on('mouseenter', function() { 1360 eaelPostCarousel.autoplay.stop(); 1361 }); 1362 $postCarousel.on('mouseleave', function() { 1363 eaelPostCarousel.autoplay.start(); 1364 }); 1365 } 1366 }; 1367 1368 /*=================================*/ 1369 /* 20. Facebook Carousel 1370 /*=================================*/ 1371 var FacebookCarouselHandler = function ($scope, $) { 1372 1373 var loadingFeed = $scope.find( '.eael-loading-feed' ), 1374 $fbCarousel = $scope.find('.eael-facebook-feed-carousel-wrapper').eq(0), 1375 $name = ($fbCarousel.data("facebook-feed-carousel-ac") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-ac") : '', 1376 $limit = ($fbCarousel.data("facebook-feed-carousel-post-limit") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-post-limit") : '', 1377 $app_id = ($fbCarousel.data("facebook-feed-carousel-app-id") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-app-id") : '', 1378 $app_secret = ($fbCarousel.data("facebook-feed-carousel-app-secret") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-app-secret") : '', 1379 $length = ($fbCarousel.data("facebook-feed-carousel-length") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-length") : 400, 1380 $media = ($fbCarousel.data("facebook-feed-carousel-media") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-media") : false, 1381 $carouselId = ($fbCarousel.data("facebook-feed-carousel-id") !== undefined) ? $fbCarousel.data("facebook-feed-carousel-id") : ' '; 1382 1383 /** 1384 * Facebook Feed Init 1385 */ 1386 function eael_facebook_feeds() { 1387 var $access_token = ($app_id+'|'+$app_secret).toString(); 1388 var $id_name = $name.toString(); 1389 1390 $('#eael-facebook-feed-'+ $carouselId +'.eael-facebook-feed-main-carousel-container').socialfeed({ 1391 facebook:{ 1392 accounts : [$id_name], 1393 limit : $limit, 1394 access_token: $access_token 1395 }, 1396 // GENERAL SETTINGS 1397 length : $length, 1398 show_media : $media, 1399 template_html: '<div class="swiper-slide"><div class="carousel-cell eael-social-feed-element {{?\ !it.moderation_passed}}hidden{{?}}" dt-create="{{=it.dt_create}}" social-feed-id = "{\{=it.id}}">\ 1400 {{=it.attachment}}\ 1401 <div class="eael-content">\ 1402 <a class="pull-left auth-img" href="{{=it.author_link}}" target="_blank">\ 1403 <img class="media-object" src="{{=it.author_picture}}">\ 1404 </a>\ 1405 <div class="media-body">\ 1406 <p>\ 1407 <i class="fa fa-{{=it.social_network}} social-feed-icon"></i>\ 1408 <span class="author-title">{{=it.author_name}}</span>\ 1409 <span class="muted pull-right social-feed-date"> {{=it.time_ago}}</span>\ 1410 </p>\ 1411 <div class="text-wrapper">\ 1412 <p class="social-feed-text">{{=it.text}} </p>\ 1413 <p><a href="{{=it.link}}" target="_blank" class="read-more-link">Read \</a></p>\ 1414 </div>\ 1415 </div>\ 1416 </div>\ 1417 </div></div>', 1418 }); 1419 } 1420 1421 /** 1422 * Facebook Feed Carousel View 1423 */ 1424 function eael_facebook_feed_carosuel() { 1425 var $carousel = $scope.find('.eael-facebook-feed-carousel-nav').eq(0), 1426 $pagination = ($carousel.data("pagination") !== undefined) ? $carousel.data("pagination") : '.swiper-pagination', 1427 $arrow_next = ($carousel.data("arrow-next") !== undefined) ? $carousel.data("arrow-next") : '.swiper-button-next', 1428 $arrow_prev = ($carousel.data("arrow-prev") !== undefined) ? $carousel.data("arrow-prev") : '.swiper-button-prev', 1429 $items = ($carousel.data("items") !== undefined) ? $carousel.data("items") : 3, 1430 $items_tablet = ($carousel.data("items-tablet") !== undefined) ? $carousel.data("items-tablet") : 3, 1431 $items_mobile = ($carousel.data("items-mobile") !== undefined) ? $carousel.data("items-mobile") : 3, 1432 $margin = ($carousel.data("margin") !== undefined) ? $carousel.data("margin") : 10, 1433 $margin_tablet = ($carousel.data("margin-tablet") !== undefined) ? $carousel.data("margin-tablet") : 10, 1434 $margin_mobile = ($carousel.data("margin-mobile") !== undefined) ? $carousel.data("margin-mobile") : 10, 1435 $effect = ($carousel.data("effect") !== undefined) ? $carousel.data("effect") : 'slide', 1436 $speed = ($carousel.data("speed") !== undefined) ? $carousel.data("speed") : 400, 1437 $autoplay = ($carousel.data("autoplay") !== undefined) ? $carousel.data("autoplay") : 999999, 1438 $loop = ($carousel.data("loop") !== undefined) ? $carousel.data("loop") : 0, 1439 $grab_cursor = ($carousel.data("grab-cursor") !== undefined) ? $carousel.data("grab-cursor") : 0, 1440 $centeredSlides = ($effect == 'coverflow')? true : false, 1441 1442 mySwiper = new Swiper($carousel, { 1443 direction : 'horizontal', 1444 speed : $speed, 1445 effect : $effect, 1446 centeredSlides: $centeredSlides, 1447 slidesPerView : $items, 1448 spaceBetween : $margin, 1449 grabCursor : $grab_cursor, 1450 autoHeight : true, 1451 loop : $loop, 1452 autoplay : { 1453 delay: $autoplay, 1454 }, 1455 pagination: { 1456 el : $pagination, 1457 clickable: true, 1458 }, 1459 navigation: { 1460 nextEl: $arrow_next, 1461 prevEl: $arrow_prev, 1462 }, 1463 breakpoints: { 1464 // when window width is <= 480px 1465 480: { 1466 slidesPerView: $items_mobile, 1467 spaceBetween : $margin_mobile 1468 }, 1469 // when window width is <= 640px 1470 768: { 1471 slidesPerView: $items_tablet, 1472 spaceBetween : $margin_tablet 1473 } 1474 } 1475 }); 1476 } 1477 1478 $.ajax({ 1479 url: eael_facebook_feeds(), 1480 beforeSend: function() { 1481 loadingFeed.addClass( 'show-loading' ); 1482 }, 1483 success: function() { 1484 setTimeout(function() { 1485 eael_facebook_feed_carosuel(); 1486 loadingFeed.removeClass( 'show-loading' ); 1487 }, 2000); 1488 }, 1489 error: function() { 1490 console.log('error loading'); 1491 } 1492 }); 1493 }; 1494 1495 /*=================================*/ 1496 /* 21. Facebook Feed 1497 /*=================================*/ 1498 var FacebookFeedHandler = function ($scope, $) { 1499 var $feed_element = $scope.find('.eael-facebook-feed-wrapper').eq(0), 1500 $loading_feed = $feed_element.find('.eael-loading-feed'), 1501 $feed_settings = $feed_element.data('settings'); 1502 1503 function get_feed_data() { 1504 $feed_element.find('.eael-social-feed-container').socialfeed({ 1505 facebook: { 1506 accounts : [$feed_settings.accounts], 1507 limit : ($feed_settings.limit), 1508 access_token: ($feed_settings.access_token), 1509 }, 1510 length : parseInt($feed_settings.length), 1511 show_media: $feed_settings.showMedia, 1512 template : $feed_settings.template 1513 }); 1514 } 1515 1516 function facebook_masonry_grid() { 1517 var $masonry_container = $feed_element.find('.eael-social-feed-container'); 1518 $( $masonry_container ).masonry({ 1519 itemSelector: '.eael-social-feed-element-wrap', 1520 percentPosition: true 1521 }); 1522 } 1523 1524 $.ajax({ 1525 url: get_feed_data(), 1526 beforeSend: function() { 1527 $loading_feed.addClass('show-loading'); 1528 }, 1529 success: function() { 1530 if($feed_settings.layout === 'grid-layout') { 1531 setTimeout(function() { 1532 facebook_masonry_grid(); 1533 }, 1500); 1534 } 1535 $loading_feed.removeClass('show-loading'); 1536 }, 1537 error: function() { 1538 console.log('Error getting data from Facebook'); 1539 } 1540 }); 1541 1542 }; 1543 1544 /*=================================*/ 1545 /* 22. Twitter Feed 1546 /*=================================*/ 1547 var TwitterFeedHandler = function ($scope, $) { 1548 var loadingFeed = $scope.find( '.eael-loading-feed' ), 1549 $twitterFeed = $scope.find('.eael-twitter-feed-layout-wrapper').eq(0), 1550 $name = ($twitterFeed.data("twitter-feed-ac-name") !== undefined) ? $twitterFeed.data("twitter-feed-ac-name") : '', 1551 $limit = ($twitterFeed.data("twitter-feed-post-limit") !== undefined) ? $twitterFeed.data("twitter-feed-post-limit") : '', 1552 $hash_tag = ($twitterFeed.data("twitter-feed-hashtag-name") !== undefined) ? $twitterFeed.data("twitter-feed-hashtag-name") : '', 1553 $key = ($twitterFeed.data("twitter-feed-consumer-key") !== undefined) ? $twitterFeed.data("twitter-feed-consumer-key") : '', 1554 $app_secret = ($twitterFeed.data("twitter-feed-consumer-secret") !== undefined) ? $twitterFeed.data("twitter-feed-consumer-secret") : '', 1555 $length = ($twitterFeed.data("twitter-feed-content-length") !== undefined) ? $twitterFeed.data("twitter-feed-content-length") : 400, 1556 $media = ($twitterFeed.data("twitter-feed-media") !== undefined) ? $twitterFeed.data("twitter-feed-media") : false, 1557 $feed_type = ($twitterFeed.data("twitter-feed-type") !== undefined) ? $twitterFeed.data("twitter-feed-type") : false, 1558 $carouselId = ($twitterFeed.data("twitter-feed-id") !== undefined) ? $twitterFeed.data("twitter-feed-id") : ' '; 1559 1560 var $id_name = $name.toString(), 1561 $hash_tag_name = $hash_tag.toString(), 1562 $key_name = $key.toString(), 1563 $app_secret = $app_secret.toString(); 1564 1565 function eael_twitter_feeds() { 1566 $( '#eael-twitter-feed-'+ $carouselId +'.eael-twitter-feed-layout-container' ).socialfeed({ 1567 // TWITTER 1568 twitter:{ 1569 accounts : [ $id_name , $hash_tag_name ], 1570 limit : $limit, 1571 consumer_key : $key_name, 1572 consumer_secret: $app_secret, 1573 }, 1574 // GENERAL SETTINGS 1575 length : $length, 1576 show_media : $media, 1577 template_html: '<div class="eael-social-feed-element {{? !it.moderation_passed}}hidden{{?}}" dt-create="{{=it.dt_create}}" social-feed-id = "{{=it.id}}">\ 1578 <div class="eael-content">\ 1579 <a class="pull-left auth-img" href="{{=it.author_link}}" target="_blank">\ 1580 <img class="media-object" src="{{=it.author_picture}}">\ 1581 </a>\ 1582 <div class="media-body">\ 1583 <p>\ 1584 <i class="fa fa-{{=it.social_network}} social-feed-icon"></i>\ 1585 <span class="author-title">{{=it.author_name}}</span>\ 1586 <span class="muted pull-right social-feed-date"> {{=it.time_ago}}</span>\ 1587 </p>\ 1588 <div class="text-wrapper">\ 1589 <p class="social-feed-text">{{=it.text}} </p>\ 1590 <p><a href="{{=it.link}}" target="_blank" class="read-more-link">Read More <i class="fa fa-angle-double-right"></i></a></p>\ 1591 </div>\ 1592 </div>\ 1593 </div>\ 1594 {{=it.attachment}}\ 1595 </div>', 1596 }); 1597 } 1598 1599 1600 //Twitter Feed masonry View 1601 function eael_twitter_feed_masonry() { 1602 $('.eael-twitter-feed-layout-container.masonry-view').masonry({ 1603 itemSelector: '.eael-social-feed-element', 1604 percentPosition: true, 1605 columnWidth: '.eael-social-feed-element' 1606 }); 1607 } 1608 1609 $.ajax({ 1610 url: eael_twitter_feeds(), 1611 beforeSend: function() { 1612 loadingFeed.addClass('show-loading'); 1613 }, 1614 success: function() { 1615 $('.eael-twitter-feed-layout-container').bind("DOMSubtreeModified", function() { 1616 if ($feed_type == 'masonry') { 1617 setTimeout(function() { 1618 eael_twitter_feed_masonry(); 1619 }, 150); 1620 } 1621 }) 1622 loadingFeed.removeClass('show-loading'); 1623 }, 1624 error: function() { 1625 console.log('error loading'); 1626 } 1627 }); 1628 1629 } 1630 1631 /*=================================*/ 1632 /* 23. Twitter Feed Carousel
1633 /*=================================*/ 1634 var TwitterFeedCarouselHandler = function ($scope, $) { 1635 var loadingFeed = $scope.find( '.eael-loading-feed' ), 1636 $twitterFeedCarousel = $scope.find('.eael-twitter-feed-carousel-wrapper').eq(0), 1637 $name = ($twitterFeedCarousel.data("twitter-feed-carousel-ac-name") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-ac-name") : '', 1638 $limit = ($twitterFeedCarousel.data("twitter-feed-carousel-post-limit") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-post-limit") : '', 1639 $hash_tag = ($twitterFeedCarousel.data("twitter-feed-carousel-hashtag-name") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-hashtag-name") : '', 1640 $key = ($twitterFeedCarousel.data("twitter-feed-carousel-consumer-key") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-consumer-key") : '', 1641 $app_secret = ($twitterFeedCarousel.data("twitter-feed-carousel-consumer-secret") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-consumer-secret") : '', 1642 $length = ($twitterFeedCarousel.data("twitter-feed-carousel-content-length") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-content-length") : 400, 1643 $media = ($twitterFeedCarousel.data("twitter-feed-carousel-media") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-media") : false, 1644 $carouselId = ($twitterFeedCarousel.data("twitter-feed-carousel-id") !== undefined) ? $twitterFeedCarousel.data("twitter-feed-carousel-id") : ' '; 1645 1646 var $id_name = $name.toString(), 1647 $hash_tag_name = $hash_tag.toString(), 1648 $key_name = $key.toString(), 1649 $app_secret = $app_secret.toString(); 1650 1651 function eael_twitter_feeds() { 1652 $( '#eael-twitter-feed-'+ $carouselId +'.eael-twitter-feed-main-carousel-container' ).socialfeed({ 1653 // TWITTER 1654 twitter:{ 1655 accounts : [ $id_name , $hash_tag_name ], 1656 limit : $limit, 1657 consumer_key : $key_name, 1658 consumer_secret: $app_secret, 1659 tweet_mode: 'extended', 1660 }, 1661 // GENERAL SETTINGS 1662 length : $length, 1663 show_media : $media, 1664 template_html: '<div class="swiper-slide"><div class="carousel-cell eael-social-feed-element {{? !it.moderation_passed}}hidden{{?}}" dt-create="{{=it.dt_create}}" social-feed-id = "{{=it.id}}">\ 1665 <div class="eael-content">\ 1666 <a class="pull-left auth-img" href="{{=it.author_link}}" target="_blank">\ 1667 <img class="media-object" src="{{=it.author_picture}}">\ 1668 </a>\ 1669 <div class="media-body">\ 1670 <p>\ 1671 <i class="fa fa-{{=it.social_network}} social-feed-icon"></i>\ 1672 <span class="author-title">{{=it.author_name}}</span>\ 1673 <span class="muted pull-right social-feed-date"> {{=it.time_ago}}</span>\ 1674 </p>\ 1675 <div class="text-wrapper">\ 1676 <p class="social-feed-text">{{=it.text}} </p>\ 1677 <p><a href="{{=it.link}}" target="_blank" class="read-more-link">Read More <i class="fa fa-angle-double-right"></i></a></p>\ 1678 </div>\ 1679 </div>\ 1680 </div>\ 1681 {{=it.attachment}}\ 1682 </div></div>', 1683 }); 1684 } 1685 1686 1687 /** 1688 * Twitter Feed Carousel View 1689 */ 1690 function eael_twitter_feed_carosuel() { 1691 var $carousel = $scope.find('.eael-twitter-feed-carousel-nav').eq(0), 1692 $pagination = ($carousel.data("pagination") !== undefined) ? $carousel.data("pagination") : '.swiper-pagination', 1693 $arrow_next = ($carousel.data("arrow-next") !== undefined) ? $carousel.data("arrow-next") : '.swiper-button-next', 1694 $arrow_prev = ($carousel.data("arrow-prev") !== undefined) ? $carousel.data("arrow-prev") : '.swiper-button-prev', 1695 $items = ($carousel.data("items") !== undefined) ? $carousel.data("items") : 3, 1696 $items_tablet = ($carousel.data("items-tablet") !== undefined) ? $carousel.data("items-tablet") : 3, 1697 $items_mobile = ($carousel.data("items-mobile") !== undefined) ? $carousel.data("items-mobile") : 3, 1698 $margin = ($carousel.data("margin") !== undefined) ? $carousel.data("margin") : 10, 1699 $margin_tablet = ($carousel.data("margin-tablet") !== undefined) ? $carousel.data("margin-tablet") : 10, 1700 $margin_mobile = ($carousel.data("margin-mobile") !== undefined) ? $carousel.data("margin-mobile") : 10, 1701 $effect = ($carousel.data("effect") !== undefined) ? $carousel.data("effect") : 'slide', 1702 $speed = ($carousel.data("speed") !== undefined) ? $carousel.data("speed") : 400, 1703 $autoplay = ($carousel.data("autoplay") !== undefined) ? $carousel.data("autoplay") : 999999, 1704 $loop = ($carousel.data("loop") !== undefined) ? $carousel.data("loop") : 0, 1705 $grab_cursor = ($carousel.data("grab-cursor") !== undefined) ? $carousel.data("grab-cursor") : 0, 1706 $centeredSlides = ($effect == 'coverflow')? true : false,
1707 $pause_on_hover = ($carousel.data('pause-on-hover') !== undefined ? $carousel.data('pause-on-hover') : ''), 1708 $twitterCarouselOptions = { 1709 direction : 'horizontal', 1710 speed : $speed, 1711 effect : $effect, 1712 centeredSlides: $centeredSlides, 1713 slidesPerView : $items, 1714 spaceBetween : $margin, 1715 grabCursor : $grab_cursor, 1716 autoHeight : true, 1717 loop : $loop, 1718 autoplay: { 1719 delay: $autoplay, 1720 }, 1721 pagination: { 1722 el: $pagination, 1723 clickable: true, 1724 }, 1725 navigation: { 1726 nextEl: $arrow_next, 1727 prevEl: $arrow_prev, 1728 }, 1729 breakpoints: { 1730 // when window width is <= 480px 1731 480: { 1732 slidesPerView: $items_mobile, 1733 spaceBetween : $margin_mobile 1734 }, 1735 // when window width is <= 640px 1736 768: { 1737 slidesPerView: $items_tablet, 1738 spaceBetween : $margin_tablet 1739 } 1740 } 1741 }; 1742 1743 var twitterCarousel = new Swiper($carousel, $twitterCarouselOptions); 1744 if($autoplay === 0) { 1745 twitterCarousel.autoplay.stop(); 1746 } 1747 1748 if($pause_on_hover && $autoplay !== 0) { 1749 $carousel.on('mouseenter', function() { 1750 twitterCarousel.autoplay.stop(); 1751 }); 1752 $carousel.on('mouseleave', function() { 1753 twitterCarousel.autoplay.start(); 1754 }); 1755 } 1756 } 1757 1758 $.ajax({ 1759 url: eael_twitter_feeds(), 1760 beforeSend: function() { 1761 loadingFeed.addClass( 'show-loading' ); 1762 }, 1763 success: function() { 1764 setTimeout( function() { 1765 eael_twitter_feed_carosuel(); 1766 loadingFeed.removeClass( 'show-loading' ); 1767 }, 6000 ); 1768 }, 1769 error: function() { 1770 console.log('error loading'); 1771 } 1772 }); 1773 } 1774 1775 /*=================================*/ 1776 /* 24. Testimonial Slider 1777 /*=================================*/ 1778 var TestimonialSliderHandler = function ( $scope, $ ) { 1779 var $testimonialSlider = $scope.find('.eael-testimonial-slider-main').eq(0), 1780 $pagination = ($testimonialSlider.data("pagination") !== undefined) ? $testimonialSlider.data("pagination") : '.swiper-pagination', 1781 $arrow_next = ($testimonialSlider.data("arrow-next") !== undefined) ? $testimonialSlider.data("arrow-next") : '.swiper-button-next', 1782 $arrow_prev = ($testimonialSlider.data("arrow-prev") !== undefined) ? $testimonialSlider.data("arrow-prev") : '.swiper-button-prev', 1783 $items = ($testimonialSlider.data("items") !== undefined) ? $testimonialSlider.data("items") : 3, 1784 $items_tablet = ($testimonialSlider.data("items-tablet") !== undefined) ? $testimonialSlider.data("items-tablet") : 3, 1785 $items_mobile = ($testimonialSlider.data("items-mobile") !== undefined) ? $testimonialSlider.data("items-mobile") : 3, 1786 $margin = ($testimonialSlider.data("margin") !== undefined) ? $testimonialSlider.data("margin") : 10, 1787 $margin_tablet = ($testimonialSlider.data("margin-tablet") !== undefined) ? $testimonialSlider.data("margin-tablet") : 10, 1788 $margin_mobile = ($testimonialSlider.data("margin-mobile") !== undefined) ? $testimonialSlider.data("margin-mobile") : 10, 1789 $effect = ($testimonialSlider.data("effect") !== undefined) ? $testimonialSlider.data("effect") : 'slide', 1790 $speed = ($testimonialSlider.data("speed") !== undefined) ? $testimonialSlider.data("speed") : 400, 1791 $autoplay = ($testimonialSlider.data("autoplay_speed") !== undefined) ? $testimonialSlider.data("autoplay_speed") : 999999, 1792 $loop = ($testimonialSlider.data("loop") !== undefined) ? $testimonialSlider.data("loop") : 0, 1793 $grab_cursor = ($testimonialSlider.data("grab-cursor") !== undefined) ? $testimonialSlider.data("grab-cursor") : 0, 1794 $centeredSlides = ($effect == 'coverflow')? true : false, 1795 $pause_on_hover = ($testimonialSlider.data('pause-on-hover') !== undefined ? $testimonialSlider.data('pause-on-hover') : ''), 1796 1797 $testimonialSliderOptions = { 1798 direction : 'horizontal', 1799 speed : $speed, 1800 effect : $effect, 1801 centeredSlides: $centeredSlides, 1802 slidesPerView : $items, 1803 spaceBetween : $margin, 1804 grabCursor : $grab_cursor, 1805 autoHeight : true, 1806 loop : $loop, 1807 autoplay: { 1808 delay: $autoplay, 1809 }, 1810 pagination: { 1811 el: $pagination, 1812 clickable: true, 1813 }, 1814 navigation: { 1815 nextEl: $arrow_next, 1816 prevEl: $arrow_prev, 1817 }, 1818 breakpoints: { 1819 // when window width is <= 480px 1820 480: { 1821 slidesPerView: $items_mobile, 1822 spaceBetween : $margin_mobile 1823 }, 1824 // when window width is <= 640px 1825 768: { 1826 slidesPerView: $items_tablet, 1827 spaceBetween : $margin_tablet 1828 } 1829 } 1830 }; 1831 1832 var $testimonialSliderObj = new Swiper($testimonialSlider, $testimonialSliderOptions); 1833 if($autoplay === 0) { 1834 $testimonialSliderObj.autoplay.stop(); 1835 } 1836 1837 if($pause_on_hover && $autoplay !== 0) { 1838 $testimonialSlider.on('mouseenter', function() { 1839 $testimonialSliderObj.autoplay.stop(); 1840 }); 1841 $testimonialSlider.on('mouseleave', function() { 1842 $testimonialSliderObj.autoplay.start(); 1843 }); 1844 } 1845 1846 } 1847 1848 /*=================================*/ 1849 /* 25. Content Ticker 1850 /*=================================*/ 1851 var ContentTicker = function ($scope, $) { 1852 var $contentTicker = $scope.find('.eael-content-ticker').eq(0), 1853 $items = ($contentTicker.data("items") !== undefined) ? $contentTicker.data("items") : 1, 1854 $items_tablet = ($contentTicker.data("items-tablet") !== undefined) ? $contentTicker.data("items-tablet") : 1, 1855 $items_mobile = ($contentTicker.data("items-mobile") !== undefined) ? $contentTicker.data("items-mobile") : 1, 1856 $margin = ($contentTicker.data("margin") !== undefined) ? $contentTicker.data("margin") : 10, 1857 $margin_tablet = ($contentTicker.data("margin-tablet") !== undefined) ? $contentTicker.data("margin-tablet") : 10, 1858 $margin_mobile = ($contentTicker.data("margin-mobile") !== undefined) ? $contentTicker.data("margin-mobile") : 10, 1859 $effect = ($contentTicker.data("effect") !== undefined) ? $contentTicker.data("effect") : 'slide', 1860 $speed = ($contentTicker.data("speed") !== undefined) ? $contentTicker.data("speed") : 400, 1861 $autoplay = ($contentTicker.data("autoplay") !== undefined) ? $contentTicker.data("autoplay") : 5000, 1862 $loop = ($contentTicker.data("loop") !== undefined) ? $contentTicker.data("loop") : false, 1863 $grab_cursor = ($contentTicker.data("grab-cursor") !== undefined) ? $contentTicker.data("grab-cursor") : false, 1864 $pagination = ($contentTicker.data("pagination") !== undefined) ? $contentTicker.data("pagination") : '.swiper-pagination', 1865 $arrow_next = ($contentTicker.data("arrow-next") !== undefined) ? $contentTicker.data("arrow-next") : '.swiper-button-next', 1866 $arrow_prev = ($contentTicker.data("arrow-prev") !== undefined) ? $contentTicker.data("arrow-prev") : '.swiper-button-prev',
1867 $pause_on_hover = ($contentTicker.data('pause-on-hover') !== undefined ? $contentTicker.data('pause-on-hover') : ''), 1868 $contentTickerOptions = { 1869 direction : 'horizontal', 1870 loop : $loop, 1871 speed : $speed, 1872 effect : $effect, 1873 slidesPerView : $items, 1874 spaceBetween : $margin, 1875 grabCursor : $grab_cursor, 1876 paginationClickable: true, 1877 autoHeight : true, 1878 autoplay: { 1879 delay: $autoplay, 1880 }, 1881 pagination: { 1882 el: $pagination, 1883 clickable: true, 1884 }, 1885 navigation: { 1886 nextEl: $arrow_next, 1887 prevEl: $arrow_prev, 1888 }, 1889 breakpoints: { 1890 // when window width is <= 480px 1891 480: { 1892 slidesPerView: $items_mobile, 1893 spaceBetween : $margin_mobile 1894 }, 1895 // when window width is <= 640px 1896 768: { 1897 slidesPerView: $items_tablet, 1898 spaceBetween : $margin_tablet 1899 } 1900 } 1901 }; 1902 1903 var $contentTickerSlider = new Swiper($contentTicker, $contentTickerOptions); 1904 if($autoplay === 0) { 1905 $contentTickerSlider.autoplay.stop(); 1906 } 1907 if($pause_on_hover && $autoplay !== 0) { 1908 $contentTicker.on('mouseenter', function() { 1909 $contentTickerSlider.autoplay.stop(); 1910 }); 1911 $contentTicker.on('mouseleave', function() { 1912 $contentTickerSlider.autoplay.start(); 1913 }); 1914 } 1915 }; 1916 1917 /*=================================*/ 1918 /* 26. Image Comparison 1919 /*=================================*/ 1920 var ImageComparisonHandler = function( $scope, $ ){ 1921 var $containerID = $scope.find( '.eael-img-comp-container' ).eq(0), 1922 $offset = $containerID.data('offset'), 1923 $orientation = $containerID.data('orientation'), 1924 $beforeLabel = $containerID.data('before_label'), 1925 $afterLabel = $containerID.data('after_label'), 1926 $overlay = $containerID.data('overlay'), 1927 $slideOnHover = $containerID.data('onhover'), 1928 $slideOnClick = $containerID.data('onclick'); 1929 $containerID.twentytwenty( { 1930 default_offset_pct : $offset || 0.7, 1931 orientation : $orientation || 'horizontal', 1932 before_label : $beforeLabel || 'Before', 1933 after_label : $afterLabel || 'After', 1934 no_overlay : $overlay == 'yes' ? false : true, 1935 move_slider_on_hover : $slideOnHover == 'yes' ? true: false, 1936 move_with_handle_only: true, 1937 click_to_move : $slideOnClick == 'yes' ? true: false 1938 } ); 1939 }; 1940 1941 /*=================================*/ 1942 /* 27. MailChimp 1943 /*=================================*/ 1944 var MailChimp = function ($scope, $) { 1945 var $mailChimp = $scope.find('.eael-mailchimp-wrap').eq(0), 1946 $mailchimp_id = ($mailChimp.data("mailchimp-id") !== undefined) ? $mailChimp.data("mailchimp-id") : '', 1947 $api_key = ($mailChimp.data("api-key") !== undefined) ? $mailChimp.data("api-key") : '', 1948 $list_id = ($mailChimp.data("list-id") !== undefined) ? $mailChimp.data("list-id") : '', 1949 $button_text = ($mailChimp.data("button-text") !== undefined) ? $mailChimp.data("button-text") : '', 1950 $success_text = ($mailChimp.data("success-text") !== undefined) ? $mailChimp.data("success-text") : '', 1951 $loading_text = ($mailChimp.data("loading-text") !== undefined) ? $mailChimp.data("loading-text") : ''; 1952 1953 eael_mailchimp_subscribe( 'eael-mailchimp-form-'+ $mailchimp_id +'', $api_key , $list_id , $button_text , $success_text , $loading_text ); 1954 } 1955 1956 /*=================================*/ 1957 /* 28. LightBox 1958 /*=================================*/ 1959 var LightBox = function ($scope, $) { 1960 var $lightBox = $scope.find('.eael-lightbox-wrapper').eq(0), 1961 $main_class = maybe_note_undefined($lightBox, 'main-class'), 1962 $popup_layout = maybe_note_undefined($lightBox, 'popup-layout'), 1963 $close_button = ($lightBox.data('close_button') === 'yes') ? true : false, 1964 $effect = maybe_note_undefined($lightBox, 'effect'), 1965 $type = maybe_note_undefined($lightBox, 'type'), 1966 $iframe_class = maybe_note_undefined($lightBox, 'iframe-class'), 1967 $src = maybe_note_undefined($lightBox, 'src'), 1968 $trigger_element = maybe_note_undefined($lightBox, 'trigger-element'), 1969 $delay = ($lightBox.data('delay') != '' ) ? $lightBox.data('delay') : 0, 1970 $trigger = maybe_note_undefined($lightBox, 'trigger'), 1971 $popup_id = maybe_note_undefined($lightBox, 'lightbox-id'),
1972 $display_after = maybe_note_undefined($lightBox, 'display-after'), 1973 $esc_exit = ($lightBox.data('esc_exit') === 'yes') ? true : false, 1974 $click_exit = ($lightBox.data('click_exit') === 'yes') ? true : false; 1975 $main_class += ' ' + $popup_layout + ' ' + $effect; 1976 1977 if('eael-lightbox-popup-fullscreen' == $popup_layout) { 1978 var win_height = ($(window).height() - 20); 1979 $('.eael-lightbox-container.content-type-image-now').css({ 1980 'max-height': win_height + 'px', 1981 'margin-top': '10px' 1982 }); 1983 } 1984 1985 if('eael_lightbox_trigger_exit_intent' == $trigger) { 1986 var flag = true, 1987 mouseY = 0, 1988 topValue = 0; 1989 1990 if ( $display_after === 0 ) { 1991 $.removeCookie($popup_id, { path: '/' }); 1992 } 1993 window.addEventListener("mouseout", function (e) { 1994 mouseY = e.clientY; 1995 if (mouseY < topValue && !$.cookie($popup_id) ) { 1996 $.magnificPopup.open({ 1997 items: { 1998 src: $src, //ID of inline element 1999 }, 2000 iframe: { 2001 markup: '<div class="' + $iframe_class + '">'+ 2002 '<div class="modal-popup-window-inner">'+ 2003 '<div class="mfp-iframe-scaler">'+ 2004 '<div class="mfp-close"></div>'+ 2005 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 2006 '</div>'+ 2007 '</div>'+ 2008 '</div>', 2009 }, 2010 type : $type, 2011 showCloseBtn : $close_button, 2012 enableEscapeKey: $esc_exit, 2013 closeOnBgClick : $click_exit, 2014 removalDelay : 500, //Delaying the removal in order to fit in the animation of the popup 2015 mainClass : $main_class, 2016 }); 2017 2018 if ( $display_after > 0 ) { 2019 $.cookie($popup_id, $display_after, { expires: $display_after, path: '/' }); 2020 } else { 2021 $.removeCookie( $popup_id ); 2022 } 2023 } 2024 }, 2025 false); 2026 2027 }else if ('eael_lightbox_trigger_pageload' == $trigger){ 2028 if ( $display_after === 0 ) { 2029 $.removeCookie($popup_id, { path: '/' }); 2030 } 2031 if ( !$.cookie($popup_id) ) { 2032 setTimeout(function() { 2033 $.magnificPopup.open({ 2034 items: { 2035 src: $src, 2036 }, 2037 iframe: { 2038 markup: '<div class="' + $iframe_class + '">'+ 2039 '<div class="modal-popup-window-inner">'+ 2040 '<div class="mfp-iframe-scaler">'+ 2041 '<div class="mfp-close"></div>'+ 2042 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 2043 '</div>'+ 2044 '</div>'+ 2045 '</div>', 2046 }, 2047 type : $type, 2048 showCloseBtn : $close_button, 2049 enableEscapeKey: $esc_exit, 2050 closeOnBgClick : $click_exit, 2051 mainClass : $main_class, 2052 }); 2053 2054 if ( $display_after > 0 ) { 2055 $.cookie($popup_id, $display_after, { expires: $display_after, path: '/' }); 2056 } else { 2057 $.removeCookie( $popup_id ); 2058 } 2059 }, $delay); 2060 } 2061 2062 }else { 2063 if (typeof $trigger_element === 'undefined' || $trigger_element === '') { 2064 $trigger_element = '.eael-modal-popup-link'; 2065 } 2066 2067 $( $trigger_element ).magnificPopup({ 2068 image: { 2069 markup: '<div class="' + $iframe_class + '">'+ 2070 '<div class="modal-popup-window-inner">'+ 2071 '<div class="mfp-figure">'+ 2072 '<div class="mfp-close"></div>'+ 2073 '<div class="mfp-img"></div>'+ 2074 '<div class="mfp-bottom-bar">'+ 2075 '<div class="mfp-title"></div>'+ 2076 '<div class="mfp-counter"></div>'+ 2077 '</div>'+ 2078 '</div>'+ 2079 '</div>'+ 2080 '</div>', 2081 }, 2082 iframe: { 2083 markup: '<div class="' + $iframe_class + '">'+ 2084 '<div class="modal-popup-window-inner">'+ 2085 '<div class="mfp-iframe-scaler">'+ 2086 '<div class="mfp-close"></div>'+ 2087 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 2088 '</div>'+ 2089 '</div>'+ 2090 '</div>', 2091 }, 2092 items: { 2093 src : $src, 2094 type: $type, 2095 }, 2096 removalDelay : 500, 2097 showCloseBtn : $close_button, 2098 enableEscapeKey: $esc_exit, 2099 closeOnBgClick : $click_exit, 2100 mainClass : $main_class, 2101 }); 2102 } 2103 2104 $.extend(true, $.magnificPopup.defaults, { 2105 tClose: 'Close', 2106 }); 2107 2108 } 2109 2110 /*=================================*/ 2111 /* 29. CountDown 2112 /*=================================*/ 2113 var CountDown = function ($scope, $) { 2114 var $coundDown = $scope.find('.eael-countdown-wrapper').eq(0),
2115 $countdown_id = ($coundDown.data("countdown-id") !== undefined) ? $coundDown.data("countdown-id") : '', 2116 $expire_type = ($coundDown.data("expire-type") !== undefined) ? $coundDown.data("expire-type") : '', 2117 $expiry_text = ($coundDown.data("expiry-text") !== undefined) ? $coundDown.data("expiry-text") : '', 2118 $expiry_title = ($coundDown.data("expiry-title") !== undefined) ? $coundDown.data('expiry-title') : '', 2119 $redirect_url = ($coundDown.data("redirect-url") !== undefined) ? $coundDown.data("redirect-url") : '', 2120 $template = ($coundDown.data("template") !== undefined) ? $coundDown.data("template") : ''; 2121 2122 jQuery(document).ready(function($) { 2123 'use strict'; 2124 2125 var countDown = $("#eael-countdown-" + $countdown_id); 2126 countDown.countdown({ 2127 end: function() { 2128 if( $expire_type == 'text'){ 2129 countDown.html( '<div class="eael-countdown-finish-message"><h4 class="expiry-title">' + $expiry_title + '</h4>' + '<div class="eael-countdown-finish-text">' + $expiry_text + '</div></div>'); 2130 } 2131 else if ( $expire_type === 'url'){ 2132 var editMode = $('body').find('#elementor').length; 2133 if( editMode > 0 ) { 2134 countDown.html("Your Page will be redirected to given URL (only on Frontend)."); 2135 } else { 2136 window.location.href = $redirect_url; 2137 } 2138 } 2139 else if ( $expire_type === 'template'){ 2140 countDown.html( $template ); 2141 } else { 2142 //do nothing! 2143 } 2144 } 2145 }); 2146 }); 2147 } 2148 2149 /*=================================*/ 2150 /* 30. Fancy Text 2151 /*=================================*/ 2152 var FancyText = function ($scope, $) { 2153 var $fancyText = $scope.find('.eael-fancy-text-container').eq(0), 2154 $id = ($fancyText.data("fancy-text-id") !== undefined) ? $fancyText.data("fancy-text-id") : '', 2155 $fancy_text = ($fancyText.data("fancy-text") !== undefined) ? $fancyText.data("fancy-text") : '', 2156 $transition_type = ($fancyText.data("fancy-text-transition-type") !== undefined) ? $fancyText.data("fancy-text-transition-type") : '', 2157 $fancy_text_speed = ($fancyText.data("fancy-text-speed") !== undefined) ? $fancyText.data("fancy-text-speed") : '', 2158 $fancy_text_delay = ($fancyText.data("fancy-text-delay") !== undefined) ? $fancyText.data("fancy-text-delay") : '', 2159 $fancy_text_cursor = ($fancyText.data("fancy-text-cursor") !== undefined) ? true : false, 2160 $fancy_text_loop = ($fancyText.data("fancy-text-loop") !== undefined) ? ($fancyText.data("fancy-text-loop") == 'yes' ? true : false) : false; 2161 $fancy_text = $fancy_text.split("|"); 2162 2163 if ( $transition_type == 'typing' ) { 2164 $("#eael-fancy-text-" + $id).typed({ 2165 strings : $fancy_text, 2166 typeSpeed : $fancy_text_speed, 2167 backSpeed : 0, 2168 startDelay: 300, 2169 backDelay : $fancy_text_delay, 2170 showCursor: $fancy_text_cursor, 2171 loop : $fancy_text_loop, 2172 }); 2173 } 2174 2175 if ( $transition_type != 'typing' ) { 2176 $("#eael-fancy-text-" + $id).Morphext({ 2177 animation: $transition_type, 2178 separator: ", ", 2179 speed : $fancy_text_delay, 2180 complete : function () { 2181 // Overrides default empty function 2182 } 2183 }); 2184 } 2185 } 2186 2187 /*=================================*/ 2188 /* 31. Image Accordion 2189 /*=================================*/ 2190 var ImageAccordion = function ($scope, $) { 2191 var $imageAccordion = $scope.find('.eael-img-accordion').eq(0), 2192 $id = ($imageAccordion.data("img-accordion-id") !== undefined) ? $imageAccordion.data("img-accordion-id") : '', 2193 $type = ($imageAccordion.data("img-accordion-type") !== undefined) ? $imageAccordion.data("img-accordion-type") : ''; 2194 2195 if( 'on-click' === $type ) { 2196 $('#eael-img-accordion-'+ $id +' a').on('click', function(e) { 2197 e.preventDefault(); 2198 $('#eael-img-accordion-'+ $id +' a').css('flex', '1'); 2199 $(this).find('.overlay').parent('a').addClass('overlay-active'); 2200 $('#eael-img-accordion-'+ $id +' a').find('.overlay-inner').removeClass('overlay-inner-show'); 2201 $(this).find('.overlay-inner').addClass('overlay-inner-show'); 2202 $(this).css('flex', '3'); 2203 }); 2204 $('#eael-img-accordion-'+ $id +' a').on('blur', function(e) { 2205 $('#eael-img-accordion-'+ $id +' a').css('flex', '1'); 2206 $('#eael-img-accordion-'+ $id +' a').find('.overlay-inner').removeClass('overlay-inner-show'); 2207 $(this).find('.overlay').parent('a').removeClass('overlay-active'); 2208 }); 2209 } 2210 } 2211 2212 /*=================================*/
2213 /* 32. Interactive Card 2214 /*=================================*/ 2215 var InteractiveCard = function ($scope, $) { 2216 var $interactiveCard = $scope.find('.interactive-card').eq(0), 2217 $id = ($interactiveCard.data("interactive-card-id") !== undefined) ? $interactiveCard.data("interactive-card-id") : '', 2218 $animation = ($interactiveCard.data("animation") !== undefined) ? $interactiveCard.data("animation") : '', 2219 $animation_time = ($interactiveCard.data("animation-time") !== undefined) ? $interactiveCard.data("animation-time") : ''; 2220 2221 var options = { 2222 containerId : 'interactive-card-' + $id, 2223 frontAnimation: { 2224 start: 'fade-out', 2225 end : 'fade-in' 2226 }, 2227 rearAnimation: { 2228 start: 'zoom-out', 2229 end : 'zoom-in' 2230 }, 2231 contentAnimation: $animation.toString(), 2232 revealTime : $animation_time 2233 } 2234 interactiveCards( options ); 2235 } 2236 2237 /*=================================*/ 2238 /* 33. Pricing Tooltip 2239 /*=================================*/ 2240 var PricingTooltip = function($scope, $) { 2241 if( $.fn.tooltipster ) { 2242 var $tooltip = $scope.find('.tooltip'), i; 2243 2244 for( i = 0; i < $tooltip.length; i++) { 2245 var $currentTooltip = $( '#' + $($tooltip[i]).attr('id') ), 2246 $tooltipSide = ( $currentTooltip.data('side') !== undefined ) ? $currentTooltip.data('side') : false, 2247 $tooltipTrigger = ( $currentTooltip.data('trigger') !== undefined ) ? $currentTooltip.data('trigger') : 'hover', 2248 $animation = ( $currentTooltip.data('animation') !== undefined ) ? $currentTooltip.data('animation') : 'fade', 2249 $anim_duration = ( $currentTooltip.data('animation_duration') !== undefined ) ? $currentTooltip.data('animation_duration') : 300, 2250 $theme = ( $currentTooltip.data('theme') !== undefined ) ? $currentTooltip.data('theme') : 'default', 2251 $arrow = ( 'yes' == $currentTooltip.data('arrow') ) ? true : false; 2252 2253 $currentTooltip.tooltipster({ 2254 animation: $animation, 2255 trigger : $tooltipTrigger, 2256 side : $tooltipSide, 2257 delay : $anim_duration, 2258 arrow : $arrow, 2259 theme : 'tooltipster-' + $theme 2260 }); 2261 2262 } 2263 } 2264 }; 2265 2266 /*=================================*/ 2267 /* 34. ProgressBar 2268 /*=================================*/ 2269 var ProgressBar = function ($scope, $) { 2270 jQuery('.eael-progressbar', $scope).eaelProgressBar() 2271 } 2272 2273 /*=================================*/ 2274 /* 35. Pricing Tooltip 2275 /*=================================*/ 2276 var EaelOffcanvas = function ($scope, $) { 2277 new EAELOffcanvasContent( $scope ); 2278 } 2279 2280 /*=================================*/ 2281 /* 36. Section Particles 2282 /*=================================*/ 2283 var EaelParticlesHandler = function($scope,$){ 2284 var target = $scope, 2285 sectionId = target.data('id'), 2286 editMode = elementorFrontend.isEditMode(), 2287 settings; 2288 2289 2290 if ( editMode ) { 2291 settings = generateEditorSettings( sectionId ); 2292 } 2293 2294 if (!editMode || ! settings ) { 2295 return false; 2296 } 2297 2298 if(settings.switch == 'yes') { 2299 target.addClass('eael-particles-section'); 2300 if(settings.themeSource === 'presets' || settings.themeSource === 'custom' && '' !== settings.selected_theme) { 2301 generateParticles(); 2302 } 2303 } else { 2304 target.removeClass('eael-particles-section'); 2305 } 2306 2307 2308 function generateEditorSettings(targetId){ 2309 var editorElements = null, 2310 sectionData = {}, 2311 settings = {}; 2312 2313 if ( ! window.elementor.hasOwnProperty( 'elements' ) ) { 2314 return false; 2315 } 2316 2317 editorElements = window.elementor.elements; 2318 2319 if ( ! editorElements.models ) { 2320 return false; 2321 } 2322 2323 $.each(editorElements.models,function(index,elem){ 2324 if( targetId == elem.id){ 2325 sectionData = elem.attributes.settings.attributes; 2326 2327 } else if( elem.id == target.closest( '.elementor-top-section' ).data( 'id' ) ) { 2328 $.each(elem.attributes.elements.models,function(index,col){ 2329 $.each(col.attributes.elements.models,function(index,subSec){ 2330 sectionData = subSec.attributes.settings.attributes; 2331 }); 2332 }); 2333 } 2334 }); 2335 2336 settings.switch = sectionData[ 'eael_particle_switch' ]; 2337 settings.zIndex = sectionData[ 'eael_particles_zindex' ]; 2338 settings.themeSource = sectionData['eael_particle_theme_from']; 2339 2340 2341 if(settings.themeSource == 'presets') { 2342 settings.selected_theme = (ParticleThemesData[sectionData[ 'eael_particle_preset_themes' ]]); 2343 } 2344 2345 if( (settings.themeSource == 'custom') && ('' !== sectionData[ 'eael_particles_custom_style' ]) ){ 2346 settings.selected_theme = sectionData[ 'eael_particles_custom_style' ]; 2347 } 2348 2349 if ( 0 !== settings.length ) { 2350 return settings; 2351 } 2352 2353 return false; 2354 } 2355 2356 function generateParticles(){ 2357 target.attr('id','eael-section-particles-'+ sectionId); 2358 if(typeof particlesJS !== 'undefined' && $.isFunction(particlesJS)) { 2359 particlesJS("eael-section-particles-" + sectionId, JSON.parse(settings.selected_theme)); 2360 target.children('canvas.particles-js-canvas-el').css({ 2361 zIndex: settings.zIndex, 2362 position: 'absolute', 2363 top:0 2364 }); 2365 } 2366 } 2367 2368 }; 2369 2370 /*=================================*/ 2371 /* 37. Section Parallax 2372 /*=================================*/ 2373 var EaelParallaxHandler = function($scope,$){ 2374 var target = $scope, 2375 sectionId = target.data('id'), 2376 settings = false, 2377 editMode = elementorFrontend.isEditMode(); 2378 2379 if( editMode ){ 2380 settings = generateEditorSettings(sectionId); 2381 } 2382 2383 if( ! editMode || ! settings ){ 2384 return false;
2385 } 2386 2387 if(settings[0] == 'yes'){ 2388 if('multi' != settings[1] && 'automove' != settings[1]){ 2389 generateJarallax(); 2390 } else if( 'automove' == settings[1] ){ 2391 generateAutoMoveBackground(); 2392 } else { 2393 generateMultiLayers(); 2394 } 2395 } 2396 2397 function generateEditorSettings(targetId){ 2398 var editorElements = null, 2399 sectionData = {}, 2400 sectionMultiData= {}, 2401 settings = []; 2402 2403 if( ! window.elementor.hasOwnProperty('elements')){ 2404 return false; 2405 } 2406 2407 editorElements = window.elementor.elements; 2408 2409 if( !editorElements.models){ 2410 return false; 2411 } 2412 2413 $.each(editorElements.models,function(index,elem){ 2414 if(targetId == elem.id){ 2415 sectionData = elem.attributes.settings.attributes; 2416 } else if( elem.id == target.closest( '.elementor-top-section' ).data( 'id' ) ) { 2417 $.each(elem.attributes.elements.models,function(index,col){ 2418 $.each(col.attributes.elements.models,function(index,subSec){ 2419 sectionData = subSec.attributes.settings.attributes; 2420 }); 2421 }); 2422 } 2423 }); 2424 2425 if( ! sectionData.hasOwnProperty('eael_parallax_type' ) ){ 2426 return false; 2427 } 2428 2429 if( '' == sectionData[ 'eael_parallax_type' ] ){ 2430 return false; 2431 } 2432 2433 if( 'multi' != sectionData[ 'eael_parallax_type' ] && 'automove' != sectionData[ 'eael_parallax_type' ] ){ 2434 settings.push(sectionData['eael_parallax_switcher']); 2435 settings.push(sectionData['eael_parallax_type']); 2436 settings.push(sectionData['eael_parallax_speed']); 2437 settings.push(('yes' == sectionData['eael_parallax_android_support']) ? 0 : 1 ); 2438 settings.push(('yes' == sectionData['eael_parallax_ios_support']) ? 0 : 1 ); 2439 settings.push(sectionData['eael_parallax_background_size']); 2440 settings.push(sectionData['eael_parallax_background_pos']); 2441 } else if ( 'automove' == sectionData[ 'eael_parallax_type' ] ){ 2442 settings.push(sectionData['eael_parallax_switcher']); 2443 settings.push(sectionData['eael_parallax_type']); 2444 settings.push(sectionData['eael_auto_speed']); 2445 settings.push(sectionData['eael_parallax_auto_type']); 2446 } else { 2447 if( !sectionData.hasOwnProperty('eael_parallax_layers_list' ) ){ 2448 return false; 2449 } 2450 2451 sectionMultiData = sectionData['eael_parallax_layers_list'].models; 2452 2453 if(0 == sectionMultiData.length){ 2454 return false; 2455 } 2456 settings.push(sectionData['eael_parallax_switcher']); 2457 settings.push(sectionData['eael_parallax_type']); 2458 settings.push(( 'yes' == sectionData['eael_parallax_layer_invert'] ) ? 1 : 0 ); 2459 $.each(sectionMultiData,function(index,obj){ 2460 settings.push(obj.attributes); 2461 }); 2462 2463 } 2464 2465 if( 0 !== settings.length ){ 2466 return settings; 2467 } 2468 2469 return false; 2470 } 2471 2472 function responsiveParallax(android, ios) { 2473 switch( true || 1 ){ 2474 case android && ios: 2475 return /iPad|iPhone|iPod|Android/; 2476 break; 2477 case android && ! ios: 2478 return /Android/; 2479 break; 2480 case ! android && ios: 2481 return /iPad|iPhone|iPod/; 2482 break;
2483 case ( ! android && ! ios ): 2484 return null; 2485 } 2486 } 2487 2488 function generateJarallax(){ 2489 setTimeout(function(){ 2490 target.jarallax({ 2491 type: settings[1], 2492 speed: settings[2], 2493 disableParallax: responsiveParallax( 1 == settings[3], 1 == settings[4] ), 2494 keepImg: true 2495 }); 2496 }, 500); 2497 } 2498 2499 function generateAutoMoveBackground(){ 2500 var speed = parseInt(settings[2]); 2501 target.css('background-position','0px 0px'); 2502 if(settings[3] == 11) { 2503 var position = parseInt(target.css('background-position-x')); 2504 setInterval(function(){ 2505 position = position + speed; 2506 target.css( 2507 "backgroundPosition", position + "px 0"); 2508 },70); 2509 } else if(settings[3] == 'right') { 2510 var position = parseInt(target.css('background-position-x')); 2511 setInterval(function(){ 2512 position = position - speed; 2513 target.css( 2514 "backgroundPosition", position + "px 0"); 2515 },70); 2516 } else if(settings[3] == 'top') { 2517 var position = parseInt(target.css('background-position-y')); 2518 setInterval(function(){ 2519 position = position + speed; 2520 target.css( 2521 "backgroundPosition", "0 " + position + "px"); 2522 },70); 2523 } else if(settings[3] == 'bottom') { 2524 var position = parseInt(target.css('background-position-y')); 2525 setInterval(function(){ 2526 position = position - speed; 2527 target.css( 2528 "backgroundPosition", "0 " + position + "px"); 2529 },70); 2530 } 2531 } 2532 2533 function generateMultiLayers(){ 2534 var counter = 0, 2535 mouseParallax = '', 2536 mouseRate = ''; 2537 $.each(settings,function(index,layout){ 2538 if( 2 < index ){ 2539 if(null != layout['eael_parallax_layer_image']['url'] && '' != layout['eael_parallax_layer_image']['url']){ 2540 if('yes' == layout['eael_parallax_layer_mouse'] && '' != layout['eael_parallax_layer_rate']){ 2541 mouseParallax = ' data-parallax="true" '; 2542 mouseRate = ' data-rate="'+ layout['eael_parallax_layer_rate'] + '" '; 2543 } else { 2544 mouseParallax = ' data-parallax="false" '; 2545 } 2546 var backgroundImage = layout['eael_parallax_layer_image']['url'], 2547 $html = $('<div id="eael-parallax-layer-'+ counter + '"' +mouseParallax + mouseRate + ' class="eael-parallax-layer"></div>').prependTo( target ).css({ 2548 'z-index' : layout['eael_parallax_layer_z_index'], 2549 'background-image': 'url(' + backgroundImage + ')', 2550 'background-size': layout['eael_parallax_layer_back_size'], 2551 'background-position-x': layout['eael_parallax_layer_hor_pos'] + '%', 2552 'background-position-y': layout['eael_parallax_layer_ver_pos'] + '%' 2553 }); 2554 2555 counter++; 2556 } 2557 } 2558 }); 2559 target.mousemove( function( e ) {
2560 $(this).find('.eael-parallax-layer[data-parallax="true"]').each(function(index,element){ 2561 $(this).parallax($(this).data('rate'), e); 2562 }); 2563 }); 2564 } 2565 }; 2566 2567 /*=================================*/ 2568 /* 38. Advanced Menu 2569 /*=================================*/ 2570 var AdvancedMenu = function($scope, $) { 2571 var $indicator_class = $('.eael-advanced-menu-container', $scope).data('indicator-class') 2572 var $dropdown_indicator_class = $('.eael-advanced-menu-container', $scope).data('dropdown-indicator-class') 2573 var $horizontal = $('.eael-advanced-menu', $scope).hasClass('eael-advanced-menu-horizontal') 2574 2575 if($horizontal) { 2576 // insert indicator 2577 $('.eael-advanced-menu > li.menu-item-has-children', $scope).each(function() { 2578 $('> a', $(this)).append('<span class="' + $indicator_class + '"></span>') 2579 }) 2580 $('.eael-advanced-menu > li ul li.menu-item-has-children', $scope).each(function() { 2581 $('> a', $(this)).append('<span class="' + $dropdown_indicator_class + '"></span>') 2582 }) 2583 2584 // insert responsive menu toggle, text 2585 $('.eael-advanced-menu-horizontal', $scope).before('<span class="eael-advanced-menu-toggle-text"></span>').after('<button class="eael-advanced-menu-toggle"><span class="eicon-menu-bar"></span></button>') 2586 2587 // responsive menu slide 2588 $('.eael-advanced-menu-container', $scope).on('click', '.eael-advanced-menu-toggle', function(e) { 2589 e.preventDefault() 2590 $(this).siblings('.eael-advanced-menu-horizontal').css('display') == 'none' ? $(this).siblings('.eael-advanced-menu-horizontal').slideDown(300) : $(this).siblings('.eael-advanced-menu-horizontal').slideUp(300) 2591 }) 2592 2593 // clear responsive props 2594 $(window).on('resize load', function() { 2595 if (window.matchMedia('(max-width: 991px)').matches) { 2596 $('.eael-advanced-menu-horizontal', $scope).addClass('eael-advanced-menu-responsive') 2597 $('.eael-advanced-menu-toggle-text', $scope).text($('.eael-advanced-menu-horizontal .current-menu-item a', $scope).eq(0).text()) 2598 } else { 2599 $('.eael-advanced-menu-horizontal', $scope).removeClass('eael-advanced-menu-responsive') 2600 $('.eael-advanced-menu-horizontal, .eael-advanced-menu-horizontal ul', $scope).css('display', '') 2601 } 2602 }) 2603 } 2604 2605 $('.eael-advanced-menu > li.menu-item-has-children', $scope).each(function() { 2606 // indicator position 2607 var $height = parseInt($('a', this).css('line-height')) / 2 2608 $(this).append('<span class="eael-advanced-menu-indicator ' + $indicator_class + '" style="top:' + $height + 'px"></span>') 2609 2610 // if current, keep indicator open 2611 // $(this).hasClass('current-menu-ancestor') ? $(this).addClass('eael-advanced-menu-indicator-open') : '' 2612 }) 2613 2614 $('.eael-advanced-menu > li ul li.menu-item-has-children', $scope).each(function(e) { 2615 // indicator position 2616 var $height = parseInt($('a', this).css('line-height')) / 2 2617 $(this).append('<span class="eael-advanced-menu-indicator ' + $dropdown_indicator_class + '" style="top:' + $height + 'px"></span>') 2618 2619 // if current, keep indicator open 2620 // $(this).hasClass('current-menu-ancestor') ? $(this).addClass('eael-advanced-menu-indicator-open') : '' 2621 }) 2622 2623 // menu indent 2624 $('.eael-advanced-menu-dropdown-align-left .eael-advanced-menu-vertical li.menu-item-has-children').each(function() { 2625 var $padding_left = parseInt($('a', $(this)).css('padding-left')) 2626 2627 $('ul li a', this).css({ 2628 'padding-left': ($padding_left + 20) + 'px' 2629 }) 2630 }) 2631 2632 $('.eael-advanced-menu-dropdown-align-right .eael-advanced-menu-vertical li.menu-item-has-children').each(function() { 2633 var $padding_right = parseInt($('a', $(this)).css('padding-right')) 2634 2635 $('ul li a', this).css({ 2636 'padding-right': ($padding_right + 20) + 'px' 2637 }) 2638 }) 2639 2640 // menu toggle 2641 $('.eael-advanced-menu', $scope).on('click', '.eael-advanced-menu-indicator', function(e) { 2642 e.preventDefault() 2643 $(this).toggleClass('eael-advanced-menu-indicator-open') 2644 $(this).hasClass('eael-advanced-menu-indicator-open') ? $(this).siblings('ul').slideDown(300) : $(this).siblings('ul').slideUp(300) 2645 }) 2646 } 2647 2648 /*=================================*/ 2649 /* 38. Image Scroller 2650 /*=================================*/ 2651 var ImageScroller = function($scope, $) { 2652 $('.eael-image-scroller-hover', $scope).hover(function() { 2653 if($(this).hasClass('eael-image-scroller-vertical')) { 2654 var $container_height = parseInt($(this).css('height')) 2655 var $image_height = $('img', $(this)).height() 2656 var $translate = ($container_height - $image_height) 2657 2658 if($translate > 0) { 2659 return 2660 } 2661 2662 $('img', $(this)).css({ 2663 'transform': 'translateY('+ $translate +'px)' 2664 }) 2665 } else if ($(this).hasClass('eael-image-scroller-horizontal')) { 2666 var $container_width = parseInt($(this).width()) 2667 var $image_width = $('img', $(this)).width() 2668 var $translate = ($container_width - $image_width) 2669 2670 if($translate > 0) { 2671 return 2672 } 2673 2674 $('img', $(this)).css({ 2675 'transform': 'translateX('+ $translate +'px)' 2676 }) 2677 } 2678 }, function() { 2679 $('img', $(this)).css({ 2680 'transform': 'translate(0)' 2681 }) 2682 }) 2683 } 2684 2685 $(window).on('elementor/frontend/init', function () { 2686 if ( elementorFrontend.isEditMode() ) { isEditMode = true; } 2687 2688 elementorFrontend.hooks.addAction('frontend/element_ready/eael-toggle.default', ToggleHandler); 2689 elementorFrontend.hooks.addAction('frontend/element_ready/eael-counter.default', CounterHandler); 2690 elementorFrontend.hooks.addAction('frontend/element_ready/eael-flip-carousel.default', FlipCarousel); 2691 elementorFrontend.hooks.addAction('frontend/element_ready/eael-filterable-gallery.default', filterableGalleryHandler); 2692 elementorFrontend.hooks.addAction('frontend/element_ready/eael-dynamic-filterable-gallery.default', DynamicFilterableGallery); 2693 elementorFrontend.hooks.addAction('frontend/element_ready/eael-instafeed.default', InstagramGallery); 2694 elementorFrontend.hooks.addAction('frontend/element_ready/eael-adv-accordion.default', AdvAccordionH
2694andler); 2695 elementorFrontend.hooks.addAction('frontend/element_ready/eael-google-map.default', AdvGoogleMap); 2696 elementorFrontend.hooks.addAction('frontend/element_ready/eael-adv-tabs.default', AdvanceTabHandler); 2697 elementorFrontend.hooks.addAction('frontend/element_ready/eael-post-timeline.default', postTimelineHandler); 2698 elementorFrontend.hooks.addAction('frontend/element_ready/eael-post-list.default', postListHandler); 2699 elementorFrontend.hooks.addAction('frontend/element_ready/eael-data-table.default', dataTable); 2700 elementorFrontend.hooks.addAction('frontend/element_ready/eael-content-timeline.default', contentTimelineHandler); 2701 elementorFrontend.hooks.addAction('frontend/element_ready/eael-team-member-carousel.default', TeamMemberCarouselHandler); 2702 elementorFrontend.hooks.addAction('frontend/element_ready/eael-image-hotspots.default', ImageHotspotHandler); 2703 elementorFrontend.hooks.addAction('frontend/element_ready/eael-logo-carousel.default', LogoCarouselHandler); 2704 elementorFrontend.hooks.addAction('frontend/element_ready/eael-post-carousel.default', PostCarouselHandler); 2705 elementorFrontend.hooks.addAction('frontend/element_ready/eael-post-block.default', PostBlockHandler); 2706 elementorFrontend.hooks.addAction('frontend/element_ready/eael-facebook-feed-carousel.default', FacebookCarouselHandler); 2707 elementorFrontend.hooks.addAction('frontend/element_ready/eael-facebook-feed.default', FacebookFeedHandler); 2708 elementorFrontend.hooks.addAction('frontend/element_ready/eael-twitter-feed.default', TwitterFeedHandler); 2709 elementorFrontend.hooks.addAction('frontend/element_ready/eael-twitter-feed-carousel.default', TwitterFeedCarouselHandler); 2710 elementorFrontend.hooks.addAction('frontend/element_ready/eael-testimonial-slider.default', TestimonialSliderHandler); 2711 elementorFrontend.hooks.addAction('frontend/element_ready/eael-content-ticker.default', ContentTicker); 2712 elementorFrontend.hooks.addAction('frontend/element_ready/eael-image-comparison.default', ImageComparisonHandler); 2713 elementorFrontend.hooks.addAction('frontend/element_ready/eael-mailchimp.default', MailChimp); 2714 elementorFrontend.hooks.addAction('frontend/element_ready/eael-lightbox.default', LightBox); 2715 elementorFrontend.hooks.addAction('frontend/element_ready/eael-countdown.default', CountDown); 2716 elementorFrontend.hooks.addAction('frontend/element_ready/eael-fancy-text.default', FancyText); 2717 elementorFrontend.hooks.addAction('frontend/element_ready/eael-image-accordion.default', ImageAccordion); 2718 elementorFrontend.hooks.addAction('frontend/element_ready/eael-interactive-card.default', InteractiveCard); 2719 elementorFrontend.hooks.addAction('frontend/element_ready/eael-pricing-table.default', PricingTooltip); 2720 elementorFrontend.hooks.addAction('frontend/element_ready/eael-progress-bar.default', ProgressBar); 2721 elementorFrontend.hooks.addAction('frontend/element_ready/eael-offcanvas.default', EaelOffcanvas); 2722 2723 elementorFrontend.hooks.addAction( 'frontend/element_ready/section', EaelParticlesHandler ); 2724 elementorFrontend.hooks.addAction( 'frontend/element_ready/section', EaelParallaxHandler ); 2725 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.default', AdvancedMenu ); 2726 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-one', AdvancedMenu ); 2727 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-two', AdvancedMenu ); 2728 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-three', AdvancedMenu ); 2729 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-four', AdvancedMenu ); 2730 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-five', AdvancedMenu ); 2731 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-six', AdvancedMenu ); 2732 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-advanced-menu.skin-seven', AdvancedMenu ); 2733 elementorFrontend.hooks.addAction( 'frontend/element_ready/eael-image-scroller.default', ImageScroller ); 2734 }); 2735 2736}(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.