1//For load more functionality 2jQuery(document).ready(function () { 3 /* Accordion Jquery For Blog */ 4 5 jQuery('.blog_template.accordion.accordion_wrapper').accordion({ 6 collapsible: true, 7 active: 0, 8 heightStyle: "content", 9 classes: { 10 "ui-accordion": "highlight" 11 }, 12 header: "h3", 13 icons: { "header": jQuery(this).find(".accordion-icon-header").attr('data-accordion-header'), "activeHeader": jQuery(this).find(".accordion-icon-header").attr('data-accordion-active-header') } 14 }); 15 16 /*Start Same Height Jquery */ 17 if (jQuery( '.boxy' ).hasClass( 'same_height_all' )) { 18 var sameheight = 0; 19 jQuery('.post_hentry').each(function() { 20 if(sameheight < jQuery(this).outerHeight()){ 21 sameheight = jQuery(this).outerHeight(); 22 }; 23 }); 24 jQuery('.post_hentry').outerHeight(sameheight); 25 } 26 if (jQuery( '.chapter' ).hasClass( 'same_height_all' )) { 27 var sameheight = 0; 28 jQuery('.chapter-post-container').each(function() { 29 if(sameheight < jQuery(this).outerHeight()){ 30 sameheight = jQuery(this).outerHeight(); 31 }; 32 }); 33 jQuery('.chapter-post-container').outerHeight(sameheight); 34 } 35 if (jQuery( '.famous' ).hasClass( 'same_height_all' )) { 36 var sameheight = 0; 37 jQuery('.post-body-div').each(function() { 38 if(sameheight < jQuery(this).outerHeight()){ 39 sameheight = jQuery(this).outerHeight(); 40 }; 41 }); 42 jQuery('.post-body-div').outerHeight(sameheight); 43 } 44 if (jQuery( '.glamour' ).hasClass( 'same_height_all' )) { 45 var sameheight = 0; 46 jQuery('.glamour-blog').each(function() { 47 if(sameheight < jQuery(this).outerHeight()){ 48 sameheight = jQuery(this).outerHeight(); 49 }; 50 }); 51 jQuery('.glamour-blog').outerHeight(sameheight); 52 } 53 if (jQuery( '.minimal' ).hasClass( 'same_height_all' )) { 54 var sameheight = 0; 55 jQuery('.minimal-post-container').each(function() { 56 if(sameheight < jQuery(this).outerHeight()){ 57 sameheight = jQuery(this).outerHeight(); 58 }; 59 }); 60 jQuery('.minimal-post-container').outerHeight(sameheight); 61 } 62 if (jQuery( '.quci' ).hasClass( 'same_height_all' )) { 63 var sameheight = 0; 64 jQuery('.blog_item').each(function() { 65 if(sameheight < jQuery(this).outerHeight()){ 66 sameheight = jQuery(this).outerHeight(); 67 }; 68 }); 69 jQuery('.blog_item').outerHeight(sameheight); 70 } 71 if (jQuery( '.wise_block' ).hasClass( 'same_height_all' )) { 72 var sameheight = 0; 73 jQuery('.bdp_blog_wraper').each(function() { 74 if(sameheight < jQuery(this).outerHeight()){ 75 sameheight = jQuery(this).outerHeight(); 76 }; 77 }); 78 jQuery('.bdp_blog_wraper').outerHeight(sameheight); 79 } 80 /*End Same Height Jquery */ 81 82 jQuery('#bdp_sort_by').on('change', function () { 83 var key = encodeURI('sortby'); 84 var value = encodeURI(jQuery(this).val()); 85 var current_sort_value = document.location.search.substr(1).split('&'); 86 var i = current_sort_value.length; 87 var x; 88 while (i--) { 89 x = current_sort_value[i].split('='); 90 if (x[0] == key) { 91 x[1] = value; 92 current_sort_value[i] = x.join('='); 93 break; 94 } 95 } 96 if (i < 0) { 97 current_sort_value[current_sort_value.length] = [key, value].join('='); 98 } 99 document.location.search = current_sort_value.join('&'); 100 });
101 if (jQuery('.bdp_filter_layout').length > 0) { 102 var layoutMode = ''; 103 if(jQuery('.bdp-js-masonry').hasClass('masonry')){ 104 layoutMode = 'masonry'; 105 } else if(jQuery('.bdp-row.masonry').hasClass('roctangle')) { 106 layoutMode = 'masonry'; 107 }else{ 108 layoutMode = 'fitRows'; 109 } 110 var filterclass = ''; 111 var filterfindclass = ''; 112 if(jQuery('.bdp-js-masonry').hasClass('masonry')){ 113 filterclass = '.bdp_filter_class .bdp-js-masonry'; 114 filterfindclass = '.bdp-js-masonry'; 115 } else if(jQuery('.blog_template').hasClass('boxy-clean')){ 116 filterfindclass = '.blog_template ul'; 117 filterclass = '.bdp_filter_class .bdp_post_list'; 118 } else if(jQuery('.bdp-row.masonry').hasClass('roctangle')){ 119 filterfindclass = '.bdp-row.masonry'; 120 filterclass = '.bdp-row.masonry'; 121 } else if(jQuery('.brit_co').hasClass('bdp_brit_co')){ 122 filterfindclass = '.bdp_post_list .bdp_brit_co'; 123 filterclass = '.bdp_post_list .bdp_brit_co'; 124 } else { 125 filterclass = '.bdp_filter_class .bdp_post_list'; 126 filterfindclass = '.bdp_post_list'; 127 } 128 if(filterclass != '') { 129 jQuery(filterclass).isotope({ 130 itemSelector: '.bdp_blog_single_post_wrapp', 131 layoutMode: layoutMode, 132 containerStyle: { 133 position: 'relative', 134 overflow: 'visible' 135 }, 136 getSortData: { 137 category: '[data-slug]' 138 }, 139 }); 140 } 141 if(filterfindclass != '') { 142 jQuery('.bdp_filter_post_ul').on('click', 'li', function () { 143 jQuery('.bdp_filter_post_ul li a').removeClass('bdp_post_selected'); 144 jQuery(this).children('a').addClass('bdp_post_selected'); 145 var filterValue = jQuery(this).attr('data-filter'); 146 jQuery(this).closest('.bdp_filter_class').find(filterfindclass).isotope({filter: filterValue}); 147 }); 148 } 149} 150 151 if (jQuery('.chosen-select').length > 0) { 152 var config = { 153 '.chosen-select': {}, 154 '.chosen-select-deselect': {allow_single_deselect: true}, 155 '.chosen-select-no-single': {disable_search_threshold: 10}, 156 '.chosen-select-no-results': {no_results_text: 'Oops, nothing found!'}, 157 '.chosen-select-width': {width: "95%"} 158 } 159 jQuery(".chosen-select").chosen(); 160 } 161
162 var $previous_height = jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-previous').outerHeight(); 163 var $next_height = jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-next').outerHeight(); 164 if ($previous_height > $next_height) { 165 jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-next').css('min-height', $previous_height); 166 jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-previous').css('min-height', $previous_height); 167 } else if ($previous_height < $next_height) { 168 jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-next').css('min-height', $next_height); 169 jQuery('.bdp_single .navigation.post-navigation .nav-links .nav-previous').css('min-height', $next_height); 170 } 171 172 if (jQuery('.bdp-flexslider.flexslider').length > 0) { 173 jQuery('.bdp-flexslider.flexslider').flexslider({ 174 animation: "slide", 175 controlNav: false, 176 prevText: "", 177 nextText: "", 178 rtl: ajax_object.is_rtl 179 }); 180 } 181 182 jQuery('#bdp-filer-change select').on('change', function () { 183 var template = jQuery('#blog_template').val(); 184 185 if (template == 'boxy') { 186 if (jQuery('.bdp-js-masonry.masonry').hasClass('bdp_boxy')) { 187 jQuery('.bdp-js-masonry.masonry').html(''); 188 } else { 189 jQuery('.bdp-js-masonry.masonry').html(''); 190 } 191 } 192 if (template == 'boxy-clean') { 193 jQuery('.boxy-clean ul').html(''); 194 } 195 else if (template == 'invert-grid') { 196 jQuery('.bdp-row').html(''); 197 } else if (template == 'media-grid') { 198 jQuery('.media-grid-wrapper').html(''); 199 } 200 else if (template == 'news') { 201 jQuery('.news-wrapper').remove(); 202 } else if (template == 'brit_co') { 203 jQuery('.brit_co.bdp_brit_co').html(''); 204 } else { 205 var min_height = jQuery('.logbook.flatLine').height(); 206 jQuery('.logbook.flatLine').css('min-height', min_height); 207 jQuery('.logbook.flatLine').append('<div class="bdp_logbook_loader"></div>'); 208 } 209 jQuery('.wl_pagination_box').hide(); 210 jQuery('.bdp-load-more').hide(); 211 var $this = jQuery(this).val(); 212 jQuery.ajax({ 213 url: ajaxurl, 214 type: 'POST', 215 data: 'action=filter_change&' + jQuery('#bdp-filer-change').serialize(), 216 cache: false, 217 success: function (response) { 218 if(response == ''){ 219 response = 'No post found'; 220 } 221 if (template == 'boxy') { 222 if (jQuery('.bdp-js-masonry.masonry').hasClass('bdp_boxy')) { 223 jQuery('.bdp-js-masonry.masonry').append(response); 224 jQuery('.bdp-js-masonry.masonry').imagesLoaded(function () { 225 jQuery('.bdp-js-masonry.masonry').masonry('reloadItems').masonry('layout').masonry(); 226 }); 227 } else { 228 jQuery('.bdp-js-masonry.masonry').append(response); 229 jQuery(".bdp-js-masonry.masonry").append(response).masonry('reload'); 230 } 231 } 232 else if (template == 'boxy-clean') { 233 jQuery('.blog_template.boxy-clean ul').append(response); 234 bdp_get_boxy_clean_height(); 235 } 236 else if (template == 'invert-grid') { 237 jQuery('.bdp-row.invert-grid').html(''); 238 jQuery('.bdp-row.invert-grid').append(response); 239 } 240 else if (template == 'media-grid') { 241 jQuery('.media-grid-wrapper').append(response); 242 } 243 else if (template == 'news') { 244 jQuery('.bdp_wrapper').prepend(response); 245 } else if (template == 'brit_co') { 246 jQuery('.brit_co.bdp_brit_co').append(response); 247 bdp_get_brit_co_height(); 248 249 } else if (template == 'famous') { 250 jQuery('.famous').append(response); 251 bdp_get_famous_height(); 252 253 } else if(template == 'wise_block' ) { 254 jQuery('.wise_block_wrapper').append(response); 255 bdp_get_wise_block_height(); 256 } else { 257 var jsmasonry = jQuery(".logbook.flatLine.flatNav.flatButton"); 258 jsmasonry.html(response); 259 if ( jQuery( ".my_logbook" ).length ) { 260 jQuery(".my_logbook").logbook({ 261 levels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 262 showYears: 10, 263 del: 130, 264 vertical: false, 265 isPostLink: false, 266 isYears: false, 267 triggerWidth: 800,
268 itemMargin: parseInt(jQuery('#blog_itemMargin').val()), 269 customSize: { 270 "sheet": {"itemWidth": jQuery('#blog_itemWidth').val(), "itemHeight": jQuery('#blog_itemHeight').val(), "margin": jQuery('#blog_itemMargin').val()}, 271 "active": {"itemWidth": jQuery('#blog_itemWidth').val(), "itemHeight": jQuery('#blog_itemHeight').val(), "imageHeight": "150"} 272 }, 273 id: 10, 274 easing: jQuery('#blog_easing').val(), 275 enableSwipe: true, 276 startFrom: 'first', 277 enableYears: true, 278 class: { 279 readMore: '.lb-read-more', 280 }, 281 hideLogbook: (jQuery('#blog_hideLogbook').val() == 1) ? true : false, 282 hideArrows: false, 283 closeItemOnTransition: false, 284 autoplay: (jQuery('#blog_autoplay').val() == 1) ? true : false, 285 scrollSpeed: parseInt(jQuery('#blog_scrollSpeed').val()), 286 }); 287 } 288 //For Cool Horizontal Template 289 var maxHeight = Math.max.apply(null, jQuery('.horizontal .post-title').map(function () { 290 return jQuery(this).height(); 291 }).get()); 292 jQuery('.horizontal .post-title').css('min-height', maxHeight + 70); 293 var maxHeight = Math.max.apply(null, jQuery('.horizontal .post-content-area .post_wrapper').map(function () { 294 return jQuery(this).height(); 295 }).get()); 296 jQuery('.horizontal .post-content-area .post_wrapper').css('min-height', Math.round(maxHeight)); 297 298 jQuery('.logbook.flatLine').css('min-height', ''); 299 300 //For Overlay Horizontal Template 301 var logbookMaxHeight = Math.max.apply(null, jQuery('.overlay_horizontal .post_hentry').map(function () { 302 return jQuery(this).height(); 303 }).get()); 304 if (logbookMaxHeight == 0) { 305 logbookMaxHeight = '420'; 306 } 307 jQuery('.logbook .lb-item .post-image img').css('min-height', Math.round(logbookMaxHeight)); 308 jQuery('.logbook .lb-item .post-image').css('min-height', Math.round(logbookMaxHeight)); 309 } 310 if ($this == null) { 311 jQuery('.wl_pagination_box').show(); 312 jQuery('.bdp-load-more').show(); 313 } 314 } 315 }); 316 }); 317 //For Overlay Horizontal Template 318 var logbookMaxHeight = Math.max.apply(null, jQuery('.overlay_horizontal .post_hentry').map(function () { 319 return jQuery(this).height(); 320 }).get()); 321 if (logbookMaxHeight == 0) { 322 logbookMaxHeight = '420'; 323 } 324 jQuery('.logbook .lb-item .post-image img').css('min-height', Math.round(logbookMaxHeight)); 325 jQuery('.logbook .lb-item .post-image').css('min-height', Math.round(logbookMaxHeight)); 326 //For Cool Horizontal Template 327 var maxHeight = Math.max.apply(null, jQuery('.horizontal .post-title').map(function () { 328 return jQuery(this).height(); 329 }).get()); 330 jQuery('.horizontal .post-title').css('min-height', maxHeight + 70); 331 var maxHeight = Math.max.apply(null, jQuery('.horizontal .post-content-area .post_wrapper').map(function () { 332 return jQuery(this).height(); 333 }).get()); 334 jQuery('.horizontal .post-content-area .post_wrapper').css('min-height', Math.round(maxHeight)); 335 //For load more functionality 336 function bdp_load_onscroll_ajax(layout_id) { 337 var layout_id_class = ".layout_id_"+layout_id; 338 var paged = parseInt(jQuery(layout_id_class +' #bdp-load-more-hidden #paged').val()); 339 var $timeline_year = jQuery(layout_id_class +' #bdp-load-more-hidden #timeline_previous_year').val(); 340 paged = paged + 1;
341 var max_num_pages = parseInt(jQuery(layout_id_class +' #bdp-load-more-hidden #max_num_pages').val()); 342 jQuery(layout_id_class +' .bdp-load-more-btn').addClass('loading'); 343 this_year = jQuery('#bdp-load-more-hidden #this_year').val(); 344 jQuery(layout_id_class +' .bdp-load-more-btn').fadeOut(); 345 if (paged <= max_num_pages) { 346 jQuery(layout_id_class +' .loading-image').fadeIn(); 347 jQuery.ajax({ 348 url: ajaxurl, 349 type: 'POST', 350 data: 'action=get_load_onscroll_blog&' + jQuery(layout_id_class +' #bdp-load-more-hidden').serialize(), 351 cache: false, 352 success: function (response) { 353 var jsmasonry = jQuery(layout_id_class +" .bdp-load-onscroll-pre").find("div"); 354 jQuery(window).on('scroll', bdp_animate_elems); 355 // loop through each item to check when it animates 356 357 if (jsmasonry.hasClass('bdp-js-masonry')) { 358 if (jQuery(layout_id_class + ' .bdp-js-masonry.masonry').hasClass('bdp_glossary') || jQuery(layout_id_class + ' .bdp-js-masonry.masonry').hasClass('bdp_boxy')) { 359 jQuery(layout_id_class +' .bdp-js-masonry.masonry').append(response); 360 jQuery(layout_id_class +' .bdp-js-masonry.masonry').imagesLoaded(function () { 361 jQuery(layout_id_class +' .bdp-js-masonry.masonry').masonry('reloadItems').masonry('layout').masonry(); 362 }); 363 } else { 364 jQuery(layout_id_class +' .bdp-js-masonry.masonry').append(response); 365 jQuery(layout_id_class + " .bdp-js-masonry.masonry").append(response).masonry('reload'); 366 } 367 } else if (jsmasonry.hasClass('timeline_bg_wrap')) { 368 jQuery(layout_id_class + ' div.timeline_back').append(response); 369 var only_year = jQuery(layout_id_class + ' div.timeline_back').find('.timeline_year .only_year'); 370 jQuery(only_year).each(function () { 371 $timeline_year = jQuery(this).text(); 372 }); 373 jQuery(layout_id_class +' #bdp-load-more-hidden #timeline_previous_year').val(jQuery.trim($timeline_year)); 374 } else if (jsmasonry.hasClass('bdp-grid-row')) { 375 jQuery(layout_id_class + ' div.bdp-grid-row').append(response); 376 bdp_explore_content_center() 377 } 378 else if (jsmasonry.hasClass('story')) { 379 jQuery(layout_id_class + ' .story_wrapper').append(response); 380 var $get_year = this_year; 381 jQuery(response).find('.year-number').each(function () { 382 if (jQuery(this).html() != '') { 383 $get_year = jQuery(this).html(); 384 } 385 }); 386 jQuery(layout_id_class + ' #bdp-load-more-hidden #this_year').val(jQuery.trim($get_year)); 387 } else if (jsmasonry.hasClass('boxy-clean')) { 388 jQuery(layout_id_class + ' .blog_template.boxy-clean > ul').append(response); 389 bdp_get_boxy_clean_height(); 390 } else if (jsmasonry.hasClass('brit_co')) { 391 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre div.brit_co.bdp_brit_co').append(response); 392 bdp_get_brit_co_height(); 393 } else if (jsmasonry.hasClass('famous')) { 394 jQuery(layout_id_class + ' .famous').append(response); 395 bdp_get_famous_height(); 396 } else if(jsmasonry.hasClass( 'wise_block_wrapper' )) { 397 jQuery(layout_id_class + ' .wise_block_wrapper').append(response); 398 bdp_get_wise_block_height(); 399 } else if (jsmasonry.hasClass('easy-timeline-wrapper')) { 400 jQuery(layout_id_class + ' .easy-timeline-wrapper .easy-timeline').append(response); 401 easy_timeline_effects(); 402 } else if (jsmasonry.hasClass('my_diary_wrapper')) { 403 jQuery(layout_id_class + ' .bdp-load-onscroll-pre .my_diary_wrapper').append(response); 404 } else if (jsmasonry.hasClass('elina_wrapper')) { 405 jQuery(layout_id_class + ' .bdp-load-onscroll-pre .elina_wrapper').append(response); 406 social_share_div(); 407 } else if (jsmasonry.hasClass('masonry_timeline_wrapper')) { 408 jQuery(layout_id_class + ' .bdp-load-onscroll-pre .masonry_timeline_wrapper').append(response); 409 masonry_timeline_fun(); 410 } else if (jsmasonry.hasClass('invert-grid')) { 411 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre div.bdp-row').append(response); 412 } else if (jsmasonry.hasClass('brite-wrapp')) { 413 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .brite-wrapp').append(response); 414 } else if (jsmasonry.hasClass('media-grid')) { 415 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .media-grid-wrapper').append(response); 416 } else if (jsmasonry.hasClass('chapter')) { 417 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row').append(response); 418 } else if (jsmasonry.hasClass('roctangle')) { 419 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row').append(response).masonry('reloadItems').masonry('layout').masonry(); 420 }else if (jsmasonry.hasClass('advice')) { 421 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row').append(response); 422 } else if(jsmasonry.hasClass('fairy')){ 423 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre').append(response); 424 fairy_template_height(); 425 } else if(jsmasonry.hasClass('famous')) { 426 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row').append(response); 427 } else if (jsmasonry.hasClass('steps-wrapper')) { 428 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre div.steps-wrapper .steps').append(response); 429 steps_effects(); 430 } else if (jsmasonry.hasClass('glamour')) { 431 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row').append(response); 432 glamour_template_height(); 433 } else if (jsmasonry.hasClass('minimal')) { 434 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre .bdp-row ').append(response); 435 } else if (jsmasonry.hasClass('clicky')) { 436 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre').append(response); 437 clicky_template_height(); 438 } else if (jsmasonry.hasClass('soft_block_wrapper')) { 439 jQuery(layout_id_class + ' .blog_template.soft_block_wrapper').append(response); 440 } else if (jsmasonry.hasClass('neaty_block_blog_wrapp')) { 441 jQuery(layout_id_class + ' .neaty_block_blog_wrapp').append(response); 442 } else if (jsmasonry.hasClass('schedule_wrapper')) { 443 jQuery(layout_id_class + ' .schedule_wrapper').append(response); 444 } else if (jsmasonry.hasClass('foodbox-blog-wrapp')) { 445 jQuery(layout_id_class + ' .foodbox-blog-wrapp').append(response); 446 } else if (jsmasonry.hasClass('blog_accordion_section')) { 447 jQuery(layout_id_class + ' .blog_accordion_section').after(response); 448 jQuery('.blog_template.accordion.accordion_wrapper').accordion({ 449 collapsible: true, 450 active: 0, 451 heightStyle: "content", 452 classes: { 453 "ui-accordion": "highlight" 454 }, 455 header: "h3", 456 icons: { "header": jQuery(this).find(".accordion-icon-header").attr('data-accordion-header'), "activeHeader": jQuery(this).find(".accordion-icon-header").attr('data-accordion-active-header') } 457 }); 458 } 459 else { 460 jQuery(layout_id_class + ' div.bdp-load-onscroll-pre').append(response); 461 } 462 jQuery(layout_id_class + ' .bdp-load-more-btn').removeClass('loading'); 463 jQuery(layout_id_class + ' .loading-image').fadeOut(); 464 jQuery(layout_id_class + ' .bdp-load-more-btn').fadeIn(); 465 jQuery(layout_id_class + ' div.bdp-load-onscroll').show(); 466 jQuery(layout_id_class + ' #bdp-load-more-hidden #paged').val(paged); 467 jQuery(layout_id_class + ' .edd-no-js').hide(); 468 if (paged == max_num_pages) 469 jQuery(layout_id_class + ' .bdp-load-more-btn').fadeOut(); 470 if (jQuery(layout_id_class + ' .bdp-flexslider.flexslider').length > 0) { 471 jQuery(layout_id_class + ' .bdp-flexslider.flexslider').flexslider({ 472 animation: "slide", 473 controlNav: false, 474 prevText: "", 475 nextText: "", 476 rtl: ajax_object.is_rtl 477 }); 478 } 479 } 480 }); 481 } 482 return false; 483 } 484 //For load more functionality 485 jQuery(".bdp-load-more-btn").on('click',function () { 486 var layout_id = jQuery(this).closest('.bdp_wrapper').find('#blog_shortcode_id').val(); 487 var $data = jQuery(this).closest('.bdp_wrapper').find('form#bdp-load-more-hidden').seri
487alize(); 488 bdp_load_more_ajax($data, layout_id); 489 }); 490 jQuery(".bdp-load-onscroll-btn").on('click',function () { 491 var layout_id = jQuery(this).closest('.bdp_wrapper').find('#blog_shortcode_id').val(); 492 var $select_value = jQuery('#bdp-filer-change select').val(); 493 if ($select_value == null) { 494 bdp_load_onscroll_ajax(layout_id); 495 } 496 }); 497 var ajax_window = jQuery(window); 498 ajax_window.on("scroll touchstart", function () { 499 if (jQuery('a.bdp-load-onscroll-btn').length >= 1) { 500 var content_offset = jQuery('a.bdp-load-onscroll-btn').offset(); 501 var top = Math.round(content_offset.top - jQuery(window).height()); 502 if (jQuery(window).scrollTop() >= top) { 503 if (jQuery('div.bdp-load-onscroll').is(':visible')) { 504 jQuery('div.bdp-load-onscroll').hide(); 505 jQuery('.bdp-load-onscroll-btn').trigger('click'); 506 } 507 } 508 } 509 }); 510 jQuery(function () { 511 var elems = jQuery('.animateblock'); 512 var winheight = jQuery(window).height(); 513 elems.each(function () { 514 var elm = jQuery(this); 515 var topcoords = elm.offset().top; 516 if (topcoords < winheight) { 517 // animate when top of the window is 3/4 above the element 518 elm.addClass('animated'); 519 elm.removeClass('animateblock'); 520 } 521 }); 522 523 jQuery('.timeline').each(function () { 524 if (jQuery(this).offset().top < winheight) 525 { 526 var width = jQuery(this).attr('data-width'); 527 jQuery(this).animate({ 528 width: width 529 }, 1000); 530 } 531 }); 532 533 jQuery(window).scroll(function () { 534 bdp_animate_elems(); 535 }); 536 537 }); 538 539 jQuery(document).on('click', '.bdp-wrapper-like .bdp-like-button', function (e) { 540 e.stopPropagation(); 541 e.preventDefault(); 542 var post_id = jQuery(this).attr('data-post-id'); 543 var security = jQuery(this).attr('data-nonce'); 544 var allbuttons;
545 allbuttons = jQuery('.bdp-button-' + post_id); 546 var loader = allbuttons.next('#bdp-loader'); 547 if (post_id !== '') { 548 jQuery.ajax({ 549 type: 'POST', 550 url: ajaxurl, 551 data: { 552 action: 'get_bdp_process_posts_like', 553 post_id: post_id, 554 nonce: security 555 }, 556 beforeSend: function () { 557 loader.html('<div class="bdp-like-loader"><i class="fas fa-spinner fa-pulse fa-1x fa-fw"></i></div>'); 558 }, 559 success: function (response) { 560 var icon = response.icon; 561 var count = response.count; 562 allbuttons.html(icon + count); 563 if (response.status === 'unliked') { 564 var like_text = ajax_object.like; 565 allbuttons.prop('title', like_text); 566 allbuttons.removeClass('liked'); 567 } else { 568 var unlike_text = ajax_object.unlike; 569 allbuttons.prop('title', unlike_text); 570 allbuttons.addClass('liked'); 571 } 572 loader.empty(); 573 } 574 }); 575 576 } 577 return false; 578 }); 579 580 jQuery(document).on('click', '.glamour-social-links', function () { 581 jQuery(this).parents('.glamour-blog').find('.glamour-social-cover').addClass('show'); 582 }); 583 jQuery(document).on('click', '.glamour-social-links-closed', function () { 584 jQuery(this).parents('.glamour-social-cover').removeClass('show'); 585 }); 586 587 jQuery(document).on('click', '.fairy .fairy_footer .fairy-post-share', function() { 588 jQuery(this).parents('.fairy_wrap').find('.fairy-social-cover').addClass('show'); 589 jQuery(this).parents('.fairy_wrap').find('.fairy-social-cover').css({'bottom': 0 }); 590 }) 591 jQuery(document).on('click', '.fairy .fairy-social-cover .fairy-social-div-closed', function() { 592 var $fairy_wrap = jQuery(this).closest('.fairy_wrap'); 593 var $minHeight = $fairy_wrap.find('.fairy_footer').outerHeight(); 594 var $socialHeight = $fairy_wrap.find('.fairy-social-cover .social-component').outerHeight(); 595 if($minHeight < $socialHeight) { 596 $minHeight = $socialHeight; 597 } 598 var $minbottom = $minHeight + 25; 599 jQuery(this).parents('.fairy-social-cover').removeClass('show'); 600 jQuery(this).parents('.fairy-social-cover').css({ 'bottom': '-'+ $minbottom +'px' }); 601 }); 602 jQuery(document).on('click', '.minimal-footer span.minimal-social-share-btn', function() { 603 jQuery(this).parents('.minimal-entry').find('.minimal-social-cover').addClass('show'); 604 jQuery(this).parents('.minimal-entry').find('.minimal-social-cover').css({'bottom': '15px' }); 605 }); 606 jQuery(document).on('click', '.minimal-social-cover span.minimal-social-share-btn-close', function() { 607 var $minHeight = jQuery('.minimal .minimal-entry .minimal-social-cover').outerHeight(); 608 $minHeight = $minHeight + 2; 609 jQuery(this).parents('.minimal-entry').find('.minimal-social-cover').removeClass('show'); 610 jQuery(this).parents('.minimal-entry').find('.minimal-social-cover').css({ 'bottom': '-'+ $minHeight +'px' }); 611 }); 612 613 var $bdp_image_height = jQuery('.blog_template.bdp_blog_template .bdp-post-image img').height(); 614 if ($bdp_image_height == 0) { 615 $bdp_image_height = 250 616 } 617 jQuery('.blog_template.bdp_blog_template .bdp-video').each(function() { 618 jQuery(this).find('iframe').attr('height', $bdp_image_height); 619 }); 620 621}); 622 623jQuery(window).resize(function () { 624 bdp_get_boxy_clean_height(); 625 clicky_template_height(); 626 fairy_template_height(); 627 glamour_template_height(); 628 bdp_explore_content_center(); 629 accordion_header_height(); 630}); 631 632jQuery(function () { 633 easy_timeline_effects(); 634 steps_effects(); 635 clicky_template_height(); 636 fairy_template_height(); 637 minimum_template_social(); 638 glamour_template_height(); 639 social_share_div(); 640 masonry_timeline_fun(); 641 accordion_header_height(); 642}); 643 644function accordion_header_height() { 645 jQuery('.accordion_wrapper.accordion-template-4 .ui-accordion-header').each(function () { 646 if(jQuery(window).width() > 991 ) { 647 var accordion_header = jQuery(this).outerHeight() - 15; 648 } 649 if(jQuery(window).width() <= 991 ) { 650 var acw = jQuery(this).outerHeight() ; 651 var accordion_header = acw - 5 ; 652 } 653 var sid = jQuery(this).attr('aria-controls'); 654 jQuery('#'+sid).css("margin-top","-"+accordion_header+"px"); 655 jQuery('#'+sid).css("padding-top",accordion_header+"px"); 656 });
657} 658 659function social_share_div() { 660 661 var maxWidth = Math.max.apply(null, jQuery('.post-media').map(function () { 662 return jQuery(this).width(); 663 }).get()); 664 maxWidth = (maxWidth / 2) + 10; 665 var cusstyle = '<style> .post-content-area:before { border-left-width: ' + Math.round(maxWidth) + 'px; } .post-media:before { border-right-width: ' + Math.round(maxWidth) + 'px; } .post-media:after { border-left-width: ' + Math.round(maxWidth) + 'px; } </style>' 666 jQuery('head').append(cusstyle); 667 668 var previous_post_height = jQuery('.elina .nav-links .previous-post').height(); 669 var next_post_height = jQuery('.elina .nav-links .next-post').height(); 670 if (previous_post_height < next_post_height) { 671 jQuery('.elina .nav-links .previous-post').css('min-height', next_post_height); 672 } else { 673 jQuery('.elina .nav-links .next-post').css('min-height', previous_post_height); 674 } 675 676 jQuery('.elina-footer').find('.social-component').append("<div class='social-share social-close-btn'><a class='close-div'title='close' href='javascript:void(0)'>x</a></div>"); 677 678 jQuery('.post-share-div > a.post-share').on('click',function () { 679 jQuery(this).parents('.elina-footer').find('.social-component').addClass('open-content'); 680 jQuery(this).parents('.elina-footer').find('.social-component > .social-share').addClass('add-eff'); 681 }); 682 683 jQuery('.social-share a.close-div').on('click',function () { 684 jQuery(this).parents('.elina-footer').find('.social-component').removeClass('open-content'); 685 jQuery(this).parents('.elina-footer').find('.social-component > .social-share').removeClass('add-eff'); 686 }); 687 688 jQuery('.elina.bdp_archive').find('.author-avatar-div').append('<div class="fakegb"></div>'); 689} 690 691function masonry_timeline_fun() { 692 jQuery('.masonry-timeline-wrapp .post-footer').find('.social-component').append("<div class='social-share social-close-btn'><a class='close-div'title='close' href='javascript:void(0)'>x</a></div>"); 693 694 jQuery('.masonry-timeline-wrapp .post-footer').each(function () { 695 696 var social_icon_height = jQuery(this).find('.social-component').outerHeight(); 697 var read_more_div_height = jQuery(this).find('.read-more-div').outerHeight(); 698 var metabox_height = jQuery(this).find('.metadatabox').outerHeight(); 699 700 var max_height = Math.max(social_icon_height, metabox_height + read_more_div_height); 701 jQuery(this).css("max-height", max_height + 2); 702 703 }); 704 705 jQuery('.masonry-timeline-wrapp .post-footer a.post-share').on('click',function () { 706 jQuery(this).parents('.post-footer').find('.social-component').addClass('open-content'); 707 jQuery(this).parents('.post-footer').find('.metadatabox').css('opacity', 0); 708 709 var metabox_height = jQuery(this).parents('.post-footer').find('.metadatabox').outerHeight(); 710 var transform_css = 'translateY(-' + (metabox_height - 1) + 'px)'; 711 jQuery(this).parents('.post-footer').find('.social-component').css('transform', transform_css); 712 jQuery(this).parents('.post-footer').find('.social-component').css('opacity', 1); 713 714 }); 715 jQuery('.masonry-timeline-wrapp .post-footer a.close-div').on('click',function () { 716 //jQuery(this).parents('.social-component').removeClass('open-content'); 717 jQuery(this).parents('.post-footer').find('.metadatabox').removeAttr("style"); 718 jQuery(this).parents('.post-footer').find('.social-component').removeAttr("style"); 719 }); 720} 721 722function easy_timeline_effects() { 723 var effect = jQuery('.easy-timeline').attr('data-effect'); 724 jQuery('.easy-timeline li').each(function () { 725 if (jQuery(this).offset().top > jQuery(window).scrollTop() + jQuery(window).height() * 0.75) { 726 jQuery(this).addClass('is-hidden'); 727 } else { 728 jQuery(this).addClass(effect); 729 } 730 }); 731 732 jQuery(window).on('scroll', function () { 733 jQuery('.easy-timeline li').each(function () { 734 if ((jQuery(this).offset().top <= (jQuery(window).scrollTop() + jQuery(window).height() * 0.75
734)) && jQuery(this).hasClass("is-hidden")) { 735 jQuery(this).removeClass("is-hidden").addClass(effect); 736 } 737 }); 738 }); 739} 740 741function steps_effects() { 742 var effect = jQuery('.steps-wrapper .steps').attr('data-effect'); 743 jQuery('.steps-wrapper .steps li').each(function () { 744 if (jQuery(this).offset().top > jQuery(window).scrollTop() + jQuery(window).height() * 0.75) { 745 jQuery(this).addClass('is-hidden'); 746 } else { 747 jQuery(this).addClass(effect); 748 } 749 }); 750 751 jQuery(window).on('scroll', function () { 752 jQuery('.steps-wrapper .steps li').each(function () { 753 if ((jQuery(this).offset().top <= (jQuery(window).scrollTop() + jQuery(window).height() * 0.75)) && jQuery(this).hasClass("is-hidden")) { 754 jQuery(this).removeClass("is-hidden").addClass(effect); 755 } 756 }); 757 }); 758} 759 760function fairy_template_height() { 761 jQuery('.bdp_wrapper .blog_template.fairy').each(function() { 762 var $minHeight = jQuery(this).find('.fairy_footer').outerHeight(); 763 var $socialHeight = jQuery(this).find('.fairy-social-cover .social-component').outerHeight(); 764 if($minHeight < $socialHeight) { 765 $minHeight = $socialHeight; 766 } 767 var $minbottom = $minHeight + 25; 768 jQuery(this).find('.fairy_wrap .fairy-social-cover').css({ 'min-height': $minHeight + 'px','bottom': '-'+ $minbottom +'px' }); 769 770 }); 771 772 jQuery('.bdp_blog_template.fairy').find('.fairy_wrap').removeClass('bdp-fairy-center'); 773 jQuery('.bdp_blog_template.fairy').find('.bdp-post-image').removeClass('bdp-fairy-center'); 774 if(jQuery(window).width() > 899) { 775 setTimeout( function(){ 776 jQuery('.bdp_blog_template.fairy').each(function() { 777 var $imgDivHeight = jQuery(this).find('.bdp-post-image').outerHeight(); 778 var $contentDivHeight = jQuery(this).find('.fairy_wrap').outerHeight(); 779 if($imgDivHeight > $contentDivHeight) { 780 jQuery(this).find('.fairy_wrap').addClass('bdp-fairy-center'); 781 } else if($imgDivHeight < $contentDivHeight) { 782 jQuery(this).find('.bdp-post-image').addClass('bdp-fairy-center'); 783 } 784 }); 785 }, 1000 ); 786 } 787} 788 789function glamour_template_height() { 790 var $minHeight = jQuery('.glamour .glamour-social-cover').outerHeight(); 791 $minHeight = $minHeight + 2; 792 jQuery('.glamour .glamour-social-cover').css({ 'bottom': '-'+ $minHeight +'px'}); 793} 794 795function minimum_template_social() { 796 var $minHeight = jQuery('.minimal .minimal-entry .minimal-social-cover').outerHeight(); 797 $minHeight = $minHeight + 2; 798 jQuery('.minimal .minimal-entry .minimal-social-cover').css({ 'bottom': '-'+ $minHeight +'px' }); 799 800} 801 802function clicky_template_height() { 803 if(jQuery('.bdp_wrapper').hasClass('clicky_cover')) { 804 jQuery('.bdp_wrapper.clicky_cover').imagesLoaded(function () { 805 jQuery('.bdp_blog_template.clicky').each(function() { 806 jQuery(this).find('.clicky-wrap').removeClass('bdp-clicky-center'); 807 jQuery(this).find('.bdp-post-image').removeClass('bdp-clicky-center'); 808 jQuery(this).find('.clicky-wrap').removeAttr('style'); 809 jQuery(this).find('.bdp-post-image').removeAttr('style'); 810 var $imgDivHeight = jQuery(this).find('.bdp-post-image').outerHeight(); 811 var $contentDivHeight = jQuery(this).find('.clicky-wrap').outerHeight(); 812 if($imgDivHeight > $contentDivHeight) { 813 jQuery(this).find('.clicky-wrap').addClass('bdp-clicky-center').css('min-height', $imgDivHeight + 'px'); 814 } else if($imgDivHeight < $contentDivHeight) { 815 jQuery(this).find('.bdp-post-image').addClass('bdp-clicky-center').css('min-height', $contentDivHeight + 'px'); 816 } 817 }); 818 }); 819 820 jQuery('.bdp_archive.clicky .avtar-img').removeAttr('style');
821 jQuery('.bdp_archive.clicky .author_content').removeAttr('style'); 822 var $authorImage = jQuery('.bdp_archive.clicky .avtar-img').outerHeight(); 823 var $authorContent = jQuery('.bdp_archive.clicky .author_content').outerHeight(); 824 825 if($authorImage > $authorContent) { 826 jQuery('.bdp_archive.clicky .author_content').css('min-height', $authorImage + 'px'); 827 } else if($authorImage < $authorContent) { 828 jQuery('.bdp_archive.clicky .avtar-img').css('min-height', $authorContent + 'px'); 829 } 830 } 831 832} 833 834 835/*----------- code to apply same height to all template 4 li ---------------*/ 836function bdp_get_boxy_clean_height() { 837 if(jQuery('.bdp_wrapper').hasClass('boxy-clean_cover')) { 838 var divs = jQuery(".boxy-clean li.blog_wrap").not('.first_post'); 839 if (jQuery(window).width() > 980) { 840 var column = 4; 841 if (divs.hasClass('three_column')) { 842 column = 3; 843 } else if (divs.hasClass('two_column')) { 844 column = 2; 845 } else if (divs.hasClass('one_column')) { 846 column = 1; 847 } 848 } else if (jQuery(window).width() <= 980 && jQuery(window).width() > 720) { 849 var column = 4; 850 if (divs.hasClass('three_column_ipad')) { 851 column = 3; 852 } else if (divs.hasClass('two_column_ipad')) { 853 column = 2; 854 } else if (divs.hasClass('one_column_ipad')) { 855 column = 1; 856 } 857 } else if (jQuery(window).width() <= 720 && jQuery(window).width() > 480) { 858 var column = 4; 859 if (divs.hasClass('three_column_tablet')) { 860 column = 3; 861 } else if (divs.hasClass('two_column_tablet')) { 862 column = 2; 863 } else if (divs.hasClass('one_column_tablet')) { 864 column = 1; 865 } 866 } else if (jQuery(window).width() <= 480) { 867 var column = 4; 868 if (divs.hasClass('one_column_mobile')) { 869 column = 3; 870 } else if (divs.hasClass('two_column_mobile')) { 871 column = 2; 872 } else if (divs.hasClass('three_column_mobile')) { 873 column = 1; 874 } 875 } 876 jQuery(".boxy-clean li.blog_wrap").removeAttr('style'); 877 878 jQuery('.boxy-clean li.blog_wrap').imagesLoaded(function () { 879 for (var i = 0; i < divs.length; i += column) { 880 var heights = jQuery(".boxy-clean li.blog_wrap").not('.first_post').slice(i, i + column).map(function () { 881 return jQuery(this).height(); 882 }).get(); 883 var maxHeight = Math.max.apply(null, heights); 884 if (screen.width > 640) { 885 jQuery(".boxy-clean li.blog_wrap").not('.first_post').slice(i, i + column).css('height', maxHeight + 50); 886 } 887 } 888 }); 889 890 } 891} 892 893function bdp_animate_elems() { 894 var elems = jQuery('.animateblock'); 895 var winheight = jQuery(window).height(); 896 var wintop = jQuery(window).scrollTop(); // calculate distance from top of window 897 898 // loop through each item to check when it animates 899 elems.each(function () { 900 var elm = jQuery(this); 901 if (elm.hasClass('animated')) { 902 return true; 903 } // if already animated skip to the next item 904 var topcoords = elm.offset().top; // element's distance from top of page in pixels 905 if (wintop > (topcoords - (winheight * 0.6))) { 906 // animate when top of the window is 3/4 above the element 907 elm.addClass('animated'); 908 elm.removeClass('animateblock'); 909 } 910 }); 911 jQuery('.timeline').each(function () { 912 if (wintop > jQuery(this).offset().top - winheight) 913 { 914 var width = jQuery(this).attr('data-width'); 915 jQuery(this).animate({ 916 width: width 917 }, 500); 918 } 919 });
920} 921 922//For load more functionality 923function bdp_load_more_ajax($data, layout_id) { 924 var layout_id_class = ".layout_id_"+layout_id; 925 var paged = parseInt(jQuery(layout_id_class + ' #bdp-load-more-hidden #paged').val()); 926 var this_year = jQuery(layout_id_class + ' #bdp-load-more-hidden #this_year').val(); 927 var $timeline_year = jQuery(layout_id_class + ' #bdp-load-more-hidden #timeline_previous_year').val(); 928 paged = paged + 1; 929 var max_num_pages = parseInt(jQuery(layout_id_class + ' #bdp-load-more-hidden #max_num_pages').val()); 930 jQuery(layout_id_class + ' .bdp-load-more-btn').addClass('loading'); 931 jQuery(layout_id_class + ' .bdp-load-more-btn').fadeOut(); 932 933 if (paged <= max_num_pages) { 934 jQuery(layout_id_class + ' .loading-image').fadeIn(); 935 jQuery.ajax({ 936 url: ajaxurl, 937 type: 'POST', 938 data: 'action=get_loadmore_blog&' + $data, 939 cache: false, 940 success: function (response) { 941 var jsmasonry = jQuery(layout_id_class + " .bdp-load-more-pre").find("div"); 942 jQuery(window).on('scroll', bdp_animate_elems); 943 // loop through each item to check when it animates 944 945 if (jsmasonry.hasClass('bdp-js-masonry')) { 946 if (jQuery(layout_id_class + ' .bdp-js-masonry.masonry').hasClass('bdp_glossary') || jQuery(layout_id_class + ' .bdp-js-masonry.masonry').hasClass('bdp_boxy')) { 947 jQuery(layout_id_class + ' .bdp-js-masonry.masonry').append(response); 948 jQuery(layout_id_class + ' .bdp-js-masonry.masonry').imagesLoaded(function () { 949 jQuery(layout_id_class + ' .bdp-js-masonry.masonry').masonry('reloadItems').masonry('layout').masonry(); 950 }); 951 } else { 952 jQuery(layout_id_class + ' .bdp-js-masonry.masonry').append(response); 953 jQuery(layout_id_class + " .bdp-js-masonry.masonry").append(response).masonry('reload'); 954 } 955 } else if (jsmasonry.hasClass('timeline_bg_wrap')) { 956 jQuery(layout_id_class + ' div.timeline_back').append(response); 957 var only_year = jQuery(layout_id_class + ' div.timeline_back').find('.timeline_year .only_year'); 958 jQuery(only_year).each(function () { 959 $timeline_year = jQuery(this).text(); 960 }); 961 jQuery(layout_id_class + ' #bdp-load-more-hidden #timeline_previous_year').val(jQuery.trim($timeline_year)); 962 } 963 else if (jsmasonry.hasClass('story')) { 964 jQuery(layout_id_class + ' .story_wrapper').append(response); 965 var $get_year = this_year; 966 jQuery(response).find('.year-number').each(function () { 967 if (jQuery(this).html() != '') { 968 $get_year = jQuery(this).html(); 969 } 970 }); 971 jQuery(layout_id_class + ' #bdp-load-more-hidden #this_year').val(jQuery.trim($get_year)); 972 } else if (jsmasonry.hasClass('bdp-grid-row')) { 973 jQuery(layout_id_class + ' div.bdp-grid-row').append(response); 974 bdp_explore_content_center() 975 } else if (jsmasonry.hasClass('boxy-clean')) { 976 jQuery(layout_id_class + ' .blog_template.boxy-clean > ul').append(response); 977 bdp_get_boxy_clean_height(); 978 } else if (jsmasonry.hasClass('brit_co')) { 979 jQuery(layout_id_class + ' div.bdp-row .bdp_brit_co').append(response); 980 bdp_get_brit_co_height(); 981 } else if (jsmasonry.hasClass('famous')) { 982 jQuery(layout_id_class + ' .famous').append(response); 983 bdp_get_famous_height(); 984 } else if(jsmasonry.hasClass('wise_block_wrapper')) { 985 jQuery(layout_id_class + ' .wise_block_wrapper').append(response); 986 bdp_get_wise_block_height(); 987 } else if (jsmasonry.hasClass('easy-timeline-wrapper')) { 988 jQuery(layout_id_class + ' div.bdp-load-more-pre div.easy-timeline-wrapper .easy-timeline').append(response); 989 easy_timeline_effects(); 990 } else if (jsmasonry.hasClass('my_diary_wrapper')) { 991 jQuery(layout_id_class + ' .bdp-load-more-pre .my_diary_wrapper').append(response); 992 } else if (jsmasonry.hasClass('elina_wrapper')) { 993 jQuery(layout_id_class + ' .bdp-load-more-pre .elina_wrapper').append(response); 994 social_share_div(); 995 } else if (jsmasonry.hasClass('masonry_timeline_wrapper')) { 996 jQuery(layout_id_class + ' .bdp-load-more-pre .masonry_timeline_wrapper').append(response); 997 masonry_timeline_fun(); 998 } else if (jsmasonry.hasClass('invert-grid')) { 999 jQuery(layout_id_class + ' div.bdp-load-more-pre div.bdp-row').append(response); 1000 } else if (jsmasonry.hasClass('brite-wrapp')) { 1001 jQuery(layout_id_class + ' .bdp-load-more-pre .brite-wrapp').append(response); 1002 } else if (jsmasonry.hasClass('media-grid')) { 1003 jQuery(layout_id_class + ' .bdp-load-more-pre .media-grid-wrapper').append(response); 1004 } else if (jsmasonry.hasClass('chapter') || jsmasonry.hasClass('glamour')) { 1005 glamour_template_height(); 1006 jQuery(layout_id_class + ' .bdp-load-more-pre .bdp-row').append(response); 1007 } else if (jsmasonry.hasClass('roctangle')) { 1008 jQuery(layout_id_class + ' .bdp-load-more-pre .bdp-row').append(response).masonry('reloadItems').masonry('layout').masonry(); 1009 } else if (jsmasonry.hasClass('advice')) { 1010 jQuery(layout_id_class + ' .bdp-load-more-pre .bdp-row').append(response); 1011 } else if(jsmasonry.hasClass('fairy')){ 1012 jQuery(layout_id_class + ' div.bdp-load-more-pre').append(response); 1013 fairy_template_height(); 1014 } else if(jsmasonry.hasClass('famous')) { 1015 jQuery(layout_id_class + ' .bdp-load-more-pre .famous').append(response); 1016 } else if (jsmasonry.hasClass('steps-wrapper')) { 1017 jQuery(layout_id_class + ' div.bdp-load-more-pre div.steps-wrapper .steps').append(response); 1018 steps_effects(); 1019 } else if (jsmasonry.hasClass('glamour')) { 1020 jQuery(layout_id_class + ' div.bdp-load-more-pre .bdp-row').append(response); 1021 glamour_template_height(); 1022 } else if (jsmasonry.hasClass('minimal')) { 1023 jQuery(layout_id_class + ' div.bdp-load-more-pre .bdp-row').append(response); 1024 } else if (jsmasonry.hasClass('clicky')) { 1025 jQuery(layout_id_class + ' div.bdp-load-more-pre').append(response); 1026 clicky_template_height(); 1027 } else if (jsmasonry.hasClass('soft_block_wrapper')) { 1028 jQuery(layout_id_class + ' .blog_template.soft_block_wrapper').append(response); 1029 } else if (jsmasonry.hasClass('neaty_block_blog_wrapp')) { 1030 jQuery(layout_id_class + ' .neaty_block_blog_wrapp').append(response); 1031 } else if (jsmasonry.hasClass('schedule_wrapper')) { 1032 jQuery(layout_id_class + ' .schedule_wrapper').append(response); 1033 } else if (jsmasonry.hasClass('foodbox-blog-wrapp')) { 1034 jQuery(layout_id_class + ' .foodbox-blog-wrapp').append(response); 1035 } else if (jsmasonry.hasClass('blog_accordion_section')) { 1036 jQuery(layout_id_class + ' .blog_accordion_section').after(response); 1037 jQuery('.blog_template.accordion.accordion_wrapper').accordion({ 1038 collapsible: true, 1039 active: 0, 1040 heightStyle: "content", 1041 classes: { 1042 "ui-accordion": "highlight" 1043 }, 1044 header: "h3", 1045 icons: { "header": jQuery(this).find(".accordion-icon-header").attr('data-accordion-header'), "activeHeader": jQuery(this).find(".accordion-icon-header").attr('data-accordion-active-header') } 1046 }); 1047 } 1048 else { 1049 jQuery(layout_id_class + ' div.bdp-load-more-pre').append(response); 1050 } 1051 1052 jQuery(layout_id_class + ' .bdp-load-more-btn').removeClass('loading'); 1053 jQuery(layout_id_class + ' .loading-image').fadeOut(); 1054 jQuery(layout_id_class + ' .bdp-load-more-btn').fadeIn(); 1055 jQuery(layout_id_class + ' #bdp-load-more-hidden #paged').val(paged); 1056 jQuery(layout_id_class + ' .edd-no-js').hide(); 1057 if (paged == max_num_pages) 1058 jQuery(layout_id_class + ' .bdp-load-more-btn').fadeOut();
1059 jQuery('.bdp-flexslider.flexslider').flexslider({ 1060 animation: "slide", 1061 controlNav: false, 1062 prevText: "", 1063 nextText: "", 1064 rtl: ajax_object.is_rtl 1065 }); 1066 } 1067 }); 1068 } 1069 return false; 1070} 1071jQuery(window).on('load',function () { 1072 if (jQuery('.masonry').length > 0) { 1073 setTimeout(function () { 1074 jQuery('.masonry').imagesLoaded(function () { 1075 jQuery('.masonry').masonry({ 1076 columnWidth: 0, 1077 itemSelector: '.blog_masonry_item', 1078 isResizable: true 1079 }); 1080 }); 1081 }, 500); 1082 } 1083 bdp_get_boxy_clean_height(); 1084 bdp_get_brit_co_height(); 1085 bdp_explore_content_center(); 1086 bdp_get_famous_height(); 1087 bdp_get_wise_block_height(); 1088 bdp_get_tabbed_height(); 1089 if (jQuery('.bdp_filter_layout').length > 0) { 1090 var layoutMode = ''; 1091 if(jQuery('.bdp-js-masonry').hasClass('masonry')){ 1092 layoutMode = 'masonry'; 1093 } else if(jQuery('.bdp-row.masonry').hasClass('roctangle')) { 1094 layoutMode = 'masonry'; 1095 }else{ 1096 layoutMode = 'fitRows'; 1097 } 1098 var filterclass = ''; 1099 var filterfindclass = ''; 1100 if(jQuery('.bdp-js-masonry').hasClass('masonry')){ 1101 filterclass = '.bdp_filter_class .bdp-js-masonry'; 1102 filterfindclass = '.bdp-js-masonry'; 1103 } else if(jQuery('.blog_template').hasClass('boxy-clean')){ 1104 filterfindclass = '.blog_template ul'; 1105 filterclass = 'blog_template ul'; 1106 } else if(jQuery('.bdp-row.masonry').hasClass('roctangle')){ 1107 filterfindclass = '.bdp-row.masonry'; 1108 filterclass = '.bdp-row.masonry'; 1109 } else if(jQuery('.brit_co').hasClass('bdp_brit_co')){ 1110 filterfindclass = '.bdp_post_list .bdp_brit_co'; 1111 filterclass = '.bdp_post_list .bdp_brit_co'; 1112 } else { 1113 filterclass = '.bdp_filter_class .bdp_post_list'; 1114 filterfindclass = '.bdp_post_list'; 1115 } 1116 jQuery(filterclass).isotope({ 1117 itemSelector: '.bdp_blog_single_post_wrapp', 1118 layoutMode: layoutMode, 1119 containerStyle: { 1120 position: 'relative', 1121 overflow: 'visible' 1122 }, 1123 getSortData: { 1124 category: '[data-slug]' 1125 }, 1126 }); 1127 jQuery('.bdp_filter_post_ul').on('click', 'li', function () { 1128 jQuery('.bdp_filter_post_ul li a').removeClass('bdp_post_selected'); 1129 jQuery(this).children('a').addClass('bdp_post_selected'); 1130 var filterValue = jQuery(this).attr('data-filter'); 1131 jQuery(this).closest('.bdp_filter_class').find(filterfindclass).isotope({filter: filterValue}); 1132 }); 1133 } 1134}); 1135 1136function bdp_explore_content_center() { 1137 if(jQuery('.bdp-grid-row .explore').length > 0) {
1138 var $explorerDiv = jQuery('.bdp-grid-row .explore'); 1139 1140 $explorerDiv.removeClass('explorer-clear'); 1141 if(jQuery(window).width() < 641) { 1142 $explorerDiv.each(function() { 1143 jQuery(this).addClass('explorer-clear'); 1144 }); 1145 } else if(jQuery(window).width() < 981) { 1146 1147 if($explorerDiv.hasClass('default')) { 1148 jQuery('.bdp-grid-row .explore:odd').addClass('explorer-clear'); 1149 } 1150 if($explorerDiv.hasClass('repeat') && $explorerDiv.hasClass('reverse')) { 1151 $explorerDiv.each(function () { 1152 var $alert = jQuery(this).data('alter'); 1153 if($alert%5 == 2 || $alert%5 == 4) { 1154 jQuery(this).addClass('explorer-clear'); 1155 } 1156 }); 1157 } 1158 } else { 1159 if($explorerDiv.hasClass('default')) { 1160 jQuery('.bdp-grid-row .explore:nth-child(3n)').addClass('explorer-clear'); 1161 } 1162 if($explorerDiv.hasClass('repeat') || $explorerDiv.hasClass('reverse')) { 1163 $explorerDiv.each(function () { 1164 var $alert = jQuery(this).data('alter'); 1165 if($alert%10 == 1 || $alert%10 == 3 || $alert%10 == 6 || $alert%10 == 8) { 1166 jQuery(this).addClass('explorer-clear'); 1167 } 1168 }); 1169 } 1170 } 1171 } 1172} 1173function bdp_get_brit_co_height() { 1174 var heights = jQuery(".image_wrapper").map(function () { 1175 return jQuery(this).height(); 1176 }).get(), 1177 maxHeight = Math.max.apply(null, heights); 1178 var content_heights = jQuery(".content_wrapper").map(function () { 1179 return jQuery(this).height(); 1180 }).get(), 1181 content_height = Math.max.apply(null, content_heights); 1182 jQuery('.britco').each(function () { 1183 var total_height = maxHeight + content_height + 5; 1184 jQuery(this).find('.bdp_blog_wraper').height(total_height); 1185 }); 1186} 1187function bdp_get_famous_height() { 1188 var famous_content_heights = jQuery(".famous-grid .post-body-div").map(function () { 1189 return jQuery(this).height(); 1190 }).get(), 1191 famous_content_heights = Math.max.apply(null, famous_content_heights); 1192 jQuery('.bdp-row.famous').each(function () { 1193 var famous_total_height = famous_content_heights + 25; 1194 jQuery(this).find('.famous-grid').height(famous_total_height); 1195 }); 1196} 1197function bdp_get_wise_block_height() { 1198 var wise_block_heights = jQuery(".wise_block_blog").map(function () { 1199 return jQuery(this).height(); 1200 }).get(), 1201 wise_block_heights = Math.max.apply(null, wise_block_heights); 1202 jQuery('.wise_block_wrapper').each(function () { 1203 var wise_block_total_height = wise_block_heights; 1204 1205 jQuery(this).find('.wise_block_blog').height(wise_block_total_height); 1206 }); 1207} 1208function bdp_get_tabbed_height() { 1209 jQuery('.left-side.bdp-tabbed-all-post-content').imagesLoaded(function () { 1210 var leftContent = jQuery('.left-side.bdp-tabbed-all-post-content').outerHeight(); 1211 var rightContent = jQuery('.right-side.bdp-tabbed-all-post-content').outerHeight(); 1212 if(rightContent > leftContent ) { 1213 jQuery('.right-side.bdp-tabbed-all-post-content').css('overflow-y', 'scroll'); 1214 jQuery('.right-side.bdp-tabbed-all-post-content').css('max-height', leftContent); 1215 } else { 1216 jQuery('.right-side.bdp-tabbed-all-post-content').css('overflow-y', ''); 1217 } 1218 }); 1219} 1220 1221jQuery(document).ready(function() { 1222 var icon_element = jQuery('.slides.design2 .mauthor .author'); 1223 var date_element = jQuery('.slides.design2 .post-date > a'); 1224 var timeline_date = jQuery('.timeline .date_wrap .datetime'); 1225 icon_element.each(function() { 1226 if(jQuery(this).find('i')) { 1227 jQuery(this).find('i').remove(); 1228 jQuery(this).prepend('By'); 1229 } 1230 }); 1231 date_element.each(function() { 1232 if(jQuery(this).find('i')) { 1233 jQuery(this).find('i').remove(); 1234 jQuery(this).prepend('/ '); 1235 } 1236 });
1237 timeline_date.each(function(){ 1238 if(jQuery(this).find('a').length == 0) { 1239 jQuery('.bdp_post_list.timeline .timeline.blog-wrap .datetime, .blog_template.timeline_cover .timeline.blog-wrap .datetime').css('position','absolute'); 1240 } 1241 }); 1242 jQuery('.blog_template.blog_carousel .slides li').each(function() { 1243 if(jQuery(this).find('.bdp-post-image a').length == 0 ) { 1244 jQuery(this).find('.blog_header').css('margin-top', '0px'); 1245 } 1246 }); 1247 1248 if(jQuery('.bdp_single.invert-grid .post-body-div').find('.bdp-post-image').length == 0 ) { 1249 jQuery('.bdp_single.invert-grid').find('.metadatabox').css('padding-top', '40px'); 1250 } 1251 1252 jQuery('.sharpen.bdp_blog_single_post_wrapp').each(function() { 1253 if(jQuery(this).find('.bdp-post-image').length > 0 ) { 1254 jQuery(this).find('.blog_header').css('margin-top', '-70px'); 1255 } 1256 if(jQuery(this).find('.bdp-post-image.post-video').length > 0 ) { 1257 jQuery(this).find('.blog_header').css('margin-top', '0px'); 1258 } 1259 }); 1260 1261});
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.