PageSourceSearch

https://www.eabeng.no/static/js/legacy/jquery.ajax-load.js

js eabeng.no collected 2026-10-02 20:20:03 UTC 7,800 bytes, 1 lines download raw bytes

1!function(t){var e,a,i;i=function(t,e){return function(){return t.apply(e,arguments)}},a={customTags:["[[","]]"],filters:{},availableFilters:{},params:{currentPage:2}},e=function(){function e(e,r){this.handler=e;r=t.extend(!0,this,a,r);this.init=i(this.init,this)}return e.prototype.buildQuery=function(){var t={},e=[];for(var a in this.filters)this.filters[a]instanceof Array?t[a]=this.filters[a].join(","):t[a]=this.filters[a];for(var i in this.params)t[i]=this.params[i];for(var r in t)e.push([r,t[r]].join("="));return"?"+e.join("&")},e.prototype.removeFilter=function(t,e){this.filters[t].splice(this.filters[t].indexOf(e),1),this.syncFilters()},e.prototype.addFilter=function(t,e){this.filters[t]||(this.filters[t]=[]),this.checkFilter(t,e)||this.filters[t].push(e),this.syncFilters()},e.prototype.checkFilter=function(t,e){return void 0!==this.filters[t]&&this.filters[t].indexOf(e)>=0},e.prototype.getCount=function(t,e){if(void 0!==this.availableFilters){if(void 0!==this.availableFilters[t])for(var a in this.availableFilters)for(var i in this.availableFilters[a])if(this.availableFilters[a][i].Value===e)return this.availableFilters[a][i].AggregatedCount;return 0}return-1},e.prototype.checkIfEmptyFilters=function(){var e=0,a=0;for(var i in this.filters)a++,t.isEmptyObject(this.filters[i])&&e++;return e!==a},e.prototype.syncFilters=function(){var e=this.handler.data("ajax-id"),a=t("[data-ajax-filters="+e+"]").find("[type=checkbox]"),i=this;a.each(function(){var e=t(this);i.checkFilter(e.prop("name"),e.prop("value"))?e.prop("checked",!0):e.prop("checked",!1)}),i.renderSelectedOptions()},e.prototype.syncFilterCounts=function(){var e=this.handler.data("ajax-id"),a=t("[data-ajax-filters="+e+"]"),i=a.find("[type=checkbox]"),r=a.find("[data-ajax-filter-group]"),n=this;i.each(function(){var e=t(this),a=n.getCount(e.prop("name"),e.prop("value")),i=e.parents("label");e.parents("label").find("span").html("("+a+")"),0===a?i.addClass("hide"):i.removeClass("hide")}),r.each(function(){var e=0;t(this).children().each(function(){t(this).hasClass("hide")&&e++}),e===t(this).children().length?t(this).parents("[data-ajax-filter-group-wrapper]").hide():t(this).parents("[data-ajax-filter-group-wrapper]").show()})},e.prototype.clearFilters=function(){var e=this,a=this.handler.data("ajax-id"),i=t("[data-selected-options="+a+"]");e.params.currentPage=1,e.filters={},e.syncFilters(),e.ajaxCall(!0),i.hide()},e.prototype.renderFilters=function(){let{filters:e}=this.getFilterElements(),a=this;e.each(function(){var e=t(this).data("ajax-filter-group"),i=a.availableFilters[e];if(void 0!==i&&0!=i.length){var r=[];for(var n in i)r.push({Group:e,Value:i[n].Value,Name:i[n].Name,AggregatedCount:i[n].AggregatedCount});var s=Mustache.render(a.filterTemplate,{menuItems:r});t(this).html(s)}}),t(document).trigger("accordion-control.handleShowMore"),a.initFilterEvents()},e.prototype.initFilterEvents=function(){const{filterCheckboxes:e}=this.getFilterElements(),a=this;e.each(function(){var e=t(this);e.on("change",function(){if(t(this).is(":checked")?a.addFilter(e.attr("name"),e.attr("value")):a.removeFilter(e.attr("name"),e.attr("value")),t(this).parents(".browse-by__menus").length>0){var i=t(this).parents(".accordion-filters__menu");if(i.length){var r=i.find(".accordion-filters__menu__list");i.toggleClass(i.data("toggler")),r.toggleClass(r.data("toggler"));var n=i.find(".accordion-filters__menu__toggle button");n.toggleClass(n.data("toggle-self"))}}a.ajaxCall(!0)})})},e.prototype.initFilters=function(){const{filters:e}=this.getFilterElements(),a=this;e.each(function(){var e=t(this).data("ajax-filter-group");a.filters[e]instanceof Array||(a.filters[e]=[])}),a.syncFilters(),a.initFilterEvents()},e.prototype.getFiltersFromURL=function(){var e=window.location.search.replace("?","").split("&"),a=this.handler.data("ajax-id"),i=t("[data-ajax-filters="+a+"]"),r=[];for(var n in i.find("[data-ajax-filter-group]").each(function(e,a){var i=t(a).data("ajax-filter-group");-1===r.indexOf(i)&&r.push(i)}),e){var s=e[n].split("=")[0],l=e[n].split("=")[1];if(r.indexOf(s)>=0&&""!==l){var o=l.split(",");for(var d in o)this.addFilter(s,o[d])}}},e.prototype.renderSelectedOptions=function(){var e=this,a=this.handler.data("ajax-id"),i=t("[data-ajax-filters="+a+"]"),r=t("[data-selected-options="+a+"]"),n={"selected-options-items":[],ajaxID:a};if(this.checkIfEmptyFilters()){r.show();var s=e.handler.find("[data-selected-items]");for(var l in e.filters){var o=i.find("[data-ajax-filter-group="+l+"]"),d=o.data("ajax-filter-group"),h=o.data("ajax-filter-group-title");for(var f in e.filters[l]){var c=o.find('[value="'+e.filters[l][f]+'"]');n["selected-options-items"].push({"item-filter-group":d,"item-filter-group-title":h,"item-filter-name":c.data("ajax-filter-name"),"item-filter-value":e.filters[l][f]})}}var p=Mustache.render(e.optionTemplate,n);s.html(p),r.find("[data-ajax-clear-all="+a+"]").click(function(){e.clearFilters()}),s.find("[data-selected-filter]").each(function(a,i){var r=t(this),n=r.data("selected-filter").split(":")[0],s=r.data("selected-filter").split(":")[1];r.find("button").click(function(){e.removeFilter(n,s),e.ajaxCall(!0)})})}else r.hide()},e.prototype.ajaxCall=function(e){e&&(this.params.currentPage=1);var a=this.handler.data("ajax-load"),i=this.buildQuery(),r=this;t.get(a+i).done(function(t){var a=Mustache.render(r.itemTemplate,t);if(e?r.handler.find("[data-ajax-items]").html(a):r.handler.find("[data-ajax-items]").append(a),"function"==typeof productListingInfoToDataLayerPush&&productListingInfoToDataLayerPush(),"function"==typeof lineRelatedInformationInfoToDataLayerPush&&lineRelatedInformationInfoToDataLayerPush(),t.hideLoadButton)r.handler.find("[data-load-more]").find("button").hide();else{const t=r.handler.find("[data-load-more]").find("button");t.show(),t.blur()}null!==t.filters&&(r.availableFilters=t.filters),r.params.currentPage++,r.renderFilters(),r.syncFilters(),r.syncFilterCounts(),window.history.pushState({},"",i)})},e.prototype.getFilterElements=function(){const e=this.handler.data("ajax-id"),a=t("[data-ajax-filters="+e+"]");return{id:e,filtersWrap:a,filterCheckboxes:a.find("[type=checkbox]"),filters:a.find("[data-ajax-filter-group]")}},e.prototype.init=function(){if(this.handler.length>0){var e=this.handler.data("ajax-id"),a=[];Mustache.tags=this.customTags,e&&(a=t("[data-ajax-filters="+e+"]"),this.filterTemplate=a.find("[type=x-tmpl-mustache][data-filter-template]").html(),Mustache.parse(this.filterTemplate)),this.itemTemplate=this.handler.find("[type=x-tmpl-mustache][data-item-template]").html(),this.optionTemplate=this.handler.find("[type=x-tmpl-mustache][data-option-template]").html(),Mustache.parse(this.itemTemplate),Mustache.parse(this.optionTemplate);var i=this.handler.data("ajax-itemid");if(void 0===i){var r=this.handler.find("[data-ajax-itemid]");console.log("e"),r.length<1?console.error("ItemID parameter is not defined on the aja
1x plugin"):i=r.data("ajax-itemid")}this.params.itemId=i;a=[];(e=this.handler.data("ajax-id"))&&(a=t("[data-ajax-filters="+e+"]")),a.length>0?(this.getFiltersFromURL(),this.initFilters(),this.renderSelectedOptions()):this.renderSelectedOptions();var n=this.handler.find("[data-load-more]").find("button"),s=this;n.on("click",function(){s.ajaxCall(!1)});var l=this.handler.find("[data-toggle=newsFiltersModal]");s=this;l.on("click",function(){s.handler.find(".full.reveal.browse__side--refine-by").show()});var o=this.handler.find("[data-close]");s=this;o.on("click",function(){s.handler.find(".full.reveal.browse__side--refine-by").hide()}),e&&t(document).find("[data-ajax-clear-all="+e+"]").click(function(){s.clearFilters()})}},e}(),t.fn.ajaxLoad=function(t){return this.ajaxLoadInstance||(this.ajaxLoadInstance=new e(this,t||{})),this.ajaxLoadInstance.init(),this}}(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.