PageSourceSearch

https://www.historiskmuseum.no/vrtx/dist/resources/uio2/js/media-slide.js

js historiskmuseum.no collected 2026-10-02 06:57:38 UTC 1,222 bytes, 1 lines download raw bytes

1export default function mediaSlide(){if("vrtx-frontpage"==document.body.id){const e=document.querySelectorAll(".media-slide");e.length&&e.forEach(t=>{const e=t.querySelectorAll("img"),o=(e.length&&e.forEach(e=>{var t=e.src.split("?")[0]+"?alt=listing";e.src=t}),t.tabIndex=0,t.querySelectorAll(":scope > *"));function l(){if(2<=o.length)return o[1].offsetLeft-o[0].offsetLeft;console.debug("media-slide: Less than two items.")}const s=document.createElement("button"),r=(s.className="next",s.setAttribute("aria-label","Neste"),document.body.classList.contains("en")&&s.setAttribute("aria-label","Next"),document.createElement("button")),a=(r.className="prev",r.setAttribute("aria-label","Forrige"),document.body.classList.contains("en")&&r.setAttribute("aria-label","Previous"),s.addEventListener("click",()=>{var e=l();t.scrollTo({left:t.scrollLeft+e,behavior:"smooth"})}),r.addEventListener("click",()=>{var e=l();t.scrollTo({left:t.scrollLeft-e,behavior:"smooth"})}),document.createElement("div"));function n(){t.scrollWidth===t.offsetWidth?a.classList.add("no-overflow"):a.classList.remove("no-overflow")}a.className="media-slide-prev-next",a.append(r,s),t.before(a),n(),window.addEventListener("resize",()=>{n()})})}}

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.