1document.addEventListener('alpine:init', () => { 2 Alpine.data('loginPage', (registerOpened = false) => { 3 return { 4 showRegister: registerOpened, 5 titleSubtext: '', 6 oauthPopup: null, 7 oauthCheckInterval: null, 8 9 init() { 10 // Listen for OAuth success messages from popup 11 window.addEventListener('message', this.handleOauthMessage.bind(this)); 12 }, 13 14 handleOauthMessage(event) { 15 // Verify message is from our domain 16 if (event.origin !== window.location.origin) { 17 return; 18 } 19 20 // Check if this is an OAuth success message 21 if (event.data && event.data.type === 'oauth-success') { 22 // Reload the page to reflect logged-in state 23 window.location.reload(); 24 } 25 }, 26 27 openOauthPopup(url) { 28 // Close any existing popup 29 if (this.oauthPopup && !this.oauthPopup.closed) { 30 this.oauthPopup.close(); 31 } 32 33 // Open new popup window 34 const width = 600; 35 const height = 700; 36 const left = (window.screen.width - width) / 2; 37 const top = (window.screen.height - height) / 2; 38 39 this.oauthPopup = window.open(url, 'oauth_popup', `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes,status=yes`); 40 41 // Focus the popup 42 if (this.oauthPopup) { 43 this.oauthPopup.focus(); 44 45 // Check if popup was closed without completing OAuth 46 this.oauthCheckInterval = setInterval(() => { 47 if (this.oauthPopup && this.oauthPopup.closed) { 48 clearInterval(this.oauthCheckInterval); 49 this.oauthPopup = null; 50 } 51 }, 500); 52 } 53 }, 54 }; 55 }); 56});
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.