Loading...

Loading...

Connection Error

Unable to load the content. Please check your connection and try again.

Facebook feed would appear here

External widgets are loaded in parent window due to cross-origin restrictions

`; document.body.appendChild(feedContainer); // Add toggle button const toggleBtn = document.createElement('button'); toggleBtn.innerHTML = 'f'; toggleBtn.style.cssText = ` position: fixed; bottom: 20px; right: 20px; background: #1877f2; color: white; border: none; border-radius: 50%; width: 60px; height: 60px; cursor: pointer; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; `; toggleBtn.onclick = function() { const feed = document.getElementById('parent-facebook-feed').firstElementChild; feed.style.display = feed.style.display === 'none' ? 'block' : 'none'; }; document.body.appendChild(toggleBtn); } function loadElfsightPlatform() { // Load Elfsight platform script in parent window if (!document.querySelector('script[src*="elfsight"]')) { const script = document.createElement('script'); script.src = 'https://static.elfsight.com/platform/platform.js'; script.async = true; script.onload = function() { console.log('Elfsight platform loaded in parent window'); }; document.head.appendChild(script); } // Add Elfsight widget container to parent if (!document.querySelector('.elfsight-app-b4e56e8c-d99d-4b4b-a65c-765264b4a35d')) { const widgetContainer = document.createElement('div'); widgetContainer.className = 'elfsight-app-b4e56e8c-d99d-4b4b-a65c-765264b4a35d'; widgetContainer.setAttribute('data-elfsight-app-lazy', ''); widgetContainer.style.cssText = ` position: fixed !important; bottom: 90px !important; right: 20px !important; z-index: 10000 !important; max-width: 340px !important; `; document.body.appendChild(widgetContainer); } } function fixIframeTables() { // Send postMessage to iframe to fix responsive tables // This only works if the iframe has a listener for this message try { currentIframe.contentWindow.postMessage({ type: 'FIX_RESPONSIVE_TABLES', css: ` .table-responsive { width: 100% !important; max-width: 100% !important; overflow-x: auto !important; } .table-responsive table { width: 100% !important; max-width: 100% !important; table-layout: auto !important; } body { overflow-x: hidden !important; max-width: 100% !important; } ` }, iframeDomain); } catch (error) { console.log('Cannot send postMessage to iframe'); } } // Consolidated message listener window.addEventListener('message', function(event) { // For security, verify origin if possible // if (event.origin !== iframeDomain) return; switch (event.data.type) { case 'STATBS21D_NAVIGATE': console.log('StatBS21D navigation requested:', event.data.url); window.location.href = event.data.url; break; case 'NAVIGATE': console.log('Navigation requested:', event.data.url); window.location.href = event.data.url; break; case 'RESIZE_IFRAME': console.log('Resize requested:', event.data.height); if (currentIframe && event.data.height) { currentIframe.style.height = event.data.height + 'px'; } break; case 'SHOW_LOADER': document.getElementById('loader').classList.remove('hidden'); break; case 'HIDE_LOADER': document.getElementById('loader').classList.add('hidden'); break; } }); function retryLoad() { const loader = document.getElementById('loader'); const errorMessage = document.getElementById('error-message'); const content = document.getElementById('content'); errorMessage.style.display = 'none'; loader.classList.remove('hidden'); content.classList.remove('visible'); // Clean up existing widgets const existingFeed = document.getElementById('parent-facebook-feed'); const existingToggle = document.querySelector('button[style*="position: fixed"][style*="bottom: 20px"]'); if (existingFeed) existingFeed.remove(); if (existingToggle) existingToggle.remove(); if (currentIframe && currentIframe.parentNode) { currentIframe.parentNode.removeChild(currentIframe); } setTimeout(init, 500); } // Handle browser back/forward buttons window.addEventListener('popstate', function(event) { if (event.state && event.state.iframeUrl) { currentIframe.src = event.state.iframeUrl; } }); // Initialize when DOM is ready if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } // CSS for loader animation and general styles const style = document.createElement('style'); style.textContent = ` @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Ensure iframe takes full space */ #content { width: 100%; height: 100%; } #live-iframe { width: 100%; height: 100%; border: none; } /* Loader styles */ #loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; } #loader.hidden { display: none; } /* Error message styles */ .error-message { display: none; padding: 20px; text-align: center; color: #d32f2f; } `; document.head.appendChild(style);