1/*! 2Code in this file was copied from the Extra theme, copyright Elegant Themes. 3Used in this project under the GNU General Public License version 3 (GPLv3). 4See ../license.txt for the GPLv3 license text. 5*/ 6 7function agsdcm_extra($module) { 8 var $ = $module 9 ? function(selector) { 10 return $module.find(selector); 11 } 12 : jQuery; 13 14 var //$comment_form = $('#commentform'), 15 //$rating_stars = $('#rating-stars'), 16 $tabbed_post_module = $('.tabbed-post-module'), 17 $post_module = $('.post-module'), 18 $et_slider = $('.et-slider'), 19 $featured_posts_slider_module = $('.featured-posts-slider-module'), 20 $posts_carousel_module = $('.posts-carousel-module'), 21 //$filterable_portfolio = $('.et_filterable_portfolio'), 22 //$timeline = $('#timeline'), 23 //$contact_form = $('.extra-contact-form'), 24 //$post_format_map = $('.post-format-map'), 25 $paginated = $('.paginated'), 26 $internal_links = $('a[href^="#"]:not([href="#"])'); 27 //$back_to_top = $('#back_to_top'), 28 //$social_share_icons = $('.ed-social-share-icons'), 29 //$woocommerce_details_accordion = $('.extra-woocommerce-details-accordion'), 30 //$search_icon = $('#et-search-icon'), 31 //$et_trending_container = $('#et-trending-container'), 32 //$widget_et_recent_videos = $('.widget_et_recent_videos'), 33 //$et_top_cart_total = $('.et-top-cart-total'); 34 35 var $ = jQuery; 36 37 38 function paginated_transition_page($this_paginated, to_page) { 39 var $this = $this_paginated, 40 $paginated_pages = $this.find('.paginated_page'), 41 window_width = $(window).width(); 42 43 $this.data('current_page', to_page); 44 45 paginated_update_pagination($this); 46 47 $paginated_pages.removeClass('active').hide(); 48 $paginated_pages.filter('.paginated_page_' + to_page).addClass('active').fadeIn('fast', function () { 49 50 if ($('body').hasClass('et_fixed_nav') && 980 < window_width) { 51 $menu_offset = ( $('#top-header').outerHeight() || 0 ) + ( $('#main-header').outerHeight() || 0 ) - 1; 52 } else { 53 $menu_offset = -1; 54 } 55 56 var scroll_to_top_offset = ($this_paginated.offset().top - $menu_offset - et_calclate_admin_bar_height() - 20); 57 58 if ($('html').scrollTop()) { 59 $('html').animate({ 60 scrollTop: scroll_to_top_offset 61 }, { 62 duration: 500, 63 }); 64 65 return; 66 } 67 68 $('body').animate({ 69 scrollTop: scroll_to_top_offset 70 }, { 71 duration: 500, 72 }); 73 }); 74 } 75 76 function paginated_update_pagination($this_paginated) { 77 var current_page = $this_paginated.data('current_page'), 78 $pagination = $this_paginated.find('.pagination'), 79 total_pages = $pagination.find('li').not('.arrow, .ellipsis').length, 80 show_front = false, 81 show_back = false; 82 83 $pagination.find('li').removeClass('active'); 84 $pagination.find('li').not('.arrow, .ellipsis').each(function (i) { 85 86 var $this = $(this); 87 i = i + 1; 88 89 if (i === current_page) { 90 $this.addClass('active'); 91 } 92 93 if (total_pages > 5) { 94 if (i === 1 || i === total_pages) { 95 $this.show(); 96 } else { 97 if (i < 4 && current_page < 4) { 98 $this.show(); 99 } else if (i > (total_pages - 3) && current_page > (total_pages - 3)) { 100 $this.show(); 101 } else if ((i >= current_page - 1) && (i <= current_page + 1)) { 102 $this.show(); 103 } else { 104 $this.hide(); 105 } 106 } 107 108 } 109 110 }); 111 112 if (total_pages > 5) { 113 if (current_page < 4) { 114 show_back = true; 115 show_front = false; 116 } else if (current_page <= (total_pages - 3) && current_page >= 4) { 117 show_back = true; 118 show_front = true; 119 } else if (current_page > (total_pages - 5)) { 120 show_front = true; 121 show_back = false; 122 } else { 123 show_front = false; 124 show_back = false; 125 } 126 127 if (show_front) { 128 $pagination.find('.ellipsis.front').show(); 129 } else { 130 $pagination.find('.ellipsis.front').hide(); 131 } 132 133 if (show_back) { 134 $pagination.find('.ellipsis.back').show(); 135 } else { 136 $pagination.find('.ellipsis.back').hide(); 137 } 138 } 139 140 if (current_page > 1) { 141 $pagination.find('li.prev').show(); 142 } else { 143 $pagination.find('li.prev').hide(); 144 } 145 146 if (current_page < total_pages) { 147 $pagination.find('li.next').show(); 148 } else { 149 $pagination.find('li.next').hide(); 150 } 151 } 152 153 if ($paginated.length) { 154 155 $paginated.each(function () { 156 var $this = $(this), 157 $pagination = $this.find('.pagination'); 158 159 paginated_update_pagination($this); 160 161 $pagination.on('click', 'a', function (e) { 162 var $this = $(this), 163 $this_paginated = $this.closest('.paginated'), 164 $loader = $this_paginated.find('.loader'), 165 current_page = $this_paginated.data('current_page'), 166 to_page, 167 page_is_loaded, 168 posts_per_page = $this_paginated.data('posts_per_page'), 169 order = $this_paginated.data('order'), 170 orderby = $this_paginated.data('orderby'), 171 categories = $this_paginated.data('category_id'), 172 show_featured_image = $this_paginated.data('show_featured_image'), 173 blog_feed_module_type = $this_paginated.data('blog_feed_module_type'), 174 et_column_type = $this_paginated.data('et_column_type'), 175 show_author = $this_paginated.data('show_author'), 176 show_categories = $this_paginated.data('show_categories'), 177 show_date = $this_paginated.data('show_date'), 178 show_rating = $this_paginated.data('show_rating'), 179 show_more = $this_paginated.data('show_more'), 180 show_comments = $this_paginated.data('show_comments'), 181 date_format = $this_paginated.data('date_format'), 182 content_length = $this_paginated.data('content_length'), 183 hover_overlay_icon = $this_paginated.data('hover_overlay_icon'), 184 use_tax_query = $this_paginated.data('use_tax_query'), 185 tax_query = ('undefined' === typeof (EXTRA_TAX_QUERY) || 1 !== parseInt(use_tax_query)) ? [] : EXTRA_TAX_QUERY; 186 187 e.preventDefault(); 188 189 if ($this.hasClass('ellipsis')) { 190 return; 191 } else if ($this.hasClass('arrow')) { 192 if ($this.hasClass('prev')) { 193 to_page = current_page - 1; 194 } else { 195 to_page = current_page + 1; 196 } 197 } else { 198 to_page = $this.data('page'); 199 } 200 201 page_is_loaded = $this_paginated.find('.paginated_page_' + to_page).length; 202 203 if (page_is_loaded) { 204 paginated_transition_page($this_paginated, to_page); 205 } else { 206 207 var $to_page_link = $this; 208 if ($this.hasClass('arrow')) { 209 $to_page_link = $this_paginated.find('.pagination-page-' + to_page); 210 } 211 212 $to_page_link_li = $to_page_link.parent(); 213 214 $loader.appendTo($to_page_link_li); 215 $to_page_link.hide(); 216 217 if ($this_paginated.data('getting_more_content')) { 218 return; 219 } 220 221 $this_paginated.data('getting_more_content', true); 222 223 $.ajax({ 224 type: "POST", 225 url: EXTRA.ajaxurl, 226 data: { 227 action: 'extra_blog_feed_get_content', 228 et_load_builder_modules: '1', 229 blog_feed_nonce: EXTRA.blog_feed_nonce, 230 to_page: to_page, 231 posts_per_page: posts_per_page, 232 order: order, 233 orderby: orderby, 234 categories: categories, 235 show_featured_image: show_featured_image, 236 blog_feed_module_type: blog_feed_module_type, 237 et_column_type: et_column_type, 238 show_author: show_author, 239 show_categories: show_categories, 240 show_date: show_date, 241 show_rating: show_rating, 242 show_more: show_more, 243 show_comments: show_comments, 244 date_format: date_format, 245 content_length: content_length, 246 hover_overlay_icon: hover_overlay_icon, 247 use_tax_query: use_tax_query, 248 tax_query: tax_query 249 }, 250 success: function (data) { 251 252 if (data) { 253 var $new_page = $(data); 254 255 $new_page.appendTo($this_paginated.find('.paginated_content')); 256 257 paginated_transition_page($this_paginated, to_page); 258 259 setTimeout(function () { 260 re_init_new_content($new_page); 261 }, 500); 262 } 263 264 setTimeout(function () { 265 $this_paginated.data('getting_more_content', false); 266 }, 250); 267 268 // reset loader image and re-show pagination page number 269 $loader.appendTo($this_paginated); 270 $to_page_link.show(); 271 } 272 }); 273 } 274 }); 275 276 // Added to run re_init_new_content on first page too in VB 277 if ($module) { 278 var $new_page = $this.find('.paginated_page.active:first'); 279 if ($new_page.length) { 280 setTimeout(function () { 281 re_init_new_content($new_page); 282 }, 500); 283 } 284 } 285 286 287 288 }); // end $paginated.each 289 } // end if ( $paginated.length ) 290 291 if ($post_module.length) { 292 $post_module.find('.title-thumb-hover').each(function () { 293 var $this = $(this), 294 $thumb = $this.find('.post-thumbnail > img'), 295 $title = $this.find('.post-content > h3 > a'), 296 title_hover_color = $title.data('hover-color'); 297 298 $title.hover(function () { 299 $thumb.addClass('hover'); 300 $title.css({ 301 'color': title_hover_color 302 }); 303 }, function () { 304 $thumb.removeClass('hover'); 305 $title.css('color', ''); 306 }); 307 }); 308 } 309 310 function tabbed_post_module_tab_change($tab) { 311 var $module = $tab.parents('.tabbed-post-module'), 312 tab_id = $tab.data('tab-id'), 313 $tab_content = $module.find('.tab-content-' + tab_id), 314 term_color = $tab.data('term-color'); 315 316 $tab.css({ 317 color: term_color 318 }); 319 320 $module.css({ 321 borderTopColor: term_color 322 }); 323 324 $tab_content.siblings().hide(); 325 326 $tab_content.stop().css({ 327 'display': 'flex' 328 }).hide().fadeIn(300, 'swing'); 329 330 $tab.addClass('active').siblings().removeClass('active').css({ 331 color: '' 332 }); 333 } 334 335 if ($tabbed_post_module.length) { 336 $tabbed_post_module.each(function () { 337 338 // Set first active colors 339 var $this = $(this), 340 $tabs_container = $this.find('.tabs'), 341 $tabs = $tabs_container.find('li'), 342 tabs_count = $tabs.length, 343 term_color = $tabs.first().data('term-color'), 344 $arrow = $tabs_container.find('.arrow'); 345 346 $tabs.first().addClass('active').css({ 347 color: term_color 348 }); 349 350 $this.css({ 351 borderTopColor: term_color 352 }); 353 354 $tabs.hover( 355 function () { 356 $(this).css({ 357 color: $(this).data('term-color') 358 }); 359 }, 360 function () { 361 if (!$(this).hasClass('active')) { 362 $(this).css({ 363 color: '' 364 }); 365 } 366 } 367 ); 368 369 $tabs.click(function (e) { 370 var $tab = $(this),
371 $ripple_div = $('<div class="ripple" />'), 372 ripple_size = 60, 373 ripple_offset = $tab.offset(), 374 ripple_y = e.pageY - ripple_offset.top, 375 ripple_x = e.pageX - ripple_offset.left; 376 377 if (!$(this).hasClass('active')) { 378 tabbed_post_module_tab_change($tab); 379 380 $ripple_div.css({ 381 top: ripple_y - (ripple_size / 2), 382 left: ripple_x - (ripple_size / 2) 383 }).appendTo($tab); 384 } 385 386 // Implement slider fix, in case the first post has gallery format 387 et_slider_fix(); 388 389 window.setTimeout(function () { 390 $ripple_div.remove(); 391 }, 900); 392 }); 393 394 $arrow.on('click', function (e) { 395 var $this = $(this), 396 $active_tab = $tabs.filter('.active'), 397 active_tab_index = $active_tab.index(), 398 to_tab_index, 399 $to_tab; 400 401 if ($this.hasClass('prev')) { 402 if ((active_tab_index) <= 0) { 403 to_tab_index = tabs_count - 1; 404 } else { 405 to_tab_index = active_tab_index - 1; 406 } 407 } else { 408 if ((active_tab_index + 1) >= tabs_count) { 409 to_tab_index = 0; 410 } else { 411 to_tab_index = active_tab_index + 1; 412 } 413 } 414 415 $to_tab = $tabs.eq(to_tab_index); 416 417 tabbed_post_module_tab_change($to_tab); 418 419 // Implement slider fix, in case the first post has gallery format 420 et_slider_fix(); 421 }); 422 423 }); 424 } /* end if ( $tabbed_post_module.length ) */ 425 426 function et_featured_posts_slider_fix() { 427 $featured_posts_slider_module.each(function () { 428 var $featured_posts_slider = $(this), 429 slider_width = $featured_posts_slider.width(), 430 slider_height = (slider_width / 15.3) * 9; 431 432 $featured_posts_slider.imagesLoaded(function () { 433 $featured_posts_slider.each(function () { 434 var $the_slider = $(this), 435 $the_slide = $the_slider.find('.carousel-item'), 436 $post_content_box = $the_slider.find('.post-content-box'), 437 $nav_arrow = $the_slider.find('.et-pb-slider-arrows a'), 438 is_relative_caption = $post_content_box.css('position') === 'relative' ? true : false, 439 max_caption_height = 0, 440 the_slider_height, 441 nav_arrow_position_top; 442 443 $the_slide.css({ 444 'height': '' 445 }); 446 $nav_arrow.removeAttr('style'); 447 $post_content_box.removeAttr('style'); 448 449 if (is_relative_caption) { 450 $the_slide.each(function () { 451 var post_content_box_height = $(this).find('.post-content-box').height(); 452 if (post_content_box_height > max_caption_height) { 453 max_caption_height = post_content_box_height; 454 } 455 }); 456 457 $post_content_box.css({ 458 'minHeight': max_caption_height, 459 'marginTop': slider_height 460 }); 461 462 the_slider_height = $the_slider.height(); 463 nav_arrow_position_top = ((the_slider_height - max_caption_height) / 2) - 20; 464 $nav_arrow.css({ 465 'top': nav_arrow_position_top, 466 'marginTop': 0 467 }); 468 } else { 469 $the_slide.height(slider_height); 470 } 471 }); 472 }); 473 }); 474 } 475 476 if ($featured_posts_slider_module.length) { 477 $featured_posts_slider_module.each(function () { 478 var slideshow = $(this).data('autoplay'); 479 480 $(this).et_pb_simple_slider({ 481 slide: '.et_pb_slide', // slide class 482 arrows: '.et-pb-slider-arrows', // arrows container class 483 prev_arrow: '.et-pb-arrow-prev', // left arrow class 484 next_arrow: '.et-pb-arrow-next', // right arrow class 485 controls: '.et-pb-controllers a', // control selector 486 carousel_controls: '.et_pb_carousel_item', // carousel control selector 487 control_active_class: 'et-pb-active-control', // active control class name 488 fade_speed: 500, 489 use_arrows: true, 490 use_controls: true, 491 controls_class: 'et-pb-controllers', 492 slideshow: typeof slideshow !== 'undefined', 493 slideshow_speed: $.isNumeric(slideshow) ? slideshow * 1000 : 7000, 494 show_progress_bar: false, 495 tabs_animation: false, 496 use_carousel: false 497 }); 498 }); 499 500 et_featured_posts_slider_fix(); 501 502 window.addEventListener('resize', et_featured_posts_slider_fix); 503 } /* end if ( $featured_posts_slider_module.length ) */ 504 505 function et_posts_carousel_init() { 506 $posts_carousel_module.each(function () { 507 var $the_carousel = $(this); 508 var slideshow = $the_carousel.data('autoplay'); 509 var $carousel_items = $the_carousel.find('.carousel-items'); 510 var carousel_width = $carousel_items.width(); 511 var $carousel_group; 512 var $carousel_item = $carousel_items.find('.carousel-item'); 513 var carousel_item_widths_array = $carousel_item.map(function() { 514 return $(this).width(); 515 }).get(); 516 var carousel_item_width = Math.max.apply(null, carousel_item_widths_array); 517 var carousel_item_thumb_widths_array = $carousel_item.find('.post-thumbnail').map(function() { 518 return $(this).width(); 519 }).get(); 520 var carousel_item_thumb_width = Math.max.apply(null, carousel_item_thumb_widths_array); 521 var carousel_item_thumb_height = (carousel_item_thumb_width / 15) * 9; 522 var carousel_column = Math.round(carousel_width / carousel_item_width); 523 var index = 0; 524 var min_height = 0; 525 var $current_carousel_group = $the_carousel.find('.carousel-group'); 526 var skip_group_height = false;
527 var current_carousel_column; 528 529 // Setup max-height for post thumbnail 530 $carousel_item.find('.post-thumbnail').css({ 531 'maxHeight': carousel_item_thumb_height 532 }); 533 534 // Remove existing column 535 if ($current_carousel_group.length) { 536 current_carousel_column = $carousel_items.find('.carousel-group:first .carousel-item').size(); 537 538 if (current_carousel_column === carousel_column) { 539 fix_carousel_arrow_position(); 540 return; 541 } 542 543 $current_carousel_group.each(function () { 544 $(this).find('.carousel-item').each(function () { 545 $(this).appendTo($carousel_items); 546 }); 547 }).remove(); 548 549 $the_carousel.find('.et-pb-slider-arrows').remove(); 550 } 551 552 // If the column isn't valid, assume its the largest possible columns 553 // Also, skip min height correction since it'll be invalid 554 if (carousel_column > 4 || carousel_column < 1) { 555 carousel_column = 4; 556 skip_group_height = true; 557 } 558 559 // Group items 560 $carousel_items.find('.carousel-item').each(function () { 561 var $the_carousel_item = $(this); 562 563 // Reset index 564 if (carousel_column === index) { 565 index = 0; 566 } 567 568 // Append new group 569 if (index === 0) { 570 $('<div />', { 571 class: 'carousel-group et_pb_slide' 572 }).appendTo($carousel_items); 573 } 574 575 // Append current item to last group 576 $the_carousel_item.appendTo($carousel_items.find('.carousel-group:last')); 577 578 index++; 579 }); 580 581 $carousel_group = $the_carousel.find('.carousel-group'); 582 583 // Calculate group index 584 if (skip_group_height === false) { 585 $carousel_group.each(function () { 586 var $the_carousel_group = $(this), 587 carousel_group_height = $the_carousel_group.height(); 588 589 if (carousel_group_height > min_height) { 590 min_height = carousel_group_height; 591 $carousel_group.css({ 592 'min-height': min_height 593 }); 594 } 595 }); 596 } 597 598 if ($carousel_items.data('et_pb_simple_slider')) { 599 $carousel_items.data('et_pb_simple_slider').et_slider_destroy(); 600 } 601 602 $carousel_items.et_pb_simple_slider({ 603 slide: '.et_pb_slide', // slide class 604 arrows: '.et-pb-slider-arrows', // arrows container class 605 prev_arrow: '.et-pb-arrow-prev', // left arrow class 606 next_arrow: '.et-pb-arrow-next', // right arrow class 607 controls: '.et-pb-controllers a', // control selector 608 carousel_controls: '.et_pb_carousel_item', // carousel control selector 609 control_active_class: 'et-pb-active-control', // active control class name 610 fade_speed: 500, 611 use_arrows: true, 612 use_controls: false, 613 slideshow: typeof slideshow !== 'undefined', 614 slideshow_speed: $.isNumeric(slideshow) ? slideshow * 1000 : 7000, 615 show_progress_bar: false, 616 tabs_animation: false, 617 use_carousel: false 618 }); 619 620 // Remove loading state 621 if ($the_carousel.hasClass('loading')) { 622 $the_carousel.removeClass('loading'); 623 $carousel_item.removeClass('carousel-item-hide-on-load carousel-item-hide-on-load-medium carousel-item-hide-on-load-small'); 624 } 625 626 // Never let carousel-group has empty slot 627 $the_carousel.on('simple_slider_before_move_to', function (trigger, param) { 628 var $carousel = $(this), 629 $next_slide = $(param.next_slide), 630 active_slide_item_count = $carousel.find('.et-pb-active-slide .carousel-item').size(), 631 next_slide_item_count = $next_slide.find('.carousel-item').size(), 632 remaining_item_count = active_slide_item_count - next_slide_item_count; 633 634 if (remaining_item_count > 0) { 635 var is_next = param.direction === 'next', 636 carousel_item_count = $the_carousel.find('.carousel-group').size(), 637 next_slide_index = $next_slide.index() + 1, 638 correction_slide_index, 639 $correction_slide, 640 $correction_slide_item; 641 642 if (is_next) { 643 if ((next_slide_index + 1) > carousel_item_count) { 644 correction_slide_index = 1; 645 } else { 646 correction_slide_index = next_slide_index + 1; 647 } 648 } else { 649 if ((next_slide_index - 1) < 1) { 650 correction_slide_index = carousel_item_count; 651 } else { 652 correction_slide_index = next_slide_index - 1; 653 } 654 } 655 656 $correction_slide = $carousel.find('.carousel-group:nth-child(' + correction_slide_index + ')'); 657 658 $the_carousel.addClass('et-pb-slide-is-transitioning'); 659 660 if (is_next) { 661 $correction_slide_item = $correction_slide.find('.carousel-item:lt(' + (remaining_item_count) + ')'); 662 663 $next_slide.append($correction_slide_item.clone()); 664 } else { 665 $correction_slide_item = $correction_slide.find('.carousel-item:gt(' + (active_slide_item_count - remaining_item_count - 1) + ')'); 666 667 $next_slide.prepend($correction_slide_item.clone()); 668 } 669 670 $the_carousel.one('simple_slider_after_move_to', function () { 671 $correction_slide_item.remove(); 672 $the_carousel.removeClass('et-pb-slide-is-transitioning'); 673 }); 674 } 675 }); 676 677 function fix_carousel_arrow_position() { 678 // Fix arrow position 679 var $updated_carousel_group = $the_carousel.find('.carousel-group'), 680 $updated_carousel_group_thumb = $updated_carousel_group.find('.post-thumbnail'), 681 updated_carousel_group_thumb_height = $updated_carousel_group_thumb.height(), 682 carousel_arrow_constant = parseInt($updated_carousel_group_thumb.css('marginLeft')) === 0 ? 5 : 25, 683 carousel_arrow_top = (updated_carousel_group_thumb_height / 2) + carousel_arrow_constant; 684 685 $the_carousel.find('.et-pb-slider-arrows a').css({ 686 'top': carousel_arrow_top 687 }); 688 } 689 690 $the_carousel.imagesLoaded(function () { 691 fix_carousel_arrow_position(); 692 }); 693 }); 694 } 695 696 if ($posts_carousel_module.length) { 697 et_posts_carousel_init(); 698 699 window.addEventListener('resize', et_posts_carousel_init); 700 } /* end if ( $posts_carousel_module.length ) */ 701 702 function re_init_new_content($new_content) { 703 //init_videos(); temp comment out 704 705 if ($new_content.find('.et-slider').length) { 706 $new_sliders = $new_content.find('.et-slider'); 707 $new_sliders.each(function () { 708 et_slider_setup($(this)); 709 }); 710 et_slider_fix(); 711 } 712 713 if ($new_content.find('.wp-audio-shortcode, .wp-video-shortcode').length) { 714 var settings = {}; 715 716 if (typeof _wpmejsSettings !== 'undefined') { 717 settings.pluginPath = _wpmejsSettings.pluginPath; 718 } 719 720 settings.success = function (mejs) { 721 var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; 722 if ('flash' === mejs.pluginType && autoplay) { 723 mejs.addEventListener('canplay', function () { 724 mejs.play(); 725 }, false); 726 } 727 }; 728 $new_content.find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer(settings); 729 } 730 731 if ($new_content.find('.post-format-map').length) { 732 $new_maps = $new_content.find('.post-format-map'); 733 $new_maps.each(function () { 734 et_simple_marker_map($(this)); 735 }); 736 } 737 738 // Re-apply Salvattore grid to the new content. 739 if ('undefined' !== $new_content.attr('data-columns')) { 740 console.log('creating grid'); 741 salvattore.registerGrid($new_content[0]); 742 salvattore.recreateColumns($new_content[0]); 743 } 744 745 } 746 747 function et_calclate_admin_bar_height() { 748 var admin_bar = $('#wpadminbar').length, 749 admin_bar_height = 0, 750 admin_bar_position; 751 752 if (admin_bar) { 753 admin_bar_position = $('#wpadminbar').length ? $('#wpadminbar').css('position') : ''; 754 admin_bar_height = $('#wpadminbar').length ? $('#wpadminbar').height() : 0; 755 if ('fixed' !== admin_bar_position) { 756 admin_bar_height = 0; 757 } 758 } 759 760 return admin_bar_height; 761 } 762 763 function et_slider_fix() { 764 $et_slider.each(function () { 765 var $slider = $(this); 766 767 $slider.each(function () { 768 var $the_slider = $(this), 769 $the_slide = $the_slider.find('.carousel-item'), 770 slide_max_height = 0; 771 772 // Remove transition class to prevent unwanted transition when element reappearing 773 $the_slider.removeClass('et_slide_transition_to_previous et_slide_transition_to_next'); 774 775 $the_slider.imagesLoaded(function () { 776 $the_slider.removeAttr('style'); 777 778 $the_slide.each(function () { 779 var slide_height = $(this).height(); 780 781 if (slide_max_height === 0 || slide_max_height > slide_height) { 782 slide_max_height = slide_height; 783 } 784 }); 785 786 $the_slider.css({ 787 'maxHeight': slide_max_height 788 }); 789 }); 790 }); 791 }); 792 } 793 794} 795 796jQuery(document).ready(function() { 797 agsdcm_extra(); 798}); /* end $(document).ready */ 799 800 801 802 803 804 805 806// Code after this line is original by Aspen Grove Studios 807 808// Following code is copied from WP and Divi Icons Pro by Aspen Grove Studios, modified 809jQuery(document).ready(function($) { 810 var fbBody = $('body.et-fb'); 811 if (fbBody.length) { 812 var MO = window.MutationObserver ? window.MutationObserver : window.WebkitMutationObserver; 813 if (MO) { 814 (new MO(function(events) { 815 $.each(events, function(i, event) { 816 if (event.target) { 817 var $element = $(event.type === 'characterData' ? event.target.parentElement : event.target); 818 if (event.addedNodes && event.addedNodes.length) { 819 $(event.addedNodes).find('.ags-divi-extras-module').addBack('.ags-divi-extras-module').each(function() { 820 agsdcm_extra($(this)); 821 }); 822 } 823 } 824 }); 825 })).observe(fbBody[0], {childList: true, subtree: true}); 826 } 827 } 828}); 829// End code copied from WP and Divi Icons Pro
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.