PageSourceSearch

https://limavin.com/wp-content/themes/dinakala/js/dina-ajax-filter.js

js limavin.com collected 2026-10-02 20:17:43 UTC 5,685 bytes, 1 lines download raw bytes

1(function(i){"use strict";function e(i){var e=new URLSearchParams(S);Object.keys(i).forEach(function(n){var a=i[n];null===a||""===a||void 0===a?e.delete(n):e.set(n,a)}),e.delete("paged");var n=e.toString();return n?window.location.pathname+"?"+n:window.location.pathname}function n(e){A||(A=!0,b.addClass("dina-ajax-loading"),a(!0),u(),fetch(e,{credentials:"same-origin"}).then(function(i){if(!i.ok)throw new Error("dina-ajax-filter: bad response "+i.status);return i.text()}).then(function(n){var a=(new DOMParser).parseFromString(n,"text/html");S=new URL(e,window.location.origin).search,t(a),d(a),r(e,a),h(),m(),p(),i(document.body).trigger("dina_ajax_filter_loaded")}).catch(function(i){console.error(i),window.location.href=e}).finally(function(){A=!1,b.removeClass("dina-ajax-loading"),a(!1)}))}function a(e){var n=b.find(".dina-ajax-loading-overlay");clearTimeout(y),e?(n.length||(n=i('<div class="dina-ajax-loading-overlay"><i class="fal fa-spinner-third fa-spin" aria-hidden="true"></i></div>'),b.append(n)),requestAnimationFrame(function(){n.addClass("dina-overlay-visible")})):(n.removeClass("dina-overlay-visible"),y=setTimeout(function(){b.find(".dina-ajax-loading-overlay").remove()},F))}function t(e){var n=b.find(".theiaStickySidebar").first(),a=n.find(".dina-archive-title-con").first();a.length||(a=null),k.forEach(function(t){var r=i(e).find(t).first(),o=b.find(t).first();r.length?(o.length?o.replaceWith(r):a&&a.length?a.after(r):n.length?n.append(r):b.append(r),a=r):o.length&&o.remove()})}function r(e,n){if("push"===j)if(C)C=!1;else{var a=i(n).filter("title").text()||document.title;document.title=a,history.pushState({dinaAjaxFilter:!0},a,e)}}function o(e){e.find('select[class*="dropdown_layered_nav_"]').each(function(){var e=i(this),n=this.className.match(/dropdown_layered_nav_([a-z0-9_-]+)/i);if(n){var a="filter_"+n[1],t=e.closest("form");e.off("change.dinaLayeredNav").on("change.dinaLayeredNav",function(){var e=i(this).val();t.find(':input[name="'+a+'"]').val(e),i(this).attr("multiple")||t.trigger("submit")}),i.fn.selectWoo&&!e.hasClass("select2-hidden-accessible")&&e.selectWoo({minimumResultsForSearch:5,width:"100%",allowClear:!!e.attr("multiple"),language:{noResults:function(){return dinaAjaxFilterObject.i18n.noResults}}})}})}function d(e){var n=i("#dinaSidebar"),a=[".widget_layered_nav[id]",".widget_dina_brand_filter_widget[id]",".widget_dina_onsale_stock_widget[id]"].join(", ");n.find(a).each(function(){var n=this.id,a=i(e).find("#"+n);a.length&&i(this).replaceWith(a)});var t=n.find(".widget_layered_nav_filters"),r=i(e).find(".widget_layered_nav_filters");r.length&&t.length?t.replaceWith(r):r.length&&!t.length?n.find(".widget_price_filter").first().before(r):!r.length&&t.length&&t.remove(),l(e),o(n)}function l(e){var n=i("#dinaSidebar"),a=n.find(".widget_price_filter form").first(),t=i(e).find(".widget_price_filter form").first();a.length&&t.length&&(a.replaceWith(t),i(document.body).trigger("init_price_filter"))}
1function c(i){i.preventDefault();var e=this.getAttribute("href"),a=new URL(e,window.location.origin);n(a.pathname+a.search)}function f(a){a.preventDefault();var t={};i(this).serializeArray().forEach(function(i){t[i.name]=i.value}),n(e(t))}function s(){return b.hasClass("dina-ajax-prod")}function u(){if(s()){var i=b.find(x.products),e=window.InfiniteScroll?window.InfiniteScroll.data(i[0]):null;if(e)try{e.destroy()}catch(i){console.error("dina-ajax-filter: InfiniteScroll destroy failed",i)}}}function h(){if(s()&&b.find(".woocommerce-pagination .next").length){var i=b.find(x.products);i.infiniteScroll({path:".woocommerce-pagination .next",append:".dina-mini-con",button:"#dina-load-more-button",hideNav:".woocommerce-pagination",status:".dina-page-load-status",history:j,scrollThreshold:b.data("auto-ajax-load")})}}function g(e){var a=i(this);if(!s()||!a.hasClass("next")){e.preventDefault();var t=this.getAttribute("href"),r=new URL(t,window.location.origin);n(r.pathname+r.search)}}function m(){i.fn.tooltip&&b.find('[data-toggle="tooltip"]').tooltip(),i(document.body).trigger("yith_wcwl_init"),i(document.body).trigger("dina_rebind_quick_view"),i(document.body).trigger("dina_rebind_compare")}function p(){i("#dinaSidebar").find(".widget_price_filter form").off("submit.dinaAjaxFilter").on("submit.dinaAjaxFilter",v),b.find(".dina-order-products a").off("
1click.dinaAjaxFilter").on("click.dinaAjaxFilter",w),b.find('form.woocommerce-ordering select[name="orderby"]').off("change.dinaAjaxFilter").on("change.dinaAjaxFilter",_)}function v(a){a.preventDefault();var t=i(this);n(e({min_price:t.find("#min_price").val(),max_price:t.find("#max_price").val()}))}function w(i){i.preventDefault();var a=this.getAttribute("href"),t=new URL(a).searchParams.get("orderby");n(e({orderby:t||null}))}function _(){n(e({orderby:i(this).val()||null}))}var b=i(".dina-product-archive-con");if(b.length){var y,x={orderingCon:".dina-woocommerce-ordering-con",products:"ul.products",pagination:".woocommerce-pagination",loadMore:".dina-load-more"},j=b.data("ajax-prod-history"),A=!1,S=window.location.search,F=200,k=[".dina-no-products-notice",".dina-woocommerce-ordering-con","ul.products",".woocommerce-pagination",".dina-load-more"],C=!1;window.addEventListener("popstate",function(i){i.state&&i.state.dinaAjaxFilter&&(C=!0,n(window.location.pathname+window.location.search))}),i(function(){p(),i("#dinaSidebar").on("click.dinaAjaxFilter",".widget_layered_nav a, .widget_layered_nav_filters a, .dina-brand-filter a, .dina-sale-stock-filter a",c).on("submit.dinaAjaxFilter",".woocommerce-widget-layered-nav-dropdown",f),o(i("#dinaSidebar")),b.on("click.dinaAjaxFilter",".woocommerce-pagination a.page-numbers",g)})}})(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.