PageSourceSearch

https://sweb.ru/scripts/reusable/slide-toggle.min.js?nc=2026091801

js sweb.ru collected 2026-09-24 18:17:47 UTC 1,148 bytes, 1 lines download raw bytes

1function createSlideToggle({id,onChange}){const toggle=document.getElementById(id);if(!toggle)return null;const variants=toggle.querySelectorAll(".js-toggle-variant"),marker=toggle.querySelector(".js-toggle-marker"),instance={value:()=>selected.value,toggleSelectionByValue,updateMarker,toggleReadOnly};let selected=variants[0];toggleSelectionByValue(selected.value),updateMarker(),window.addEventListener("resize",updateMarker),variants.forEach(variant=>{variant.addEventListener("change",({target})=>{target.checked&&(selected=target),updateMarker(),onChange&&onChange()})});function toggleSelectionByValue(value){variants.forEach(variant=>{variant.value===value&&variant.click()})}function toggleReadOnly(isActive){toggle.classList.toggle("is-readonly",isActive),variants.forEach(variant=>{isActive?variant.setAttribute("readonly",""):variant.removeAttribute("readonly")})}function updateMarker(){marker.style.width=selected.parentElement.getBoundingClientRect().width+"px",marker.style.left=selected.parentElement.offsetLeft+"px",variants.forEac
1h(variant=>{variant.parentElement.classList.toggle("active",variant===selected)})}return instance}

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.