1jQuery(document).ready(function ($) { 2 3 var ajaxurl = bozu_pagination.ajax_url; 4 5 function bozu_is_on_screen(elem) { 6 7 if ($(elem)[0]) { 8 9 var tmtwindow = jQuery(window); 10 var viewport_top = tmtwindow.scrollTop(); 11 var viewport_height = tmtwindow.height(); 12 var viewport_bottom = viewport_top + viewport_height; 13 var tmtelem = jQuery(elem); 14 var top = tmtelem.offset().top; 15 var height = tmtelem.height(); 16 var bottom = top + height; 17 return (top >= viewport_top && top < viewport_bottom) || 18 (bottom > viewport_top && bottom <= viewport_bottom) || 19 (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom); 20 } 21 } 22 23 var n = window.TWP_JS || {}; 24 var paged = parseInt(bozu_pagination.paged) + 1; 25 var maxpage = bozu_pagination.maxpage; 26 var nextLink = bozu_pagination.nextLink; 27 var loadmore = bozu_pagination.loadmore; 28 var loading = bozu_pagination.loading; 29 var nomore = bozu_pagination.nomore; 30 var pagination_layout = bozu_pagination.pagination_layout; 31 32 function bozu_load_content_ajax(){ 33 34 if ((!$('.theme-no-posts').hasClass('theme-no-posts'))) { 35 36 $('.theme-loading-button .loading-text').text(loading); 37 $('.theme-loading-status').addClass('theme-ajax-loading'); 38 $('.theme-loaded-content').load(nextLink + ' .article-panel-blocks', function () { 39 if (paged < 10) { 40 var newlink = nextLink.substring(0, nextLink.length - 2); 41 } else { 42 43 var newlink = nextLink.substring(0, nextLink.length - 3); 44 } 45 paged++; 46 paged = "=" + paged; 47 newlink = newlink.replace("paged=", "paged"); 48 nextLink = newlink + paged + "/"; 49 paged = paged.replace("=", ""); 50 if (paged > maxpage) { 51 $('.theme-loading-button').addClass('theme-no-posts'); 52 $('.theme-loading-button .loading-text').text(nomore); 53 } else { 54 $('.theme-loading-button .loading-text').text(loadmore); 55 } 56 57 $('.theme-loaded-content .theme-article-post-main').each(function(){ 58 $(this).addClass(paged + '-twp-article-ajax after-ajax-load'); 59 $(this).find('.video-main-wraper').removeClass('video-main-wraper').addClass('video-main-wraper-ajax'); 60 }); 61 62 var lodedContent = $('.theme-loaded-content').html(); 63 $('.theme-loaded-content').html(''); 64 65 if ($('.theme-panelarea').hasClass('theme-panelarea-blocks')) { 66 67 if ($('.theme-panelarea-blocks').length > 0) { 68 69 var content = $(lodedContent); 70 content.hide(); 71 grid = $('.theme-panelarea-blocks'); 72 grid.append(content); 73 grid.imagesLoaded(function () { 74 content.show(); 75 76 var rtled = false; 77 78 if( $('body').hasClass('rtl') ){ 79 rtled = true; 80 } 81 82 $( '.'+paged + '-twp-article-ajax figure.wp-block-gallery.has-nested-images.columns-1, .'+paged + '-twp-article-ajax .wp-block-gallery.columns-1 ul.blocks-gallery-grid, .'+paged + '-twp-article-ajax .gallery-columns-1').each(function () { 83 $(this).slick({ 84 slidesToShow: 1, 85 slidesToScroll: 1, 86 fade: true, 87 autoplay: false, 88 autoplaySpeed: 8000, 89 infinite: true, 90 nextArrow: '<button type="button" class="slide-btn slide-next-icon"></button>', 91 prevArrow: '<button type="button" class="slide-btn slide-prev-icon"></button>', 92 dots: false, 93 rtl: rtled 94 }); 95 96 }); 97 98 var winwidth = $(window).width(); 99 $(window).resize(function () { 100 winwidth = $(window).width(); 101 }); 102 103 if (winwidth > 990) { 104 grid.masonry('appended', content).masonry(); 105 } else { 106 grid.masonry('appended', content); 107 } 108 109 }); 110 111 } 112 113 } else { 114 115 $('.content-area .theme-panelarea').append(lodedContent); 116 117 } 118 119 120 $('.theme-loading-status').removeClass('theme-ajax-loading'); 121 122 // Youtube Video Custom Controls Start 123 var action = []; 124 var iframe = document.getElementsByClassName("video-main-wraper-ajax"); 125 var src; 126 127 Array.prototype.forEach.call(iframe, function(el) { 128 // Do stuff here 129 var id = el.getAttribute("data-id"); 130 jQuery(document).ready(function ($) { 131 "use strict"; 132 133 src = $(el).find('iframe').attr('src'); 134 135 if( src ){ 136 137 if( src.indexOf('youtube.com') != -1 ){ 138 139 $(el).find('iframe').attr('id',id); 140 $(el).find('iframe').addClass('twp-iframe-video-youtube-ajax'); 141 $(el).find('iframe').attr('src',src+'&enablejsapi=1&autoplay=1&mute=1&rel=0&modestbranding=0&autohide=0&showinfo=0&controls=0&loop=1'); 142 143 } 144 145 if( src.indexOf('vimeo.com') != -1 ){ 146 147 Bozu_Vimeo(); 148 $(el).find('iframe').attr('id',id); 149 $(el).find('iframe').addClass('twp-iframe-video-vimeo'); 150 $(el).find('iframe').attr('src',src+'&title=0&byline=0&portrait=0&transparent=0&autoplay=1&controls=0&loop=1'); 151 $(el).find('iframe').attr('allow','autoplay;'); 152 153 var player = document.getElementById(id); 154 155 $(player).vimeo("setVolume", 0); 156 157 $('#'+id).closest('.entry-video').find('.twp-mute-unmute').on('click',function(){ 158 159 160 if( $(this).hasClass('unmute') ){ 161 162 $(player).vimeo("setVolume", 1); 163 $(this).removeClass('unmute'); 164 $(this).addClass('mute'); 165 $(this).find('.twp-video-control-action').html(bozu_custom.unmute); 166 $(this).find('.screen-reader-text').html(bozu_custom.unmute_text); 167 168 }else if( $(this).hasClass('mute') ){ 169 170 $(player).vimeo("setVolume", 0); 171 $(this).removeClass('mute'); 172 $(this).addClass('unmute'); 173 $(this).find('.twp-video-control-action').html(bozu_custom.mute); 174 $(this).find('.screen-reader-text').html(bozu_custom.mute_text); 175 176 } 177 178 }); 179 180 $('#'+id).closest('.entry-video').find('.twp-pause-play').on('click',function(){ 181 182 if( $(this).hasClass('play') ){ 183 184 $(player).vimeo('play'); 185 $(this).removeClass('play'); 186 $(this).addClass('pause'); 187 $(this).find('.twp-video-control-action').html(bozu_custom.pause); 188 $(this).find('.screen-reader-text').html(bozu_custom.pause_text); 189 190 }else if( $(this).hasClass('pause') ){ 191 192 $(player).vimeo('pause'); 193 $(this).removeClass('pause'); 194 $(this).addClass('play'); 195 $(this).find('.twp-video-control-action').html(bozu_custom.play); 196 $(this).find('.screen-reader-text').html(bozu_custom.play_text); 197 198 } 199 200 }); 201 202 } 203 204 }else{ 205 206 var currentVideo; 207 $(el).find('video').attr('loop','loop'); 208 $(el).find('video').attr('autoplay','autoplay'); 209 $(el).find('video').removeAttr('controls'); 210 $(el).find('video').attr('id',id); 211 212 $('#'+id).closest('.entry-video').find('.twp-mute-unmute').on('click',function(){ 213 214 if( $(this).hasClass('unmute') ){ 215 216 currentVideo = document.getElementById(id); 217 $(currentVideo).prop('muted', false); 218 $(this).removeClass('unmute'); 219 $(this).addClass('mute'); 220 $(this).find('.twp-video-control-action').html(bozu_custom.unmute); 221 $(this).find('.screen-reader-text').html(bozu_custom.unmute_text); 222 223 }else if( $(this).hasClass('mute') ){ 224 225 currentVideo = document.getElementById(id); 226 $(currentVideo).prop('muted', true); 227 $(this).removeClass('mute'); 228 $(this).addClass('unmute'); 229 $(this).find('.twp-video-control-action').html(bozu_custom.mute); 230 $(this).find('.screen-reader-text').html(bozu_custom.mute_text); 231 232 } 233 234 }); 235 236 setTimeout(function(){ 237 238 currentVideo = document.getElementById(id); 239 currentVideo.play(); 240 241 },2000); 242 243 $('#'+id).closest('.entry-video').find('.twp-pause-play').on('click',function(){ 244 245 if( $(this).hasClass('play') ){ 246 247 currentVideo = document.getElementById(id); 248 currentVideo.play(); 249 $(this).removeClass('play'); 250 $(this).addClass('pause'); 251 $(this).find('.twp-video-control-action').html(bozu_custom.pause); 252 $(this).find('.screen-reader-text').html(bozu_custom.pause_text); 253 254 }else if( $(this).hasClass('pause') ){ 255 256 currentVideo = document.getElementById(id); 257 currentVideo.pause(); 258 $(this).removeClass('pause'); 259 $(this).addClass('play'); 260 $(this).find('.twp-video-control-action').html(bozu_custom.play); 261 $(this).find('.screen-reader-text').html(bozu_custom.play_text); 262 263 } 264 265 }); 266 267 } 268 269 }); 270 271 }); 272 273 onYouTubePlayerAPIReady(); 274 // this function gets called when API is ready to use 275 function onYouTubePlayerAPIReady() { 276 277 jQuery(document).ready(function ($) { 278 "use strict"; 279 280 $('.twp-iframe-video-youtube-ajax').each(function(){ 281 282 283 var id = $(this).attr('id'); 284 285 // create the global action from the specific iframe (#video) 286 action[id] = new YT.Player(id, { 287 events: { 288 // call this function when action is ready to use 289 'onReady': function onReady() { 290 291 $('#'+id).closest('.entry-video').find('.twp-pause-play').on('click',function(){ 292 293 var id = $(this).attr('attr-id'); 294 295 if( $(this).hasClass('play') ){ 296 297 action[id].playVideo(); 298 299 $(this).removeClass('play'); 300 $(this).addClass('pause'); 301 $(this).find('.twp-video-control-action').html(bozu_custom.pause); 302 $(this).find('.screen-reader-text').html(bozu_custom.pause_text); 303 304 }else if( $(this).hasClass('pause') ){ 305 306 action[id].pauseVideo(); 307 $(this).removeClass('pause'); 308 $(this).addClass('play'); 309 $(this).find('.twp-video-control-action').html(bozu_custom.play); 310 $(this).find('.screen-reader-text').html(bozu_custom.play_text); 311 312 } 313 314 315 }); 316 317 $('#'+id).closest('.entry-video').find('.twp-mute-unmute').on('click',function(){ 318 319 var id = $(this).attr('attr-id'); 320 if( $(this).hasClass('unmute') ){ 321 322 action[id].unMute(); 323 324 $(this).removeClass('unmute'); 325 $(this).addClass('mute'); 326 $(this).find('.twp-video-control-action').html(bozu_custom.unmute); 327 $(this).find('.screen-reader-text').html(bozu_custom.unmute_text); 328 329 }else if( $(this).hasClass('mute') ){ 330 331 action[id].mute(); 332 $(this).removeClass('mute'); 333 $(this).addClass('unmute'); 334 $(this).find('.twp-video-control-action').html(bozu_custom.mute); 335 $(this).find('.screen-reader-text').html(bozu_custom.mute_text); 336 337 } 338 339 340 }); 341 342 }, 343 } 344 }); 345 346 }); 347 348 }); 349 } 350 351 // Youtube Video Custom Contr
351ols End 352 353 $('.theme-article-post-main').each(function(){ 354 355 $(this).removeClass('slick-slider-active'); 356 $(this).find('.video-main-wraper-ajax').removeClass('video-main-wraper-ajax'); 357 $(this).find('.video-main-wraper-ajax').removeClass('video-main-wraper-ajax'); 358 $(this).find('.twp-iframe-video-youtube-ajax').removeClass('twp-iframe-video-youtube-ajax'); 359 360 }); 361 362 }); 363 364 } 365 } 366 367 $('.theme-loading-button').click(function () { 368 369 bozu_load_content_ajax(); 370 371 }); 372 373 if (pagination_layout == 'auto-load') { 374 $(window).scroll(function () { 375 376 if (!$('.theme-loading-status').hasClass('theme-ajax-loading') && !$('.theme-loading-button').hasClass('theme-no-posts') && maxpage > 1 && bozu_is_on_screen('.theme-loading-button')) { 377 378 bozu_load_content_ajax(); 379 380 } 381 382 }); 383 } 384 385 $(window).scroll(function () { 386 387 if (!$('.twp-single-infinity').hasClass('twp-single-loading') && $('.twp-single-infinity').attr('loop-count') <= 3 && bozu_is_on_screen('.twp-single-infinity')) { 388 389 $('.twp-single-infinity').addClass('twp-single-loading'); 390 var loopcount = $('.twp-single-infinity').attr('loop-count'); 391 var postid = $('.twp-single-infinity').attr('next-post'); 392 393 var data = { 394 'action': 'bozu_single_infinity', 395 '_wpnonce': bozu_pagination.ajax_nonce, 396 'postid': postid, 397 }; 398 399 $.post(ajaxurl, data, function (response) { 400 401 if (response) { 402 var content = response.data.content.join(''); 403 var content = $(content); 404 $('.twp-single-infinity').before(content); 405 var newpostid = response.data.postid.join(''); 406 $('.twp-single-infinity').attr('next-post', newpostid); 407 408 if ($('body').hasClass('booster-extension')) { 409 likedislike('after-load-ajax-'+postid); 410 booster_extension_post_reaction('after-load-ajax-'+postid); 411 } 412 var rtled = false; 413 414 if( $('body').hasClass('rtl') ){ 415 rtled = true; 416 } 417 // Content Gallery Slide Start 418 $(".after-load-ajax-"+postid+" figure.wp-block-gallery.has-nested-images.columns-1, .after-load-ajax-"+postid+" .wp-block-gallery.columns-1 ul.blocks-gallery-grid, .after-load-ajax-"+postid+" .gallery-columns-1").each(function () { 419 $(this).slick({ 420 slidesToShow: 1, 421 slidesToScroll: 1, 422 fade: true, 423 autoplay: false, 424 autoplaySpeed: 8000, 425 infinite: true, 426 nextArrow: '<button type="button" class="slide-btn slide-next-icon"></button>', 427 prevArrow: '<button type="button" class="slide-btn slide-prev-icon"></button>', 428 dots: false, 429 rtl: rtled 430 }); 431 }); 432 // Content Gallery End 433 434 // Content Gallery popup Start 435 $('.after-load-ajax .entry-content .gallery, .widget .gallery, .after-load-ajax .wp-block-gallery').each(function () { 436 437 $(this).magnificPopup({ 438 delegate: 'a', 439 type: 'image', 440 closeOnContentClick: false, 441 closeBtnInside: false, 442 mainClass: 'mfp-with-zoom mfp-img-mobile', 443 image: { 444 verticalFit: true, 445 titleSrc: function (item) { 446 return item.el.attr('title'); 447 } 448 }, 449 gallery: { 450 enabled: true 451 }, 452 zoom: { 453 enabled: true, 454 duration: 300, 455 opener: function (element) { 456 return element.find('img'); 457 } 458 } 459 }); 460 461 }); 462 463 // Content Gallery popup End 464 465 $('article').each(function () { 466 $(this).removeClass('after-load-ajax'); 467 }); 468 469 } 470 471 $('.twp-single-infinity').removeClass('twp-single-loading'); 472 loopcount++; 473 $('.twp-single-infinity').attr('loop-count', loopcount); 474 475 }); 476 477 } 478 479 }); 480 481});
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.