1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 connect() { 5 this.abort = new AbortController() 6 this.observer = new ResizeObserver(() => { 7 parent.postMessage({type:"lb-course:resize", height:this.element.getBoundingClientRect().height}, location.origin) 8 }) 9 this.observer.observe(this.element) 10 window.addEventListener("message", event => { 11 if (event.origin !== location.origin || event.source !== parent || event.data?.type !== "lb-course:pause") return 12 this.element.querySelectorAll('[data-controller~="courses--embed-player"]').forEach(element => { 13 this.application.getControllerForElementAndIdentifier(element, "courses--embed-player")?.pause() 14 }) 15 this.element.querySelectorAll("video,audio").forEach(media => media.pause()) 16 this.element.querySelectorAll("iframe").forEach(frame => frame.contentWindow?.postMessage({type:"lb-component:pause"}, location.origin)) 17 }, {signal:this.abort.signal}) 18 } 19 disconnect() { this.abort.abort(); this.observer.disconnect() } 20}
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.