1(function (e) { 2 "use strict"; 3 var n = window.MINIMAL_JS || {}; 4 var grid; 5 /*Used for ajax loading posts*/ 6 var loadType, loadButton, loader, pageNo, loading, morePost, scrollHandling; 7 /**/ 8 9 function minimal_grid_is_on_scrn(elem) { 10 // if the element doesn't exist, abort 11 if (elem.length == 0) { 12 return; 13 } 14 var tmtwindow = jQuery(window); 15 var viewport_top = tmtwindow.scrollTop(); 16 var viewport_height = tmtwindow.height(); 17 var viewport_bottom = viewport_top + viewport_height; 18 var tmtelem = jQuery(elem); 19 var top = tmtelem.offset().top; 20 var height = tmtelem.height(); 21 var bottom = top + height; 22 return (top >= viewport_top && top < viewport_bottom) || 23 (bottom > viewport_top && bottom <= viewport_bottom) || 24 (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom); 25 } 26 27 n.mobileMenu = { 28 init: function () { 29 this.toggleMenu(); 30 this.menuArrow(); 31 }, 32 toggleMenu: function () { 33 e('.nav-toogle').on('click', function (event) { 34 e('body').toggleClass('extended-menu'); 35 }); 36 e('.main-navigation').on('click', 'ul.menu a i', function (event) { 37 event.preventDefault(); 38 var ethis = e(this), 39 eparent = ethis.closest('li'), 40 esub_menu = eparent.find('> .sub-menu'); 41 if (esub_menu.css('display') == 'none') { 42 esub_menu.slideDown('300'); 43 ethis.addClass('active'); 44 } else { 45 esub_menu.slideUp('300'); 46 ethis.removeClass('active'); 47 } 48 return false; 49 }); 50 }, 51 menuArrow: function () { 52 if (e('.main-navigation ul.menu').length) { 53 e('.main-navigation ul.menu .sub-menu').parent('li').find('> a').append('<i class="icon-nav-down">'); 54 } 55 } 56 }; 57 n.ThemematticSearch = function () { 58 e('.icon-search').on('click', function (event) { 59 e('body').toggleClass('reveal-search'); 60 }); 61 e('.close-popup').on('click', function (event) { 62 e('body').removeClass('reveal-search'); 63 }); 64 }; 65 n.ThemematticPreloader = function () { 66 e(window).load(function () { 67 e("body").addClass("page-loaded"); 68 }); 69 }; 70 n.ThemematticSlider = function () { 71 if (e('.insta-slider').length > 0) { 72 e('.insta-slider.insta-slider-enable').slick({ 73 slidesToShow: 6, 74 slidesToScroll: 1, 75 dots: false, 76 infinite: false, 77 nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>', 78 prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>', 79 responsive: [ 80 { 81 breakpoint: 991, 82 settings: { 83 slidesToShow: 3, 84 slidesToScroll: 3 85 } 86 }, 87 { 88 breakpoint: 768, 89 settings: { 90 slidesToShow: 2, 91 slidesToScroll: 2 92 } 93 }, 94 { 95 breakpoint: 480, 96 settings: { 97 slidesToShow: 2, 98 slidesToScroll: 2 99 } 100 } 101 ] 102 }); 103 } 104 e(".gallery-columns-1, ul.wp-block-gallery.columns-1, .wp-block-gallery.columns-1 .blocks-gallery-grid").each(function () { 105 e(this).slick({ 106 slidesToShow: 1, 107 slidesToScroll: 1, 108 fade: true, 109 autoplay: true, 110 autoplaySpeed: 8000, 111 infinite: true, 112 dots: false, 113 nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>', 114 prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>' 115 }); 116 }); 117 }; 118 n.SingleColGallery = function (gal_selector) { 119 if (e.isArray(gal_selector)) { 120 e.each(gal_selector, function (index, value) { 121 e("#" + value).find('.gallery-columns-1, ul.wp-block-gallery.columns-1, .wp-block-gallery.columns-1 .blocks-gallery-grid').slick({ 122 slidesToShow: 1, 123 slidesToScroll: 1, 124 dots: false, 125 infinite: false, 126 nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>', 127 prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>' 128 }); 129 }); 130 } else { 131 e("." + gal_selector).slick({ 132 slidesToShow: 1, 133 slidesToScroll: 1, 134 dots: false, 135 infinite: false, 136 nextArrow: '<i class="navcontrol-icon slide-next ion-ios-arrow-right"></i>', 137 prevArrow: '<i class="navcontrol-icon slide-prev ion-ios-arrow-left"></i>' 138 }); 139 } 140 }; 141 n.MagnificPopup = function () { 142 e('.zoom-gallery, .gallery, .wp-block-gallery').each(function () { 143 e(this).magnificPopup({ 144 delegate: 'a', 145 type: 'image', 146 gallery: { 147 enabled: true 148 }, 149 zoom: { 150 enabled: true, 151 duration: 300, 152 opener: function (element) { 153 return element.find('img'); 154 } 155 } 156 }); 157 }); 158 };
159 n.DataBackground = function () { 160 var pageSection = e(".data-bg"); 161 pageSection.each(function (indx) { 162 if (e(this).attr("data-background")) { 163 e(this).css("background-image", "url(" + e(this).data("background") + ")"); 164 } 165 }); 166 e('.bg-image').each(function () { 167 var src = e(this).children('img').attr('src'); 168 e(this).css('background-image', 'url(' + src + ')').children('img').hide(); 169 }); 170 }; 171 n.show_hide_scroll_top = function () { 172 if (e(window).scrollTop() > e(window).height() / 2) { 173 e("#scroll-up").fadeIn(300); 174 } else { 175 e("#scroll-up").fadeOut(300); 176 } 177 }; 178 n.scroll_up = function () { 179 e("#scroll-up").on("click", function () { 180 e("html, body").animate({ 181 scrollTop: 0 182 }, 800); 183 return false; 184 }); 185 }; 186 n.toogle_minicart = function () { 187 e(".minicart-title-handle").on("click", function () { 188 e(".minicart-content").slideToggle(); 189 }); 190 }; 191 n.ms_masonry = function () { 192 if (e('.masonry-grid').length > 0) { 193 /*Default masonry animation*/ 194 var hidden = 'scale(0.5)'; 195 var visible = 'scale(1)'; 196 /**/ 197 /*Get masonry animation*/ 198 if (minimalGridVal.masonry_animation === 'none') { 199 hidden = 'translateY(0)'; 200 visible = 'translateY(0)'; 201 } 202 if (minimalGridVal.masonry_animation === 'slide-up') { 203 hidden = 'translateY(50px)'; 204 visible = 'translateY(0)'; 205 } 206 if (minimalGridVal.masonry_animation === 'slide-down') { 207 hidden = 'translateY(-50px)'; 208 visible = 'translateY(0)'; 209 } 210 if (minimalGridVal.masonry_animation === 'zoom-out') { 211 hidden = 'translateY(-20px) scale(1.25)'; 212 visible = 'translateY(0) scale(1)'; 213 } 214 /**/ 215 grid = e('.masonry-grid').imagesLoaded(function () { 216 //e('.masonry-grid article').fadeIn(); 217 grid.masonry({ 218 itemSelector: 'article', 219 hiddenStyle: { 220 transform: hidden, 221 opacity: 0 222 }, 223 visibleStyle: { 224 transform: visible, 225 opacity: 1 226 } 227 }); 228 }); 229 } 230 }; 231 n.thememattic_matchheight = function () { 232 e('.widget-area').theiaStickySidebar({ 233 additionalMarginTop: 30 234 }); 235 }; 236 n.thememattic_reveal = function () { 237 e('#thememattic-reveal').on('click', function (event) { 238 e('body').toggleClass('reveal-box'); 239 }); 240 e('.close-popup').on('click', function (event) { 241 e('body').removeClass('reveal-box'); 242 }); 243 }; 244 n.setLoadPostDefaults = function () { 245 if (e('.load-more-posts').length > 0) { 246 loadButton = e('.load-more-posts'); 247 loader = e('.load-more-posts .ajax-loader'); 248 loadType = loadButton.attr('data-load-type'); 249 pageNo = 2; 250 loading = false; 251 morePost = true; 252 scrollHandling = { 253 allow: true, 254 reallow: function () { 255 scrollHandling.allow = true; 256 }, 257 delay: 400 258 }; 259 } 260 }; 261 n.fetchPostsOnScroll = function () { 262 263 e(window).scroll(function () { 264 if ( !e('.load-more-posts').hasClass('tmt-no-post') && !e('.load-more-posts').hasClass('tmt-post-loding') && e('.load-more-posts').hasClass('scroll') && minimal_grid_is_on_scrn('.load-more-posts')) { 265 266 e('.load-more-posts').addClass('tmt-post-loding'); 267 n.ShowPostsAjax(); 268 269 } 270 }); 271 }; 272 n.fetchPostsOnClick = function () { 273 if (e('.load-more-posts').length > 0 && 'click' === loadType) { 274 e('.load-more-posts a').on('click', function (event) { 275 event.preventDefault(); 276 n.ShowPostsAjax(); 277 }); 278 } 279 }; 280 n.masonryOnClickUpdate = function () { 281 setTimeout(function () { 282 e('.masonry-grid').masonry(); 283 }, 100); 284 }; 285 n.fetchPostsOnMenuClick = function () { 286 e('.trigger-icon-wraper').on('click', function (event) { 287 event.preventDefault(); 288 grid = e('.masonry-grid'); 289 n.masonryOnClickUpdate(); 290 }); 291 }; 292 n.popup_boxeter = function () { 293 294 if (document.cookie.indexOf('visited=true') == -1) { 295 e(window).load(function () { 296 e('.tmt-modal.single-load').each(function () { 297 e(this).addClass('is-visible'); 298 }); 299 }); 300 301 } else { 302 e(window).load(function () { 303 e('.tmt-modal.always-load').each(function () { 304 e(this).addClass('is-visible'); 305 }); 306 }); 307 } 308 e('.tmt-modal-toggle').on("click", function () { 309 e('.tmt-modal').toggleClass('is-visible'); 310 }); 311 312 e('.single-load .tmt-modal-toggle').on("click", function () { 313 e('.tmt-modal').removeClass('is-visible'); 314 var year = 1000 * 60 * 60 * 24 * 365; 315 var expires = new Date((new Date()).valueOf() + year); 316 document.cookie = "visited=true;expires=" + expires.toUTCString(); 317 }); 318 319 }; 320 n.ShowPostsAjax = function () { 321 e.ajax({
322 type: 'GET', 323 url: minimalGridVal.ajaxurl, 324 data: { 325 action: 'minimal_grid_load_more', 326 nonce: minimalGridVal.nonce, 327 page: pageNo, 328 post_type: minimalGridVal.post_type, 329 search: minimalGridVal.search, 330 cat: minimalGridVal.cat, 331 taxonomy: minimalGridVal.taxonomy, 332 author: minimalGridVal.author, 333 year: minimalGridVal.year, 334 month: minimalGridVal.month, 335 day: minimalGridVal.day 336 }, 337 dataType: 'json', 338 beforeSend: function () { 339 loader.addClass('ajax-loader-enabled'); 340 }, 341 success: function (response) { 342 e('.load-more-posts').removeClass('tmt-post-loding'); 343 if (response.success) { 344 var gallery = true; 345 var gal_selectors = []; 346 var content_join = response.data.content.join(''); 347 /*Push the post ids having galleries so that new gallery instance can be created*/ 348 e(content_join).find('.entry-gallery').each(function () { 349 gal_selectors.push(e(this).closest('article').attr('id')); 350 }); 351 if (e('.masonry-grid').length > 0) { 352 var content = e(content_join); 353 content.hide(); 354 grid = e('.masonry-grid'); 355 grid.append(content); 356 grid.imagesLoaded(function () { 357 content.show(); 358 /*Init new Gallery*/ 359 if (true === gallery) { 360 n.SingleColGallery(gal_selectors); 361 } 362 363 var winwidth = e(window).width(); 364 e(window).resize(function() { 365 winwidth = e(window).width(); 366 }); 367 368 if( winwidth > 990 ){ 369 grid.masonry('appended', content).masonry(); 370 }else{ 371 grid.masonry('appended', content); 372 } 373 374 loader.removeClass('ajax-loader-enabled'); 375 }); 376 } else { 377 e('.minimal-grid-posts-lists').append(response.data.content); 378 /*Init new Gallery*/ 379 if (true === gallery) { 380 n.SingleColGallery(gal_selectors); 381 } 382 /**/ 383 loader.removeClass('ajax-loader-enabled'); 384 } 385 pageNo++; 386 loading = false; 387 if (!response.data.more_post) { 388 morePost = false; 389 loadButton.fadeOut(); 390 } 391 /*For audio and video to work properly after ajax load*/ 392 e('video, audio').mediaelementplayer({alwaysShowControls: true}); 393 /**/ 394 /*For Gallery to work*/ 395 n.MagnificPopup(); 396 /**/ 397 loader.removeClass('ajax-loader-enabled'); 398 } else { 399 e('.load-more-posts').addClass('tmt-no-post'); 400 loadButton.fadeOut(); 401 } 402 } 403 }); 404 }; 405 e(document).ready(function () { 406 n.mobileMenu.init(); 407 n.ThemematticSearch(); 408 n.ThemematticPreloader(); 409 n.ThemematticSlider(); 410 n.MagnificPopup(); 411 n.DataBackground(); 412 n.scroll_up(); 413 n.thememattic_reveal(); 414 n.thememattic_matchheight(); 415 n.toogle_minicart(); 416 n.ms_masonry();
417 n.setLoadPostDefaults(); 418 n.fetchPostsOnClick(); 419 n.fetchPostsOnMenuClick(); 420 n.popup_boxeter(); 421 }); 422 e(window).scroll(function () { 423 n.show_hide_scroll_top(); 424 n.fetchPostsOnScroll(); 425 }); 426})(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.