1//Place your JavaScript of jQuery snippets here. Remember to remove the <script> tags 2 3 4 (function ($) { 5 var pa_equalize_button_height = "true"; 6 7 if (pa_equalize_button_height == "false") { 8 function pa_equalize_blog_post_height(blog) { 9 var articles = blog.find('article'); 10 var heights = []; 11 12 articles.each(function () { 13 var height = 0; 14 height += ($(this).find('.et_pb_image_container, .et_main_video_container').length != 0) ? $(this).find('.et_pb_image_container, .et_main_video_container').outerHeight(true) : 0; 15 height += $(this).find('.entry-title').outerHeight(true); 16 height += ($(this).find('.post-meta').length != 0) ? $(this).find('.post-meta').outerHeight(true) : 0; 17 height += ($(this).find('.post-content').length != 0) ? $(this).find('.post-content').outerHeight(true) : 0; 18 19 heights.push(height); 20 }); 21 22 var max_height = Math.max.apply(Math, heights); 23 24 articles.each(function () { 25 $(this).height(max_height); 26 }); 27 } 28 } else { 29 function pa_equalize_blog_post_height(blog) { 30 var articles = blog.find('article'); 31 var heights = []; 32 var btnheights = []; 33 34 articles.each(function () { 35 var height = 0; 36 var btnheight = 0; 37 var basebtnmargin = 20; 38 39 height += ($(this).find('.et_pb_image_container, .et_main_video_container').length != 0) ? $(this).find('.et_pb_image_container, .et_main_video_container').outerHeight(true) : 0; 40 height += $(this).find('.entry-title').outerHeight(true); 41 height += $(this).find('.post-meta').outerHeight(true); 42 height += $(this).find('.post-content').outerHeight(true); 43 44 btnheight += ($(this).find('.et_pb_image_container, .et_main_video_container').length != 0) ? $(this).find('.et_pb_image_container, .et_main_video_container').outerHeight(true) : 0; 45 btnheight += $(this).find('.entry-title').outerHeight(true); 46 btnheight += $(this).find('.post-meta').outerHeight(true); 47 btnheight += $(this).find(".post-content p").outerHeight(true); 48 btnheight += basebtnmargin; 49 50 heights.push(height); 51 btnheights.push(btnheight); 52 53 }); 54 55 var max_height = Math.max.apply(Math, heights); 56 var max_btn_height = Math.max.apply(Math, btnheights); 57 58 articles.each(function () { 59 $(this).height(max_height); 60 61 var eachheight = 0; 62 var eachbasebtnmargin = 20; 63 eachheight += ($(this).find('.et_pb_image_container, .et_main_video_container').length != 0) ? $(this).find('.et_pb_image_container, .et_main_video_container').outerHeight(true) : 0; 64 eachheight += $(this).find('.entry-title').outerHeight(true); 65 eachheight += $(this).find('.post-meta').outerHeight(true); 66 eachheight += $(this).find(".post-content p").outerHeight(true); 67 eachheight += eachbasebtnmargin; 68 69 var requiredbtnmargin = (max_btn_height - eachheight) + eachbasebtnmargin; 70 $(this).find(".more-link").css("margin-top", requiredbtnmargin + "px"); 71 }); 72 } 73 } 74 75 $(document).ready(function () { 76 $(window).resize(function () { 77 if ($(this).width() >= 768) { 78 79 $(".pa-blog-equal-height article").each(function () { 80 $(this).removeClass("pa-auto-height"); 81 $(this).find(".more-link").removeClass("pa-auto-margin"); 82 }) 83 $('.pa-blog-equal-height').each(function () { 84 pa_equalize_blog_post_height($(this)); 85 }); 86 87 $('.pa-blog-equal-height').each(function () { 88 var pa_blog = $(this); 89 90 pa_equalize_blog_post_height(pa_blog); 91 92 var observer = new MutationObserver(function (mutations) { 93 pa_equalize_blog_post_height(pa_blog); 94 }); 95 96 var config = { 97 subtree: true, 98 childList: true 99 }; 100 101 observer.observe(pa_blog[0], config); 102 }); 103 104 $(document).ajaxComplete(function () { 105 $('.pa-blog-equal-height').imagesLoaded().then(function () { 106 $('.pa-blog-equal-height').each(function () { 107 pa_equalize_blog_post_height($(this)); 108 }); 109 }); 110 }); 111 112 $.fn.imagesLoaded = function () { 113 var $imgs = this.find('img[src!=""]'); 114 var dfds = []; 115 116 if (!$imgs.length) { 117 return $.Deferred().resolve().promise(); 118 } 119 120 $imgs.each(function () { 121 var dfd = $.Deferred(); 122 dfds.push(dfd); 123 var img = new Image(); 124 125 img.onload = function () { 126 dfd.resolve(); 127 }; 128 129 img.onerror = function () { 130 dfd.resolve(); 131 }; 132 133 img.src = this.src; 134 }); 135 136 return $.when.apply($, dfds); 137 } 138 } else { 139 $(".pa-blog-equal-height article").each(function () { 140 $(this).addClass("pa-auto-height"); 141 $(this).find(".more-link").addClass("pa-auto-margin"); 142 }) 143 } 144 }); 145 }); 146 })(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.