پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۳۰: خط ۳۰:
             padding: 0;
             padding: 0;
             margin: 0;
             margin: 0;
        }
       
        /* مخفی کردن هدرهای اضافی ویکی */
        body > header:first-child,
        .wiki-header,
        .mw-header,
        #mw-header,
        #header,
        .header,
        #mw-navigation,
        #mw-panel,
        #footer,
        .mw-footer {
            display: none !important;
         }
         }
          
          
خط ۱۸۷: خط ۱۷۳:
         .content-display {
         .content-display {
             width: 100%;
             width: 100%;
             height: 650px;
             min-height: 650px;
             border: 1px solid var(--border-color);
             border: 1px solid var(--border-color);
             border-radius: 6px;
             border-radius: 6px;
             background: white;
             background: white;
            padding: 20px;
            overflow-y: auto;
            direction: rtl;
            text-align: right;
            line-height: 2;
        }
       
        .content-display table {
            width: 100%;
            border-collapse: collapse;
            margin: 15px 0;
            direction: rtl;
        }
       
        .content-display table,
        .content-display th,
        .content-display td {
            border: 1px solid var(--border-color);
        }
       
        .content-display th,
        .content-display td {
            padding: 10px;
            text-align: right;
        }
       
        .content-display th {
            background-color: var(--light-color);
            font-weight: bold;
        }
       
        .content-display a {
            color: var(--accent-color);
            text-decoration: none;
            transition: color 0.3s;
        }
       
        .content-display a:hover {
            color: var(--primary-color);
            text-decoration: underline;
         }
         }
          
          
خط ۲۶۵: خط ۲۹۱:
         }
         }


         .access-denied {
         .loading {
             text-align: center;
             text-align: center;
             padding: 40px;
             padding: 40px;
             background: #fee;
             color: var(--primary-color);
            border-radius: 8px;
            border: 2px solid #f5c6cb;
            color: #721c24;
            margin-top: 20px;
         }
         }


         .access-denied h3 {
         .loading i {
             color: #721c24;
             font-size: 2rem;
             margin-bottom: 15px;
             margin-bottom: 15px;
             font-size: 1.5rem;
             color: var(--accent-color);
         }
         }


خط ۳۲۴: خط ۳۴۶:
              
              
             .content-display {
             .content-display {
                 height: 500px;
                 min-height: 500px;
                padding: 15px;
             }
             }
              
              
خط ۳۴۰: خط ۳۶۳:
         @media (max-width: 480px) {
         @media (max-width: 480px) {
             .content-display {
             .content-display {
                 height: 450px;
                 min-height: 450px;
                padding: 10px;
             }
             }
              
              
خط ۴۰۴: خط ۴۲۸:


     <script>
     <script>
        // 🔒 سیستم حفاظتی - بررسی دامنه مجاز
        const ALLOWED_DOMAINS = [
            'pediabible.com',
            'www.pediabible.com',
            'localhost',
            '127.0.0.1'
        ];
        // تابع بررسی مجاز بودن دامنه
        function isDomainAllowed() {
            const currentDomain = window.location.hostname;
            console.log('🔍 بررسی دامنه:', currentDomain);
           
            // اگر روی فایل محلی هستیم، اجازه بده
            if (!currentDomain || currentDomain === '' || currentDomain === 'null') {
                console.log('✅ فایل محلی - مجاز');
                return true;
            }
           
            const isAllowed = ALLOWED_DOMAINS.some(domain => {
                const match = currentDomain === domain || currentDomain.endsWith('.' + domain);
                if (match) {
                    console.log(`✅ دامنه ${currentDomain} مجاز است`);
                }
                return match;
            });
           
            if (!isAllowed) {
                console.log(`❌ دامنه ${currentDomain} غیرمجاز است`);
            }
           
            return isAllowed;
        }
        // تابع نمایش پیام دسترسی غیرمجاز
        function showAccessDenied() {
            const wrapper = document.getElementById('content-wrapper');
            wrapper.innerHTML = `
                <div class="access-denied">
                    <h3><i class="fas fa-ban"></i> دسترسی محدود شده</h3>
                    <p>این صفحه فقط بر روی دامنه <strong>pediabible.com</strong> قابل دسترسی است.</p>
                    <p>دامنه فعلی: <code>${window.location.hostname}</code></p>
                    <p>لطفاً از <a href="https://www.pediabible.com" style="color: #721c24; text-decoration: underline;">سایت اصلی</a> بازدید کنید.</p>
                </div>
            `;
        }
        // تابع برای اضافه کردن target="_blank" به تمام لینک‌های داخل iframe
        function addTargetBlankToIframeLinks() {
            const iframe = document.getElementById('content-iframe');
            if (!iframe) return;
           
            iframe.addEventListener('load', function() {
                try {
                    const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                   
                    // مخفی کردن هدرها و فوترها در داخل iframe
                    const elementsToHide = iframeDoc.querySelectorAll(
                        '#mw-navigation, #mw-panel, #footer, .mw-footer, .mw-header, header, .header'
                    );
                    elementsToHide.forEach(el => {
                        el.style.display = 'none';
                    });
                   
                    // اضافه کردن target="_blank" به تمام لینک‌ها
                    const links = iframeDoc.querySelectorAll('a');
                    links.forEach(link => {
                        if (link.href &&
                            !link.href.startsWith('javascript:') &&
                            !link.href.startsWith('#')) {
                            link.setAttribute('target', '_blank');
                            link.setAttribute('rel', 'noopener noreferrer');
                        }
                    });
                   
                    console.log(`✅ ${links.length} لینک پردازش شد`);
                } catch (error) {
                    console.log('⚠️ امکان دسترسی به محتوای iframe وجود ندارد (محدودیت CORS)');
                }
            });
        }
        // تابع اصلی بارگذاری برنامه
        function loadApplication() {
            console.log('🚀 شروع بارگذاری با بررسی امنیتی...');
           
            if (!isDomainAllowed()) {
                console.log('❌ دسترسی غیرمجاز - نمایش پیام خطا');
                showAccessDenied();
                return;
            }
            console.log('✅ دامنه مجاز - بارگذاری برنامه اصلی');
            // اگر دامنه مجاز باشد، برنامه اصلی بارگذاری می‌شود
            initializeBibleApp();
        }
         // داده‌های کامل کتاب‌های مقدس
         // داده‌های کامل کتاب‌های مقدس
         const bibleBooks = {
         const bibleBooks = {
خط ۷۷۴: خط ۷۰۱:
                  
                  
                 if (currentChapter) {
                 if (currentChapter) {
                     displayChapterWithIframe();
                     displayChapterContent();
                 } else {
                 } else {
                     resetContent();
                     resetContent();
خط ۷۸۰: خط ۷۰۷:
             });
             });


             // نمایش فصل با iframe
             // نمایش محتوای فصل
             function displayChapterWithIframe() {
             async function displayChapterContent() {
                 const bookIndex = parseInt(currentBook);
                 const bookIndex = parseInt(currentBook);
                 const bookData = bibleBooks[currentTestament][bookIndex];
                 const bookData = bibleBooks[currentTestament][bookIndex];
خط ۷۸۹: خط ۷۱۶:
                  
                  
                 chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
                 chapterTitle.textContent = `${translationName} - ${bookName} - فصل ${currentChapter}`;
               
                // نمایش حالت بارگذاری
                versesContainer.innerHTML = `
                    <div class="loading">
                        <i class="fas fa-spinner fa-spin"></i>
                        <p>در حال بارگذاری محتوا...</p>
                    </div>
                `;
                  
                  
                 // استفاده از الگوی مناسب برای هر ترجمه
                 // استفاده از الگوی مناسب برای هر ترجمه
                 const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
                 const pageTitle = translations[currentTranslation].getPageTitle(bookDisplayName, currentChapter);
                  
                  
                 // ساخت URL بدون action=render
                 // ساخت URL
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                  
                  
                 versesContainer.innerHTML = `
                 try {
                    <iframe  
                    // استفاده از iframe ساده بدون محدودیت‌های امنیتی
                        id="content-iframe"
                    versesContainer.innerHTML = `
                        src="${contentUrl}"  
                        <iframe  
                        class="content-display"
                            src="${contentUrl}"  
                        frameborder="0"
                            class="content-display"
                        loading="lazy"
                            frameborder="0"
                        allowfullscreen>
                            loading="lazy"
                    </iframe>
                            allowfullscreen
                 `;
                            onload="handleIframeLoad(this)">
                        </iframe>
                    `;
                   
                 } catch (error) {
                    console.error('خطا در بارگذاری محتوا:', error);
                    versesContainer.innerHTML = `
                        <div class="instructions">
                            <div class="placeholder">
                                <i class="fas fa-exclamation-triangle"></i>
                                <p>خطا در بارگذاری محتوا. لطفاً دوباره تلاش کنید.</p>
                                <p><small>${error.message}</small></p>
                            </div>
                        </div>
                    `;
                }
                  
                  
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 // لینک صفحه کامل برای باز کردن در تب جدید
                 wikiPageLink.href = contentUrl;
                 wikiPageLink.href = contentUrl;
                 wikiPageLink.style.display = 'flex';
                 wikiPageLink.style.display = 'flex';
               
                // اضافه کردن ویژگی باز کردن لینک‌ها در پنجره جدید
                addTargetBlankToIframeLinks();
                 updateNavigationButtons();
                 updateNavigationButtons();
            }
            // تابع برای مدیریت لینک‌های داخل iframe
            function handleIframeLoad(iframe) {
                try {
                    const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                    const links = iframeDoc.querySelectorAll('a');
                   
                    links.forEach(link => {
                        if (link.href &&
                            !link.href.startsWith('javascript:') &&
                            !link.href.startsWith('#')) {
                            link.setAttribute('target', '_blank');
                            link.setAttribute('rel', 'noopener noreferrer');
                        }
                    });
                   
                    console.log(`✅ ${links.length} لینک پردازش شد`);
                } catch (error) {
                    console.log('⚠️ امکان دسترسی به محتوای iframe وجود ندارد');
                }
             }
             }


خط ۸۲۸: خط ۷۹۶:
                     currentChapter--;
                     currentChapter--;
                     chapterSelect.value = currentChapter;
                     chapterSelect.value = currentChapter;
                     displayChapterWithIframe();
                     displayChapterContent();
                 }
                 }
             });
             });
خط ۸۳۹: خط ۸۰۷:
                     currentChapter++;
                     currentChapter++;
                     chapterSelect.value = currentChapter;
                     chapterSelect.value = currentChapter;
                     displayChapterWithIframe();
                     displayChapterContent();
                 }
                 }
             });
             });
خط ۸۶۸: خط ۸۳۶:
             }
             }


             console.log('✅ برنامه کتاب مقدس روی دامنه مجاز بارگذاری شد');
             console.log('✅ برنامه کتاب مقدس بارگذاری شد');
         }
         }


         // 🔒 شروع برنامه با بررسی امنیتی
         // شروع برنامه
         document.addEventListener('DOMContentLoaded', function() {
         document.addEventListener('DOMContentLoaded', function() {
             console.log('🚀 شروع بارگذاری با بررسی امنیتی...');
             console.log('🚀 شروع بارگذاری برنامه...');
             loadApplication();
             initializeBibleApp();
        });
 
        // 🔒 جلوگیری از دسترسی به توابع از کنسول
        Object.defineProperty(window, 'translations', {
            value: null,
            writable: false,
            configurable: false
         });
         });
     </script>
     </script>
</body>
</body>
</html>
</html>

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

کتاب مقدس - مطالعه آنلاین

کتاب مقدس

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