File "pp-posts.min.js"

Full path: /home/kosmetik/public_html/wp-content/plugins/powerpack-elements/assets/js/min/pp-posts.min.js
File size: 9.25 B
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

!function(w){var v=!0,y=1,i="",k=0;var t=function(e,a){var t=e.find(".pp-posts-container"),p=e.find(".pp-posts"),o=e.find(".pp-posts").data("layout"),n=e.find(".pp-post-filters-container").data("search-form"),i=e.find(".pp-search-form-input"),s=e.find(".pp-post-filters-container").data("search-action"),d=e.find(".pp-posts-loader");post_filter=e.find(".pp-post-filters");var r,l,f,c,u,h,m,g=e.find(".pp-coupons");function _(){var t=elementorFrontend.config.breakpoints,p=0,o="auto";e.find(".pp-post-wrap").each(function(){a(this).find(".pp-post-content").outerHeight()>p&&(p=a(this).find(".pp-post-content").outerHeight())}),a(window).width()>=t.md&&(o=p),e.find(".pp-post-wrap").css("height",o)}"masonry"==o&&e.imagesLoaded(function(t){p.isotope({layoutMode:o,itemSelector:".pp-grid-item-wrap"})}),x(e,1),post_filter.find(".pp-post-filter").off("click").on("click",function(){a(this).siblings().removeClass("pp-filter-current"),a(this).addClass("pp-filter-current"),y=1,0<g.length?b(e,a(this),"coupon"):b(e,a(this),"")}),0<post_filter.length&&(""!==location.hash&&(r=location.hash.split("#")[1],post_filter.find('li[data-filter=".'+r+'"]').trigger("click")),a(window).on("hashchange",function(){var t;""!==location.hash&&(t=location.hash.split("#")[1],post_filter.find('li[data-filter=".'+t+'"]').trigger("click"))})),"show"==n&&(i.on({focus:function(){e.find(".pp-search-form").addClass("pp-search-form-focus")},blur:function(){e.find(".pp-search-form").removeClass("pp-search-form-focus")}}),"instant"==s?e.find(".pp-search-form-input").keyup((l=function(){$(e,a(this))},f=f||100,function(){clearTimeout(c);var t=arguments,p=this;c=setTimeout(function(){l.apply(p,t)},f)})):"button-click"==s&&e.find(".pp-search-form-submit").on("click",function(){$(e,a(this))})),t.find(".pp-posts").hasClass("pp-posts-skin-checkerboard")&&e.hasClass("pp-equal-height-yes")&&t.find(".pp-posts").hasClass("pp-posts-height-auto")&&(a(_),a(window).resize(_)),(t.hasClass("pp-posts-infinite-scroll")||g.hasClass("pp-coupons-infinite-scroll"))&&(u=jQuery(window).outerHeight()/1.25,a(window).scroll(function(){return elementorFrontend.isEditMode()?(d.show(),!1):void(g.hasClass("pp-coupons-infinite-scroll")?a(window).scrollTop()+u>=e.find(".pp-coupons-grid-wrapper:last").offset().top&&(t={page_id:e.find(".pp-coupons-grid-wrapper").data("page"),widget_id:e.data("id"),filter:e.find(".pp-filter-current").data("filter"),taxonomy:e.find(".pp-filter-current").data("taxonomy"),skin:e.find(".pp-coupons-grid-wrapper").data("skin"),page_number:e.find(".page-numbers.current").next("a").html(),ajax_for:"coupon"},k=e.find(".pp-posts-pagination").data("total"),1==v&&y<k&&(d.show(),j(e,t,!0),y++,v=!1)):a(window).scrollTop()+u>=e.find(".pp-post:last").offset().top&&(t={page_id:e.find(".pp-posts").data("page"),widget_id:e.data("id"),filter:e.find(".pp-filter-current").data("filter"),taxonomy:e.find(".pp-filter-current").data("taxonomy"),skin:e.find(".pp-posts").data("skin"),page_number:e.find(".pp-posts-pagination .current").next("a").html(),ajax_for:""},k=e.find(".pp-posts-pagination").data("total"),1==v&&y<k&&(d.show(),j(e,t,!0),y++,v=!1)));var t})),"carousel"==o&&(h=e.find(".pp-posts-carousel").eq(0),m=JSON.parse(h.attr("data-slider-settings")),0<h.length&&e.imagesLoaded(function(){h.slick(m)}),a(h).on("setPosition",function(){var t,p,o;"yes"==(o=e.find(".pp-posts-carousel")).data("equal-height")&&(o.find(".slick-slide").height("auto"),t=o.find(".slick-track"),p=w(t).height(),o.find(".slick-slide").css("height",p+"px"))}))};function s(t){return t.find(".pp-post-load-more").data("count")}function x(t,p){t.find(".pp-post-load-more").attr("data-count",p)}w(document).on("click",".pp-post-load-more",function(t){$scope=w(this).closest(".elementor-widget-pp-posts"),i=$scope.find(".pp-posts-loader");var p,o,e,a,n=w(this).closest(".elementor-widget-pp-coupons");if(coupon_loader=n.find(".pp-posts-loader"),t.preventDefault(),elementorFrontend.isEditMode())return i.show(),coupon_loader.show(),!1;0<n.length?(p=s(n),o=n.find(".pp-filter-current").data("filter"),e=n.find(".pp-filter-current").data("taxonomy"),a={page_id:n.find(".pp-coupons-grid-wrapper").data("page"),widget_id:n.data("id"),filter:o||"",taxonomy:e||"",page_number:p+1,ajax_for:"coupon"},k=n.find(".pp-posts-pagination").data("total"),1==v&&p<k&&(coupon_loader.show(),w(this).hide(),j(n,a,!0,p),p++,v=!1)):(p=s($scope),o=$scope.find(".pp-filter-current").data("filter"),e=$scope.find(".pp-filter-current").data("taxonomy"),a={page_id:$scope.find(".pp-posts").data("page"),widget_id:$scope.data("id"),filter:o||"",taxonomy:e||"",skin:$scope.find(".pp-posts").data("skin"),page_number:p+1,ajax_for:""},k=$scope.find(".pp-posts-pagination").data("total"),1==v&&p<k&&(i.show(),w(this).hide(),j($scope,a,!0,p),p++,v=!1))}),w("body").on("click",".pp-posts-pagination-ajax .page-numbers",function(t){$scope=w(this).closest(".elementor-widget-pp-posts");var p,o,e,a=w(this).closest(".elementor-widget-pp-coupons");"main"!=$scope.find(".pp-posts").data("query-type")&&(t.preventDefault(),0<a.length?(a.find(".pp-coupons-grid-wrapper .pp-coupon").last().after('<div class="pp-post-loader"><div class="pp-loader"></div><div class="pp-loader-overlay"></div></div>'),p=1,o=parseInt(a.find(".pp-posts-pagination .page-numbers.current").html()),p=w(this).hasClass("next")?o+1:w(this).hasClass("prev")?o-1:w(this).html(),e={page_id:a.find(".pp-coupons-grid-wrapper").data("page"),widget_id:a.data("id"),filter:a.find(".pp-filter-current").data("filter"),taxonomy:a.find(".pp-filter-current").data("taxonomy"),page_number:p,ajax_for:"coupon"},w("html, body").animate({scrollTop:a.find(".pp-coupons-wrap").offset().top-30},"slow"),j(a,e)):($scope.find(".pp-posts .pp-post").last().after('<div class="pp-post-loader"><div class="pp-loader"></div><div class="pp-loader-overlay"></div></div>'),p=1,o=parseInt($scope.find(".pp-posts-pagination .page-numbers.current").html()),p=w(this).hasClass("next")?o+1:w(this).hasClass("prev")?o-1:w(this).html(),e={page_id:$scope.find(".pp-posts").data("page"),widget_id:$scope.data("id"),filter:$scope.find(".pp-filter-current").data("filter"),taxonomy:$scope.find(".pp-filter-current").data("taxonomy"),skin:$scope.find(".pp-posts").data("skin"),page_number:p,ajax_for:""},w("html, body").animate({scrollTop:$scope.find(".pp-posts-container").offset().top-30},"slow"),j($scope,e)))});var b=function(t,p,o){var e;e="coupon"===o?(t.find(".pp-coupons-grid-wrapper .pp-grid-item-wrap").last().after('<div class="pp-posts-loader-wrap"><div class="pp-loader"></div><div class="pp-loader-overlay"></div></div>'),{page_id:t.find(".pp-coupons-grid-wrapper").data("page"),widget_id:t.data("id"),filter:p.data("filter"),taxonomy:p.data("taxonomy"),page_number:1,ajax_for:"coupon"}):(t.find(".pp-posts .pp-grid-item-wrap").last().after('<div class="pp-posts-loader-wrap"><div class="pp-loader"></div><div class="pp-loader-overlay"></div></div>'),{page_id:t.find(".pp-posts").data("page"),widget_id:t.data("id"),filter:p.data("filter"),taxonomy:p.data("taxonomy"),skin:t.find(".pp-posts").data("skin"),page_number:1,ajax_for:""}),j(t,e)},$=function(t,p){t.find(".pp-posts .pp-grid-item-wrap").last().after('<div class="pp-posts-loader-wrap"><div class="pp-loader"></div><div class="pp-loader-overlay"></div></div>');var o={page_id:t.find(".pp-posts").data("page"),widget_id:t.data("id"),search:t.find(".pp-search-form-input").val(),page_number:1};j(t,o)},j=function(i,s,d,r){var l=i.find(".pp-posts-loader");w.ajax({url:pp_posts_script.ajax_url,data:{action:"pp_get_post",page_id:s.page_id,widget_id:s.widget_id,category:s.filter,search:s.search,taxonomy:s.taxonomy,skin:s.skin,page_number:s.page_number,ajax_for:s.ajax_for,nonce:pp_posts_script.posts_nonce},dataType:"json",type:"POST",success:function(t){var p,o,e,a,n;v=("coupon"===s.ajax_for?(p=i.find(".pp-coupons-grid-wrapper"),(o=i.find(".pp-posts-empty")).remove(),0==w(o).length&&w(t.data.not_found).insertBefore(p),1==d?(e=t.data.html,p.append(e)):p.html(t.data.html),i.find(".pp-posts-pagination-wrap").html(t.data.pagination)):(p=i.find(".pp-posts"),(o=i.find(".pp-posts-empty")).remove(),0==w(o).length&&w(t.data.not_found).insertBefore(p),1==d?(e=t.data.html,p.append(e)):p.html(t.data.html),i.find(".pp-posts-pagination-wrap").html(t.data.pagination),a=i.find(".pp-posts").data("layout"),n=i.find(".pp-posts"),"masonry"==a&&i.imagesLoaded(function(){n.isotope("destroy"),n.isotope({layoutMode:a,itemSelector:".pp-grid-item-wrap"})})),!0),1==d&&(l.hide(),i.find(".pp-post-load-more").show()),x(i,s.page_number),(r+=1)==k&&i.find(".pp-post-load-more").hide(),i.trigger("posts.rendered")}})};w(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.classic",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.card",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.checkerboard",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.creative",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.event",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.news",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.portfolio",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.overlap",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-posts.template",t),elementorFrontend.hooks.addAction("frontend/element_ready/pp-coupons.default",t)})}(jQuery);