1jQuery(document).ready(function ($) { 2 "use strict"; 3 4 5 // Content Gallery Start 6 var i = 1; 7 $('.entry-content .wp-block-gallery ').each(function () { 8 $(this).attr('gallery-data', 'gallery-num-' + i); 9 $(this).addClass('gallery-data-slick'); 10 $(this).addClass('gallery-data-gallery-num-' + i); 11 i++; 12 13 var k = 0; 14 $(this).find('.blocks-gallery-item').each(function () { 15 $(this).attr('gallery-index', k); 16 k++; 17 }); 18 }); 19 20 var j = 1; 21 $('.footer-galleries .wp-block-gallery ').each(function () { 22 23 $(this).append('<div class="gallery-popup"><i class="ion ion-ios-add-circle-outline" aria-hidden="true"></i></div>'); 24 $(this).append('<div class="gallery-popup-close"><i class="ion ion-ios-close" aria-hidden="true"></i></div>'); 25 26 $(this).addClass('gallery-num-' + j); 27 j++; 28 29 $(this).addClass('newsreaders-slick-dactivated'); 30 }); 31 32 $('.gallery-data-slick .blocks-gallery-item a').click(function (event) { 33 event.preventDefault(); 34 35 }); 36 $('.gallery-data-slick .blocks-gallery-item').click(function () { 37 38 if (!$(this).closest('.gallery-data-slick').hasClass('columns-1')) { 39 40 $('html').attr('style', 'margin: 0; height: 100%; overflow: hidden'); 41 42 var galid = $(this).closest('.gallery-data-slick').attr('gallery-data'); 43 $('.' + galid).addClass('gallery-show fullscreen'); 44
45 if ($('.' + galid).hasClass('newsreaders-slick-dactivated')) { 46 47 $('.' + galid + ' .blocks-gallery-grid').slick({ 48 slidesToShow: 1, 49 slidesToScroll: 1, 50 fade: true, 51 autoplay: false, 52 autoplaySpeed: 8000, 53 infinite: true, 54 nextArrow: '<button type="button" class="slide-btn slide-next-icon ion ion-ios-arrow-forward"></button>', 55 prevArrow: '<button type="button" class="slide-btn slide-prev-icon ion ion-ios-arrow-back"></button>', 56 dots: false, 57 }); 58 } 59 var galindex = $(this).attr('gallery-index'); 60 $('.' + galid + ' .blocks-gallery-grid').slick('slickGoTo', galindex); 61 $('.' + galid).removeClass('newsreaders-slick-dactivated'); 62 63 } 64 65 }); 66 67 $('.wp-block-gallery.columns-1').append('<div class="gallery-popup"><i class="ion ion-ios-add-circle-outline" aria-hidden="true"></i></div>'); 68 $('.wp-block-gallery.columns-1').append('<div class="gallery-popup-close"><i class="ion ion-ios-close" aria-hidden="true"></i></div>'); 69 $('.gallery-popup').click(function () { 70 $(this).closest('.wp-block-gallery').addClass('fullscreen'); 71 $('html').attr('style', 'margin: 0; height: 100%; overflow: hidden'); 72 $('.wp-block-gallery.columns-1 .blocks-gallery-grid').slick("slickSetOption", "speed", 500, !0); 73 74 }); 75 76 $('.gallery-popup-close').click(function () { 77 $(this).closest('.wp-block-gallery').removeClass('fullscreen gallery-show'); 78 $('html').attr('style', ''); 79 $('.wp-block-gallery.columns-1 .blocks-gallery-grid').slick("slickSetOption", "speed", 500, !0); 80 81 }); 82 83 // Content Gallery End 84 85 // Widget Gallery Start 86 87 $('.widget_media_gallery a').click(function (event) { 88 event.preventDefault(); 89 }); 90 91 var k = 1; 92 $('.widget_media_gallery').each(function () { 93 94 if (!$(this).find('.gallery').hasClass('gallery-columns-1')) { 95 96 $(this).attr('gallery-id', 'gallery-' + k); 97 var gallhtml = $(this).find('.gallery').html(); 98 $('.widget-footer-galleries').append('<div class="footer-gallery-main"><div class="footer-gallery-' + k + '">' + gallhtml + '</div><div class="gallery-popup"><i class="ion ion-ios-add-circle-outline" aria-hidden="true"></i></div><div class="gallery-popup-close"><i class="ion ion-ios-close" aria-hidden="true"></i></div></div>'); 99 100 var l = 0; 101 $(this).find('.gallery-item').each(function () { 102 $(this).attr('index-item', l); 103 l++; 104 }); 105 106 k++; 107 } 108 109 if ($(this).find('.gallery').hasClass('gallery-columns-1')) { 110 111 $(this).append('<div class="gallery-popup"><i class="ion ion-ios-add-circle-outline" aria-hidden="true"></i></div>'); 112 $(this).append('<div class="gallery-popup-close"><i class="ion ion-ios-close" aria-hidden="true"></i></div>'); 113 114 } 115 116 }); 117 118 $('.footer-gallery-main a').click(function (event) { 119 event.preventDefault(); 120 }); 121 122 $('figure.gallery-item').click(function () { 123 124 if (!$(this).closest('.gallery').hasClass('gallery-columns-1')) { 125 $('html').attr('style', 'margin: 0; height: 100%; overflow: hidden'); 126 } 127 var clickedgal = $(this).closest('.widget_media_gallery').attr('gallery-id'); 128 $('.footer-' + clickedgal).closest('.footer-gallery-main').addClass('fullscreen'); 129 if (!$('.footer-' + clickedgal).hasClass('widget-slider-active')) { 130 131 $('.footer-' + clickedgal).addClass('widget-slider-active'); 132 133 $('.footer-' + clickedgal).slick({ 134 slidesToShow: 1, 135 slidesToScroll: 1, 136 fade: true, 137 autoplay: false, 138 autoplaySpeed: 8000, 139 infinite: true, 140 nextArrow: '<button type="button" class="slide-btn slide-next-icon ion ion-ios-arrow-forward"></button>', 141 prevArrow: '<button type="button" class="slide-btn slide-prev-icon ion ion-ios-arrow-back"></button>', 142 dots: false, 143 }); 144 145 } 146 var galindex = $(this).attr('index-item'); 147 $('.footer-' + clickedgal).slick('slickGoTo', galindex); 148 149 }); 150 151 $('.gallery-popup-close').click(function () { 152 153 $(this).closest('.footer-gallery-main').removeClass('fullscreen gallery-show'); 154 $('html').attr('style', ''); 155 156 }); 157 158 $('.widget.widget_media_gallery .gallery-popup').click(function () { 159 $(this).closest('.widget_media_gallery').addClass('fullscreen'); 160 $('html').attr('style', 'margin: 0; height: 100%; overflow: hidden'); 161 $('.gallery-columns-1').slick("slickSetOption", "speed", 500, !0); 162 163 }); 164 165 $('.widget.widget_media_gallery .gallery-popup-close').click(function () { 166 $(this).closest('.widget_media_gallery').removeClass('fullscreen'); 167 $('html').attr('style', ''); 168 $('.gallery-columns-1').slick("slickSetOption", "speed", 500, !0); 169 170 }); 171 172 // Widget Gallery End 173 174 // Rating disable 175 if (newsreaders_custom.single_post == 1 && newsreaders_custom.newsreaders_ed_post_reaction) { 176 177 $('.tpk-single-rating').remove(); 178 $('.tpk-comment-rating-label').remove(); 179 $('.comments-rating').remove(); 180 $('.tpk-star-rating').remove(); 181 182 } 183 // Add Class on article 184 $('.twp-archive-items.post').each(function () { 185 $(this).addClass('twp-article-loded'); 186 }); 187 188 // Aub Menu Toggle 189 $('.submenu-toggle').click(function () { 190 $(this).toggleClass('button-toggle-active'); 191 var currentClass = $(this).attr('data-toggle-target'); 192 $(currentClass).toggleClass('submenu-toggle-active'); 193 }); 194 195 // Toggle Search 196 $('.navbar-control-search').click(function () { 197 $('.header-searchbar').toggleClass('header-searchbar-active'); 198 199 $('#search-closer').focus(); 200 201 }); 202 203 $('.skip-link-search-start').focus(function(){ 204 $('#search-closer').focus(); 205 }); 206
207 $('.skip-link-search-end').focus(function(){ 208 $('.header-searchbar-area .search-field').focus(); 209 }); 210 211 $('.header-searchbar').click(function () { 212 213 $('.header-searchbar').removeClass('header-searchbar-active'); 214 215 }); 216 217 $(".header-searchbar-inner").click(function (e) { 218 219 e.stopPropagation(); //stops click event from reaching document 220 221 }); 222 223 $('#search-closer').click(function () { 224 225 $('.header-searchbar').removeClass('header-searchbar-active'); 226 $('.navbar-control-search').focus(); 227 228 }); 229 230 // Action On Esc Button 231 $(document).keyup(function (j) { 232 if (j.key === "Escape") { // escape key maps to keycode `27` 233 234 if( $('.header-searchbar').hasClass('header-searchbar-active') ){ 235 $('.header-searchbar').removeClass('header-searchbar-active'); 236 $('.navbar-control-search').focus(); 237 } 238 239 if( $('#offcanvas-menu').hasClass('offcanvas-menu-active') ){ 240 $('#offcanvas-menu').removeClass('offcanvas-menu-active'); 241 $('.navbar-control-offcanvas').removeClass('active'); 242 $('.navbar-control-offcanvas').focus(); 243 } 244 $('html').removeAttr('style'); 245 246 } 247 }); 248 249 // Toggle Menu 250 $('.navbar-control-offcanvas').click(function () { 251 252 $(this).addClass('active'); 253 254 $('#offcanvas-menu').toggleClass('offcanvas-menu-active'); 255 $('.button-offcanvas-close').focus(); 256 257 }); 258 259 $('.offcanvas-close .button-offcanvas-close').click(function () { 260 $('#offcanvas-menu').removeClass('offcanvas-menu-active'); 261 $('.navbar-control-offcanvas').removeClass('active'); 262 263 $('.navbar-control-offcanvas').focus(); 264 265 }) 266 267 $('#offcanvas-menu').click(function () { 268 269 $('#offcanvas-menu').removeClass('offcanvas-menu-active'); 270 $('.navbar-control-offcanvas').removeClass('active'); 271 272 273 }); 274 275 $('.skip-link-menu-start').focus(function(){ 276 277 278 if( !$("#offcanvas-menu #primary-nav-offcanvas").length == 0 ){ 279 $("#offcanvas-menu #primary-nav-offcanvas ul li:last-child a").focus(); 280 } 281 282 if( !$("#offcanvas-menu #social-nav-offcanvas").length == 0 ){ 283 $("#offcanvas-menu #social-nav-offcanvas ul li:last-child a").focus(); 284 } 285 286 }); 287 288 $(".offcanvas-wraper").click(function (e) { 289 290 e.stopPropagation(); //stops click event from reaching document 291 292 }); 293 294 $('input, a, button').on('focus', function () { 295 if ($('#offcanvas-menu').hasClass('offcanvas-menu-active')) { 296 297 if (!$(this).parents('#offcanvas-menu').length) { 298 $('.button-offcanvas-close').focus(); 299 } 300 } 301 }); 302 303 var rtled = false; 304 if ($('body').hasClass('rtl')) { 305 rtled = true; 306 } 307 308 $("figure.wp-block-gallery.has-nested-images.columns-1, .wp-block-gallery.columns-1 ul.blocks-gallery-grid, .gallery-columns-1").each(function () { 309 $(this).slick({ 310 slidesToShow: 1, 311 slidesToScroll: 1, 312 fade: true, 313 autoplay: false, 314 autoplaySpeed: 8000, 315 infinite: true, 316 nextArrow: '<button type="button" class="slide-btn slide-next-icon ion ion-ios-arrow-forward"></button>', 317 prevArrow: '<button type="button" class="slide-btn slide-prev-icon ion ion-ios-arrow-back"></button>', 318 dots: false, 319 rtl: rtled 320 }); 321 }); 322 323 var pageSection = $(".data-bg"); 324 pageSection.each(function (indx) { 325 if ($(this).attr("data-background")) { 326 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 327 } 328 }); 329 330 // Masonry Grid 331 if ($('.archive-layout-masonry').length > 0) { 332 /*Default masonry animation*/ 333 var grid; 334 var hidden = 'scale(0.5)'; 335 var visible = 'scale(1)'; 336 grid = $('.archive-layout-masonry').imagesLoaded(function () { 337 grid.masonry({ 338 itemSelector: '.twp-archive-items', 339 hiddenStyle: { 340 transform: hidden, 341 opacity: 0 342 }, 343 visibleStyle: { 344 transform: visible, 345 opacity: 1 346 } 347 }); 348 }); 349 } 350 351}); 352 353/* ----------------------------------------------------------------------------------------------- 354 Intrinsic Ratio Embeds 355--------------------------------------------------------------------------------------------------- */ 356 357var newsreaders = newsreaders || {}, 358 $ = jQuery; 359 360var $doc = $(document), 361 $win = $(window), 362 winHeight = $win.height(), 363 winWidth = $win.width(); 364 365var viewport = {}; 366viewport.top = $win.scrollTop(); 367viewport.bottom = viewport.top + $win.height(); 368 369newsreaders.instrinsicRatioVideos = { 370 371 init: function () { 372 373 newsreaders.instrinsicRatioVideos.makeFit(); 374 375 $win.on('resize fit-videos', function () { 376 377 newsreaders.instrinsicRatioVideos.makeFit(); 378 379 }); 380 381 }, 382 383 makeFit: function () { 384 385 var vidSelector = "iframe, object, video"; 386 387 $(vidSelector).each(function () { 388 389 var $video = $(this), 390 $container = $video.parent(), 391 iTargetWidth = $container.width(); 392 393 // Skip videos we want to ignore 394 if ($video.hasClass('intrinsic-ignore') || $video.parent().hasClass('intrinsic-ignore')) { 395 return true; 396 } 397 398 if (!$video.attr('data-origwidth')) { 399 400 // Get the video element proportions 401 $video.attr('data-origwidth', $video.attr('width')); 402 $video.attr('data-origheight', $video.attr('height')); 403 404 } 405 406 // Get ratio from proportions 407 var ratio = iTargetWidth / $video.attr('data-origwidth'); 408 409 // Scale based on ratio, thus retaining proportions 410 $video.css('width', iTargetWidth + 'px'); 411 $video.css('height', ($video.attr('data-origheight') * ratio) + 'px'); 412 413 }); 414 415 } 416 417} 418 419$doc.ready(function () { 420 421 newsreaders.instrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize 422 423});
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.