پرش به محتوا

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

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۳۰: خط ۳۰:
             padding: 0;
             padding: 0;
             margin: 0;
             margin: 0;
        }
       
        /* مخفی کردن هدرهای اضافی ویکی */
        body > header:first-child,
        .wiki-header,
        .mw-header,
        #mw-header,
        #header,
        .header {
            display: none !important;
         }
         }
          
          
خط ۱۷۳: خط ۱۸۳:
         .content-display {
         .content-display {
             width: 100%;
             width: 100%;
             min-height: 650px;
             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;
         }
         }
          
          
خط ۲۹۱: خط ۲۶۱:
         }
         }


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


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


خط ۳۴۶: خط ۳۲۰:
              
              
             .content-display {
             .content-display {
                 min-height: 500px;
                 height: 500px;
                padding: 15px;
             }
             }
              
              
خط ۳۶۳: خط ۳۳۶:
         @media (max-width: 480px) {
         @media (max-width: 480px) {
             .content-display {
             .content-display {
                 min-height: 450px;
                 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(iframe) {
            if (!iframe) return;
           
            iframe.onload = function() {
                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('#')) {
                            // برای تمام لینک‌ها (داخلی و خارجی) target="_blank" اضافه کن
                            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 = {
خط ۵۸۰: خط ۶۴۰:
                     name: 'ترجمه قدیم',
                     name: 'ترجمه قدیم',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                    // برای ترجمه قدیم از الگوی ساده با displayName استفاده می‌کنیم
                     getPageTitle: function(bookDisplayName, chapter) {
                     getPageTitle: function(bookDisplayName, chapter) {
                         return `${bookDisplayName} فصل ${chapter}`;
                         return `${bookDisplayName} فصل ${chapter}`;
خط ۵۸۷: خط ۶۴۸:
                     name: 'هزاره نو',
                     name: 'هزاره نو',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                     baseUrl: 'https://www.pediabible.com/index.php?title=',
                    // برای ترجمه‌های جدید از displayName + نام ترجمه استفاده می‌کنیم
                     getPageTitle: function(bookDisplayName, chapter) {
                     getPageTitle: function(bookDisplayName, chapter) {
                         return `${bookDisplayName} هزاره نو فصل ${chapter}`;
                         return `${bookDisplayName} هزاره نو فصل ${chapter}`;
خط ۷۰۱: خط ۷۶۳:
                  
                  
                 if (currentChapter) {
                 if (currentChapter) {
                     displayChapterContent();
                     displayChapterWithIframe();
                 } else {
                 } else {
                     resetContent();
                     resetContent();
خط ۷۰۷: خط ۷۶۹:
             });
             });


             // نمایش محتوای فصل
             // نمایش فصل با iframe - فقط محتوای اصلی
             async function displayChapterContent() {
             function displayChapterWithIframe() {
                 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 برای نمایش فقط محتوای اصلی
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 const contentUrl = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}&action=render`;
                  
                  
                 try {
                 versesContainer.innerHTML = `
                    // استفاده از iframe ساده بدون محدودیت‌های امنیتی
                    <iframe
                    versesContainer.innerHTML = `
                         id="content-iframe"
                         <iframe  
                        src="${contentUrl}"  
                            src="${contentUrl}"  
                        class="content-display"
                            class="content-display"
                        frameborder="0"
                            frameborder="0"
                        loading="lazy"
                            loading="lazy"
                        allowfullscreen>
                            allowfullscreen
                    </iframe>
                            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 = `${translations[currentTranslation].baseUrl}${encodeURIComponent(pageTitle)}`;
                 wikiPageLink.style.display = 'flex';
                 wikiPageLink.style.display = 'flex';
               
                // اضافه کردن ویژگی باز کردن لینک‌ها در پنجره جدید
                const iframe = document.getElementById('content-iframe');
                addTargetBlankToIframeLinks(iframe);
                 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;
                     displayChapterContent();
                     displayChapterWithIframe();
                 }
                 }
             });
             });
خط ۸۰۷: خط ۸۲۹:
                     currentChapter++;
                     currentChapter++;
                     chapterSelect.value = currentChapter;
                     chapterSelect.value = currentChapter;
                     displayChapterContent();
                     displayChapterWithIframe();
                 }
                 }
             });
             });
خط ۸۳۶: خط ۸۵۸:
             }
             }


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


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

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

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

کتاب مقدس

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