PageSourceSearch

https://www.doorware.com/cdn/shop/t/33/assets/dw-storefront-filters.js?v=134665352044278483741791319163

js doorware.com collected 2026-10-07 07:30:49 UTC 4,465 bytes, 2 lines download raw bytes

1(function(){if(window.__dwStorefrontFiltersInit)return;window.__dwStorefrontFiltersInit=!0;function parseAmount(str){return str==null||String(str).trim()===""?NaN:parseFloat(String(str).replace(/,/g,""),10)}function formatUsdWhole(n){return isNaN(n)?"":String(Math.round(n))}function syncSlider(wrap){var max=parseFloat(wrap.getAttribute("data-max"),10);if(isNaN(max)||max<=0)return;var lowR=wrap.querySelector(".dw-price-slider__range--min"),highR=wrap.querySelector(".dw-price-slider__range--max"),fill=wrap.querySelector(".dw-price-slider__fill"),hMin=wrap.querySelector(".dw-price-slider__hidden-min"),hMax=wrap.querySelector(".dw-price-slider__hidden-max"),fieldMin=wrap.querySelector(".dw-price-slider__field--min"),fieldMax=wrap.querySelector(".dw-price-slider__field--max");if(!lowR||!highR||!hMin||!hMax||!fieldMin||!fieldMax)return;function clamp(n,a,b){return isNaN(n)?a:Math.min(b,Math.max(a,n))}function pushFromRanges(){var lo=parseFloat(lowR.value,10),hi=parseFloat(highR.value,10);isNaN(lo)&&(lo=0),isNaN(hi)&&(hi=max),lo>hi&&(document.activeElement===lowR?(hi=lo,highR.value=String(hi)):(lo=hi,lowR.value=String(lo))),fieldMin.value=formatUsdWhole(lo),fieldMax.value=formatUsdWhole(hi),hMin.value=lo<=0?"":String(Math.round(lo)),hMax.value=hi>=max?"":String(Math.round(hi));var pctLo=max?lo/max*100:0,pctHi=max?hi/max*100:100;fill&&(fill.style.left=pctLo+"%",fill.style.width=Math.max(0,pctHi-pctLo)+"%")}function applyFromFields(){var lo=parseAmount(fieldMin.value),hi=parseAmount(fieldMax.value);isNaN(lo)&&(lo=0),isNaN(hi)&&(hi=max),lo=Math.floor(clamp(lo,0,max)),hi=Math.ceil(clamp(hi,0,max)),lo>hi&&(document.activeElement===fieldMin?hi=lo:lo=hi),lowR.value=String(lo),highR.value=String(hi),pushFromRanges()}lowR.addEventListener("input",pushFromRanges),highR.addEventListener("input",pushFromRanges),lowR.addEventListener("pointerdown",function(){lowR.style.zIndex="5",highR.style.zIndex="4"}),highR.addEventListener("pointerdown",function(){highR.style.zIndex="5",lowR.style.zIndex="4"}),fieldMin.addEventListener("change",applyFromFields),fieldMin.addEventListener("blur",applyFromFields),fieldMax.addEventListener("change",applyFromFields),fieldMax.addEventListener("blur",applyFromFields),pushFromRanges()}function initFilterSearchable(){document.querySelectorAll("[data-dw-filter-searchable]").forEach(function(root){var input=root.querySelector(".dw-filter-searchable__input"),items=root.querySelectorAll(".dw-filter-searchable__item");!input||!items.length||input.addEventListener("input",function(){for(var q=input.value.trim().toLowerCase(),i=0;i<items.length;i++){var li=items[i],t=li.getAttribute("data-dw-search-text")||"";li.hidden=!!(q&&t.indexOf(q)===-1)}})})}function bindForms(){document.querySelectorAll(".dw-storefront-filters-form").forEach(function(form){form.querySelectorAll("[data-dw-price-slider]").forEach(syncSlider),form.addEventListener("submit",function(){var slider=form.querySelector("[data-dw-price-slider]");if(slider){var max=parseFloat(slider.getAttribute("data-max"),10),fieldMin=slider.querySelector(".dw-price-slider__field--min"),fieldMax=slider.querySelector(".dw-price-slider__field--max"),hMin=slider.querySelector(".dw-price-slider__hidden-min"),hMax=slider.querySelector(".dw-price-slider__hidden-max"),lowR=slider.querySelector(".dw-price-slider__range--min"),highR=slider.querySelector(".dw-price-slider__range--max");if(max>0&&fieldMin&&fieldMax&&hMin&&hMax&&lowR&&highR){var lo=parseAmount(fieldMin.value),hi=parseAmount(fieldMax.value);isNaN(lo)&&(lo=0),isNaN(hi)&&(hi=max),lo=Math.floor(Math.min(max,Math.max(0,lo))),hi=Math.ceil(Math.min(max,Math.max(0,hi))),lo>hi&&(hi=lo),lowR.value=String(lo),highR.value=String(hi),fieldMin.value=formatUsdWhole(lo),fieldMax.value=formatUsdWhole(hi),hMin.value=lo<=0?"":String(Math.round(lo)),hMax.value=hi>=max?"":String(Math.round(hi)),lo<=0&&hi>=max&&(hMin.removeAttribute("name"),hMax.removeAttribute("name"))}}form.querySelectorAll(".dw-price-slider__field").forEach(function(el){el.blur()}),form.querySelectorAll('input[type="text"]').forEach(function(input){input.name&&String(input.value).trim()===""&&input.removeAttribute("name")}
1)})})}function init(){initFilterSearchable(),bindForms()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init(),document.addEventListener("shopify:section:load",init)})();
2//# sourceMappingURL=/cdn/shop/t/33/assets/dw-storefront-filters.js.map?v=134665352044278483741791319163

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.