1let iframeTop = 0; 2let windowHeight = 0; 3let windowScroll = 0; 4let iframeDidLoad = false; 5let iframeDidEnterViewport = false; 6 7document.addEventListener("DOMContentLoaded", e => { 8 9 let iframe = document.getElementById("connector-3-step-form"); 10 11 window.addEventListener("message", e => { 12 if(e.data.id != "connector-iframe") return; 13 let height = e.data.height; 14 iframe.style.height = height + "px"; 15 iframeDidLoad = true; 16 update(); 17 }); 18 19 let scroll = () => { 20 windowScroll = window.scrollY; 21 update(); 22 }; 23 24 let resize = () => { 25 iframeTop = iframe.offsetTop; 26 windowHeight = window.innerHeight; 27 windowScroll = window.scrollY; 28 update(); 29 }; 30 31 let update = () => { 32 33 if(!iframeDidEnterViewport && iframeDidLoad) { 34 if(windowScroll > iframeTop - windowHeight) { 35 iframeDidEnterViewport = true; 36 iframe.contentWindow.postMessage({ 37 id: "connector-iframe-parent", 38 message: "connector-iframe-did-enter-viewport" 39 }, "*"); 40 } 41 } 42 43 }; 44 45 setTimeout(() => { 46 resize(); 47 }, 0) 48 49 window.addEventListener("scroll", () => { 50 scroll(); 51 }); 52 53 window.addEventListener("resize", () => { 54 resize(); 55 }); 56 57}); 58 59let mentoringConnectorScript = document.querySelector("[data-mentoring-connector-partner-id]") 60let mentoringConnectorPartnerId = mentoringConnectorScript.getAttribute('data-mentoring-connector-partner-id') 61 62let content = ` 63 <iframe id="connector-3-step-form" src="https://3step.connect.mentoring.org/en/?partnerId=${mentoringConnectorPartnerId}" frameborder="0" style="width: 100%; max-width: 100%; border: none;"></iframe> 64` 65 66document.write(content)
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.