پرش به محتوا

کتاب مقدس آنلاین: تفاوت میان نسخه‌ها

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
خط ۱۸۸: خط ۱۸۸:
             border-radius: 6px;
             border-radius: 6px;
             background: white;
             background: white;
        }
       
        /* استایل‌های جدید برای Overlay */
        .iframe-wrapper {
            position: relative;
            width: 100%;
            height: 650px;
        }
       
        .iframe-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
            z-index: 10;
            background: transparent;
            transition: background-color 0.3s;
        }
       
        .iframe-overlay:hover {
            background: rgba(52, 152, 219, 0.1);
        }
       
        .overlay-message {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            opacity: 0;
            transition: opacity 0.3s;
        }
       
        .iframe-overlay:hover .overlay-message {
            opacity: 1;
         }
         }
          
          
خط ۳۶۰: خط ۳۲۰:
             }
             }
              
              
             .content-display, .iframe-wrapper {
             .content-display {
                 height: 500px;
                 height: 500px;
             }
             }
خط ۳۷۶: خط ۳۳۶:


         @media (max-width: 480px) {
         @media (max-width: 480px) {
             .content-display, .iframe-wrapper {
             .content-display {
                 height: 450px;
                 height: 450px;
             }
             }
خط ۷۸۲: خط ۷۴۲:
             });
             });


             // نمایش فصل با iframe و Overlay
             // نمایش فصل با iframe - فقط محتوای اصلی
             function displayChapterWithIframe() {
             function displayChapterWithIframe() {
                 const bookIndex = parseInt(currentBook);
                 const bookIndex = parseInt(currentBook);
خط ۷۹۷: خط ۷۵۷:
                 // استفاده از action=render برای نمایش فقط محتوای اصلی
                 // استفاده از action=render برای نمایش فقط محتوای اصلی
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                const fullPageUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                  
                  
                // ایجاد iframe با overlay
                 versesContainer.innerHTML = `
                 versesContainer.innerHTML = `
                     <div class="iframe-wrapper">
                     <iframe  
                         <iframe
                         id="content-iframe"
                            id="content-iframe"
                        src="${contentUrl}"  
                            src="${contentUrl}"  
                        class="content-display"
                            class="content-display"
                        frameborder="0"
                            frameborder="0"
                        loading="lazy"
                            loading="lazy"
                        allowfullscreen>
                            sandbox="allow-scripts allow-same-origin allow-popups"
                    </iframe>
                            allowfullscreen>
                        </iframe>
                        <div class="iframe-overlay" id="iframe-overlay">
                            <div class="overlay-message">برای باز کردن صفحه کامل کلیک کنید</div>
                        </div>
                    </div>
                 `;
                 `;
                  
                  
                 // اضافه کردن event listener برای overlay
                 // مدیریت لینک‌های داخل iframe
                const overlay = document.getElementById('iframe-overlay');
                 setTimeout(() => {
                 overlay.addEventListener('click', function() {
                     manageIframeLinks();
                     window.open(fullPageUrl, '_blank');
                 }, 2000);
                 });
                  
                  
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 wikiPageLink.href = fullPageUrl;
                 wikiPageLink.href = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.style.display = 'flex';
                 wikiPageLink.style.display = 'flex';
                 updateNavigationButtons();
                 updateNavigationButtons();
            }
            // تابع جدید برای مدیریت لینک‌های داخل iframe
            function manageIframeLinks() {
                const iframe = document.getElementById('content-iframe');
                if (!iframe) return;
               
                iframe.addEventListener('load', function() {
                    try {
                        const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                        const links = iframeDoc.querySelectorAll('a');
                       
                        links.forEach(link => {
                            // فقط لینک‌های داخلی سایت pediabible.com را مدیریت می‌کنیم
                            if (link.href && link.href.includes('pediabible.com')) {
                                link.addEventListener('click', function(e) {
                                    e.preventDefault();
                                   
                                    // ساخت URL جدید با action=render
                                    let newUrl = link.href;
                                    if (!newUrl.includes('action=render')) {
                                        if (newUrl.includes('?')) {
                                            newUrl += '&action=render';
                                        } else {
                                            newUrl += '?action=render';
                                        }
                                    }
                                   
                                    // بارگذاری لینک جدید در همان iframe
                                    iframe.src = newUrl;
                                });
                            } else {
                                // لینک‌های خارجی در تب جدید باز شوند
                                link.target = '_blank';
                            }
                        });
                       
                        console.log(`✅ ${links.length} لینک مدیریت شد`);
                    } catch (error) {
                        console.log('⚠️ امکان دسترسی به iframe به دلیل CORS وجود ندارد');
                        // استفاده از روش جایگزین
                        useAlternativeLinkManagement();
                    }
                });
            }
            // روش جایگزین برای زمانی که CORS مانع می‌شود
            function useAlternativeLinkManagement() {
                const iframe = document.getElementById('content-iframe');
                if (!iframe) return;
               
                // گوش دادن به تغییرات iframe
                let currentUrl = iframe.src;
               
                const checkUrlChange = setInterval(() => {
                    try {
                        const iframeWindow = iframe.contentWindow;
                        const iframeUrl = iframeWindow.location.href;
                       
                        if (iframeUrl !== currentUrl && !iframeUrl.includes('action=render')) {
                            // اگر URL تغییر کرد و action=render ندارد، آن را اضافه کنیم
                            let newUrl = iframeUrl;
                            if (newUrl.includes('?')) {
                                newUrl += '&action=render';
                            } else {
                                newUrl += '?action=render';
                            }
                           
                            iframe.src = newUrl;
                            currentUrl = newUrl;
                        }
                    } catch (error) {
                        // خطای CORS - متوقف کردن چک
                        clearInterval(checkUrlChange);
                        console.log('⚠️ نظارت بر تغییرات iframe متوقف شد');
                    }
                }, 500);
               
                // بعد از 30 ثانیه چک کردن را متوقف کن
                setTimeout(() => {
                    clearInterval(checkUrlChange);
                }, 30000);
             }
             }



نسخهٔ ‏۹ اکتبر ۲۰۲۵، ساعت ۲۱:۵۸

<!DOCTYPE html> کتاب مقدس - مطالعه آنلاین

کتاب مقدس

مطالعه کتاب مقدس با ترجمه‌های مختلف